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 organization_id = "organization_id";
1095 /// # let simulation_id = "simulation_id";
1096 /// # let valued_resource_id = "valued_resource_id";
1097 /// # let attack_path_id = "attack_path_id";
1098 /// let x = AttackPath::new().set_name(format!("organizations/{organization_id}/simulations/{simulation_id}/valuedResources/{valued_resource_id}/attackPaths/{attack_path_id}"));
1099 /// ```
1100 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1101 self.name = v.into();
1102 self
1103 }
1104
1105 /// Sets the value of [path_nodes][crate::model::AttackPath::path_nodes].
1106 ///
1107 /// # Example
1108 /// ```ignore,no_run
1109 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1110 /// use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1111 /// let x = AttackPath::new()
1112 /// .set_path_nodes([
1113 /// AttackPathNode::default()/* use setters */,
1114 /// AttackPathNode::default()/* use (different) setters */,
1115 /// ]);
1116 /// ```
1117 pub fn set_path_nodes<T, V>(mut self, v: T) -> Self
1118 where
1119 T: std::iter::IntoIterator<Item = V>,
1120 V: std::convert::Into<crate::model::attack_path::AttackPathNode>,
1121 {
1122 use std::iter::Iterator;
1123 self.path_nodes = v.into_iter().map(|i| i.into()).collect();
1124 self
1125 }
1126
1127 /// Sets the value of [edges][crate::model::AttackPath::edges].
1128 ///
1129 /// # Example
1130 /// ```ignore,no_run
1131 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1132 /// use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1133 /// let x = AttackPath::new()
1134 /// .set_edges([
1135 /// AttackPathEdge::default()/* use setters */,
1136 /// AttackPathEdge::default()/* use (different) setters */,
1137 /// ]);
1138 /// ```
1139 pub fn set_edges<T, V>(mut self, v: T) -> Self
1140 where
1141 T: std::iter::IntoIterator<Item = V>,
1142 V: std::convert::Into<crate::model::attack_path::AttackPathEdge>,
1143 {
1144 use std::iter::Iterator;
1145 self.edges = v.into_iter().map(|i| i.into()).collect();
1146 self
1147 }
1148}
1149
1150impl wkt::message::Message for AttackPath {
1151 fn typename() -> &'static str {
1152 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath"
1153 }
1154}
1155
1156/// Defines additional types related to [AttackPath].
1157pub mod attack_path {
1158 #[allow(unused_imports)]
1159 use super::*;
1160
1161 /// Represents one point that an attacker passes through in this attack path.
1162 #[derive(Clone, Default, PartialEq)]
1163 #[non_exhaustive]
1164 pub struct AttackPathNode {
1165 /// The name of the resource at this point in the attack path.
1166 /// The format of the name follows the Cloud Asset Inventory [resource
1167 /// name
1168 /// format](https://cloud.google.com/asset-inventory/docs/resource-name-format)
1169 pub resource: std::string::String,
1170
1171 /// The [supported resource
1172 /// type](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
1173 pub resource_type: std::string::String,
1174
1175 /// Human-readable name of this resource.
1176 pub display_name: std::string::String,
1177
1178 /// The findings associated with this node in the attack path.
1179 pub associated_findings:
1180 std::vec::Vec<crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding>,
1181
1182 /// Unique id of the attack path node.
1183 pub uuid: std::string::String,
1184
1185 /// A list of attack step nodes that exist in this attack path node.
1186 pub attack_steps:
1187 std::vec::Vec<crate::model::attack_path::attack_path_node::AttackStepNode>,
1188
1189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1190 }
1191
1192 impl AttackPathNode {
1193 /// Creates a new default instance.
1194 pub fn new() -> Self {
1195 std::default::Default::default()
1196 }
1197
1198 /// Sets the value of [resource][crate::model::attack_path::AttackPathNode::resource].
1199 ///
1200 /// # Example
1201 /// ```ignore,no_run
1202 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1203 /// let x = AttackPathNode::new().set_resource("example");
1204 /// ```
1205 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1206 self.resource = v.into();
1207 self
1208 }
1209
1210 /// Sets the value of [resource_type][crate::model::attack_path::AttackPathNode::resource_type].
1211 ///
1212 /// # Example
1213 /// ```ignore,no_run
1214 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1215 /// let x = AttackPathNode::new().set_resource_type("example");
1216 /// ```
1217 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(
1218 mut self,
1219 v: T,
1220 ) -> Self {
1221 self.resource_type = v.into();
1222 self
1223 }
1224
1225 /// Sets the value of [display_name][crate::model::attack_path::AttackPathNode::display_name].
1226 ///
1227 /// # Example
1228 /// ```ignore,no_run
1229 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1230 /// let x = AttackPathNode::new().set_display_name("example");
1231 /// ```
1232 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
1233 mut self,
1234 v: T,
1235 ) -> Self {
1236 self.display_name = v.into();
1237 self
1238 }
1239
1240 /// Sets the value of [associated_findings][crate::model::attack_path::AttackPathNode::associated_findings].
1241 ///
1242 /// # Example
1243 /// ```ignore,no_run
1244 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1245 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1246 /// let x = AttackPathNode::new()
1247 /// .set_associated_findings([
1248 /// PathNodeAssociatedFinding::default()/* use setters */,
1249 /// PathNodeAssociatedFinding::default()/* use (different) setters */,
1250 /// ]);
1251 /// ```
1252 pub fn set_associated_findings<T, V>(mut self, v: T) -> Self
1253 where
1254 T: std::iter::IntoIterator<Item = V>,
1255 V: std::convert::Into<
1256 crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding,
1257 >,
1258 {
1259 use std::iter::Iterator;
1260 self.associated_findings = v.into_iter().map(|i| i.into()).collect();
1261 self
1262 }
1263
1264 /// Sets the value of [uuid][crate::model::attack_path::AttackPathNode::uuid].
1265 ///
1266 /// # Example
1267 /// ```ignore,no_run
1268 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1269 /// let x = AttackPathNode::new().set_uuid("example");
1270 /// ```
1271 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1272 self.uuid = v.into();
1273 self
1274 }
1275
1276 /// Sets the value of [attack_steps][crate::model::attack_path::AttackPathNode::attack_steps].
1277 ///
1278 /// # Example
1279 /// ```ignore,no_run
1280 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1281 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1282 /// let x = AttackPathNode::new()
1283 /// .set_attack_steps([
1284 /// AttackStepNode::default()/* use setters */,
1285 /// AttackStepNode::default()/* use (different) setters */,
1286 /// ]);
1287 /// ```
1288 pub fn set_attack_steps<T, V>(mut self, v: T) -> Self
1289 where
1290 T: std::iter::IntoIterator<Item = V>,
1291 V: std::convert::Into<crate::model::attack_path::attack_path_node::AttackStepNode>,
1292 {
1293 use std::iter::Iterator;
1294 self.attack_steps = v.into_iter().map(|i| i.into()).collect();
1295 self
1296 }
1297 }
1298
1299 impl wkt::message::Message for AttackPathNode {
1300 fn typename() -> &'static str {
1301 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode"
1302 }
1303 }
1304
1305 /// Defines additional types related to [AttackPathNode].
1306 pub mod attack_path_node {
1307 #[allow(unused_imports)]
1308 use super::*;
1309
1310 /// A finding that is associated with this node in the attack path.
1311 #[derive(Clone, Default, PartialEq)]
1312 #[non_exhaustive]
1313 pub struct PathNodeAssociatedFinding {
1314 /// Canonical name of the associated findings. Example:
1315 /// `organizations/123/sources/456/findings/789`
1316 pub canonical_finding: std::string::String,
1317
1318 /// The additional taxonomy group within findings from a given source.
1319 pub finding_category: std::string::String,
1320
1321 /// Full resource name of the finding.
1322 pub name: std::string::String,
1323
1324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1325 }
1326
1327 impl PathNodeAssociatedFinding {
1328 /// Creates a new default instance.
1329 pub fn new() -> Self {
1330 std::default::Default::default()
1331 }
1332
1333 /// Sets the value of [canonical_finding][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::canonical_finding].
1334 ///
1335 /// # Example
1336 /// ```ignore,no_run
1337 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1338 /// let x = PathNodeAssociatedFinding::new().set_canonical_finding("example");
1339 /// ```
1340 pub fn set_canonical_finding<T: std::convert::Into<std::string::String>>(
1341 mut self,
1342 v: T,
1343 ) -> Self {
1344 self.canonical_finding = v.into();
1345 self
1346 }
1347
1348 /// Sets the value of [finding_category][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::finding_category].
1349 ///
1350 /// # Example
1351 /// ```ignore,no_run
1352 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1353 /// let x = PathNodeAssociatedFinding::new().set_finding_category("example");
1354 /// ```
1355 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
1356 mut self,
1357 v: T,
1358 ) -> Self {
1359 self.finding_category = v.into();
1360 self
1361 }
1362
1363 /// Sets the value of [name][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::name].
1364 ///
1365 /// # Example
1366 /// ```ignore,no_run
1367 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1368 /// let x = PathNodeAssociatedFinding::new().set_name("example");
1369 /// ```
1370 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1371 self.name = v.into();
1372 self
1373 }
1374 }
1375
1376 impl wkt::message::Message for PathNodeAssociatedFinding {
1377 fn typename() -> &'static str {
1378 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding"
1379 }
1380 }
1381
1382 /// Detailed steps the attack can take between path nodes.
1383 #[derive(Clone, Default, PartialEq)]
1384 #[non_exhaustive]
1385 pub struct AttackStepNode {
1386 /// Unique ID for one Node
1387 pub uuid: std::string::String,
1388
1389 /// Attack step type. Can be either AND, OR or DEFENSE
1390 pub r#type: crate::model::attack_path::attack_path_node::NodeType,
1391
1392 /// User friendly name of the attack step
1393 pub display_name: std::string::String,
1394
1395 /// Attack step labels for metadata
1396 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1397
1398 /// Attack step description
1399 pub description: std::string::String,
1400
1401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1402 }
1403
1404 impl AttackStepNode {
1405 /// Creates a new default instance.
1406 pub fn new() -> Self {
1407 std::default::Default::default()
1408 }
1409
1410 /// Sets the value of [uuid][crate::model::attack_path::attack_path_node::AttackStepNode::uuid].
1411 ///
1412 /// # Example
1413 /// ```ignore,no_run
1414 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1415 /// let x = AttackStepNode::new().set_uuid("example");
1416 /// ```
1417 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1418 self.uuid = v.into();
1419 self
1420 }
1421
1422 /// Sets the value of [r#type][crate::model::attack_path::attack_path_node::AttackStepNode::type].
1423 ///
1424 /// # Example
1425 /// ```ignore,no_run
1426 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1427 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::NodeType;
1428 /// let x0 = AttackStepNode::new().set_type(NodeType::And);
1429 /// let x1 = AttackStepNode::new().set_type(NodeType::Or);
1430 /// let x2 = AttackStepNode::new().set_type(NodeType::Defense);
1431 /// ```
1432 pub fn set_type<
1433 T: std::convert::Into<crate::model::attack_path::attack_path_node::NodeType>,
1434 >(
1435 mut self,
1436 v: T,
1437 ) -> Self {
1438 self.r#type = v.into();
1439 self
1440 }
1441
1442 /// Sets the value of [display_name][crate::model::attack_path::attack_path_node::AttackStepNode::display_name].
1443 ///
1444 /// # Example
1445 /// ```ignore,no_run
1446 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1447 /// let x = AttackStepNode::new().set_display_name("example");
1448 /// ```
1449 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
1450 mut self,
1451 v: T,
1452 ) -> Self {
1453 self.display_name = v.into();
1454 self
1455 }
1456
1457 /// Sets the value of [labels][crate::model::attack_path::attack_path_node::AttackStepNode::labels].
1458 ///
1459 /// # Example
1460 /// ```ignore,no_run
1461 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1462 /// let x = AttackStepNode::new().set_labels([
1463 /// ("key0", "abc"),
1464 /// ("key1", "xyz"),
1465 /// ]);
1466 /// ```
1467 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1468 where
1469 T: std::iter::IntoIterator<Item = (K, V)>,
1470 K: std::convert::Into<std::string::String>,
1471 V: std::convert::Into<std::string::String>,
1472 {
1473 use std::iter::Iterator;
1474 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1475 self
1476 }
1477
1478 /// Sets the value of [description][crate::model::attack_path::attack_path_node::AttackStepNode::description].
1479 ///
1480 /// # Example
1481 /// ```ignore,no_run
1482 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1483 /// let x = AttackStepNode::new().set_description("example");
1484 /// ```
1485 pub fn set_description<T: std::convert::Into<std::string::String>>(
1486 mut self,
1487 v: T,
1488 ) -> Self {
1489 self.description = v.into();
1490 self
1491 }
1492 }
1493
1494 impl wkt::message::Message for AttackStepNode {
1495 fn typename() -> &'static str {
1496 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode"
1497 }
1498 }
1499
1500 /// The type of the incoming attack step node.
1501 ///
1502 /// # Working with unknown values
1503 ///
1504 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1505 /// additional enum variants at any time. Adding new variants is not considered
1506 /// a breaking change. Applications should write their code in anticipation of:
1507 ///
1508 /// - New values appearing in future releases of the client library, **and**
1509 /// - New values received dynamically, without application changes.
1510 ///
1511 /// Please consult the [Working with enums] section in the user guide for some
1512 /// guidelines.
1513 ///
1514 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1515 #[derive(Clone, Debug, PartialEq)]
1516 #[non_exhaustive]
1517 pub enum NodeType {
1518 /// Type not specified
1519 Unspecified,
1520 /// Incoming edge joined with AND
1521 And,
1522 /// Incoming edge joined with OR
1523 Or,
1524 /// Incoming edge is defense
1525 Defense,
1526 /// Incoming edge is attacker
1527 Attacker,
1528 /// If set, the enum was initialized with an unknown value.
1529 ///
1530 /// Applications can examine the value using [NodeType::value] or
1531 /// [NodeType::name].
1532 UnknownValue(node_type::UnknownValue),
1533 }
1534
1535 #[doc(hidden)]
1536 pub mod node_type {
1537 #[allow(unused_imports)]
1538 use super::*;
1539 #[derive(Clone, Debug, PartialEq)]
1540 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1541 }
1542
1543 impl NodeType {
1544 /// Gets the enum value.
1545 ///
1546 /// Returns `None` if the enum contains an unknown value deserialized from
1547 /// the string representation of enums.
1548 pub fn value(&self) -> std::option::Option<i32> {
1549 match self {
1550 Self::Unspecified => std::option::Option::Some(0),
1551 Self::And => std::option::Option::Some(1),
1552 Self::Or => std::option::Option::Some(2),
1553 Self::Defense => std::option::Option::Some(3),
1554 Self::Attacker => std::option::Option::Some(4),
1555 Self::UnknownValue(u) => u.0.value(),
1556 }
1557 }
1558
1559 /// Gets the enum value as a string.
1560 ///
1561 /// Returns `None` if the enum contains an unknown value deserialized from
1562 /// the integer representation of enums.
1563 pub fn name(&self) -> std::option::Option<&str> {
1564 match self {
1565 Self::Unspecified => std::option::Option::Some("NODE_TYPE_UNSPECIFIED"),
1566 Self::And => std::option::Option::Some("NODE_TYPE_AND"),
1567 Self::Or => std::option::Option::Some("NODE_TYPE_OR"),
1568 Self::Defense => std::option::Option::Some("NODE_TYPE_DEFENSE"),
1569 Self::Attacker => std::option::Option::Some("NODE_TYPE_ATTACKER"),
1570 Self::UnknownValue(u) => u.0.name(),
1571 }
1572 }
1573 }
1574
1575 impl std::default::Default for NodeType {
1576 fn default() -> Self {
1577 use std::convert::From;
1578 Self::from(0)
1579 }
1580 }
1581
1582 impl std::fmt::Display for NodeType {
1583 fn fmt(
1584 &self,
1585 f: &mut std::fmt::Formatter<'_>,
1586 ) -> std::result::Result<(), std::fmt::Error> {
1587 wkt::internal::display_enum(f, self.name(), self.value())
1588 }
1589 }
1590
1591 impl std::convert::From<i32> for NodeType {
1592 fn from(value: i32) -> Self {
1593 match value {
1594 0 => Self::Unspecified,
1595 1 => Self::And,
1596 2 => Self::Or,
1597 3 => Self::Defense,
1598 4 => Self::Attacker,
1599 _ => Self::UnknownValue(node_type::UnknownValue(
1600 wkt::internal::UnknownEnumValue::Integer(value),
1601 )),
1602 }
1603 }
1604 }
1605
1606 impl std::convert::From<&str> for NodeType {
1607 fn from(value: &str) -> Self {
1608 use std::string::ToString;
1609 match value {
1610 "NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
1611 "NODE_TYPE_AND" => Self::And,
1612 "NODE_TYPE_OR" => Self::Or,
1613 "NODE_TYPE_DEFENSE" => Self::Defense,
1614 "NODE_TYPE_ATTACKER" => Self::Attacker,
1615 _ => Self::UnknownValue(node_type::UnknownValue(
1616 wkt::internal::UnknownEnumValue::String(value.to_string()),
1617 )),
1618 }
1619 }
1620 }
1621
1622 impl serde::ser::Serialize for NodeType {
1623 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1624 where
1625 S: serde::Serializer,
1626 {
1627 match self {
1628 Self::Unspecified => serializer.serialize_i32(0),
1629 Self::And => serializer.serialize_i32(1),
1630 Self::Or => serializer.serialize_i32(2),
1631 Self::Defense => serializer.serialize_i32(3),
1632 Self::Attacker => serializer.serialize_i32(4),
1633 Self::UnknownValue(u) => u.0.serialize(serializer),
1634 }
1635 }
1636 }
1637
1638 impl<'de> serde::de::Deserialize<'de> for NodeType {
1639 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1640 where
1641 D: serde::Deserializer<'de>,
1642 {
1643 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeType>::new(
1644 ".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType",
1645 ))
1646 }
1647 }
1648 }
1649
1650 /// Represents a connection between a source node and a destination node in
1651 /// this attack path.
1652 #[derive(Clone, Default, PartialEq)]
1653 #[non_exhaustive]
1654 pub struct AttackPathEdge {
1655 /// The attack node uuid of the source node.
1656 pub source: std::string::String,
1657
1658 /// The attack node uuid of the destination node.
1659 pub destination: std::string::String,
1660
1661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1662 }
1663
1664 impl AttackPathEdge {
1665 /// Creates a new default instance.
1666 pub fn new() -> Self {
1667 std::default::Default::default()
1668 }
1669
1670 /// Sets the value of [source][crate::model::attack_path::AttackPathEdge::source].
1671 ///
1672 /// # Example
1673 /// ```ignore,no_run
1674 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1675 /// let x = AttackPathEdge::new().set_source("example");
1676 /// ```
1677 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1678 self.source = v.into();
1679 self
1680 }
1681
1682 /// Sets the value of [destination][crate::model::attack_path::AttackPathEdge::destination].
1683 ///
1684 /// # Example
1685 /// ```ignore,no_run
1686 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1687 /// let x = AttackPathEdge::new().set_destination("example");
1688 /// ```
1689 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1690 self.destination = v.into();
1691 self
1692 }
1693 }
1694
1695 impl wkt::message::Message for AttackPathEdge {
1696 fn typename() -> &'static str {
1697 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathEdge"
1698 }
1699 }
1700}
1701
1702/// Information related to Google Cloud Backup and DR Service findings.
1703#[derive(Clone, Default, PartialEq)]
1704#[non_exhaustive]
1705pub struct BackupDisasterRecovery {
1706 /// The name of a Backup and DR template which comprises one or more backup
1707 /// policies. See the [Backup and DR
1708 /// documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp)
1709 /// for more information. For example, `snap-ov`.
1710 pub backup_template: std::string::String,
1711
1712 /// The names of Backup and DR policies that are associated with a template
1713 /// and that define when to run a backup, how frequently to run a backup, and
1714 /// how long to retain the backup image. For example, `onvaults`.
1715 pub policies: std::vec::Vec<std::string::String>,
1716
1717 /// The name of a Backup and DR host, which is managed by the backup and
1718 /// recovery appliance and known to the management console. The host can be of
1719 /// type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file
1720 /// system, etc.), vCenter, or an ESX server. See the [Backup and DR
1721 /// documentation on
1722 /// hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications)
1723 /// for more information. For example, `centos7-01`.
1724 pub host: std::string::String,
1725
1726 /// The names of Backup and DR applications. An application is a VM, database,
1727 /// or file system on a managed host monitored by a backup and recovery
1728 /// appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`,
1729 /// `centos7-01-vol02`.
1730 pub applications: std::vec::Vec<std::string::String>,
1731
1732 /// The name of the Backup and DR storage pool that the backup and recovery
1733 /// appliance is storing data in. The storage pool could be of type Cloud,
1734 /// Primary, Snapshot, or OnVault. See the [Backup and DR documentation on
1735 /// storage
1736 /// pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools).
1737 /// For example, `DiskPoolOne`.
1738 pub storage_pool: std::string::String,
1739
1740 /// The names of Backup and DR advanced policy options of a policy applying to
1741 /// an application. See the [Backup and DR documentation on policy
1742 /// options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings).
1743 /// For example, `skipofflineappsincongrp, nounmap`.
1744 pub policy_options: std::vec::Vec<std::string::String>,
1745
1746 /// The name of the Backup and DR resource profile that specifies the storage
1747 /// media for backups of application and VM data. See the [Backup and DR
1748 /// documentation on
1749 /// profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile).
1750 /// For example, `GCP`.
1751 pub profile: std::string::String,
1752
1753 /// The name of the Backup and DR appliance that captures, moves, and manages
1754 /// the lifecycle of backup data. For example, `backup-server-57137`.
1755 pub appliance: std::string::String,
1756
1757 /// The backup type of the Backup and DR image.
1758 /// For example, `Snapshot`, `Remote Snapshot`, `OnVault`.
1759 pub backup_type: std::string::String,
1760
1761 /// The timestamp at which the Backup and DR backup was created.
1762 pub backup_create_time: std::option::Option<wkt::Timestamp>,
1763
1764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1765}
1766
1767impl BackupDisasterRecovery {
1768 /// Creates a new default instance.
1769 pub fn new() -> Self {
1770 std::default::Default::default()
1771 }
1772
1773 /// Sets the value of [backup_template][crate::model::BackupDisasterRecovery::backup_template].
1774 ///
1775 /// # Example
1776 /// ```ignore,no_run
1777 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1778 /// let x = BackupDisasterRecovery::new().set_backup_template("example");
1779 /// ```
1780 pub fn set_backup_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1781 self.backup_template = v.into();
1782 self
1783 }
1784
1785 /// Sets the value of [policies][crate::model::BackupDisasterRecovery::policies].
1786 ///
1787 /// # Example
1788 /// ```ignore,no_run
1789 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1790 /// let x = BackupDisasterRecovery::new().set_policies(["a", "b", "c"]);
1791 /// ```
1792 pub fn set_policies<T, V>(mut self, v: T) -> Self
1793 where
1794 T: std::iter::IntoIterator<Item = V>,
1795 V: std::convert::Into<std::string::String>,
1796 {
1797 use std::iter::Iterator;
1798 self.policies = v.into_iter().map(|i| i.into()).collect();
1799 self
1800 }
1801
1802 /// Sets the value of [host][crate::model::BackupDisasterRecovery::host].
1803 ///
1804 /// # Example
1805 /// ```ignore,no_run
1806 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1807 /// let x = BackupDisasterRecovery::new().set_host("example");
1808 /// ```
1809 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1810 self.host = v.into();
1811 self
1812 }
1813
1814 /// Sets the value of [applications][crate::model::BackupDisasterRecovery::applications].
1815 ///
1816 /// # Example
1817 /// ```ignore,no_run
1818 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1819 /// let x = BackupDisasterRecovery::new().set_applications(["a", "b", "c"]);
1820 /// ```
1821 pub fn set_applications<T, V>(mut self, v: T) -> Self
1822 where
1823 T: std::iter::IntoIterator<Item = V>,
1824 V: std::convert::Into<std::string::String>,
1825 {
1826 use std::iter::Iterator;
1827 self.applications = v.into_iter().map(|i| i.into()).collect();
1828 self
1829 }
1830
1831 /// Sets the value of [storage_pool][crate::model::BackupDisasterRecovery::storage_pool].
1832 ///
1833 /// # Example
1834 /// ```ignore,no_run
1835 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1836 /// let x = BackupDisasterRecovery::new().set_storage_pool("example");
1837 /// ```
1838 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1839 self.storage_pool = v.into();
1840 self
1841 }
1842
1843 /// Sets the value of [policy_options][crate::model::BackupDisasterRecovery::policy_options].
1844 ///
1845 /// # Example
1846 /// ```ignore,no_run
1847 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1848 /// let x = BackupDisasterRecovery::new().set_policy_options(["a", "b", "c"]);
1849 /// ```
1850 pub fn set_policy_options<T, V>(mut self, v: T) -> Self
1851 where
1852 T: std::iter::IntoIterator<Item = V>,
1853 V: std::convert::Into<std::string::String>,
1854 {
1855 use std::iter::Iterator;
1856 self.policy_options = v.into_iter().map(|i| i.into()).collect();
1857 self
1858 }
1859
1860 /// Sets the value of [profile][crate::model::BackupDisasterRecovery::profile].
1861 ///
1862 /// # Example
1863 /// ```ignore,no_run
1864 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1865 /// let x = BackupDisasterRecovery::new().set_profile("example");
1866 /// ```
1867 pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1868 self.profile = v.into();
1869 self
1870 }
1871
1872 /// Sets the value of [appliance][crate::model::BackupDisasterRecovery::appliance].
1873 ///
1874 /// # Example
1875 /// ```ignore,no_run
1876 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1877 /// let x = BackupDisasterRecovery::new().set_appliance("example");
1878 /// ```
1879 pub fn set_appliance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1880 self.appliance = v.into();
1881 self
1882 }
1883
1884 /// Sets the value of [backup_type][crate::model::BackupDisasterRecovery::backup_type].
1885 ///
1886 /// # Example
1887 /// ```ignore,no_run
1888 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1889 /// let x = BackupDisasterRecovery::new().set_backup_type("example");
1890 /// ```
1891 pub fn set_backup_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1892 self.backup_type = v.into();
1893 self
1894 }
1895
1896 /// Sets the value of [backup_create_time][crate::model::BackupDisasterRecovery::backup_create_time].
1897 ///
1898 /// # Example
1899 /// ```ignore,no_run
1900 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1901 /// use wkt::Timestamp;
1902 /// let x = BackupDisasterRecovery::new().set_backup_create_time(Timestamp::default()/* use setters */);
1903 /// ```
1904 pub fn set_backup_create_time<T>(mut self, v: T) -> Self
1905 where
1906 T: std::convert::Into<wkt::Timestamp>,
1907 {
1908 self.backup_create_time = std::option::Option::Some(v.into());
1909 self
1910 }
1911
1912 /// Sets or clears the value of [backup_create_time][crate::model::BackupDisasterRecovery::backup_create_time].
1913 ///
1914 /// # Example
1915 /// ```ignore,no_run
1916 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1917 /// use wkt::Timestamp;
1918 /// let x = BackupDisasterRecovery::new().set_or_clear_backup_create_time(Some(Timestamp::default()/* use setters */));
1919 /// let x = BackupDisasterRecovery::new().set_or_clear_backup_create_time(None::<Timestamp>);
1920 /// ```
1921 pub fn set_or_clear_backup_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1922 where
1923 T: std::convert::Into<wkt::Timestamp>,
1924 {
1925 self.backup_create_time = v.map(|x| x.into());
1926 self
1927 }
1928}
1929
1930impl wkt::message::Message for BackupDisasterRecovery {
1931 fn typename() -> &'static str {
1932 "type.googleapis.com/google.cloud.securitycenter.v2.BackupDisasterRecovery"
1933 }
1934}
1935
1936/// Configures how to deliver Findings to BigQuery Instance.
1937#[derive(Clone, Default, PartialEq)]
1938#[non_exhaustive]
1939pub struct BigQueryExport {
1940 /// Identifier. The relative resource name of this export. See:
1941 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>.
1942 /// The following list shows some examples:
1943 ///
1944 ///
1945 /// `organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}`
1946 ///
1947 /// + `folders/{folder_id}/locations/{location_id}/bigQueryExports/{export_id}`
1948 ///
1949 /// `projects/{project_id}/locations/{location_id}/bigQueryExports/{export_id}`
1950 ///
1951 /// This field is provided in responses, and is ignored when provided in create
1952 /// requests.
1953 pub name: std::string::String,
1954
1955 /// The description of the export (max of 1024 characters).
1956 pub description: std::string::String,
1957
1958 /// Expression that defines the filter to apply across create/update events
1959 /// of findings. The expression is a list of zero or more restrictions combined
1960 /// via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
1961 /// has higher precedence than `AND`.
1962 ///
1963 /// Restrictions have the form `<field> <operator> <value>` and may have a
1964 /// `-` character in front of them to indicate negation. The fields map to
1965 /// those defined in the corresponding resource.
1966 ///
1967 /// The supported operators are:
1968 ///
1969 /// * `=` for all value types.
1970 /// * `>`, `<`, `>=`, `<=` for integer values.
1971 /// * `:`, meaning substring matching, for strings.
1972 ///
1973 /// The supported value types are:
1974 ///
1975 /// * string literals in quotes.
1976 /// * integer literals without quotes.
1977 /// * boolean literals `true` and `false` without quotes.
1978 pub filter: std::string::String,
1979
1980 /// The dataset to write findings' updates to. Its format is
1981 /// "projects/[project_id]/datasets/[bigquery_dataset_id]".
1982 /// BigQuery dataset unique ID must contain only letters (a-z, A-Z), numbers
1983 /// (0-9), or underscores (_).
1984 pub dataset: std::string::String,
1985
1986 /// Output only. The time at which the BigQuery export was created.
1987 /// This field is set by the server and will be ignored if provided on export
1988 /// on creation.
1989 pub create_time: std::option::Option<wkt::Timestamp>,
1990
1991 /// Output only. The most recent time at which the BigQuery export was updated.
1992 /// This field is set by the server and will be ignored if provided on export
1993 /// creation or update.
1994 pub update_time: std::option::Option<wkt::Timestamp>,
1995
1996 /// Output only. Email address of the user who last edited the BigQuery export.
1997 /// This field is set by the server and will be ignored if provided on export
1998 /// creation or update.
1999 pub most_recent_editor: std::string::String,
2000
2001 /// Output only. The service account that needs permission to create table and
2002 /// upload data to the BigQuery dataset.
2003 pub principal: std::string::String,
2004
2005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2006}
2007
2008impl BigQueryExport {
2009 /// Creates a new default instance.
2010 pub fn new() -> Self {
2011 std::default::Default::default()
2012 }
2013
2014 /// Sets the value of [name][crate::model::BigQueryExport::name].
2015 ///
2016 /// # Example
2017 /// ```ignore,no_run
2018 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2019 /// # let organization_id = "organization_id";
2020 /// # let location_id = "location_id";
2021 /// # let export_id = "export_id";
2022 /// let x = BigQueryExport::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}"));
2023 /// ```
2024 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2025 self.name = v.into();
2026 self
2027 }
2028
2029 /// Sets the value of [description][crate::model::BigQueryExport::description].
2030 ///
2031 /// # Example
2032 /// ```ignore,no_run
2033 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2034 /// let x = BigQueryExport::new().set_description("example");
2035 /// ```
2036 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2037 self.description = v.into();
2038 self
2039 }
2040
2041 /// Sets the value of [filter][crate::model::BigQueryExport::filter].
2042 ///
2043 /// # Example
2044 /// ```ignore,no_run
2045 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2046 /// let x = BigQueryExport::new().set_filter("example");
2047 /// ```
2048 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2049 self.filter = v.into();
2050 self
2051 }
2052
2053 /// Sets the value of [dataset][crate::model::BigQueryExport::dataset].
2054 ///
2055 /// # Example
2056 /// ```ignore,no_run
2057 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2058 /// let x = BigQueryExport::new().set_dataset("example");
2059 /// ```
2060 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2061 self.dataset = v.into();
2062 self
2063 }
2064
2065 /// Sets the value of [create_time][crate::model::BigQueryExport::create_time].
2066 ///
2067 /// # Example
2068 /// ```ignore,no_run
2069 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2070 /// use wkt::Timestamp;
2071 /// let x = BigQueryExport::new().set_create_time(Timestamp::default()/* use setters */);
2072 /// ```
2073 pub fn set_create_time<T>(mut self, v: T) -> Self
2074 where
2075 T: std::convert::Into<wkt::Timestamp>,
2076 {
2077 self.create_time = std::option::Option::Some(v.into());
2078 self
2079 }
2080
2081 /// Sets or clears the value of [create_time][crate::model::BigQueryExport::create_time].
2082 ///
2083 /// # Example
2084 /// ```ignore,no_run
2085 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2086 /// use wkt::Timestamp;
2087 /// let x = BigQueryExport::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2088 /// let x = BigQueryExport::new().set_or_clear_create_time(None::<Timestamp>);
2089 /// ```
2090 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2091 where
2092 T: std::convert::Into<wkt::Timestamp>,
2093 {
2094 self.create_time = v.map(|x| x.into());
2095 self
2096 }
2097
2098 /// Sets the value of [update_time][crate::model::BigQueryExport::update_time].
2099 ///
2100 /// # Example
2101 /// ```ignore,no_run
2102 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2103 /// use wkt::Timestamp;
2104 /// let x = BigQueryExport::new().set_update_time(Timestamp::default()/* use setters */);
2105 /// ```
2106 pub fn set_update_time<T>(mut self, v: T) -> Self
2107 where
2108 T: std::convert::Into<wkt::Timestamp>,
2109 {
2110 self.update_time = std::option::Option::Some(v.into());
2111 self
2112 }
2113
2114 /// Sets or clears the value of [update_time][crate::model::BigQueryExport::update_time].
2115 ///
2116 /// # Example
2117 /// ```ignore,no_run
2118 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2119 /// use wkt::Timestamp;
2120 /// let x = BigQueryExport::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2121 /// let x = BigQueryExport::new().set_or_clear_update_time(None::<Timestamp>);
2122 /// ```
2123 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2124 where
2125 T: std::convert::Into<wkt::Timestamp>,
2126 {
2127 self.update_time = v.map(|x| x.into());
2128 self
2129 }
2130
2131 /// Sets the value of [most_recent_editor][crate::model::BigQueryExport::most_recent_editor].
2132 ///
2133 /// # Example
2134 /// ```ignore,no_run
2135 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2136 /// let x = BigQueryExport::new().set_most_recent_editor("example");
2137 /// ```
2138 pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
2139 mut self,
2140 v: T,
2141 ) -> Self {
2142 self.most_recent_editor = v.into();
2143 self
2144 }
2145
2146 /// Sets the value of [principal][crate::model::BigQueryExport::principal].
2147 ///
2148 /// # Example
2149 /// ```ignore,no_run
2150 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2151 /// let x = BigQueryExport::new().set_principal("example");
2152 /// ```
2153 pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2154 self.principal = v.into();
2155 self
2156 }
2157}
2158
2159impl wkt::message::Message for BigQueryExport {
2160 fn typename() -> &'static str {
2161 "type.googleapis.com/google.cloud.securitycenter.v2.BigQueryExport"
2162 }
2163}
2164
2165/// Contains details about a chokepoint, which is a resource or resource group
2166/// where high-risk attack paths converge, based on [attack path simulations]
2167/// (<https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations>).
2168#[derive(Clone, Default, PartialEq)]
2169#[non_exhaustive]
2170pub struct Chokepoint {
2171 /// List of resource names of findings associated with this chokepoint.
2172 /// For example, organizations/123/sources/456/findings/789.
2173 /// This list will have at most 100 findings.
2174 pub related_findings: std::vec::Vec<std::string::String>,
2175
2176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2177}
2178
2179impl Chokepoint {
2180 /// Creates a new default instance.
2181 pub fn new() -> Self {
2182 std::default::Default::default()
2183 }
2184
2185 /// Sets the value of [related_findings][crate::model::Chokepoint::related_findings].
2186 ///
2187 /// # Example
2188 /// ```ignore,no_run
2189 /// # use google_cloud_securitycenter_v2::model::Chokepoint;
2190 /// let x = Chokepoint::new().set_related_findings(["a", "b", "c"]);
2191 /// ```
2192 pub fn set_related_findings<T, V>(mut self, v: T) -> Self
2193 where
2194 T: std::iter::IntoIterator<Item = V>,
2195 V: std::convert::Into<std::string::String>,
2196 {
2197 use std::iter::Iterator;
2198 self.related_findings = v.into_iter().map(|i| i.into()).collect();
2199 self
2200 }
2201}
2202
2203impl wkt::message::Message for Chokepoint {
2204 fn typename() -> &'static str {
2205 "type.googleapis.com/google.cloud.securitycenter.v2.Chokepoint"
2206 }
2207}
2208
2209/// Fields related to Google Cloud Armor findings.
2210#[derive(Clone, Default, PartialEq)]
2211#[non_exhaustive]
2212pub struct CloudArmor {
2213 /// Information about the [Google Cloud Armor security
2214 /// policy](https://cloud.google.com/armor/docs/security-policy-overview)
2215 /// relevant to the finding.
2216 pub security_policy: std::option::Option<crate::model::SecurityPolicy>,
2217
2218 /// Information about incoming requests evaluated by [Google Cloud Armor
2219 /// security
2220 /// policies](https://cloud.google.com/armor/docs/security-policy-overview).
2221 pub requests: std::option::Option<crate::model::Requests>,
2222
2223 /// Information about potential Layer 7 DDoS attacks identified by [Google
2224 /// Cloud Armor Adaptive
2225 /// Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
2226 pub adaptive_protection: std::option::Option<crate::model::AdaptiveProtection>,
2227
2228 /// Information about DDoS attack volume and classification.
2229 pub attack: std::option::Option<crate::model::Attack>,
2230
2231 /// Distinguish between volumetric & protocol DDoS attack and
2232 /// application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
2233 /// attacks, or "L_7" for Layer 7 DDoS attacks.
2234 pub threat_vector: std::string::String,
2235
2236 /// Duration of attack from the start until the current moment (updated every 5
2237 /// minutes).
2238 pub duration: std::option::Option<wkt::Duration>,
2239
2240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2241}
2242
2243impl CloudArmor {
2244 /// Creates a new default instance.
2245 pub fn new() -> Self {
2246 std::default::Default::default()
2247 }
2248
2249 /// Sets the value of [security_policy][crate::model::CloudArmor::security_policy].
2250 ///
2251 /// # Example
2252 /// ```ignore,no_run
2253 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2254 /// use google_cloud_securitycenter_v2::model::SecurityPolicy;
2255 /// let x = CloudArmor::new().set_security_policy(SecurityPolicy::default()/* use setters */);
2256 /// ```
2257 pub fn set_security_policy<T>(mut self, v: T) -> Self
2258 where
2259 T: std::convert::Into<crate::model::SecurityPolicy>,
2260 {
2261 self.security_policy = std::option::Option::Some(v.into());
2262 self
2263 }
2264
2265 /// Sets or clears the value of [security_policy][crate::model::CloudArmor::security_policy].
2266 ///
2267 /// # Example
2268 /// ```ignore,no_run
2269 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2270 /// use google_cloud_securitycenter_v2::model::SecurityPolicy;
2271 /// let x = CloudArmor::new().set_or_clear_security_policy(Some(SecurityPolicy::default()/* use setters */));
2272 /// let x = CloudArmor::new().set_or_clear_security_policy(None::<SecurityPolicy>);
2273 /// ```
2274 pub fn set_or_clear_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
2275 where
2276 T: std::convert::Into<crate::model::SecurityPolicy>,
2277 {
2278 self.security_policy = v.map(|x| x.into());
2279 self
2280 }
2281
2282 /// Sets the value of [requests][crate::model::CloudArmor::requests].
2283 ///
2284 /// # Example
2285 /// ```ignore,no_run
2286 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2287 /// use google_cloud_securitycenter_v2::model::Requests;
2288 /// let x = CloudArmor::new().set_requests(Requests::default()/* use setters */);
2289 /// ```
2290 pub fn set_requests<T>(mut self, v: T) -> Self
2291 where
2292 T: std::convert::Into<crate::model::Requests>,
2293 {
2294 self.requests = std::option::Option::Some(v.into());
2295 self
2296 }
2297
2298 /// Sets or clears the value of [requests][crate::model::CloudArmor::requests].
2299 ///
2300 /// # Example
2301 /// ```ignore,no_run
2302 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2303 /// use google_cloud_securitycenter_v2::model::Requests;
2304 /// let x = CloudArmor::new().set_or_clear_requests(Some(Requests::default()/* use setters */));
2305 /// let x = CloudArmor::new().set_or_clear_requests(None::<Requests>);
2306 /// ```
2307 pub fn set_or_clear_requests<T>(mut self, v: std::option::Option<T>) -> Self
2308 where
2309 T: std::convert::Into<crate::model::Requests>,
2310 {
2311 self.requests = v.map(|x| x.into());
2312 self
2313 }
2314
2315 /// Sets the value of [adaptive_protection][crate::model::CloudArmor::adaptive_protection].
2316 ///
2317 /// # Example
2318 /// ```ignore,no_run
2319 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2320 /// use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2321 /// let x = CloudArmor::new().set_adaptive_protection(AdaptiveProtection::default()/* use setters */);
2322 /// ```
2323 pub fn set_adaptive_protection<T>(mut self, v: T) -> Self
2324 where
2325 T: std::convert::Into<crate::model::AdaptiveProtection>,
2326 {
2327 self.adaptive_protection = std::option::Option::Some(v.into());
2328 self
2329 }
2330
2331 /// Sets or clears the value of [adaptive_protection][crate::model::CloudArmor::adaptive_protection].
2332 ///
2333 /// # Example
2334 /// ```ignore,no_run
2335 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2336 /// use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2337 /// let x = CloudArmor::new().set_or_clear_adaptive_protection(Some(AdaptiveProtection::default()/* use setters */));
2338 /// let x = CloudArmor::new().set_or_clear_adaptive_protection(None::<AdaptiveProtection>);
2339 /// ```
2340 pub fn set_or_clear_adaptive_protection<T>(mut self, v: std::option::Option<T>) -> Self
2341 where
2342 T: std::convert::Into<crate::model::AdaptiveProtection>,
2343 {
2344 self.adaptive_protection = v.map(|x| x.into());
2345 self
2346 }
2347
2348 /// Sets the value of [attack][crate::model::CloudArmor::attack].
2349 ///
2350 /// # Example
2351 /// ```ignore,no_run
2352 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2353 /// use google_cloud_securitycenter_v2::model::Attack;
2354 /// let x = CloudArmor::new().set_attack(Attack::default()/* use setters */);
2355 /// ```
2356 pub fn set_attack<T>(mut self, v: T) -> Self
2357 where
2358 T: std::convert::Into<crate::model::Attack>,
2359 {
2360 self.attack = std::option::Option::Some(v.into());
2361 self
2362 }
2363
2364 /// Sets or clears the value of [attack][crate::model::CloudArmor::attack].
2365 ///
2366 /// # Example
2367 /// ```ignore,no_run
2368 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2369 /// use google_cloud_securitycenter_v2::model::Attack;
2370 /// let x = CloudArmor::new().set_or_clear_attack(Some(Attack::default()/* use setters */));
2371 /// let x = CloudArmor::new().set_or_clear_attack(None::<Attack>);
2372 /// ```
2373 pub fn set_or_clear_attack<T>(mut self, v: std::option::Option<T>) -> Self
2374 where
2375 T: std::convert::Into<crate::model::Attack>,
2376 {
2377 self.attack = v.map(|x| x.into());
2378 self
2379 }
2380
2381 /// Sets the value of [threat_vector][crate::model::CloudArmor::threat_vector].
2382 ///
2383 /// # Example
2384 /// ```ignore,no_run
2385 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2386 /// let x = CloudArmor::new().set_threat_vector("example");
2387 /// ```
2388 pub fn set_threat_vector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2389 self.threat_vector = v.into();
2390 self
2391 }
2392
2393 /// Sets the value of [duration][crate::model::CloudArmor::duration].
2394 ///
2395 /// # Example
2396 /// ```ignore,no_run
2397 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2398 /// use wkt::Duration;
2399 /// let x = CloudArmor::new().set_duration(Duration::default()/* use setters */);
2400 /// ```
2401 pub fn set_duration<T>(mut self, v: T) -> Self
2402 where
2403 T: std::convert::Into<wkt::Duration>,
2404 {
2405 self.duration = std::option::Option::Some(v.into());
2406 self
2407 }
2408
2409 /// Sets or clears the value of [duration][crate::model::CloudArmor::duration].
2410 ///
2411 /// # Example
2412 /// ```ignore,no_run
2413 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2414 /// use wkt::Duration;
2415 /// let x = CloudArmor::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
2416 /// let x = CloudArmor::new().set_or_clear_duration(None::<Duration>);
2417 /// ```
2418 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
2419 where
2420 T: std::convert::Into<wkt::Duration>,
2421 {
2422 self.duration = v.map(|x| x.into());
2423 self
2424 }
2425}
2426
2427impl wkt::message::Message for CloudArmor {
2428 fn typename() -> &'static str {
2429 "type.googleapis.com/google.cloud.securitycenter.v2.CloudArmor"
2430 }
2431}
2432
2433/// Information about the [Google Cloud Armor security
2434/// policy](https://cloud.google.com/armor/docs/security-policy-overview)
2435/// relevant to the finding.
2436#[derive(Clone, Default, PartialEq)]
2437#[non_exhaustive]
2438pub struct SecurityPolicy {
2439 /// The name of the Google Cloud Armor security policy, for example,
2440 /// "my-security-policy".
2441 pub name: std::string::String,
2442
2443 /// The type of Google Cloud Armor security policy for example, 'backend
2444 /// security policy', 'edge security policy', 'network edge security policy',
2445 /// or 'always-on DDoS protection'.
2446 pub r#type: std::string::String,
2447
2448 /// Whether or not the associated rule or policy is in preview mode.
2449 pub preview: bool,
2450
2451 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2452}
2453
2454impl SecurityPolicy {
2455 /// Creates a new default instance.
2456 pub fn new() -> Self {
2457 std::default::Default::default()
2458 }
2459
2460 /// Sets the value of [name][crate::model::SecurityPolicy::name].
2461 ///
2462 /// # Example
2463 /// ```ignore,no_run
2464 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2465 /// let x = SecurityPolicy::new().set_name("example");
2466 /// ```
2467 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2468 self.name = v.into();
2469 self
2470 }
2471
2472 /// Sets the value of [r#type][crate::model::SecurityPolicy::type].
2473 ///
2474 /// # Example
2475 /// ```ignore,no_run
2476 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2477 /// let x = SecurityPolicy::new().set_type("example");
2478 /// ```
2479 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2480 self.r#type = v.into();
2481 self
2482 }
2483
2484 /// Sets the value of [preview][crate::model::SecurityPolicy::preview].
2485 ///
2486 /// # Example
2487 /// ```ignore,no_run
2488 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2489 /// let x = SecurityPolicy::new().set_preview(true);
2490 /// ```
2491 pub fn set_preview<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2492 self.preview = v.into();
2493 self
2494 }
2495}
2496
2497impl wkt::message::Message for SecurityPolicy {
2498 fn typename() -> &'static str {
2499 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPolicy"
2500 }
2501}
2502
2503/// Information about the requests relevant to the finding.
2504#[derive(Clone, Default, PartialEq)]
2505#[non_exhaustive]
2506pub struct Requests {
2507 /// For 'Increasing deny ratio', the ratio is the denied traffic divided by the
2508 /// allowed traffic. For 'Allowed traffic spike', the ratio is the allowed
2509 /// traffic in the short term divided by allowed traffic in the long term.
2510 pub ratio: f64,
2511
2512 /// Allowed RPS (requests per second) in the short term.
2513 pub short_term_allowed: i32,
2514
2515 /// Allowed RPS (requests per second) over the long term.
2516 pub long_term_allowed: i32,
2517
2518 /// Denied RPS (requests per second) over the long term.
2519 pub long_term_denied: i32,
2520
2521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2522}
2523
2524impl Requests {
2525 /// Creates a new default instance.
2526 pub fn new() -> Self {
2527 std::default::Default::default()
2528 }
2529
2530 /// Sets the value of [ratio][crate::model::Requests::ratio].
2531 ///
2532 /// # Example
2533 /// ```ignore,no_run
2534 /// # use google_cloud_securitycenter_v2::model::Requests;
2535 /// let x = Requests::new().set_ratio(42.0);
2536 /// ```
2537 pub fn set_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2538 self.ratio = v.into();
2539 self
2540 }
2541
2542 /// Sets the value of [short_term_allowed][crate::model::Requests::short_term_allowed].
2543 ///
2544 /// # Example
2545 /// ```ignore,no_run
2546 /// # use google_cloud_securitycenter_v2::model::Requests;
2547 /// let x = Requests::new().set_short_term_allowed(42);
2548 /// ```
2549 pub fn set_short_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2550 self.short_term_allowed = v.into();
2551 self
2552 }
2553
2554 /// Sets the value of [long_term_allowed][crate::model::Requests::long_term_allowed].
2555 ///
2556 /// # Example
2557 /// ```ignore,no_run
2558 /// # use google_cloud_securitycenter_v2::model::Requests;
2559 /// let x = Requests::new().set_long_term_allowed(42);
2560 /// ```
2561 pub fn set_long_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2562 self.long_term_allowed = v.into();
2563 self
2564 }
2565
2566 /// Sets the value of [long_term_denied][crate::model::Requests::long_term_denied].
2567 ///
2568 /// # Example
2569 /// ```ignore,no_run
2570 /// # use google_cloud_securitycenter_v2::model::Requests;
2571 /// let x = Requests::new().set_long_term_denied(42);
2572 /// ```
2573 pub fn set_long_term_denied<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2574 self.long_term_denied = v.into();
2575 self
2576 }
2577}
2578
2579impl wkt::message::Message for Requests {
2580 fn typename() -> &'static str {
2581 "type.googleapis.com/google.cloud.securitycenter.v2.Requests"
2582 }
2583}
2584
2585/// Information about [Google Cloud Armor Adaptive
2586/// Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection).
2587#[derive(Clone, Default, PartialEq)]
2588#[non_exhaustive]
2589pub struct AdaptiveProtection {
2590 /// A score of 0 means that there is low confidence that the detected event is
2591 /// an actual attack. A score of 1 means that there is high confidence that the
2592 /// detected event is an attack. See the [Adaptive Protection
2593 /// documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning)
2594 /// for further explanation.
2595 pub confidence: f64,
2596
2597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2598}
2599
2600impl AdaptiveProtection {
2601 /// Creates a new default instance.
2602 pub fn new() -> Self {
2603 std::default::Default::default()
2604 }
2605
2606 /// Sets the value of [confidence][crate::model::AdaptiveProtection::confidence].
2607 ///
2608 /// # Example
2609 /// ```ignore,no_run
2610 /// # use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2611 /// let x = AdaptiveProtection::new().set_confidence(42.0);
2612 /// ```
2613 pub fn set_confidence<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2614 self.confidence = v.into();
2615 self
2616 }
2617}
2618
2619impl wkt::message::Message for AdaptiveProtection {
2620 fn typename() -> &'static str {
2621 "type.googleapis.com/google.cloud.securitycenter.v2.AdaptiveProtection"
2622 }
2623}
2624
2625/// Information about DDoS attack volume and classification.
2626#[derive(Clone, Default, PartialEq)]
2627#[non_exhaustive]
2628pub struct Attack {
2629 /// Total PPS (packets per second) volume of attack.
2630 pub volume_pps_long: i64,
2631
2632 /// Total BPS (bytes per second) volume of attack.
2633 pub volume_bps_long: i64,
2634
2635 /// Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
2636 pub classification: std::string::String,
2637
2638 /// Total PPS (packets per second) volume of attack. Deprecated - refer to
2639 /// volume_pps_long instead.
2640 #[deprecated]
2641 pub volume_pps: i32,
2642
2643 /// Total BPS (bytes per second) volume of attack. Deprecated - refer to
2644 /// volume_bps_long instead.
2645 #[deprecated]
2646 pub volume_bps: i32,
2647
2648 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2649}
2650
2651impl Attack {
2652 /// Creates a new default instance.
2653 pub fn new() -> Self {
2654 std::default::Default::default()
2655 }
2656
2657 /// Sets the value of [volume_pps_long][crate::model::Attack::volume_pps_long].
2658 ///
2659 /// # Example
2660 /// ```ignore,no_run
2661 /// # use google_cloud_securitycenter_v2::model::Attack;
2662 /// let x = Attack::new().set_volume_pps_long(42);
2663 /// ```
2664 pub fn set_volume_pps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2665 self.volume_pps_long = v.into();
2666 self
2667 }
2668
2669 /// Sets the value of [volume_bps_long][crate::model::Attack::volume_bps_long].
2670 ///
2671 /// # Example
2672 /// ```ignore,no_run
2673 /// # use google_cloud_securitycenter_v2::model::Attack;
2674 /// let x = Attack::new().set_volume_bps_long(42);
2675 /// ```
2676 pub fn set_volume_bps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2677 self.volume_bps_long = v.into();
2678 self
2679 }
2680
2681 /// Sets the value of [classification][crate::model::Attack::classification].
2682 ///
2683 /// # Example
2684 /// ```ignore,no_run
2685 /// # use google_cloud_securitycenter_v2::model::Attack;
2686 /// let x = Attack::new().set_classification("example");
2687 /// ```
2688 pub fn set_classification<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2689 self.classification = v.into();
2690 self
2691 }
2692
2693 /// Sets the value of [volume_pps][crate::model::Attack::volume_pps].
2694 ///
2695 /// # Example
2696 /// ```ignore,no_run
2697 /// # use google_cloud_securitycenter_v2::model::Attack;
2698 /// let x = Attack::new().set_volume_pps(42);
2699 /// ```
2700 #[deprecated]
2701 pub fn set_volume_pps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2702 self.volume_pps = v.into();
2703 self
2704 }
2705
2706 /// Sets the value of [volume_bps][crate::model::Attack::volume_bps].
2707 ///
2708 /// # Example
2709 /// ```ignore,no_run
2710 /// # use google_cloud_securitycenter_v2::model::Attack;
2711 /// let x = Attack::new().set_volume_bps(42);
2712 /// ```
2713 #[deprecated]
2714 pub fn set_volume_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2715 self.volume_bps = v.into();
2716 self
2717 }
2718}
2719
2720impl wkt::message::Message for Attack {
2721 fn typename() -> &'static str {
2722 "type.googleapis.com/google.cloud.securitycenter.v2.Attack"
2723 }
2724}
2725
2726/// The [data profile](https://cloud.google.com/dlp/docs/data-profiles)
2727/// associated with the finding.
2728#[derive(Clone, Default, PartialEq)]
2729#[non_exhaustive]
2730pub struct CloudDlpDataProfile {
2731 /// Name of the data profile, for example,
2732 /// `projects/123/locations/europe/tableProfiles/8383929`.
2733 pub data_profile: std::string::String,
2734
2735 /// The resource hierarchy level at which the data profile was generated.
2736 pub parent_type: crate::model::cloud_dlp_data_profile::ParentType,
2737
2738 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2739}
2740
2741impl CloudDlpDataProfile {
2742 /// Creates a new default instance.
2743 pub fn new() -> Self {
2744 std::default::Default::default()
2745 }
2746
2747 /// Sets the value of [data_profile][crate::model::CloudDlpDataProfile::data_profile].
2748 ///
2749 /// # Example
2750 /// ```ignore,no_run
2751 /// # use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
2752 /// let x = CloudDlpDataProfile::new().set_data_profile("example");
2753 /// ```
2754 pub fn set_data_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2755 self.data_profile = v.into();
2756 self
2757 }
2758
2759 /// Sets the value of [parent_type][crate::model::CloudDlpDataProfile::parent_type].
2760 ///
2761 /// # Example
2762 /// ```ignore,no_run
2763 /// # use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
2764 /// use google_cloud_securitycenter_v2::model::cloud_dlp_data_profile::ParentType;
2765 /// let x0 = CloudDlpDataProfile::new().set_parent_type(ParentType::Organization);
2766 /// let x1 = CloudDlpDataProfile::new().set_parent_type(ParentType::Project);
2767 /// ```
2768 pub fn set_parent_type<
2769 T: std::convert::Into<crate::model::cloud_dlp_data_profile::ParentType>,
2770 >(
2771 mut self,
2772 v: T,
2773 ) -> Self {
2774 self.parent_type = v.into();
2775 self
2776 }
2777}
2778
2779impl wkt::message::Message for CloudDlpDataProfile {
2780 fn typename() -> &'static str {
2781 "type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpDataProfile"
2782 }
2783}
2784
2785/// Defines additional types related to [CloudDlpDataProfile].
2786pub mod cloud_dlp_data_profile {
2787 #[allow(unused_imports)]
2788 use super::*;
2789
2790 /// Parents for configurations that produce data profile findings.
2791 ///
2792 /// # Working with unknown values
2793 ///
2794 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2795 /// additional enum variants at any time. Adding new variants is not considered
2796 /// a breaking change. Applications should write their code in anticipation of:
2797 ///
2798 /// - New values appearing in future releases of the client library, **and**
2799 /// - New values received dynamically, without application changes.
2800 ///
2801 /// Please consult the [Working with enums] section in the user guide for some
2802 /// guidelines.
2803 ///
2804 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2805 #[derive(Clone, Debug, PartialEq)]
2806 #[non_exhaustive]
2807 pub enum ParentType {
2808 /// Unspecified parent type.
2809 Unspecified,
2810 /// Organization-level configurations.
2811 Organization,
2812 /// Project-level configurations.
2813 Project,
2814 /// If set, the enum was initialized with an unknown value.
2815 ///
2816 /// Applications can examine the value using [ParentType::value] or
2817 /// [ParentType::name].
2818 UnknownValue(parent_type::UnknownValue),
2819 }
2820
2821 #[doc(hidden)]
2822 pub mod parent_type {
2823 #[allow(unused_imports)]
2824 use super::*;
2825 #[derive(Clone, Debug, PartialEq)]
2826 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2827 }
2828
2829 impl ParentType {
2830 /// Gets the enum value.
2831 ///
2832 /// Returns `None` if the enum contains an unknown value deserialized from
2833 /// the string representation of enums.
2834 pub fn value(&self) -> std::option::Option<i32> {
2835 match self {
2836 Self::Unspecified => std::option::Option::Some(0),
2837 Self::Organization => std::option::Option::Some(1),
2838 Self::Project => std::option::Option::Some(2),
2839 Self::UnknownValue(u) => u.0.value(),
2840 }
2841 }
2842
2843 /// Gets the enum value as a string.
2844 ///
2845 /// Returns `None` if the enum contains an unknown value deserialized from
2846 /// the integer representation of enums.
2847 pub fn name(&self) -> std::option::Option<&str> {
2848 match self {
2849 Self::Unspecified => std::option::Option::Some("PARENT_TYPE_UNSPECIFIED"),
2850 Self::Organization => std::option::Option::Some("ORGANIZATION"),
2851 Self::Project => std::option::Option::Some("PROJECT"),
2852 Self::UnknownValue(u) => u.0.name(),
2853 }
2854 }
2855 }
2856
2857 impl std::default::Default for ParentType {
2858 fn default() -> Self {
2859 use std::convert::From;
2860 Self::from(0)
2861 }
2862 }
2863
2864 impl std::fmt::Display for ParentType {
2865 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2866 wkt::internal::display_enum(f, self.name(), self.value())
2867 }
2868 }
2869
2870 impl std::convert::From<i32> for ParentType {
2871 fn from(value: i32) -> Self {
2872 match value {
2873 0 => Self::Unspecified,
2874 1 => Self::Organization,
2875 2 => Self::Project,
2876 _ => Self::UnknownValue(parent_type::UnknownValue(
2877 wkt::internal::UnknownEnumValue::Integer(value),
2878 )),
2879 }
2880 }
2881 }
2882
2883 impl std::convert::From<&str> for ParentType {
2884 fn from(value: &str) -> Self {
2885 use std::string::ToString;
2886 match value {
2887 "PARENT_TYPE_UNSPECIFIED" => Self::Unspecified,
2888 "ORGANIZATION" => Self::Organization,
2889 "PROJECT" => Self::Project,
2890 _ => Self::UnknownValue(parent_type::UnknownValue(
2891 wkt::internal::UnknownEnumValue::String(value.to_string()),
2892 )),
2893 }
2894 }
2895 }
2896
2897 impl serde::ser::Serialize for ParentType {
2898 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2899 where
2900 S: serde::Serializer,
2901 {
2902 match self {
2903 Self::Unspecified => serializer.serialize_i32(0),
2904 Self::Organization => serializer.serialize_i32(1),
2905 Self::Project => serializer.serialize_i32(2),
2906 Self::UnknownValue(u) => u.0.serialize(serializer),
2907 }
2908 }
2909 }
2910
2911 impl<'de> serde::de::Deserialize<'de> for ParentType {
2912 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2913 where
2914 D: serde::Deserializer<'de>,
2915 {
2916 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ParentType>::new(
2917 ".google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType",
2918 ))
2919 }
2920 }
2921}
2922
2923/// Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection
2924/// job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced
2925/// the finding.
2926#[derive(Clone, Default, PartialEq)]
2927#[non_exhaustive]
2928pub struct CloudDlpInspection {
2929 /// Name of the inspection job, for example,
2930 /// `projects/123/locations/europe/dlpJobs/i-8383929`.
2931 pub inspect_job: std::string::String,
2932
2933 /// The type of information (or
2934 /// *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found,
2935 /// for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`.
2936 pub info_type: std::string::String,
2937
2938 /// The number of times Cloud DLP found this infoType within this job
2939 /// and resource.
2940 pub info_type_count: i64,
2941
2942 /// Whether Cloud DLP scanned the complete resource or a sampled subset.
2943 pub full_scan: bool,
2944
2945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2946}
2947
2948impl CloudDlpInspection {
2949 /// Creates a new default instance.
2950 pub fn new() -> Self {
2951 std::default::Default::default()
2952 }
2953
2954 /// Sets the value of [inspect_job][crate::model::CloudDlpInspection::inspect_job].
2955 ///
2956 /// # Example
2957 /// ```ignore,no_run
2958 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2959 /// let x = CloudDlpInspection::new().set_inspect_job("example");
2960 /// ```
2961 pub fn set_inspect_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2962 self.inspect_job = v.into();
2963 self
2964 }
2965
2966 /// Sets the value of [info_type][crate::model::CloudDlpInspection::info_type].
2967 ///
2968 /// # Example
2969 /// ```ignore,no_run
2970 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2971 /// let x = CloudDlpInspection::new().set_info_type("example");
2972 /// ```
2973 pub fn set_info_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2974 self.info_type = v.into();
2975 self
2976 }
2977
2978 /// Sets the value of [info_type_count][crate::model::CloudDlpInspection::info_type_count].
2979 ///
2980 /// # Example
2981 /// ```ignore,no_run
2982 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2983 /// let x = CloudDlpInspection::new().set_info_type_count(42);
2984 /// ```
2985 pub fn set_info_type_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2986 self.info_type_count = v.into();
2987 self
2988 }
2989
2990 /// Sets the value of [full_scan][crate::model::CloudDlpInspection::full_scan].
2991 ///
2992 /// # Example
2993 /// ```ignore,no_run
2994 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2995 /// let x = CloudDlpInspection::new().set_full_scan(true);
2996 /// ```
2997 pub fn set_full_scan<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2998 self.full_scan = v.into();
2999 self
3000 }
3001}
3002
3003impl wkt::message::Message for CloudDlpInspection {
3004 fn typename() -> &'static str {
3005 "type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpInspection"
3006 }
3007}
3008
3009/// Contains compliance information about a security standard indicating unmet
3010/// recommendations.
3011#[derive(Clone, Default, PartialEq)]
3012#[non_exhaustive]
3013pub struct Compliance {
3014 /// Industry-wide compliance standards or benchmarks, such as CIS, PCI, and
3015 /// OWASP.
3016 pub standard: std::string::String,
3017
3018 /// Version of the standard or benchmark, for example, 1.1
3019 pub version: std::string::String,
3020
3021 /// Policies within the standard or benchmark, for example, A.12.4.1
3022 pub ids: std::vec::Vec<std::string::String>,
3023
3024 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3025}
3026
3027impl Compliance {
3028 /// Creates a new default instance.
3029 pub fn new() -> Self {
3030 std::default::Default::default()
3031 }
3032
3033 /// Sets the value of [standard][crate::model::Compliance::standard].
3034 ///
3035 /// # Example
3036 /// ```ignore,no_run
3037 /// # use google_cloud_securitycenter_v2::model::Compliance;
3038 /// let x = Compliance::new().set_standard("example");
3039 /// ```
3040 pub fn set_standard<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3041 self.standard = v.into();
3042 self
3043 }
3044
3045 /// Sets the value of [version][crate::model::Compliance::version].
3046 ///
3047 /// # Example
3048 /// ```ignore,no_run
3049 /// # use google_cloud_securitycenter_v2::model::Compliance;
3050 /// let x = Compliance::new().set_version("example");
3051 /// ```
3052 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3053 self.version = v.into();
3054 self
3055 }
3056
3057 /// Sets the value of [ids][crate::model::Compliance::ids].
3058 ///
3059 /// # Example
3060 /// ```ignore,no_run
3061 /// # use google_cloud_securitycenter_v2::model::Compliance;
3062 /// let x = Compliance::new().set_ids(["a", "b", "c"]);
3063 /// ```
3064 pub fn set_ids<T, V>(mut self, v: T) -> Self
3065 where
3066 T: std::iter::IntoIterator<Item = V>,
3067 V: std::convert::Into<std::string::String>,
3068 {
3069 use std::iter::Iterator;
3070 self.ids = v.into_iter().map(|i| i.into()).collect();
3071 self
3072 }
3073}
3074
3075impl wkt::message::Message for Compliance {
3076 fn typename() -> &'static str {
3077 "type.googleapis.com/google.cloud.securitycenter.v2.Compliance"
3078 }
3079}
3080
3081/// Contains information about the IP connection associated with the finding.
3082#[derive(Clone, Default, PartialEq)]
3083#[non_exhaustive]
3084pub struct Connection {
3085 /// Destination IP address. Not present for sockets that are listening and not
3086 /// connected.
3087 pub destination_ip: std::string::String,
3088
3089 /// Destination port. Not present for sockets that are listening and not
3090 /// connected.
3091 pub destination_port: i32,
3092
3093 /// Source IP address.
3094 pub source_ip: std::string::String,
3095
3096 /// Source port.
3097 pub source_port: i32,
3098
3099 /// IANA Internet Protocol Number such as TCP(6) and UDP(17).
3100 pub protocol: crate::model::connection::Protocol,
3101
3102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3103}
3104
3105impl Connection {
3106 /// Creates a new default instance.
3107 pub fn new() -> Self {
3108 std::default::Default::default()
3109 }
3110
3111 /// Sets the value of [destination_ip][crate::model::Connection::destination_ip].
3112 ///
3113 /// # Example
3114 /// ```ignore,no_run
3115 /// # use google_cloud_securitycenter_v2::model::Connection;
3116 /// let x = Connection::new().set_destination_ip("example");
3117 /// ```
3118 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3119 self.destination_ip = v.into();
3120 self
3121 }
3122
3123 /// Sets the value of [destination_port][crate::model::Connection::destination_port].
3124 ///
3125 /// # Example
3126 /// ```ignore,no_run
3127 /// # use google_cloud_securitycenter_v2::model::Connection;
3128 /// let x = Connection::new().set_destination_port(42);
3129 /// ```
3130 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3131 self.destination_port = v.into();
3132 self
3133 }
3134
3135 /// Sets the value of [source_ip][crate::model::Connection::source_ip].
3136 ///
3137 /// # Example
3138 /// ```ignore,no_run
3139 /// # use google_cloud_securitycenter_v2::model::Connection;
3140 /// let x = Connection::new().set_source_ip("example");
3141 /// ```
3142 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3143 self.source_ip = v.into();
3144 self
3145 }
3146
3147 /// Sets the value of [source_port][crate::model::Connection::source_port].
3148 ///
3149 /// # Example
3150 /// ```ignore,no_run
3151 /// # use google_cloud_securitycenter_v2::model::Connection;
3152 /// let x = Connection::new().set_source_port(42);
3153 /// ```
3154 pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3155 self.source_port = v.into();
3156 self
3157 }
3158
3159 /// Sets the value of [protocol][crate::model::Connection::protocol].
3160 ///
3161 /// # Example
3162 /// ```ignore,no_run
3163 /// # use google_cloud_securitycenter_v2::model::Connection;
3164 /// use google_cloud_securitycenter_v2::model::connection::Protocol;
3165 /// let x0 = Connection::new().set_protocol(Protocol::Icmp);
3166 /// let x1 = Connection::new().set_protocol(Protocol::Tcp);
3167 /// let x2 = Connection::new().set_protocol(Protocol::Udp);
3168 /// ```
3169 pub fn set_protocol<T: std::convert::Into<crate::model::connection::Protocol>>(
3170 mut self,
3171 v: T,
3172 ) -> Self {
3173 self.protocol = v.into();
3174 self
3175 }
3176}
3177
3178impl wkt::message::Message for Connection {
3179 fn typename() -> &'static str {
3180 "type.googleapis.com/google.cloud.securitycenter.v2.Connection"
3181 }
3182}
3183
3184/// Defines additional types related to [Connection].
3185pub mod connection {
3186 #[allow(unused_imports)]
3187 use super::*;
3188
3189 /// IANA Internet Protocol Number such as TCP(6) and UDP(17).
3190 ///
3191 /// # Working with unknown values
3192 ///
3193 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3194 /// additional enum variants at any time. Adding new variants is not considered
3195 /// a breaking change. Applications should write their code in anticipation of:
3196 ///
3197 /// - New values appearing in future releases of the client library, **and**
3198 /// - New values received dynamically, without application changes.
3199 ///
3200 /// Please consult the [Working with enums] section in the user guide for some
3201 /// guidelines.
3202 ///
3203 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3204 #[derive(Clone, Debug, PartialEq)]
3205 #[non_exhaustive]
3206 pub enum Protocol {
3207 /// Unspecified protocol (not HOPOPT).
3208 Unspecified,
3209 /// Internet Control Message Protocol.
3210 Icmp,
3211 /// Transmission Control Protocol.
3212 Tcp,
3213 /// User Datagram Protocol.
3214 Udp,
3215 /// Generic Routing Encapsulation.
3216 Gre,
3217 /// Encap Security Payload.
3218 Esp,
3219 /// If set, the enum was initialized with an unknown value.
3220 ///
3221 /// Applications can examine the value using [Protocol::value] or
3222 /// [Protocol::name].
3223 UnknownValue(protocol::UnknownValue),
3224 }
3225
3226 #[doc(hidden)]
3227 pub mod protocol {
3228 #[allow(unused_imports)]
3229 use super::*;
3230 #[derive(Clone, Debug, PartialEq)]
3231 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3232 }
3233
3234 impl Protocol {
3235 /// Gets the enum value.
3236 ///
3237 /// Returns `None` if the enum contains an unknown value deserialized from
3238 /// the string representation of enums.
3239 pub fn value(&self) -> std::option::Option<i32> {
3240 match self {
3241 Self::Unspecified => std::option::Option::Some(0),
3242 Self::Icmp => std::option::Option::Some(1),
3243 Self::Tcp => std::option::Option::Some(6),
3244 Self::Udp => std::option::Option::Some(17),
3245 Self::Gre => std::option::Option::Some(47),
3246 Self::Esp => std::option::Option::Some(50),
3247 Self::UnknownValue(u) => u.0.value(),
3248 }
3249 }
3250
3251 /// Gets the enum value as a string.
3252 ///
3253 /// Returns `None` if the enum contains an unknown value deserialized from
3254 /// the integer representation of enums.
3255 pub fn name(&self) -> std::option::Option<&str> {
3256 match self {
3257 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
3258 Self::Icmp => std::option::Option::Some("ICMP"),
3259 Self::Tcp => std::option::Option::Some("TCP"),
3260 Self::Udp => std::option::Option::Some("UDP"),
3261 Self::Gre => std::option::Option::Some("GRE"),
3262 Self::Esp => std::option::Option::Some("ESP"),
3263 Self::UnknownValue(u) => u.0.name(),
3264 }
3265 }
3266 }
3267
3268 impl std::default::Default for Protocol {
3269 fn default() -> Self {
3270 use std::convert::From;
3271 Self::from(0)
3272 }
3273 }
3274
3275 impl std::fmt::Display for Protocol {
3276 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3277 wkt::internal::display_enum(f, self.name(), self.value())
3278 }
3279 }
3280
3281 impl std::convert::From<i32> for Protocol {
3282 fn from(value: i32) -> Self {
3283 match value {
3284 0 => Self::Unspecified,
3285 1 => Self::Icmp,
3286 6 => Self::Tcp,
3287 17 => Self::Udp,
3288 47 => Self::Gre,
3289 50 => Self::Esp,
3290 _ => Self::UnknownValue(protocol::UnknownValue(
3291 wkt::internal::UnknownEnumValue::Integer(value),
3292 )),
3293 }
3294 }
3295 }
3296
3297 impl std::convert::From<&str> for Protocol {
3298 fn from(value: &str) -> Self {
3299 use std::string::ToString;
3300 match value {
3301 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
3302 "ICMP" => Self::Icmp,
3303 "TCP" => Self::Tcp,
3304 "UDP" => Self::Udp,
3305 "GRE" => Self::Gre,
3306 "ESP" => Self::Esp,
3307 _ => Self::UnknownValue(protocol::UnknownValue(
3308 wkt::internal::UnknownEnumValue::String(value.to_string()),
3309 )),
3310 }
3311 }
3312 }
3313
3314 impl serde::ser::Serialize for Protocol {
3315 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3316 where
3317 S: serde::Serializer,
3318 {
3319 match self {
3320 Self::Unspecified => serializer.serialize_i32(0),
3321 Self::Icmp => serializer.serialize_i32(1),
3322 Self::Tcp => serializer.serialize_i32(6),
3323 Self::Udp => serializer.serialize_i32(17),
3324 Self::Gre => serializer.serialize_i32(47),
3325 Self::Esp => serializer.serialize_i32(50),
3326 Self::UnknownValue(u) => u.0.serialize(serializer),
3327 }
3328 }
3329 }
3330
3331 impl<'de> serde::de::Deserialize<'de> for Protocol {
3332 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3333 where
3334 D: serde::Deserializer<'de>,
3335 {
3336 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
3337 ".google.cloud.securitycenter.v2.Connection.Protocol",
3338 ))
3339 }
3340 }
3341}
3342
3343/// Details about specific contacts
3344#[derive(Clone, Default, PartialEq)]
3345#[non_exhaustive]
3346pub struct ContactDetails {
3347 /// A list of contacts
3348 pub contacts: std::vec::Vec<crate::model::Contact>,
3349
3350 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3351}
3352
3353impl ContactDetails {
3354 /// Creates a new default instance.
3355 pub fn new() -> Self {
3356 std::default::Default::default()
3357 }
3358
3359 /// Sets the value of [contacts][crate::model::ContactDetails::contacts].
3360 ///
3361 /// # Example
3362 /// ```ignore,no_run
3363 /// # use google_cloud_securitycenter_v2::model::ContactDetails;
3364 /// use google_cloud_securitycenter_v2::model::Contact;
3365 /// let x = ContactDetails::new()
3366 /// .set_contacts([
3367 /// Contact::default()/* use setters */,
3368 /// Contact::default()/* use (different) setters */,
3369 /// ]);
3370 /// ```
3371 pub fn set_contacts<T, V>(mut self, v: T) -> Self
3372 where
3373 T: std::iter::IntoIterator<Item = V>,
3374 V: std::convert::Into<crate::model::Contact>,
3375 {
3376 use std::iter::Iterator;
3377 self.contacts = v.into_iter().map(|i| i.into()).collect();
3378 self
3379 }
3380}
3381
3382impl wkt::message::Message for ContactDetails {
3383 fn typename() -> &'static str {
3384 "type.googleapis.com/google.cloud.securitycenter.v2.ContactDetails"
3385 }
3386}
3387
3388/// The email address of a contact.
3389#[derive(Clone, Default, PartialEq)]
3390#[non_exhaustive]
3391pub struct Contact {
3392 /// An email address. For example, "`person123@company.com`".
3393 pub email: std::string::String,
3394
3395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3396}
3397
3398impl Contact {
3399 /// Creates a new default instance.
3400 pub fn new() -> Self {
3401 std::default::Default::default()
3402 }
3403
3404 /// Sets the value of [email][crate::model::Contact::email].
3405 ///
3406 /// # Example
3407 /// ```ignore,no_run
3408 /// # use google_cloud_securitycenter_v2::model::Contact;
3409 /// let x = Contact::new().set_email("example");
3410 /// ```
3411 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3412 self.email = v.into();
3413 self
3414 }
3415}
3416
3417impl wkt::message::Message for Contact {
3418 fn typename() -> &'static str {
3419 "type.googleapis.com/google.cloud.securitycenter.v2.Contact"
3420 }
3421}
3422
3423/// Container associated with the finding.
3424#[derive(Clone, Default, PartialEq)]
3425#[non_exhaustive]
3426pub struct Container {
3427 /// Name of the container.
3428 pub name: std::string::String,
3429
3430 /// Container image URI provided when configuring a pod or container. This
3431 /// string can identify a container image version using mutable tags.
3432 pub uri: std::string::String,
3433
3434 /// Optional container image ID, if provided by the container runtime. Uniquely
3435 /// identifies the container image launched using a container image digest.
3436 pub image_id: std::string::String,
3437
3438 /// Container labels, as provided by the container runtime.
3439 pub labels: std::vec::Vec<crate::model::Label>,
3440
3441 /// The time that the container was created.
3442 pub create_time: std::option::Option<wkt::Timestamp>,
3443
3444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3445}
3446
3447impl Container {
3448 /// Creates a new default instance.
3449 pub fn new() -> Self {
3450 std::default::Default::default()
3451 }
3452
3453 /// Sets the value of [name][crate::model::Container::name].
3454 ///
3455 /// # Example
3456 /// ```ignore,no_run
3457 /// # use google_cloud_securitycenter_v2::model::Container;
3458 /// let x = Container::new().set_name("example");
3459 /// ```
3460 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3461 self.name = v.into();
3462 self
3463 }
3464
3465 /// Sets the value of [uri][crate::model::Container::uri].
3466 ///
3467 /// # Example
3468 /// ```ignore,no_run
3469 /// # use google_cloud_securitycenter_v2::model::Container;
3470 /// let x = Container::new().set_uri("example");
3471 /// ```
3472 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3473 self.uri = v.into();
3474 self
3475 }
3476
3477 /// Sets the value of [image_id][crate::model::Container::image_id].
3478 ///
3479 /// # Example
3480 /// ```ignore,no_run
3481 /// # use google_cloud_securitycenter_v2::model::Container;
3482 /// let x = Container::new().set_image_id("example");
3483 /// ```
3484 pub fn set_image_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3485 self.image_id = v.into();
3486 self
3487 }
3488
3489 /// Sets the value of [labels][crate::model::Container::labels].
3490 ///
3491 /// # Example
3492 /// ```ignore,no_run
3493 /// # use google_cloud_securitycenter_v2::model::Container;
3494 /// use google_cloud_securitycenter_v2::model::Label;
3495 /// let x = Container::new()
3496 /// .set_labels([
3497 /// Label::default()/* use setters */,
3498 /// Label::default()/* use (different) setters */,
3499 /// ]);
3500 /// ```
3501 pub fn set_labels<T, V>(mut self, v: T) -> Self
3502 where
3503 T: std::iter::IntoIterator<Item = V>,
3504 V: std::convert::Into<crate::model::Label>,
3505 {
3506 use std::iter::Iterator;
3507 self.labels = v.into_iter().map(|i| i.into()).collect();
3508 self
3509 }
3510
3511 /// Sets the value of [create_time][crate::model::Container::create_time].
3512 ///
3513 /// # Example
3514 /// ```ignore,no_run
3515 /// # use google_cloud_securitycenter_v2::model::Container;
3516 /// use wkt::Timestamp;
3517 /// let x = Container::new().set_create_time(Timestamp::default()/* use setters */);
3518 /// ```
3519 pub fn set_create_time<T>(mut self, v: T) -> Self
3520 where
3521 T: std::convert::Into<wkt::Timestamp>,
3522 {
3523 self.create_time = std::option::Option::Some(v.into());
3524 self
3525 }
3526
3527 /// Sets or clears the value of [create_time][crate::model::Container::create_time].
3528 ///
3529 /// # Example
3530 /// ```ignore,no_run
3531 /// # use google_cloud_securitycenter_v2::model::Container;
3532 /// use wkt::Timestamp;
3533 /// let x = Container::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3534 /// let x = Container::new().set_or_clear_create_time(None::<Timestamp>);
3535 /// ```
3536 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3537 where
3538 T: std::convert::Into<wkt::Timestamp>,
3539 {
3540 self.create_time = v.map(|x| x.into());
3541 self
3542 }
3543}
3544
3545impl wkt::message::Message for Container {
3546 fn typename() -> &'static str {
3547 "type.googleapis.com/google.cloud.securitycenter.v2.Container"
3548 }
3549}
3550
3551/// Details about a data access attempt made by a principal not authorized under
3552/// applicable data security policy.
3553#[derive(Clone, Default, PartialEq)]
3554#[non_exhaustive]
3555pub struct DataAccessEvent {
3556 /// Unique identifier for data access event.
3557 pub event_id: std::string::String,
3558
3559 /// The email address of the principal that accessed the data. The principal
3560 /// could be a user account, service account, Google group, or other.
3561 pub principal_email: std::string::String,
3562
3563 /// The operation performed by the principal to access the data.
3564 pub operation: crate::model::data_access_event::Operation,
3565
3566 /// Timestamp of data access event.
3567 pub event_time: std::option::Option<wkt::Timestamp>,
3568
3569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3570}
3571
3572impl DataAccessEvent {
3573 /// Creates a new default instance.
3574 pub fn new() -> Self {
3575 std::default::Default::default()
3576 }
3577
3578 /// Sets the value of [event_id][crate::model::DataAccessEvent::event_id].
3579 ///
3580 /// # Example
3581 /// ```ignore,no_run
3582 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3583 /// let x = DataAccessEvent::new().set_event_id("example");
3584 /// ```
3585 pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3586 self.event_id = v.into();
3587 self
3588 }
3589
3590 /// Sets the value of [principal_email][crate::model::DataAccessEvent::principal_email].
3591 ///
3592 /// # Example
3593 /// ```ignore,no_run
3594 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3595 /// let x = DataAccessEvent::new().set_principal_email("example");
3596 /// ```
3597 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3598 self.principal_email = v.into();
3599 self
3600 }
3601
3602 /// Sets the value of [operation][crate::model::DataAccessEvent::operation].
3603 ///
3604 /// # Example
3605 /// ```ignore,no_run
3606 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3607 /// use google_cloud_securitycenter_v2::model::data_access_event::Operation;
3608 /// let x0 = DataAccessEvent::new().set_operation(Operation::Read);
3609 /// let x1 = DataAccessEvent::new().set_operation(Operation::Move);
3610 /// let x2 = DataAccessEvent::new().set_operation(Operation::Copy);
3611 /// ```
3612 pub fn set_operation<T: std::convert::Into<crate::model::data_access_event::Operation>>(
3613 mut self,
3614 v: T,
3615 ) -> Self {
3616 self.operation = v.into();
3617 self
3618 }
3619
3620 /// Sets the value of [event_time][crate::model::DataAccessEvent::event_time].
3621 ///
3622 /// # Example
3623 /// ```ignore,no_run
3624 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3625 /// use wkt::Timestamp;
3626 /// let x = DataAccessEvent::new().set_event_time(Timestamp::default()/* use setters */);
3627 /// ```
3628 pub fn set_event_time<T>(mut self, v: T) -> Self
3629 where
3630 T: std::convert::Into<wkt::Timestamp>,
3631 {
3632 self.event_time = std::option::Option::Some(v.into());
3633 self
3634 }
3635
3636 /// Sets or clears the value of [event_time][crate::model::DataAccessEvent::event_time].
3637 ///
3638 /// # Example
3639 /// ```ignore,no_run
3640 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3641 /// use wkt::Timestamp;
3642 /// let x = DataAccessEvent::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
3643 /// let x = DataAccessEvent::new().set_or_clear_event_time(None::<Timestamp>);
3644 /// ```
3645 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
3646 where
3647 T: std::convert::Into<wkt::Timestamp>,
3648 {
3649 self.event_time = v.map(|x| x.into());
3650 self
3651 }
3652}
3653
3654impl wkt::message::Message for DataAccessEvent {
3655 fn typename() -> &'static str {
3656 "type.googleapis.com/google.cloud.securitycenter.v2.DataAccessEvent"
3657 }
3658}
3659
3660/// Defines additional types related to [DataAccessEvent].
3661pub mod data_access_event {
3662 #[allow(unused_imports)]
3663 use super::*;
3664
3665 /// The operation of a data access event.
3666 ///
3667 /// # Working with unknown values
3668 ///
3669 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3670 /// additional enum variants at any time. Adding new variants is not considered
3671 /// a breaking change. Applications should write their code in anticipation of:
3672 ///
3673 /// - New values appearing in future releases of the client library, **and**
3674 /// - New values received dynamically, without application changes.
3675 ///
3676 /// Please consult the [Working with enums] section in the user guide for some
3677 /// guidelines.
3678 ///
3679 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3680 #[derive(Clone, Debug, PartialEq)]
3681 #[non_exhaustive]
3682 pub enum Operation {
3683 /// The operation is unspecified.
3684 Unspecified,
3685 /// Represents a read operation.
3686 Read,
3687 /// Represents a move operation.
3688 Move,
3689 /// Represents a copy operation.
3690 Copy,
3691 /// If set, the enum was initialized with an unknown value.
3692 ///
3693 /// Applications can examine the value using [Operation::value] or
3694 /// [Operation::name].
3695 UnknownValue(operation::UnknownValue),
3696 }
3697
3698 #[doc(hidden)]
3699 pub mod operation {
3700 #[allow(unused_imports)]
3701 use super::*;
3702 #[derive(Clone, Debug, PartialEq)]
3703 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3704 }
3705
3706 impl Operation {
3707 /// Gets the enum value.
3708 ///
3709 /// Returns `None` if the enum contains an unknown value deserialized from
3710 /// the string representation of enums.
3711 pub fn value(&self) -> std::option::Option<i32> {
3712 match self {
3713 Self::Unspecified => std::option::Option::Some(0),
3714 Self::Read => std::option::Option::Some(1),
3715 Self::Move => std::option::Option::Some(2),
3716 Self::Copy => std::option::Option::Some(3),
3717 Self::UnknownValue(u) => u.0.value(),
3718 }
3719 }
3720
3721 /// Gets the enum value as a string.
3722 ///
3723 /// Returns `None` if the enum contains an unknown value deserialized from
3724 /// the integer representation of enums.
3725 pub fn name(&self) -> std::option::Option<&str> {
3726 match self {
3727 Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
3728 Self::Read => std::option::Option::Some("READ"),
3729 Self::Move => std::option::Option::Some("MOVE"),
3730 Self::Copy => std::option::Option::Some("COPY"),
3731 Self::UnknownValue(u) => u.0.name(),
3732 }
3733 }
3734 }
3735
3736 impl std::default::Default for Operation {
3737 fn default() -> Self {
3738 use std::convert::From;
3739 Self::from(0)
3740 }
3741 }
3742
3743 impl std::fmt::Display for Operation {
3744 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3745 wkt::internal::display_enum(f, self.name(), self.value())
3746 }
3747 }
3748
3749 impl std::convert::From<i32> for Operation {
3750 fn from(value: i32) -> Self {
3751 match value {
3752 0 => Self::Unspecified,
3753 1 => Self::Read,
3754 2 => Self::Move,
3755 3 => Self::Copy,
3756 _ => Self::UnknownValue(operation::UnknownValue(
3757 wkt::internal::UnknownEnumValue::Integer(value),
3758 )),
3759 }
3760 }
3761 }
3762
3763 impl std::convert::From<&str> for Operation {
3764 fn from(value: &str) -> Self {
3765 use std::string::ToString;
3766 match value {
3767 "OPERATION_UNSPECIFIED" => Self::Unspecified,
3768 "READ" => Self::Read,
3769 "MOVE" => Self::Move,
3770 "COPY" => Self::Copy,
3771 _ => Self::UnknownValue(operation::UnknownValue(
3772 wkt::internal::UnknownEnumValue::String(value.to_string()),
3773 )),
3774 }
3775 }
3776 }
3777
3778 impl serde::ser::Serialize for Operation {
3779 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3780 where
3781 S: serde::Serializer,
3782 {
3783 match self {
3784 Self::Unspecified => serializer.serialize_i32(0),
3785 Self::Read => serializer.serialize_i32(1),
3786 Self::Move => serializer.serialize_i32(2),
3787 Self::Copy => serializer.serialize_i32(3),
3788 Self::UnknownValue(u) => u.0.serialize(serializer),
3789 }
3790 }
3791 }
3792
3793 impl<'de> serde::de::Deserialize<'de> for Operation {
3794 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3795 where
3796 D: serde::Deserializer<'de>,
3797 {
3798 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
3799 ".google.cloud.securitycenter.v2.DataAccessEvent.Operation",
3800 ))
3801 }
3802 }
3803}
3804
3805/// Details about a data flow event, in which either the data is moved to or is
3806/// accessed from a non-compliant geo-location, as defined in the applicable data
3807/// security policy.
3808#[derive(Clone, Default, PartialEq)]
3809#[non_exhaustive]
3810pub struct DataFlowEvent {
3811 /// Unique identifier for data flow event.
3812 pub event_id: std::string::String,
3813
3814 /// The email address of the principal that initiated the data flow event. The
3815 /// principal could be a user account, service account, Google group, or other.
3816 pub principal_email: std::string::String,
3817
3818 /// The operation performed by the principal for the data flow event.
3819 pub operation: crate::model::data_flow_event::Operation,
3820
3821 /// Non-compliant location of the principal or the data destination.
3822 pub violated_location: std::string::String,
3823
3824 /// Timestamp of data flow event.
3825 pub event_time: std::option::Option<wkt::Timestamp>,
3826
3827 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3828}
3829
3830impl DataFlowEvent {
3831 /// Creates a new default instance.
3832 pub fn new() -> Self {
3833 std::default::Default::default()
3834 }
3835
3836 /// Sets the value of [event_id][crate::model::DataFlowEvent::event_id].
3837 ///
3838 /// # Example
3839 /// ```ignore,no_run
3840 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3841 /// let x = DataFlowEvent::new().set_event_id("example");
3842 /// ```
3843 pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3844 self.event_id = v.into();
3845 self
3846 }
3847
3848 /// Sets the value of [principal_email][crate::model::DataFlowEvent::principal_email].
3849 ///
3850 /// # Example
3851 /// ```ignore,no_run
3852 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3853 /// let x = DataFlowEvent::new().set_principal_email("example");
3854 /// ```
3855 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3856 self.principal_email = v.into();
3857 self
3858 }
3859
3860 /// Sets the value of [operation][crate::model::DataFlowEvent::operation].
3861 ///
3862 /// # Example
3863 /// ```ignore,no_run
3864 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3865 /// use google_cloud_securitycenter_v2::model::data_flow_event::Operation;
3866 /// let x0 = DataFlowEvent::new().set_operation(Operation::Read);
3867 /// let x1 = DataFlowEvent::new().set_operation(Operation::Move);
3868 /// let x2 = DataFlowEvent::new().set_operation(Operation::Copy);
3869 /// ```
3870 pub fn set_operation<T: std::convert::Into<crate::model::data_flow_event::Operation>>(
3871 mut self,
3872 v: T,
3873 ) -> Self {
3874 self.operation = v.into();
3875 self
3876 }
3877
3878 /// Sets the value of [violated_location][crate::model::DataFlowEvent::violated_location].
3879 ///
3880 /// # Example
3881 /// ```ignore,no_run
3882 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3883 /// let x = DataFlowEvent::new().set_violated_location("example");
3884 /// ```
3885 pub fn set_violated_location<T: std::convert::Into<std::string::String>>(
3886 mut self,
3887 v: T,
3888 ) -> Self {
3889 self.violated_location = v.into();
3890 self
3891 }
3892
3893 /// Sets the value of [event_time][crate::model::DataFlowEvent::event_time].
3894 ///
3895 /// # Example
3896 /// ```ignore,no_run
3897 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3898 /// use wkt::Timestamp;
3899 /// let x = DataFlowEvent::new().set_event_time(Timestamp::default()/* use setters */);
3900 /// ```
3901 pub fn set_event_time<T>(mut self, v: T) -> Self
3902 where
3903 T: std::convert::Into<wkt::Timestamp>,
3904 {
3905 self.event_time = std::option::Option::Some(v.into());
3906 self
3907 }
3908
3909 /// Sets or clears the value of [event_time][crate::model::DataFlowEvent::event_time].
3910 ///
3911 /// # Example
3912 /// ```ignore,no_run
3913 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3914 /// use wkt::Timestamp;
3915 /// let x = DataFlowEvent::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
3916 /// let x = DataFlowEvent::new().set_or_clear_event_time(None::<Timestamp>);
3917 /// ```
3918 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
3919 where
3920 T: std::convert::Into<wkt::Timestamp>,
3921 {
3922 self.event_time = v.map(|x| x.into());
3923 self
3924 }
3925}
3926
3927impl wkt::message::Message for DataFlowEvent {
3928 fn typename() -> &'static str {
3929 "type.googleapis.com/google.cloud.securitycenter.v2.DataFlowEvent"
3930 }
3931}
3932
3933/// Defines additional types related to [DataFlowEvent].
3934pub mod data_flow_event {
3935 #[allow(unused_imports)]
3936 use super::*;
3937
3938 /// The operation of a data flow event.
3939 ///
3940 /// # Working with unknown values
3941 ///
3942 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3943 /// additional enum variants at any time. Adding new variants is not considered
3944 /// a breaking change. Applications should write their code in anticipation of:
3945 ///
3946 /// - New values appearing in future releases of the client library, **and**
3947 /// - New values received dynamically, without application changes.
3948 ///
3949 /// Please consult the [Working with enums] section in the user guide for some
3950 /// guidelines.
3951 ///
3952 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3953 #[derive(Clone, Debug, PartialEq)]
3954 #[non_exhaustive]
3955 pub enum Operation {
3956 /// The operation is unspecified.
3957 Unspecified,
3958 /// Represents a read operation.
3959 Read,
3960 /// Represents a move operation.
3961 Move,
3962 /// Represents a copy operation.
3963 Copy,
3964 /// If set, the enum was initialized with an unknown value.
3965 ///
3966 /// Applications can examine the value using [Operation::value] or
3967 /// [Operation::name].
3968 UnknownValue(operation::UnknownValue),
3969 }
3970
3971 #[doc(hidden)]
3972 pub mod operation {
3973 #[allow(unused_imports)]
3974 use super::*;
3975 #[derive(Clone, Debug, PartialEq)]
3976 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3977 }
3978
3979 impl Operation {
3980 /// Gets the enum value.
3981 ///
3982 /// Returns `None` if the enum contains an unknown value deserialized from
3983 /// the string representation of enums.
3984 pub fn value(&self) -> std::option::Option<i32> {
3985 match self {
3986 Self::Unspecified => std::option::Option::Some(0),
3987 Self::Read => std::option::Option::Some(1),
3988 Self::Move => std::option::Option::Some(2),
3989 Self::Copy => std::option::Option::Some(3),
3990 Self::UnknownValue(u) => u.0.value(),
3991 }
3992 }
3993
3994 /// Gets the enum value as a string.
3995 ///
3996 /// Returns `None` if the enum contains an unknown value deserialized from
3997 /// the integer representation of enums.
3998 pub fn name(&self) -> std::option::Option<&str> {
3999 match self {
4000 Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
4001 Self::Read => std::option::Option::Some("READ"),
4002 Self::Move => std::option::Option::Some("MOVE"),
4003 Self::Copy => std::option::Option::Some("COPY"),
4004 Self::UnknownValue(u) => u.0.name(),
4005 }
4006 }
4007 }
4008
4009 impl std::default::Default for Operation {
4010 fn default() -> Self {
4011 use std::convert::From;
4012 Self::from(0)
4013 }
4014 }
4015
4016 impl std::fmt::Display for Operation {
4017 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4018 wkt::internal::display_enum(f, self.name(), self.value())
4019 }
4020 }
4021
4022 impl std::convert::From<i32> for Operation {
4023 fn from(value: i32) -> Self {
4024 match value {
4025 0 => Self::Unspecified,
4026 1 => Self::Read,
4027 2 => Self::Move,
4028 3 => Self::Copy,
4029 _ => Self::UnknownValue(operation::UnknownValue(
4030 wkt::internal::UnknownEnumValue::Integer(value),
4031 )),
4032 }
4033 }
4034 }
4035
4036 impl std::convert::From<&str> for Operation {
4037 fn from(value: &str) -> Self {
4038 use std::string::ToString;
4039 match value {
4040 "OPERATION_UNSPECIFIED" => Self::Unspecified,
4041 "READ" => Self::Read,
4042 "MOVE" => Self::Move,
4043 "COPY" => Self::Copy,
4044 _ => Self::UnknownValue(operation::UnknownValue(
4045 wkt::internal::UnknownEnumValue::String(value.to_string()),
4046 )),
4047 }
4048 }
4049 }
4050
4051 impl serde::ser::Serialize for Operation {
4052 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4053 where
4054 S: serde::Serializer,
4055 {
4056 match self {
4057 Self::Unspecified => serializer.serialize_i32(0),
4058 Self::Read => serializer.serialize_i32(1),
4059 Self::Move => serializer.serialize_i32(2),
4060 Self::Copy => serializer.serialize_i32(3),
4061 Self::UnknownValue(u) => u.0.serialize(serializer),
4062 }
4063 }
4064 }
4065
4066 impl<'de> serde::de::Deserialize<'de> for Operation {
4067 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4068 where
4069 D: serde::Deserializer<'de>,
4070 {
4071 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
4072 ".google.cloud.securitycenter.v2.DataFlowEvent.Operation",
4073 ))
4074 }
4075 }
4076}
4077
4078/// Details about data retention deletion violations, in which the data is
4079/// non-compliant based on their retention or deletion time, as defined in the
4080/// applicable data security policy. The Data Retention Deletion (DRD) control is
4081/// a control of the DSPM (Data Security Posture Management) suite that enables
4082/// organizations to manage data retention and deletion policies in compliance
4083/// with regulations, such as GDPR and CRPA. DRD supports two primary policy
4084/// types: maximum storage length (max TTL) and minimum storage length (min TTL).
4085/// Both are aimed at helping organizations meet regulatory and data management
4086/// commitments.
4087#[derive(Clone, Default, PartialEq)]
4088#[non_exhaustive]
4089pub struct DataRetentionDeletionEvent {
4090 /// Timestamp indicating when the event was detected.
4091 pub event_detection_time: std::option::Option<wkt::Timestamp>,
4092
4093 /// Number of objects that violated the policy for this resource. If the number
4094 /// is less than 1,000, then the value of this field is the exact number. If
4095 /// the number of objects that violated the policy is greater than or equal to
4096 /// 1,000, then the value of this field is 1000.
4097 pub data_object_count: i64,
4098
4099 /// Maximum duration of retention allowed from the DRD control. This comes
4100 /// from the DRD control where users set a max TTL for their data. For example,
4101 /// suppose that a user sets the max TTL for a Cloud Storage bucket to 90 days.
4102 /// However, an object in that bucket is 100 days old. In this case, a
4103 /// DataRetentionDeletionEvent will be generated for that Cloud Storage bucket,
4104 /// and the max_retention_allowed is 90 days.
4105 pub max_retention_allowed: std::option::Option<wkt::Duration>,
4106
4107 /// Type of the DRD event.
4108 pub event_type: crate::model::data_retention_deletion_event::EventType,
4109
4110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4111}
4112
4113impl DataRetentionDeletionEvent {
4114 /// Creates a new default instance.
4115 pub fn new() -> Self {
4116 std::default::Default::default()
4117 }
4118
4119 /// Sets the value of [event_detection_time][crate::model::DataRetentionDeletionEvent::event_detection_time].
4120 ///
4121 /// # Example
4122 /// ```ignore,no_run
4123 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4124 /// use wkt::Timestamp;
4125 /// let x = DataRetentionDeletionEvent::new().set_event_detection_time(Timestamp::default()/* use setters */);
4126 /// ```
4127 pub fn set_event_detection_time<T>(mut self, v: T) -> Self
4128 where
4129 T: std::convert::Into<wkt::Timestamp>,
4130 {
4131 self.event_detection_time = std::option::Option::Some(v.into());
4132 self
4133 }
4134
4135 /// Sets or clears the value of [event_detection_time][crate::model::DataRetentionDeletionEvent::event_detection_time].
4136 ///
4137 /// # Example
4138 /// ```ignore,no_run
4139 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4140 /// use wkt::Timestamp;
4141 /// let x = DataRetentionDeletionEvent::new().set_or_clear_event_detection_time(Some(Timestamp::default()/* use setters */));
4142 /// let x = DataRetentionDeletionEvent::new().set_or_clear_event_detection_time(None::<Timestamp>);
4143 /// ```
4144 pub fn set_or_clear_event_detection_time<T>(mut self, v: std::option::Option<T>) -> Self
4145 where
4146 T: std::convert::Into<wkt::Timestamp>,
4147 {
4148 self.event_detection_time = v.map(|x| x.into());
4149 self
4150 }
4151
4152 /// Sets the value of [data_object_count][crate::model::DataRetentionDeletionEvent::data_object_count].
4153 ///
4154 /// # Example
4155 /// ```ignore,no_run
4156 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4157 /// let x = DataRetentionDeletionEvent::new().set_data_object_count(42);
4158 /// ```
4159 pub fn set_data_object_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4160 self.data_object_count = v.into();
4161 self
4162 }
4163
4164 /// Sets the value of [max_retention_allowed][crate::model::DataRetentionDeletionEvent::max_retention_allowed].
4165 ///
4166 /// # Example
4167 /// ```ignore,no_run
4168 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4169 /// use wkt::Duration;
4170 /// let x = DataRetentionDeletionEvent::new().set_max_retention_allowed(Duration::default()/* use setters */);
4171 /// ```
4172 pub fn set_max_retention_allowed<T>(mut self, v: T) -> Self
4173 where
4174 T: std::convert::Into<wkt::Duration>,
4175 {
4176 self.max_retention_allowed = std::option::Option::Some(v.into());
4177 self
4178 }
4179
4180 /// Sets or clears the value of [max_retention_allowed][crate::model::DataRetentionDeletionEvent::max_retention_allowed].
4181 ///
4182 /// # Example
4183 /// ```ignore,no_run
4184 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4185 /// use wkt::Duration;
4186 /// let x = DataRetentionDeletionEvent::new().set_or_clear_max_retention_allowed(Some(Duration::default()/* use setters */));
4187 /// let x = DataRetentionDeletionEvent::new().set_or_clear_max_retention_allowed(None::<Duration>);
4188 /// ```
4189 pub fn set_or_clear_max_retention_allowed<T>(mut self, v: std::option::Option<T>) -> Self
4190 where
4191 T: std::convert::Into<wkt::Duration>,
4192 {
4193 self.max_retention_allowed = v.map(|x| x.into());
4194 self
4195 }
4196
4197 /// Sets the value of [event_type][crate::model::DataRetentionDeletionEvent::event_type].
4198 ///
4199 /// # Example
4200 /// ```ignore,no_run
4201 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4202 /// use google_cloud_securitycenter_v2::model::data_retention_deletion_event::EventType;
4203 /// let x0 = DataRetentionDeletionEvent::new().set_event_type(EventType::MaxTtlExceeded);
4204 /// ```
4205 pub fn set_event_type<
4206 T: std::convert::Into<crate::model::data_retention_deletion_event::EventType>,
4207 >(
4208 mut self,
4209 v: T,
4210 ) -> Self {
4211 self.event_type = v.into();
4212 self
4213 }
4214}
4215
4216impl wkt::message::Message for DataRetentionDeletionEvent {
4217 fn typename() -> &'static str {
4218 "type.googleapis.com/google.cloud.securitycenter.v2.DataRetentionDeletionEvent"
4219 }
4220}
4221
4222/// Defines additional types related to [DataRetentionDeletionEvent].
4223pub mod data_retention_deletion_event {
4224 #[allow(unused_imports)]
4225 use super::*;
4226
4227 /// Type of the DRD event.
4228 ///
4229 /// # Working with unknown values
4230 ///
4231 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4232 /// additional enum variants at any time. Adding new variants is not considered
4233 /// a breaking change. Applications should write their code in anticipation of:
4234 ///
4235 /// - New values appearing in future releases of the client library, **and**
4236 /// - New values received dynamically, without application changes.
4237 ///
4238 /// Please consult the [Working with enums] section in the user guide for some
4239 /// guidelines.
4240 ///
4241 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4242 #[derive(Clone, Debug, PartialEq)]
4243 #[non_exhaustive]
4244 pub enum EventType {
4245 /// Unspecified event type.
4246 Unspecified,
4247 /// The maximum retention time has been exceeded.
4248 MaxTtlExceeded,
4249 /// If set, the enum was initialized with an unknown value.
4250 ///
4251 /// Applications can examine the value using [EventType::value] or
4252 /// [EventType::name].
4253 UnknownValue(event_type::UnknownValue),
4254 }
4255
4256 #[doc(hidden)]
4257 pub mod event_type {
4258 #[allow(unused_imports)]
4259 use super::*;
4260 #[derive(Clone, Debug, PartialEq)]
4261 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4262 }
4263
4264 impl EventType {
4265 /// Gets the enum value.
4266 ///
4267 /// Returns `None` if the enum contains an unknown value deserialized from
4268 /// the string representation of enums.
4269 pub fn value(&self) -> std::option::Option<i32> {
4270 match self {
4271 Self::Unspecified => std::option::Option::Some(0),
4272 Self::MaxTtlExceeded => std::option::Option::Some(1),
4273 Self::UnknownValue(u) => u.0.value(),
4274 }
4275 }
4276
4277 /// Gets the enum value as a string.
4278 ///
4279 /// Returns `None` if the enum contains an unknown value deserialized from
4280 /// the integer representation of enums.
4281 pub fn name(&self) -> std::option::Option<&str> {
4282 match self {
4283 Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
4284 Self::MaxTtlExceeded => std::option::Option::Some("EVENT_TYPE_MAX_TTL_EXCEEDED"),
4285 Self::UnknownValue(u) => u.0.name(),
4286 }
4287 }
4288 }
4289
4290 impl std::default::Default for EventType {
4291 fn default() -> Self {
4292 use std::convert::From;
4293 Self::from(0)
4294 }
4295 }
4296
4297 impl std::fmt::Display for EventType {
4298 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4299 wkt::internal::display_enum(f, self.name(), self.value())
4300 }
4301 }
4302
4303 impl std::convert::From<i32> for EventType {
4304 fn from(value: i32) -> Self {
4305 match value {
4306 0 => Self::Unspecified,
4307 1 => Self::MaxTtlExceeded,
4308 _ => Self::UnknownValue(event_type::UnknownValue(
4309 wkt::internal::UnknownEnumValue::Integer(value),
4310 )),
4311 }
4312 }
4313 }
4314
4315 impl std::convert::From<&str> for EventType {
4316 fn from(value: &str) -> Self {
4317 use std::string::ToString;
4318 match value {
4319 "EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
4320 "EVENT_TYPE_MAX_TTL_EXCEEDED" => Self::MaxTtlExceeded,
4321 _ => Self::UnknownValue(event_type::UnknownValue(
4322 wkt::internal::UnknownEnumValue::String(value.to_string()),
4323 )),
4324 }
4325 }
4326 }
4327
4328 impl serde::ser::Serialize for EventType {
4329 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4330 where
4331 S: serde::Serializer,
4332 {
4333 match self {
4334 Self::Unspecified => serializer.serialize_i32(0),
4335 Self::MaxTtlExceeded => serializer.serialize_i32(1),
4336 Self::UnknownValue(u) => u.0.serialize(serializer),
4337 }
4338 }
4339 }
4340
4341 impl<'de> serde::de::Deserialize<'de> for EventType {
4342 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4343 where
4344 D: serde::Deserializer<'de>,
4345 {
4346 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
4347 ".google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType",
4348 ))
4349 }
4350 }
4351}
4352
4353/// Represents database access information, such as queries. A database may be a
4354/// sub-resource of an instance (as in the case of Cloud SQL instances or Cloud
4355/// Spanner instances), or the database instance itself. Some database resources
4356/// might not have the [full resource
4357/// name](https://google.aip.dev/122#full-resource-names) populated because these
4358/// resource types, such as Cloud SQL databases, are not yet supported by Cloud
4359/// Asset Inventory. In these cases only the display name is provided.
4360#[derive(Clone, Default, PartialEq)]
4361#[non_exhaustive]
4362pub struct Database {
4363 /// Some database resources may not have the [full resource
4364 /// name](https://google.aip.dev/122#full-resource-names) populated because
4365 /// these resource types are not yet supported by Cloud Asset Inventory (e.g.
4366 /// Cloud SQL databases). In these cases only the display name will be
4367 /// provided.
4368 /// The [full resource name](https://google.aip.dev/122#full-resource-names) of
4369 /// the database that the user connected to, if it is supported by Cloud Asset
4370 /// Inventory.
4371 pub name: std::string::String,
4372
4373 /// The human-readable name of the database that the user connected to.
4374 pub display_name: std::string::String,
4375
4376 /// The username used to connect to the database. The username might not be an
4377 /// IAM principal and does not have a set format.
4378 pub user_name: std::string::String,
4379
4380 /// The SQL statement that is associated with the database access.
4381 pub query: std::string::String,
4382
4383 /// The target usernames, roles, or groups of an SQL privilege grant, which is
4384 /// not an IAM policy change.
4385 pub grantees: std::vec::Vec<std::string::String>,
4386
4387 /// The version of the database, for example, POSTGRES_14.
4388 /// See [the complete
4389 /// list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
4390 pub version: std::string::String,
4391
4392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4393}
4394
4395impl Database {
4396 /// Creates a new default instance.
4397 pub fn new() -> Self {
4398 std::default::Default::default()
4399 }
4400
4401 /// Sets the value of [name][crate::model::Database::name].
4402 ///
4403 /// # Example
4404 /// ```ignore,no_run
4405 /// # use google_cloud_securitycenter_v2::model::Database;
4406 /// let x = Database::new().set_name("example");
4407 /// ```
4408 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4409 self.name = v.into();
4410 self
4411 }
4412
4413 /// Sets the value of [display_name][crate::model::Database::display_name].
4414 ///
4415 /// # Example
4416 /// ```ignore,no_run
4417 /// # use google_cloud_securitycenter_v2::model::Database;
4418 /// let x = Database::new().set_display_name("example");
4419 /// ```
4420 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4421 self.display_name = v.into();
4422 self
4423 }
4424
4425 /// Sets the value of [user_name][crate::model::Database::user_name].
4426 ///
4427 /// # Example
4428 /// ```ignore,no_run
4429 /// # use google_cloud_securitycenter_v2::model::Database;
4430 /// let x = Database::new().set_user_name("example");
4431 /// ```
4432 pub fn set_user_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4433 self.user_name = v.into();
4434 self
4435 }
4436
4437 /// Sets the value of [query][crate::model::Database::query].
4438 ///
4439 /// # Example
4440 /// ```ignore,no_run
4441 /// # use google_cloud_securitycenter_v2::model::Database;
4442 /// let x = Database::new().set_query("example");
4443 /// ```
4444 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4445 self.query = v.into();
4446 self
4447 }
4448
4449 /// Sets the value of [grantees][crate::model::Database::grantees].
4450 ///
4451 /// # Example
4452 /// ```ignore,no_run
4453 /// # use google_cloud_securitycenter_v2::model::Database;
4454 /// let x = Database::new().set_grantees(["a", "b", "c"]);
4455 /// ```
4456 pub fn set_grantees<T, V>(mut self, v: T) -> Self
4457 where
4458 T: std::iter::IntoIterator<Item = V>,
4459 V: std::convert::Into<std::string::String>,
4460 {
4461 use std::iter::Iterator;
4462 self.grantees = v.into_iter().map(|i| i.into()).collect();
4463 self
4464 }
4465
4466 /// Sets the value of [version][crate::model::Database::version].
4467 ///
4468 /// # Example
4469 /// ```ignore,no_run
4470 /// # use google_cloud_securitycenter_v2::model::Database;
4471 /// let x = Database::new().set_version("example");
4472 /// ```
4473 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4474 self.version = v.into();
4475 self
4476 }
4477}
4478
4479impl wkt::message::Message for Database {
4480 fn typename() -> &'static str {
4481 "type.googleapis.com/google.cloud.securitycenter.v2.Database"
4482 }
4483}
4484
4485/// Contains information about the disk associated with the finding.
4486#[derive(Clone, Default, PartialEq)]
4487#[non_exhaustive]
4488pub struct Disk {
4489 /// The name of the disk, for example,
4490 /// `https://www.googleapis.com/compute/v1/projects/{project-id}/zones/{zone-id}/disks/{disk-id}`.
4491 pub name: std::string::String,
4492
4493 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4494}
4495
4496impl Disk {
4497 /// Creates a new default instance.
4498 pub fn new() -> Self {
4499 std::default::Default::default()
4500 }
4501
4502 /// Sets the value of [name][crate::model::Disk::name].
4503 ///
4504 /// # Example
4505 /// ```ignore,no_run
4506 /// # use google_cloud_securitycenter_v2::model::Disk;
4507 /// let x = Disk::new().set_name("example");
4508 /// ```
4509 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4510 self.name = v.into();
4511 self
4512 }
4513}
4514
4515impl wkt::message::Message for Disk {
4516 fn typename() -> &'static str {
4517 "type.googleapis.com/google.cloud.securitycenter.v2.Disk"
4518 }
4519}
4520
4521/// Exfiltration represents a data exfiltration attempt from one or more sources
4522/// to one or more targets. The `sources` attribute lists the sources of the
4523/// exfiltrated data. The `targets` attribute lists the destinations the data was
4524/// copied to.
4525#[derive(Clone, Default, PartialEq)]
4526#[non_exhaustive]
4527pub struct Exfiltration {
4528 /// If there are multiple sources, then the data is considered "joined" between
4529 /// them. For instance, BigQuery can join multiple tables, and each
4530 /// table would be considered a source.
4531 pub sources: std::vec::Vec<crate::model::ExfilResource>,
4532
4533 /// If there are multiple targets, each target would get a complete copy of the
4534 /// "joined" source data.
4535 pub targets: std::vec::Vec<crate::model::ExfilResource>,
4536
4537 /// Total exfiltrated bytes processed for the entire job.
4538 pub total_exfiltrated_bytes: i64,
4539
4540 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4541}
4542
4543impl Exfiltration {
4544 /// Creates a new default instance.
4545 pub fn new() -> Self {
4546 std::default::Default::default()
4547 }
4548
4549 /// Sets the value of [sources][crate::model::Exfiltration::sources].
4550 ///
4551 /// # Example
4552 /// ```ignore,no_run
4553 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4554 /// use google_cloud_securitycenter_v2::model::ExfilResource;
4555 /// let x = Exfiltration::new()
4556 /// .set_sources([
4557 /// ExfilResource::default()/* use setters */,
4558 /// ExfilResource::default()/* use (different) setters */,
4559 /// ]);
4560 /// ```
4561 pub fn set_sources<T, V>(mut self, v: T) -> Self
4562 where
4563 T: std::iter::IntoIterator<Item = V>,
4564 V: std::convert::Into<crate::model::ExfilResource>,
4565 {
4566 use std::iter::Iterator;
4567 self.sources = v.into_iter().map(|i| i.into()).collect();
4568 self
4569 }
4570
4571 /// Sets the value of [targets][crate::model::Exfiltration::targets].
4572 ///
4573 /// # Example
4574 /// ```ignore,no_run
4575 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4576 /// use google_cloud_securitycenter_v2::model::ExfilResource;
4577 /// let x = Exfiltration::new()
4578 /// .set_targets([
4579 /// ExfilResource::default()/* use setters */,
4580 /// ExfilResource::default()/* use (different) setters */,
4581 /// ]);
4582 /// ```
4583 pub fn set_targets<T, V>(mut self, v: T) -> Self
4584 where
4585 T: std::iter::IntoIterator<Item = V>,
4586 V: std::convert::Into<crate::model::ExfilResource>,
4587 {
4588 use std::iter::Iterator;
4589 self.targets = v.into_iter().map(|i| i.into()).collect();
4590 self
4591 }
4592
4593 /// Sets the value of [total_exfiltrated_bytes][crate::model::Exfiltration::total_exfiltrated_bytes].
4594 ///
4595 /// # Example
4596 /// ```ignore,no_run
4597 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4598 /// let x = Exfiltration::new().set_total_exfiltrated_bytes(42);
4599 /// ```
4600 pub fn set_total_exfiltrated_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4601 self.total_exfiltrated_bytes = v.into();
4602 self
4603 }
4604}
4605
4606impl wkt::message::Message for Exfiltration {
4607 fn typename() -> &'static str {
4608 "type.googleapis.com/google.cloud.securitycenter.v2.Exfiltration"
4609 }
4610}
4611
4612/// Resource where data was exfiltrated from or exfiltrated to.
4613#[derive(Clone, Default, PartialEq)]
4614#[non_exhaustive]
4615pub struct ExfilResource {
4616 /// The resource's [full resource
4617 /// name](https://cloud.google.com/apis/design/resource_names#full_resource_name).
4618 pub name: std::string::String,
4619
4620 /// Subcomponents of the asset that was exfiltrated, like URIs used during
4621 /// exfiltration, table names, databases, and filenames. For example, multiple
4622 /// tables might have been exfiltrated from the same Cloud SQL instance, or
4623 /// multiple files might have been exfiltrated from the same Cloud Storage
4624 /// bucket.
4625 pub components: std::vec::Vec<std::string::String>,
4626
4627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4628}
4629
4630impl ExfilResource {
4631 /// Creates a new default instance.
4632 pub fn new() -> Self {
4633 std::default::Default::default()
4634 }
4635
4636 /// Sets the value of [name][crate::model::ExfilResource::name].
4637 ///
4638 /// # Example
4639 /// ```ignore,no_run
4640 /// # use google_cloud_securitycenter_v2::model::ExfilResource;
4641 /// let x = ExfilResource::new().set_name("example");
4642 /// ```
4643 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4644 self.name = v.into();
4645 self
4646 }
4647
4648 /// Sets the value of [components][crate::model::ExfilResource::components].
4649 ///
4650 /// # Example
4651 /// ```ignore,no_run
4652 /// # use google_cloud_securitycenter_v2::model::ExfilResource;
4653 /// let x = ExfilResource::new().set_components(["a", "b", "c"]);
4654 /// ```
4655 pub fn set_components<T, V>(mut self, v: T) -> Self
4656 where
4657 T: std::iter::IntoIterator<Item = V>,
4658 V: std::convert::Into<std::string::String>,
4659 {
4660 use std::iter::Iterator;
4661 self.components = v.into_iter().map(|i| i.into()).collect();
4662 self
4663 }
4664}
4665
4666impl wkt::message::Message for ExfilResource {
4667 fn typename() -> &'static str {
4668 "type.googleapis.com/google.cloud.securitycenter.v2.ExfilResource"
4669 }
4670}
4671
4672/// Representation of third party SIEM/SOAR fields within SCC.
4673#[derive(Clone, Default, PartialEq)]
4674#[non_exhaustive]
4675pub struct ExternalSystem {
4676 /// Full resource name of the external system. The following list
4677 /// shows some examples:
4678 ///
4679 /// + `organizations/1234/sources/5678/findings/123456/externalSystems/jira`
4680 ///
4681 /// `organizations/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4682 ///
4683 /// + `folders/1234/sources/5678/findings/123456/externalSystems/jira`
4684 ///
4685 /// `folders/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4686 ///
4687 /// + `projects/1234/sources/5678/findings/123456/externalSystems/jira`
4688 ///
4689 /// `projects/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4690 pub name: std::string::String,
4691
4692 /// References primary/secondary etc assignees in the external system.
4693 pub assignees: std::vec::Vec<std::string::String>,
4694
4695 /// The identifier that's used to track the finding's corresponding case in the
4696 /// external system.
4697 pub external_uid: std::string::String,
4698
4699 /// The most recent status of the finding's corresponding case, as reported by
4700 /// the external system.
4701 pub status: std::string::String,
4702
4703 /// The time when the case was last updated, as reported by the external
4704 /// system.
4705 pub external_system_update_time: std::option::Option<wkt::Timestamp>,
4706
4707 /// The link to the finding's corresponding case in the external system.
4708 pub case_uri: std::string::String,
4709
4710 /// The priority of the finding's corresponding case in the external system.
4711 pub case_priority: std::string::String,
4712
4713 /// The SLA of the finding's corresponding case in the external system.
4714 pub case_sla: std::option::Option<wkt::Timestamp>,
4715
4716 /// The time when the case was created, as reported by the external system.
4717 pub case_create_time: std::option::Option<wkt::Timestamp>,
4718
4719 /// The time when the case was closed, as reported by the external system.
4720 pub case_close_time: std::option::Option<wkt::Timestamp>,
4721
4722 /// Information about the ticket, if any, that is being used to track the
4723 /// resolution of the issue that is identified by this finding.
4724 pub ticket_info: std::option::Option<crate::model::external_system::TicketInfo>,
4725
4726 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4727}
4728
4729impl ExternalSystem {
4730 /// Creates a new default instance.
4731 pub fn new() -> Self {
4732 std::default::Default::default()
4733 }
4734
4735 /// Sets the value of [name][crate::model::ExternalSystem::name].
4736 ///
4737 /// # Example
4738 /// ```ignore,no_run
4739 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4740 /// # let organization_id = "organization_id";
4741 /// # let source_id = "source_id";
4742 /// # let finding_id = "finding_id";
4743 /// # let externalsystem_id = "externalsystem_id";
4744 /// let x = ExternalSystem::new().set_name(format!("organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/externalSystems/{externalsystem_id}"));
4745 /// ```
4746 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4747 self.name = v.into();
4748 self
4749 }
4750
4751 /// Sets the value of [assignees][crate::model::ExternalSystem::assignees].
4752 ///
4753 /// # Example
4754 /// ```ignore,no_run
4755 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4756 /// let x = ExternalSystem::new().set_assignees(["a", "b", "c"]);
4757 /// ```
4758 pub fn set_assignees<T, V>(mut self, v: T) -> Self
4759 where
4760 T: std::iter::IntoIterator<Item = V>,
4761 V: std::convert::Into<std::string::String>,
4762 {
4763 use std::iter::Iterator;
4764 self.assignees = v.into_iter().map(|i| i.into()).collect();
4765 self
4766 }
4767
4768 /// Sets the value of [external_uid][crate::model::ExternalSystem::external_uid].
4769 ///
4770 /// # Example
4771 /// ```ignore,no_run
4772 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4773 /// let x = ExternalSystem::new().set_external_uid("example");
4774 /// ```
4775 pub fn set_external_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4776 self.external_uid = v.into();
4777 self
4778 }
4779
4780 /// Sets the value of [status][crate::model::ExternalSystem::status].
4781 ///
4782 /// # Example
4783 /// ```ignore,no_run
4784 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4785 /// let x = ExternalSystem::new().set_status("example");
4786 /// ```
4787 pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4788 self.status = v.into();
4789 self
4790 }
4791
4792 /// Sets the value of [external_system_update_time][crate::model::ExternalSystem::external_system_update_time].
4793 ///
4794 /// # Example
4795 /// ```ignore,no_run
4796 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4797 /// use wkt::Timestamp;
4798 /// let x = ExternalSystem::new().set_external_system_update_time(Timestamp::default()/* use setters */);
4799 /// ```
4800 pub fn set_external_system_update_time<T>(mut self, v: T) -> Self
4801 where
4802 T: std::convert::Into<wkt::Timestamp>,
4803 {
4804 self.external_system_update_time = std::option::Option::Some(v.into());
4805 self
4806 }
4807
4808 /// Sets or clears the value of [external_system_update_time][crate::model::ExternalSystem::external_system_update_time].
4809 ///
4810 /// # Example
4811 /// ```ignore,no_run
4812 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4813 /// use wkt::Timestamp;
4814 /// let x = ExternalSystem::new().set_or_clear_external_system_update_time(Some(Timestamp::default()/* use setters */));
4815 /// let x = ExternalSystem::new().set_or_clear_external_system_update_time(None::<Timestamp>);
4816 /// ```
4817 pub fn set_or_clear_external_system_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4818 where
4819 T: std::convert::Into<wkt::Timestamp>,
4820 {
4821 self.external_system_update_time = v.map(|x| x.into());
4822 self
4823 }
4824
4825 /// Sets the value of [case_uri][crate::model::ExternalSystem::case_uri].
4826 ///
4827 /// # Example
4828 /// ```ignore,no_run
4829 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4830 /// let x = ExternalSystem::new().set_case_uri("example");
4831 /// ```
4832 pub fn set_case_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4833 self.case_uri = v.into();
4834 self
4835 }
4836
4837 /// Sets the value of [case_priority][crate::model::ExternalSystem::case_priority].
4838 ///
4839 /// # Example
4840 /// ```ignore,no_run
4841 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4842 /// let x = ExternalSystem::new().set_case_priority("example");
4843 /// ```
4844 pub fn set_case_priority<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4845 self.case_priority = v.into();
4846 self
4847 }
4848
4849 /// Sets the value of [case_sla][crate::model::ExternalSystem::case_sla].
4850 ///
4851 /// # Example
4852 /// ```ignore,no_run
4853 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4854 /// use wkt::Timestamp;
4855 /// let x = ExternalSystem::new().set_case_sla(Timestamp::default()/* use setters */);
4856 /// ```
4857 pub fn set_case_sla<T>(mut self, v: T) -> Self
4858 where
4859 T: std::convert::Into<wkt::Timestamp>,
4860 {
4861 self.case_sla = std::option::Option::Some(v.into());
4862 self
4863 }
4864
4865 /// Sets or clears the value of [case_sla][crate::model::ExternalSystem::case_sla].
4866 ///
4867 /// # Example
4868 /// ```ignore,no_run
4869 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4870 /// use wkt::Timestamp;
4871 /// let x = ExternalSystem::new().set_or_clear_case_sla(Some(Timestamp::default()/* use setters */));
4872 /// let x = ExternalSystem::new().set_or_clear_case_sla(None::<Timestamp>);
4873 /// ```
4874 pub fn set_or_clear_case_sla<T>(mut self, v: std::option::Option<T>) -> Self
4875 where
4876 T: std::convert::Into<wkt::Timestamp>,
4877 {
4878 self.case_sla = v.map(|x| x.into());
4879 self
4880 }
4881
4882 /// Sets the value of [case_create_time][crate::model::ExternalSystem::case_create_time].
4883 ///
4884 /// # Example
4885 /// ```ignore,no_run
4886 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4887 /// use wkt::Timestamp;
4888 /// let x = ExternalSystem::new().set_case_create_time(Timestamp::default()/* use setters */);
4889 /// ```
4890 pub fn set_case_create_time<T>(mut self, v: T) -> Self
4891 where
4892 T: std::convert::Into<wkt::Timestamp>,
4893 {
4894 self.case_create_time = std::option::Option::Some(v.into());
4895 self
4896 }
4897
4898 /// Sets or clears the value of [case_create_time][crate::model::ExternalSystem::case_create_time].
4899 ///
4900 /// # Example
4901 /// ```ignore,no_run
4902 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4903 /// use wkt::Timestamp;
4904 /// let x = ExternalSystem::new().set_or_clear_case_create_time(Some(Timestamp::default()/* use setters */));
4905 /// let x = ExternalSystem::new().set_or_clear_case_create_time(None::<Timestamp>);
4906 /// ```
4907 pub fn set_or_clear_case_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4908 where
4909 T: std::convert::Into<wkt::Timestamp>,
4910 {
4911 self.case_create_time = v.map(|x| x.into());
4912 self
4913 }
4914
4915 /// Sets the value of [case_close_time][crate::model::ExternalSystem::case_close_time].
4916 ///
4917 /// # Example
4918 /// ```ignore,no_run
4919 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4920 /// use wkt::Timestamp;
4921 /// let x = ExternalSystem::new().set_case_close_time(Timestamp::default()/* use setters */);
4922 /// ```
4923 pub fn set_case_close_time<T>(mut self, v: T) -> Self
4924 where
4925 T: std::convert::Into<wkt::Timestamp>,
4926 {
4927 self.case_close_time = std::option::Option::Some(v.into());
4928 self
4929 }
4930
4931 /// Sets or clears the value of [case_close_time][crate::model::ExternalSystem::case_close_time].
4932 ///
4933 /// # Example
4934 /// ```ignore,no_run
4935 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4936 /// use wkt::Timestamp;
4937 /// let x = ExternalSystem::new().set_or_clear_case_close_time(Some(Timestamp::default()/* use setters */));
4938 /// let x = ExternalSystem::new().set_or_clear_case_close_time(None::<Timestamp>);
4939 /// ```
4940 pub fn set_or_clear_case_close_time<T>(mut self, v: std::option::Option<T>) -> Self
4941 where
4942 T: std::convert::Into<wkt::Timestamp>,
4943 {
4944 self.case_close_time = v.map(|x| x.into());
4945 self
4946 }
4947
4948 /// Sets the value of [ticket_info][crate::model::ExternalSystem::ticket_info].
4949 ///
4950 /// # Example
4951 /// ```ignore,no_run
4952 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4953 /// use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4954 /// let x = ExternalSystem::new().set_ticket_info(TicketInfo::default()/* use setters */);
4955 /// ```
4956 pub fn set_ticket_info<T>(mut self, v: T) -> Self
4957 where
4958 T: std::convert::Into<crate::model::external_system::TicketInfo>,
4959 {
4960 self.ticket_info = std::option::Option::Some(v.into());
4961 self
4962 }
4963
4964 /// Sets or clears the value of [ticket_info][crate::model::ExternalSystem::ticket_info].
4965 ///
4966 /// # Example
4967 /// ```ignore,no_run
4968 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4969 /// use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4970 /// let x = ExternalSystem::new().set_or_clear_ticket_info(Some(TicketInfo::default()/* use setters */));
4971 /// let x = ExternalSystem::new().set_or_clear_ticket_info(None::<TicketInfo>);
4972 /// ```
4973 pub fn set_or_clear_ticket_info<T>(mut self, v: std::option::Option<T>) -> Self
4974 where
4975 T: std::convert::Into<crate::model::external_system::TicketInfo>,
4976 {
4977 self.ticket_info = v.map(|x| x.into());
4978 self
4979 }
4980}
4981
4982impl wkt::message::Message for ExternalSystem {
4983 fn typename() -> &'static str {
4984 "type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem"
4985 }
4986}
4987
4988/// Defines additional types related to [ExternalSystem].
4989pub mod external_system {
4990 #[allow(unused_imports)]
4991 use super::*;
4992
4993 /// Information about the ticket, if any, that is being used to track the
4994 /// resolution of the issue that is identified by this finding.
4995 #[derive(Clone, Default, PartialEq)]
4996 #[non_exhaustive]
4997 pub struct TicketInfo {
4998 /// The identifier of the ticket in the ticket system.
4999 pub id: std::string::String,
5000
5001 /// The assignee of the ticket in the ticket system.
5002 pub assignee: std::string::String,
5003
5004 /// The description of the ticket in the ticket system.
5005 pub description: std::string::String,
5006
5007 /// The link to the ticket in the ticket system.
5008 pub uri: std::string::String,
5009
5010 /// The latest status of the ticket, as reported by the ticket system.
5011 pub status: std::string::String,
5012
5013 /// The time when the ticket was last updated, as reported by the ticket
5014 /// system.
5015 pub update_time: std::option::Option<wkt::Timestamp>,
5016
5017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5018 }
5019
5020 impl TicketInfo {
5021 /// Creates a new default instance.
5022 pub fn new() -> Self {
5023 std::default::Default::default()
5024 }
5025
5026 /// Sets the value of [id][crate::model::external_system::TicketInfo::id].
5027 ///
5028 /// # Example
5029 /// ```ignore,no_run
5030 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5031 /// let x = TicketInfo::new().set_id("example");
5032 /// ```
5033 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5034 self.id = v.into();
5035 self
5036 }
5037
5038 /// Sets the value of [assignee][crate::model::external_system::TicketInfo::assignee].
5039 ///
5040 /// # Example
5041 /// ```ignore,no_run
5042 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5043 /// let x = TicketInfo::new().set_assignee("example");
5044 /// ```
5045 pub fn set_assignee<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5046 self.assignee = v.into();
5047 self
5048 }
5049
5050 /// Sets the value of [description][crate::model::external_system::TicketInfo::description].
5051 ///
5052 /// # Example
5053 /// ```ignore,no_run
5054 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5055 /// let x = TicketInfo::new().set_description("example");
5056 /// ```
5057 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5058 self.description = v.into();
5059 self
5060 }
5061
5062 /// Sets the value of [uri][crate::model::external_system::TicketInfo::uri].
5063 ///
5064 /// # Example
5065 /// ```ignore,no_run
5066 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5067 /// let x = TicketInfo::new().set_uri("example");
5068 /// ```
5069 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5070 self.uri = v.into();
5071 self
5072 }
5073
5074 /// Sets the value of [status][crate::model::external_system::TicketInfo::status].
5075 ///
5076 /// # Example
5077 /// ```ignore,no_run
5078 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5079 /// let x = TicketInfo::new().set_status("example");
5080 /// ```
5081 pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5082 self.status = v.into();
5083 self
5084 }
5085
5086 /// Sets the value of [update_time][crate::model::external_system::TicketInfo::update_time].
5087 ///
5088 /// # Example
5089 /// ```ignore,no_run
5090 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5091 /// use wkt::Timestamp;
5092 /// let x = TicketInfo::new().set_update_time(Timestamp::default()/* use setters */);
5093 /// ```
5094 pub fn set_update_time<T>(mut self, v: T) -> Self
5095 where
5096 T: std::convert::Into<wkt::Timestamp>,
5097 {
5098 self.update_time = std::option::Option::Some(v.into());
5099 self
5100 }
5101
5102 /// Sets or clears the value of [update_time][crate::model::external_system::TicketInfo::update_time].
5103 ///
5104 /// # Example
5105 /// ```ignore,no_run
5106 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5107 /// use wkt::Timestamp;
5108 /// let x = TicketInfo::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5109 /// let x = TicketInfo::new().set_or_clear_update_time(None::<Timestamp>);
5110 /// ```
5111 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5112 where
5113 T: std::convert::Into<wkt::Timestamp>,
5114 {
5115 self.update_time = v.map(|x| x.into());
5116 self
5117 }
5118 }
5119
5120 impl wkt::message::Message for TicketInfo {
5121 fn typename() -> &'static str {
5122 "type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem.TicketInfo"
5123 }
5124 }
5125}
5126
5127/// File information about the related binary/library used by an executable, or
5128/// the script used by a script interpreter
5129#[derive(Clone, Default, PartialEq)]
5130#[non_exhaustive]
5131pub struct File {
5132 /// Absolute path of the file as a JSON encoded string.
5133 pub path: std::string::String,
5134
5135 /// Size of the file in bytes.
5136 pub size: i64,
5137
5138 /// SHA256 hash of the first hashed_size bytes of the file encoded as a
5139 /// hex string. If hashed_size == size, sha256 represents the SHA256 hash
5140 /// of the entire file.
5141 pub sha256: std::string::String,
5142
5143 /// The length in bytes of the file prefix that was hashed. If
5144 /// hashed_size == size, any hashes reported represent the entire
5145 /// file.
5146 pub hashed_size: i64,
5147
5148 /// True when the hash covers only a prefix of the file.
5149 pub partially_hashed: bool,
5150
5151 /// Prefix of the file contents as a JSON-encoded string.
5152 pub contents: std::string::String,
5153
5154 /// Path of the file in terms of underlying disk/partition identifiers.
5155 pub disk_path: std::option::Option<crate::model::file::DiskPath>,
5156
5157 /// Operation(s) performed on a file.
5158 pub operations: std::vec::Vec<crate::model::file::FileOperation>,
5159
5160 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5161}
5162
5163impl File {
5164 /// Creates a new default instance.
5165 pub fn new() -> Self {
5166 std::default::Default::default()
5167 }
5168
5169 /// Sets the value of [path][crate::model::File::path].
5170 ///
5171 /// # Example
5172 /// ```ignore,no_run
5173 /// # use google_cloud_securitycenter_v2::model::File;
5174 /// let x = File::new().set_path("example");
5175 /// ```
5176 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5177 self.path = v.into();
5178 self
5179 }
5180
5181 /// Sets the value of [size][crate::model::File::size].
5182 ///
5183 /// # Example
5184 /// ```ignore,no_run
5185 /// # use google_cloud_securitycenter_v2::model::File;
5186 /// let x = File::new().set_size(42);
5187 /// ```
5188 pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5189 self.size = v.into();
5190 self
5191 }
5192
5193 /// Sets the value of [sha256][crate::model::File::sha256].
5194 ///
5195 /// # Example
5196 /// ```ignore,no_run
5197 /// # use google_cloud_securitycenter_v2::model::File;
5198 /// let x = File::new().set_sha256("example");
5199 /// ```
5200 pub fn set_sha256<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5201 self.sha256 = v.into();
5202 self
5203 }
5204
5205 /// Sets the value of [hashed_size][crate::model::File::hashed_size].
5206 ///
5207 /// # Example
5208 /// ```ignore,no_run
5209 /// # use google_cloud_securitycenter_v2::model::File;
5210 /// let x = File::new().set_hashed_size(42);
5211 /// ```
5212 pub fn set_hashed_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5213 self.hashed_size = v.into();
5214 self
5215 }
5216
5217 /// Sets the value of [partially_hashed][crate::model::File::partially_hashed].
5218 ///
5219 /// # Example
5220 /// ```ignore,no_run
5221 /// # use google_cloud_securitycenter_v2::model::File;
5222 /// let x = File::new().set_partially_hashed(true);
5223 /// ```
5224 pub fn set_partially_hashed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5225 self.partially_hashed = v.into();
5226 self
5227 }
5228
5229 /// Sets the value of [contents][crate::model::File::contents].
5230 ///
5231 /// # Example
5232 /// ```ignore,no_run
5233 /// # use google_cloud_securitycenter_v2::model::File;
5234 /// let x = File::new().set_contents("example");
5235 /// ```
5236 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5237 self.contents = v.into();
5238 self
5239 }
5240
5241 /// Sets the value of [disk_path][crate::model::File::disk_path].
5242 ///
5243 /// # Example
5244 /// ```ignore,no_run
5245 /// # use google_cloud_securitycenter_v2::model::File;
5246 /// use google_cloud_securitycenter_v2::model::file::DiskPath;
5247 /// let x = File::new().set_disk_path(DiskPath::default()/* use setters */);
5248 /// ```
5249 pub fn set_disk_path<T>(mut self, v: T) -> Self
5250 where
5251 T: std::convert::Into<crate::model::file::DiskPath>,
5252 {
5253 self.disk_path = std::option::Option::Some(v.into());
5254 self
5255 }
5256
5257 /// Sets or clears the value of [disk_path][crate::model::File::disk_path].
5258 ///
5259 /// # Example
5260 /// ```ignore,no_run
5261 /// # use google_cloud_securitycenter_v2::model::File;
5262 /// use google_cloud_securitycenter_v2::model::file::DiskPath;
5263 /// let x = File::new().set_or_clear_disk_path(Some(DiskPath::default()/* use setters */));
5264 /// let x = File::new().set_or_clear_disk_path(None::<DiskPath>);
5265 /// ```
5266 pub fn set_or_clear_disk_path<T>(mut self, v: std::option::Option<T>) -> Self
5267 where
5268 T: std::convert::Into<crate::model::file::DiskPath>,
5269 {
5270 self.disk_path = v.map(|x| x.into());
5271 self
5272 }
5273
5274 /// Sets the value of [operations][crate::model::File::operations].
5275 ///
5276 /// # Example
5277 /// ```ignore,no_run
5278 /// # use google_cloud_securitycenter_v2::model::File;
5279 /// use google_cloud_securitycenter_v2::model::file::FileOperation;
5280 /// let x = File::new()
5281 /// .set_operations([
5282 /// FileOperation::default()/* use setters */,
5283 /// FileOperation::default()/* use (different) setters */,
5284 /// ]);
5285 /// ```
5286 pub fn set_operations<T, V>(mut self, v: T) -> Self
5287 where
5288 T: std::iter::IntoIterator<Item = V>,
5289 V: std::convert::Into<crate::model::file::FileOperation>,
5290 {
5291 use std::iter::Iterator;
5292 self.operations = v.into_iter().map(|i| i.into()).collect();
5293 self
5294 }
5295}
5296
5297impl wkt::message::Message for File {
5298 fn typename() -> &'static str {
5299 "type.googleapis.com/google.cloud.securitycenter.v2.File"
5300 }
5301}
5302
5303/// Defines additional types related to [File].
5304pub mod file {
5305 #[allow(unused_imports)]
5306 use super::*;
5307
5308 /// Path of the file in terms of underlying disk/partition identifiers.
5309 #[derive(Clone, Default, PartialEq)]
5310 #[non_exhaustive]
5311 pub struct DiskPath {
5312 /// UUID of the partition (format
5313 /// <https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid>)
5314 pub partition_uuid: std::string::String,
5315
5316 /// Relative path of the file in the partition as a JSON encoded string.
5317 /// Example: /home/user1/executable_file.sh
5318 pub relative_path: std::string::String,
5319
5320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5321 }
5322
5323 impl DiskPath {
5324 /// Creates a new default instance.
5325 pub fn new() -> Self {
5326 std::default::Default::default()
5327 }
5328
5329 /// Sets the value of [partition_uuid][crate::model::file::DiskPath::partition_uuid].
5330 ///
5331 /// # Example
5332 /// ```ignore,no_run
5333 /// # use google_cloud_securitycenter_v2::model::file::DiskPath;
5334 /// let x = DiskPath::new().set_partition_uuid("example");
5335 /// ```
5336 pub fn set_partition_uuid<T: std::convert::Into<std::string::String>>(
5337 mut self,
5338 v: T,
5339 ) -> Self {
5340 self.partition_uuid = v.into();
5341 self
5342 }
5343
5344 /// Sets the value of [relative_path][crate::model::file::DiskPath::relative_path].
5345 ///
5346 /// # Example
5347 /// ```ignore,no_run
5348 /// # use google_cloud_securitycenter_v2::model::file::DiskPath;
5349 /// let x = DiskPath::new().set_relative_path("example");
5350 /// ```
5351 pub fn set_relative_path<T: std::convert::Into<std::string::String>>(
5352 mut self,
5353 v: T,
5354 ) -> Self {
5355 self.relative_path = v.into();
5356 self
5357 }
5358 }
5359
5360 impl wkt::message::Message for DiskPath {
5361 fn typename() -> &'static str {
5362 "type.googleapis.com/google.cloud.securitycenter.v2.File.DiskPath"
5363 }
5364 }
5365
5366 /// Operation(s) performed on a file.
5367 #[derive(Clone, Default, PartialEq)]
5368 #[non_exhaustive]
5369 pub struct FileOperation {
5370 /// The type of the operation
5371 pub r#type: crate::model::file::file_operation::OperationType,
5372
5373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5374 }
5375
5376 impl FileOperation {
5377 /// Creates a new default instance.
5378 pub fn new() -> Self {
5379 std::default::Default::default()
5380 }
5381
5382 /// Sets the value of [r#type][crate::model::file::FileOperation::type].
5383 ///
5384 /// # Example
5385 /// ```ignore,no_run
5386 /// # use google_cloud_securitycenter_v2::model::file::FileOperation;
5387 /// use google_cloud_securitycenter_v2::model::file::file_operation::OperationType;
5388 /// let x0 = FileOperation::new().set_type(OperationType::Open);
5389 /// let x1 = FileOperation::new().set_type(OperationType::Read);
5390 /// let x2 = FileOperation::new().set_type(OperationType::Rename);
5391 /// ```
5392 pub fn set_type<
5393 T: std::convert::Into<crate::model::file::file_operation::OperationType>,
5394 >(
5395 mut self,
5396 v: T,
5397 ) -> Self {
5398 self.r#type = v.into();
5399 self
5400 }
5401 }
5402
5403 impl wkt::message::Message for FileOperation {
5404 fn typename() -> &'static str {
5405 "type.googleapis.com/google.cloud.securitycenter.v2.File.FileOperation"
5406 }
5407 }
5408
5409 /// Defines additional types related to [FileOperation].
5410 pub mod file_operation {
5411 #[allow(unused_imports)]
5412 use super::*;
5413
5414 /// The type of the operation
5415 ///
5416 /// # Working with unknown values
5417 ///
5418 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5419 /// additional enum variants at any time. Adding new variants is not considered
5420 /// a breaking change. Applications should write their code in anticipation of:
5421 ///
5422 /// - New values appearing in future releases of the client library, **and**
5423 /// - New values received dynamically, without application changes.
5424 ///
5425 /// Please consult the [Working with enums] section in the user guide for some
5426 /// guidelines.
5427 ///
5428 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5429 #[derive(Clone, Debug, PartialEq)]
5430 #[non_exhaustive]
5431 pub enum OperationType {
5432 /// The operation is unspecified.
5433 Unspecified,
5434 /// Represents an open operation.
5435 Open,
5436 /// Represents a read operation.
5437 Read,
5438 /// Represents a rename operation.
5439 Rename,
5440 /// Represents a write operation.
5441 Write,
5442 /// Represents an execute operation.
5443 Execute,
5444 /// If set, the enum was initialized with an unknown value.
5445 ///
5446 /// Applications can examine the value using [OperationType::value] or
5447 /// [OperationType::name].
5448 UnknownValue(operation_type::UnknownValue),
5449 }
5450
5451 #[doc(hidden)]
5452 pub mod operation_type {
5453 #[allow(unused_imports)]
5454 use super::*;
5455 #[derive(Clone, Debug, PartialEq)]
5456 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5457 }
5458
5459 impl OperationType {
5460 /// Gets the enum value.
5461 ///
5462 /// Returns `None` if the enum contains an unknown value deserialized from
5463 /// the string representation of enums.
5464 pub fn value(&self) -> std::option::Option<i32> {
5465 match self {
5466 Self::Unspecified => std::option::Option::Some(0),
5467 Self::Open => std::option::Option::Some(1),
5468 Self::Read => std::option::Option::Some(2),
5469 Self::Rename => std::option::Option::Some(3),
5470 Self::Write => std::option::Option::Some(4),
5471 Self::Execute => std::option::Option::Some(5),
5472 Self::UnknownValue(u) => u.0.value(),
5473 }
5474 }
5475
5476 /// Gets the enum value as a string.
5477 ///
5478 /// Returns `None` if the enum contains an unknown value deserialized from
5479 /// the integer representation of enums.
5480 pub fn name(&self) -> std::option::Option<&str> {
5481 match self {
5482 Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
5483 Self::Open => std::option::Option::Some("OPEN"),
5484 Self::Read => std::option::Option::Some("READ"),
5485 Self::Rename => std::option::Option::Some("RENAME"),
5486 Self::Write => std::option::Option::Some("WRITE"),
5487 Self::Execute => std::option::Option::Some("EXECUTE"),
5488 Self::UnknownValue(u) => u.0.name(),
5489 }
5490 }
5491 }
5492
5493 impl std::default::Default for OperationType {
5494 fn default() -> Self {
5495 use std::convert::From;
5496 Self::from(0)
5497 }
5498 }
5499
5500 impl std::fmt::Display for OperationType {
5501 fn fmt(
5502 &self,
5503 f: &mut std::fmt::Formatter<'_>,
5504 ) -> std::result::Result<(), std::fmt::Error> {
5505 wkt::internal::display_enum(f, self.name(), self.value())
5506 }
5507 }
5508
5509 impl std::convert::From<i32> for OperationType {
5510 fn from(value: i32) -> Self {
5511 match value {
5512 0 => Self::Unspecified,
5513 1 => Self::Open,
5514 2 => Self::Read,
5515 3 => Self::Rename,
5516 4 => Self::Write,
5517 5 => Self::Execute,
5518 _ => Self::UnknownValue(operation_type::UnknownValue(
5519 wkt::internal::UnknownEnumValue::Integer(value),
5520 )),
5521 }
5522 }
5523 }
5524
5525 impl std::convert::From<&str> for OperationType {
5526 fn from(value: &str) -> Self {
5527 use std::string::ToString;
5528 match value {
5529 "OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
5530 "OPEN" => Self::Open,
5531 "READ" => Self::Read,
5532 "RENAME" => Self::Rename,
5533 "WRITE" => Self::Write,
5534 "EXECUTE" => Self::Execute,
5535 _ => Self::UnknownValue(operation_type::UnknownValue(
5536 wkt::internal::UnknownEnumValue::String(value.to_string()),
5537 )),
5538 }
5539 }
5540 }
5541
5542 impl serde::ser::Serialize for OperationType {
5543 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5544 where
5545 S: serde::Serializer,
5546 {
5547 match self {
5548 Self::Unspecified => serializer.serialize_i32(0),
5549 Self::Open => serializer.serialize_i32(1),
5550 Self::Read => serializer.serialize_i32(2),
5551 Self::Rename => serializer.serialize_i32(3),
5552 Self::Write => serializer.serialize_i32(4),
5553 Self::Execute => serializer.serialize_i32(5),
5554 Self::UnknownValue(u) => u.0.serialize(serializer),
5555 }
5556 }
5557 }
5558
5559 impl<'de> serde::de::Deserialize<'de> for OperationType {
5560 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5561 where
5562 D: serde::Deserializer<'de>,
5563 {
5564 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
5565 ".google.cloud.securitycenter.v2.File.FileOperation.OperationType",
5566 ))
5567 }
5568 }
5569 }
5570}
5571
5572/// Security Command Center finding.
5573///
5574/// A finding is a record of assessment data like security, risk, health, or
5575/// privacy, that is ingested into Security Command Center for presentation,
5576/// notification, analysis, policy testing, and enforcement. For example, a
5577/// cross-site scripting (XSS) vulnerability in an App Engine application is a
5578/// finding.
5579#[derive(Clone, Default, PartialEq)]
5580#[non_exhaustive]
5581pub struct Finding {
5582 /// Identifier. The [relative resource
5583 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
5584 /// of the finding. The following list shows some examples:
5585 ///
5586 ///
5587 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
5588 /// +
5589 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5590 ///
5591 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
5592 ///
5593 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5594 ///
5595 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
5596 ///
5597 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5598 pub name: std::string::String,
5599
5600 /// Output only. The canonical name of the finding. The following list shows
5601 /// some examples:
5602 ///
5603 ///
5604 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
5605 /// +
5606 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5607 ///
5608 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
5609 ///
5610 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5611 ///
5612 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
5613 ///
5614 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5615 ///
5616 /// The prefix is the closest CRM ancestor of the resource associated with the
5617 /// finding.
5618 pub canonical_name: std::string::String,
5619
5620 /// The relative resource name of the source and location the finding belongs
5621 /// to. See:
5622 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
5623 /// This field is immutable after creation time. The following list shows some
5624 /// examples:
5625 ///
5626 /// + `organizations/{organization_id}/sources/{source_id}`
5627 /// + `folders/{folders_id}/sources/{source_id}`
5628 /// + `projects/{projects_id}/sources/{source_id}`
5629 ///
5630 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}`
5631 ///
5632 /// + `folders/{folders_id}/sources/{source_id}/locations/{location_id}`
5633 /// + `projects/{projects_id}/sources/{source_id}/locations/{location_id}`
5634 pub parent: std::string::String,
5635
5636 /// Immutable. For findings on Google Cloud resources, the full resource
5637 /// name of the Google Cloud resource this finding is for. See:
5638 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
5639 /// When the finding is for a non-Google Cloud resource, the resourceName can
5640 /// be a customer or partner defined string.
5641 pub resource_name: std::string::String,
5642
5643 /// Output only. The state of the finding.
5644 pub state: crate::model::finding::State,
5645
5646 /// Immutable. The additional taxonomy group within findings from a given
5647 /// source. Example: "XSS_FLASH_INJECTION"
5648 pub category: std::string::String,
5649
5650 /// The URI that, if available, points to a web page outside of Security
5651 /// Command Center where additional information about the finding can be found.
5652 /// This field is guaranteed to be either empty or a well formed URL.
5653 pub external_uri: std::string::String,
5654
5655 /// Source specific properties. These properties are managed by the source
5656 /// that writes the finding. The key names in the source_properties map must be
5657 /// between 1 and 255 characters, and must start with a letter and contain
5658 /// alphanumeric characters or underscores only.
5659 pub source_properties: std::collections::HashMap<std::string::String, wkt::Value>,
5660
5661 /// Output only. User specified security marks. These marks are entirely
5662 /// managed by the user and come from the SecurityMarks resource that belongs
5663 /// to the finding.
5664 pub security_marks: std::option::Option<crate::model::SecurityMarks>,
5665
5666 /// The time the finding was first detected. If an existing finding is updated,
5667 /// then this is the time the update occurred.
5668 /// For example, if the finding represents an open firewall, this property
5669 /// captures the time the detector believes the firewall became open. The
5670 /// accuracy is determined by the detector. If the finding is later resolved,
5671 /// then this time reflects when the finding was resolved. This must not
5672 /// be set to a value greater than the current timestamp.
5673 pub event_time: std::option::Option<wkt::Timestamp>,
5674
5675 /// Output only. The time at which the finding was created in Security Command
5676 /// Center.
5677 pub create_time: std::option::Option<wkt::Timestamp>,
5678
5679 /// The severity of the finding. This field is managed by the source that
5680 /// writes the finding.
5681 pub severity: crate::model::finding::Severity,
5682
5683 /// Indicates the mute state of a finding (either muted, unmuted
5684 /// or undefined). Unlike other attributes of a finding, a finding provider
5685 /// shouldn't set the value of mute.
5686 pub mute: crate::model::finding::Mute,
5687
5688 /// Output only. The mute information regarding this finding.
5689 pub mute_info: std::option::Option<crate::model::finding::MuteInfo>,
5690
5691 /// The class of the finding.
5692 pub finding_class: crate::model::finding::FindingClass,
5693
5694 /// Represents what's commonly known as an *indicator of compromise* (IoC) in
5695 /// computer forensics. This is an artifact observed on a network or in an
5696 /// operating system that, with high confidence, indicates a computer
5697 /// intrusion. For more information, see [Indicator of
5698 /// compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise).
5699 pub indicator: std::option::Option<crate::model::Indicator>,
5700
5701 /// Represents vulnerability-specific fields like CVE and CVSS scores.
5702 /// CVE stands for Common Vulnerabilities and Exposures
5703 /// (<https://cve.mitre.org/about/>)
5704 pub vulnerability: std::option::Option<crate::model::Vulnerability>,
5705
5706 /// Output only. The most recent time this finding was muted or unmuted.
5707 pub mute_update_time: std::option::Option<wkt::Timestamp>,
5708
5709 /// Output only. Third party SIEM/SOAR fields within SCC, contains external
5710 /// system information and external system finding fields.
5711 pub external_systems:
5712 std::collections::HashMap<std::string::String, crate::model::ExternalSystem>,
5713
5714 /// MITRE ATT&CK tactics and techniques related to this finding.
5715 /// See: <https://attack.mitre.org>
5716 pub mitre_attack: std::option::Option<crate::model::MitreAttack>,
5717
5718 /// Access details associated with the finding, such as more information on the
5719 /// caller, which method was accessed, and from where.
5720 pub access: std::option::Option<crate::model::Access>,
5721
5722 /// Contains information about the IP connection associated with the finding.
5723 pub connections: std::vec::Vec<crate::model::Connection>,
5724
5725 /// Records additional information about the mute operation, for example, the
5726 /// [mute
5727 /// configuration](https://cloud.google.com/security-command-center/docs/how-to-mute-findings)
5728 /// that muted the finding and the user who muted the finding.
5729 pub mute_initiator: std::string::String,
5730
5731 /// Represents operating system processes associated with the Finding.
5732 pub processes: std::vec::Vec<crate::model::Process>,
5733
5734 /// Output only. Map containing the points of contact for the given finding.
5735 /// The key represents the type of contact, while the value contains a list of
5736 /// all the contacts that pertain. Please refer to:
5737 /// <https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories>
5738 ///
5739 /// ```norust
5740 /// {
5741 /// "security": {
5742 /// "contacts": [
5743 /// {
5744 /// "email": "person1@company.com"
5745 /// },
5746 /// {
5747 /// "email": "person2@company.com"
5748 /// }
5749 /// ]
5750 /// }
5751 /// }
5752 /// ```
5753 pub contacts: std::collections::HashMap<std::string::String, crate::model::ContactDetails>,
5754
5755 /// Contains compliance information for security standards associated to the
5756 /// finding.
5757 pub compliances: std::vec::Vec<crate::model::Compliance>,
5758
5759 /// Output only. The human readable display name of the finding source such as
5760 /// "Event Threat Detection" or "Security Health Analytics".
5761 pub parent_display_name: std::string::String,
5762
5763 /// Contains more details about the finding.
5764 pub description: std::string::String,
5765
5766 /// Represents exfiltrations associated with the finding.
5767 pub exfiltration: std::option::Option<crate::model::Exfiltration>,
5768
5769 /// Represents IAM bindings associated with the finding.
5770 pub iam_bindings: std::vec::Vec<crate::model::IamBinding>,
5771
5772 /// Steps to address the finding.
5773 pub next_steps: std::string::String,
5774
5775 /// Unique identifier of the module which generated the finding.
5776 /// Example:
5777 /// folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885
5778 pub module_name: std::string::String,
5779
5780 /// Containers associated with the finding. This field provides information for
5781 /// both Kubernetes and non-Kubernetes containers.
5782 pub containers: std::vec::Vec<crate::model::Container>,
5783
5784 /// Kubernetes resources associated with the finding.
5785 pub kubernetes: std::option::Option<crate::model::Kubernetes>,
5786
5787 /// Database associated with the finding.
5788 pub database: std::option::Option<crate::model::Database>,
5789
5790 /// The results of an attack path simulation relevant to this finding.
5791 pub attack_exposure: std::option::Option<crate::model::AttackExposure>,
5792
5793 /// File associated with the finding.
5794 pub files: std::vec::Vec<crate::model::File>,
5795
5796 /// Cloud Data Loss Prevention (Cloud DLP) inspection results that are
5797 /// associated with the finding.
5798 pub cloud_dlp_inspection: std::option::Option<crate::model::CloudDlpInspection>,
5799
5800 /// Cloud DLP data profile that is associated with the finding.
5801 pub cloud_dlp_data_profile: std::option::Option<crate::model::CloudDlpDataProfile>,
5802
5803 /// Signature of the kernel rootkit.
5804 pub kernel_rootkit: std::option::Option<crate::model::KernelRootkit>,
5805
5806 /// Contains information about the org policies associated with the finding.
5807 pub org_policies: std::vec::Vec<crate::model::OrgPolicy>,
5808
5809 /// Job associated with the finding.
5810 pub job: std::option::Option<crate::model::Job>,
5811
5812 /// Represents an application associated with the finding.
5813 pub application: std::option::Option<crate::model::Application>,
5814
5815 /// IP rules associated with the finding.
5816 pub ip_rules: std::option::Option<crate::model::IpRules>,
5817
5818 /// Fields related to Backup and DR findings.
5819 pub backup_disaster_recovery: std::option::Option<crate::model::BackupDisasterRecovery>,
5820
5821 /// The security posture associated with the finding.
5822 pub security_posture: std::option::Option<crate::model::SecurityPosture>,
5823
5824 /// Log entries that are relevant to the finding.
5825 pub log_entries: std::vec::Vec<crate::model::LogEntry>,
5826
5827 /// The load balancers associated with the finding.
5828 pub load_balancers: std::vec::Vec<crate::model::LoadBalancer>,
5829
5830 /// Fields related to Cloud Armor findings.
5831 pub cloud_armor: std::option::Option<crate::model::CloudArmor>,
5832
5833 /// Notebook associated with the finding.
5834 pub notebook: std::option::Option<crate::model::Notebook>,
5835
5836 /// Contains details about a group of security issues that, when the issues
5837 /// occur together, represent a greater risk than when the issues occur
5838 /// independently. A group of such issues is referred to as a toxic
5839 /// combination.
5840 /// This field cannot be updated. Its value is ignored in all update requests.
5841 pub toxic_combination: std::option::Option<crate::model::ToxicCombination>,
5842
5843 /// Contains details about groups of which this finding is a member. A group is
5844 /// a collection of findings that are related in some way.
5845 /// This field cannot be updated. Its value is ignored in all update requests.
5846 pub group_memberships: std::vec::Vec<crate::model::GroupMembership>,
5847
5848 /// Disk associated with the finding.
5849 pub disk: std::option::Option<crate::model::Disk>,
5850
5851 /// Data access events associated with the finding.
5852 pub data_access_events: std::vec::Vec<crate::model::DataAccessEvent>,
5853
5854 /// Data flow events associated with the finding.
5855 pub data_flow_events: std::vec::Vec<crate::model::DataFlowEvent>,
5856
5857 /// Represents the VPC networks that the resource is attached to.
5858 pub networks: std::vec::Vec<crate::model::Network>,
5859
5860 /// Data retention deletion events associated with the finding.
5861 pub data_retention_deletion_events: std::vec::Vec<crate::model::DataRetentionDeletionEvent>,
5862
5863 /// AffectedResources associated with the finding.
5864 pub affected_resources: std::option::Option<crate::model::AffectedResources>,
5865
5866 /// The AI model associated with the finding.
5867 pub ai_model: std::option::Option<crate::model::AiModel>,
5868
5869 /// Contains details about a chokepoint, which is a resource or resource group
5870 /// where high-risk attack paths converge, based on [attack path simulations]
5871 /// (<https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations>).
5872 /// This field cannot be updated. Its value is ignored in all update requests.
5873 pub chokepoint: std::option::Option<crate::model::Chokepoint>,
5874
5875 /// VertexAi associated with the finding.
5876 pub vertex_ai: std::option::Option<crate::model::VertexAi>,
5877
5878 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5879}
5880
5881impl Finding {
5882 /// Creates a new default instance.
5883 pub fn new() -> Self {
5884 std::default::Default::default()
5885 }
5886
5887 /// Sets the value of [name][crate::model::Finding::name].
5888 ///
5889 /// # Example
5890 /// ```ignore,no_run
5891 /// # use google_cloud_securitycenter_v2::model::Finding;
5892 /// # let organization_id = "organization_id";
5893 /// # let source_id = "source_id";
5894 /// # let finding_id = "finding_id";
5895 /// let x = Finding::new().set_name(format!("organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"));
5896 /// ```
5897 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5898 self.name = v.into();
5899 self
5900 }
5901
5902 /// Sets the value of [canonical_name][crate::model::Finding::canonical_name].
5903 ///
5904 /// # Example
5905 /// ```ignore,no_run
5906 /// # use google_cloud_securitycenter_v2::model::Finding;
5907 /// let x = Finding::new().set_canonical_name("example");
5908 /// ```
5909 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5910 self.canonical_name = v.into();
5911 self
5912 }
5913
5914 /// Sets the value of [parent][crate::model::Finding::parent].
5915 ///
5916 /// # Example
5917 /// ```ignore,no_run
5918 /// # use google_cloud_securitycenter_v2::model::Finding;
5919 /// let x = Finding::new().set_parent("example");
5920 /// ```
5921 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5922 self.parent = v.into();
5923 self
5924 }
5925
5926 /// Sets the value of [resource_name][crate::model::Finding::resource_name].
5927 ///
5928 /// # Example
5929 /// ```ignore,no_run
5930 /// # use google_cloud_securitycenter_v2::model::Finding;
5931 /// let x = Finding::new().set_resource_name("example");
5932 /// ```
5933 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5934 self.resource_name = v.into();
5935 self
5936 }
5937
5938 /// Sets the value of [state][crate::model::Finding::state].
5939 ///
5940 /// # Example
5941 /// ```ignore,no_run
5942 /// # use google_cloud_securitycenter_v2::model::Finding;
5943 /// use google_cloud_securitycenter_v2::model::finding::State;
5944 /// let x0 = Finding::new().set_state(State::Active);
5945 /// let x1 = Finding::new().set_state(State::Inactive);
5946 /// ```
5947 pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
5948 self.state = v.into();
5949 self
5950 }
5951
5952 /// Sets the value of [category][crate::model::Finding::category].
5953 ///
5954 /// # Example
5955 /// ```ignore,no_run
5956 /// # use google_cloud_securitycenter_v2::model::Finding;
5957 /// let x = Finding::new().set_category("example");
5958 /// ```
5959 pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5960 self.category = v.into();
5961 self
5962 }
5963
5964 /// Sets the value of [external_uri][crate::model::Finding::external_uri].
5965 ///
5966 /// # Example
5967 /// ```ignore,no_run
5968 /// # use google_cloud_securitycenter_v2::model::Finding;
5969 /// let x = Finding::new().set_external_uri("example");
5970 /// ```
5971 pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5972 self.external_uri = v.into();
5973 self
5974 }
5975
5976 /// Sets the value of [source_properties][crate::model::Finding::source_properties].
5977 ///
5978 /// # Example
5979 /// ```ignore,no_run
5980 /// # use google_cloud_securitycenter_v2::model::Finding;
5981 /// use wkt::Value;
5982 /// let x = Finding::new().set_source_properties([
5983 /// ("key0", Value::default()/* use setters */),
5984 /// ("key1", Value::default()/* use (different) setters */),
5985 /// ]);
5986 /// ```
5987 pub fn set_source_properties<T, K, V>(mut self, v: T) -> Self
5988 where
5989 T: std::iter::IntoIterator<Item = (K, V)>,
5990 K: std::convert::Into<std::string::String>,
5991 V: std::convert::Into<wkt::Value>,
5992 {
5993 use std::iter::Iterator;
5994 self.source_properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5995 self
5996 }
5997
5998 /// Sets the value of [security_marks][crate::model::Finding::security_marks].
5999 ///
6000 /// # Example
6001 /// ```ignore,no_run
6002 /// # use google_cloud_securitycenter_v2::model::Finding;
6003 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
6004 /// let x = Finding::new().set_security_marks(SecurityMarks::default()/* use setters */);
6005 /// ```
6006 pub fn set_security_marks<T>(mut self, v: T) -> Self
6007 where
6008 T: std::convert::Into<crate::model::SecurityMarks>,
6009 {
6010 self.security_marks = std::option::Option::Some(v.into());
6011 self
6012 }
6013
6014 /// Sets or clears the value of [security_marks][crate::model::Finding::security_marks].
6015 ///
6016 /// # Example
6017 /// ```ignore,no_run
6018 /// # use google_cloud_securitycenter_v2::model::Finding;
6019 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
6020 /// let x = Finding::new().set_or_clear_security_marks(Some(SecurityMarks::default()/* use setters */));
6021 /// let x = Finding::new().set_or_clear_security_marks(None::<SecurityMarks>);
6022 /// ```
6023 pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
6024 where
6025 T: std::convert::Into<crate::model::SecurityMarks>,
6026 {
6027 self.security_marks = v.map(|x| x.into());
6028 self
6029 }
6030
6031 /// Sets the value of [event_time][crate::model::Finding::event_time].
6032 ///
6033 /// # Example
6034 /// ```ignore,no_run
6035 /// # use google_cloud_securitycenter_v2::model::Finding;
6036 /// use wkt::Timestamp;
6037 /// let x = Finding::new().set_event_time(Timestamp::default()/* use setters */);
6038 /// ```
6039 pub fn set_event_time<T>(mut self, v: T) -> Self
6040 where
6041 T: std::convert::Into<wkt::Timestamp>,
6042 {
6043 self.event_time = std::option::Option::Some(v.into());
6044 self
6045 }
6046
6047 /// Sets or clears the value of [event_time][crate::model::Finding::event_time].
6048 ///
6049 /// # Example
6050 /// ```ignore,no_run
6051 /// # use google_cloud_securitycenter_v2::model::Finding;
6052 /// use wkt::Timestamp;
6053 /// let x = Finding::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
6054 /// let x = Finding::new().set_or_clear_event_time(None::<Timestamp>);
6055 /// ```
6056 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
6057 where
6058 T: std::convert::Into<wkt::Timestamp>,
6059 {
6060 self.event_time = v.map(|x| x.into());
6061 self
6062 }
6063
6064 /// Sets the value of [create_time][crate::model::Finding::create_time].
6065 ///
6066 /// # Example
6067 /// ```ignore,no_run
6068 /// # use google_cloud_securitycenter_v2::model::Finding;
6069 /// use wkt::Timestamp;
6070 /// let x = Finding::new().set_create_time(Timestamp::default()/* use setters */);
6071 /// ```
6072 pub fn set_create_time<T>(mut self, v: T) -> Self
6073 where
6074 T: std::convert::Into<wkt::Timestamp>,
6075 {
6076 self.create_time = std::option::Option::Some(v.into());
6077 self
6078 }
6079
6080 /// Sets or clears the value of [create_time][crate::model::Finding::create_time].
6081 ///
6082 /// # Example
6083 /// ```ignore,no_run
6084 /// # use google_cloud_securitycenter_v2::model::Finding;
6085 /// use wkt::Timestamp;
6086 /// let x = Finding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6087 /// let x = Finding::new().set_or_clear_create_time(None::<Timestamp>);
6088 /// ```
6089 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6090 where
6091 T: std::convert::Into<wkt::Timestamp>,
6092 {
6093 self.create_time = v.map(|x| x.into());
6094 self
6095 }
6096
6097 /// Sets the value of [severity][crate::model::Finding::severity].
6098 ///
6099 /// # Example
6100 /// ```ignore,no_run
6101 /// # use google_cloud_securitycenter_v2::model::Finding;
6102 /// use google_cloud_securitycenter_v2::model::finding::Severity;
6103 /// let x0 = Finding::new().set_severity(Severity::Critical);
6104 /// let x1 = Finding::new().set_severity(Severity::High);
6105 /// let x2 = Finding::new().set_severity(Severity::Medium);
6106 /// ```
6107 pub fn set_severity<T: std::convert::Into<crate::model::finding::Severity>>(
6108 mut self,
6109 v: T,
6110 ) -> Self {
6111 self.severity = v.into();
6112 self
6113 }
6114
6115 /// Sets the value of [mute][crate::model::Finding::mute].
6116 ///
6117 /// # Example
6118 /// ```ignore,no_run
6119 /// # use google_cloud_securitycenter_v2::model::Finding;
6120 /// use google_cloud_securitycenter_v2::model::finding::Mute;
6121 /// let x0 = Finding::new().set_mute(Mute::Muted);
6122 /// let x1 = Finding::new().set_mute(Mute::Unmuted);
6123 /// let x2 = Finding::new().set_mute(Mute::Undefined);
6124 /// ```
6125 pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
6126 self.mute = v.into();
6127 self
6128 }
6129
6130 /// Sets the value of [mute_info][crate::model::Finding::mute_info].
6131 ///
6132 /// # Example
6133 /// ```ignore,no_run
6134 /// # use google_cloud_securitycenter_v2::model::Finding;
6135 /// use google_cloud_securitycenter_v2::model::finding::MuteInfo;
6136 /// let x = Finding::new().set_mute_info(MuteInfo::default()/* use setters */);
6137 /// ```
6138 pub fn set_mute_info<T>(mut self, v: T) -> Self
6139 where
6140 T: std::convert::Into<crate::model::finding::MuteInfo>,
6141 {
6142 self.mute_info = std::option::Option::Some(v.into());
6143 self
6144 }
6145
6146 /// Sets or clears the value of [mute_info][crate::model::Finding::mute_info].
6147 ///
6148 /// # Example
6149 /// ```ignore,no_run
6150 /// # use google_cloud_securitycenter_v2::model::Finding;
6151 /// use google_cloud_securitycenter_v2::model::finding::MuteInfo;
6152 /// let x = Finding::new().set_or_clear_mute_info(Some(MuteInfo::default()/* use setters */));
6153 /// let x = Finding::new().set_or_clear_mute_info(None::<MuteInfo>);
6154 /// ```
6155 pub fn set_or_clear_mute_info<T>(mut self, v: std::option::Option<T>) -> Self
6156 where
6157 T: std::convert::Into<crate::model::finding::MuteInfo>,
6158 {
6159 self.mute_info = v.map(|x| x.into());
6160 self
6161 }
6162
6163 /// Sets the value of [finding_class][crate::model::Finding::finding_class].
6164 ///
6165 /// # Example
6166 /// ```ignore,no_run
6167 /// # use google_cloud_securitycenter_v2::model::Finding;
6168 /// use google_cloud_securitycenter_v2::model::finding::FindingClass;
6169 /// let x0 = Finding::new().set_finding_class(FindingClass::Threat);
6170 /// let x1 = Finding::new().set_finding_class(FindingClass::Vulnerability);
6171 /// let x2 = Finding::new().set_finding_class(FindingClass::Misconfiguration);
6172 /// ```
6173 pub fn set_finding_class<T: std::convert::Into<crate::model::finding::FindingClass>>(
6174 mut self,
6175 v: T,
6176 ) -> Self {
6177 self.finding_class = v.into();
6178 self
6179 }
6180
6181 /// Sets the value of [indicator][crate::model::Finding::indicator].
6182 ///
6183 /// # Example
6184 /// ```ignore,no_run
6185 /// # use google_cloud_securitycenter_v2::model::Finding;
6186 /// use google_cloud_securitycenter_v2::model::Indicator;
6187 /// let x = Finding::new().set_indicator(Indicator::default()/* use setters */);
6188 /// ```
6189 pub fn set_indicator<T>(mut self, v: T) -> Self
6190 where
6191 T: std::convert::Into<crate::model::Indicator>,
6192 {
6193 self.indicator = std::option::Option::Some(v.into());
6194 self
6195 }
6196
6197 /// Sets or clears the value of [indicator][crate::model::Finding::indicator].
6198 ///
6199 /// # Example
6200 /// ```ignore,no_run
6201 /// # use google_cloud_securitycenter_v2::model::Finding;
6202 /// use google_cloud_securitycenter_v2::model::Indicator;
6203 /// let x = Finding::new().set_or_clear_indicator(Some(Indicator::default()/* use setters */));
6204 /// let x = Finding::new().set_or_clear_indicator(None::<Indicator>);
6205 /// ```
6206 pub fn set_or_clear_indicator<T>(mut self, v: std::option::Option<T>) -> Self
6207 where
6208 T: std::convert::Into<crate::model::Indicator>,
6209 {
6210 self.indicator = v.map(|x| x.into());
6211 self
6212 }
6213
6214 /// Sets the value of [vulnerability][crate::model::Finding::vulnerability].
6215 ///
6216 /// # Example
6217 /// ```ignore,no_run
6218 /// # use google_cloud_securitycenter_v2::model::Finding;
6219 /// use google_cloud_securitycenter_v2::model::Vulnerability;
6220 /// let x = Finding::new().set_vulnerability(Vulnerability::default()/* use setters */);
6221 /// ```
6222 pub fn set_vulnerability<T>(mut self, v: T) -> Self
6223 where
6224 T: std::convert::Into<crate::model::Vulnerability>,
6225 {
6226 self.vulnerability = std::option::Option::Some(v.into());
6227 self
6228 }
6229
6230 /// Sets or clears the value of [vulnerability][crate::model::Finding::vulnerability].
6231 ///
6232 /// # Example
6233 /// ```ignore,no_run
6234 /// # use google_cloud_securitycenter_v2::model::Finding;
6235 /// use google_cloud_securitycenter_v2::model::Vulnerability;
6236 /// let x = Finding::new().set_or_clear_vulnerability(Some(Vulnerability::default()/* use setters */));
6237 /// let x = Finding::new().set_or_clear_vulnerability(None::<Vulnerability>);
6238 /// ```
6239 pub fn set_or_clear_vulnerability<T>(mut self, v: std::option::Option<T>) -> Self
6240 where
6241 T: std::convert::Into<crate::model::Vulnerability>,
6242 {
6243 self.vulnerability = v.map(|x| x.into());
6244 self
6245 }
6246
6247 /// Sets the value of [mute_update_time][crate::model::Finding::mute_update_time].
6248 ///
6249 /// # Example
6250 /// ```ignore,no_run
6251 /// # use google_cloud_securitycenter_v2::model::Finding;
6252 /// use wkt::Timestamp;
6253 /// let x = Finding::new().set_mute_update_time(Timestamp::default()/* use setters */);
6254 /// ```
6255 pub fn set_mute_update_time<T>(mut self, v: T) -> Self
6256 where
6257 T: std::convert::Into<wkt::Timestamp>,
6258 {
6259 self.mute_update_time = std::option::Option::Some(v.into());
6260 self
6261 }
6262
6263 /// Sets or clears the value of [mute_update_time][crate::model::Finding::mute_update_time].
6264 ///
6265 /// # Example
6266 /// ```ignore,no_run
6267 /// # use google_cloud_securitycenter_v2::model::Finding;
6268 /// use wkt::Timestamp;
6269 /// let x = Finding::new().set_or_clear_mute_update_time(Some(Timestamp::default()/* use setters */));
6270 /// let x = Finding::new().set_or_clear_mute_update_time(None::<Timestamp>);
6271 /// ```
6272 pub fn set_or_clear_mute_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6273 where
6274 T: std::convert::Into<wkt::Timestamp>,
6275 {
6276 self.mute_update_time = v.map(|x| x.into());
6277 self
6278 }
6279
6280 /// Sets the value of [external_systems][crate::model::Finding::external_systems].
6281 ///
6282 /// # Example
6283 /// ```ignore,no_run
6284 /// # use google_cloud_securitycenter_v2::model::Finding;
6285 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
6286 /// let x = Finding::new().set_external_systems([
6287 /// ("key0", ExternalSystem::default()/* use setters */),
6288 /// ("key1", ExternalSystem::default()/* use (different) setters */),
6289 /// ]);
6290 /// ```
6291 pub fn set_external_systems<T, K, V>(mut self, v: T) -> Self
6292 where
6293 T: std::iter::IntoIterator<Item = (K, V)>,
6294 K: std::convert::Into<std::string::String>,
6295 V: std::convert::Into<crate::model::ExternalSystem>,
6296 {
6297 use std::iter::Iterator;
6298 self.external_systems = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6299 self
6300 }
6301
6302 /// Sets the value of [mitre_attack][crate::model::Finding::mitre_attack].
6303 ///
6304 /// # Example
6305 /// ```ignore,no_run
6306 /// # use google_cloud_securitycenter_v2::model::Finding;
6307 /// use google_cloud_securitycenter_v2::model::MitreAttack;
6308 /// let x = Finding::new().set_mitre_attack(MitreAttack::default()/* use setters */);
6309 /// ```
6310 pub fn set_mitre_attack<T>(mut self, v: T) -> Self
6311 where
6312 T: std::convert::Into<crate::model::MitreAttack>,
6313 {
6314 self.mitre_attack = std::option::Option::Some(v.into());
6315 self
6316 }
6317
6318 /// Sets or clears the value of [mitre_attack][crate::model::Finding::mitre_attack].
6319 ///
6320 /// # Example
6321 /// ```ignore,no_run
6322 /// # use google_cloud_securitycenter_v2::model::Finding;
6323 /// use google_cloud_securitycenter_v2::model::MitreAttack;
6324 /// let x = Finding::new().set_or_clear_mitre_attack(Some(MitreAttack::default()/* use setters */));
6325 /// let x = Finding::new().set_or_clear_mitre_attack(None::<MitreAttack>);
6326 /// ```
6327 pub fn set_or_clear_mitre_attack<T>(mut self, v: std::option::Option<T>) -> Self
6328 where
6329 T: std::convert::Into<crate::model::MitreAttack>,
6330 {
6331 self.mitre_attack = v.map(|x| x.into());
6332 self
6333 }
6334
6335 /// Sets the value of [access][crate::model::Finding::access].
6336 ///
6337 /// # Example
6338 /// ```ignore,no_run
6339 /// # use google_cloud_securitycenter_v2::model::Finding;
6340 /// use google_cloud_securitycenter_v2::model::Access;
6341 /// let x = Finding::new().set_access(Access::default()/* use setters */);
6342 /// ```
6343 pub fn set_access<T>(mut self, v: T) -> Self
6344 where
6345 T: std::convert::Into<crate::model::Access>,
6346 {
6347 self.access = std::option::Option::Some(v.into());
6348 self
6349 }
6350
6351 /// Sets or clears the value of [access][crate::model::Finding::access].
6352 ///
6353 /// # Example
6354 /// ```ignore,no_run
6355 /// # use google_cloud_securitycenter_v2::model::Finding;
6356 /// use google_cloud_securitycenter_v2::model::Access;
6357 /// let x = Finding::new().set_or_clear_access(Some(Access::default()/* use setters */));
6358 /// let x = Finding::new().set_or_clear_access(None::<Access>);
6359 /// ```
6360 pub fn set_or_clear_access<T>(mut self, v: std::option::Option<T>) -> Self
6361 where
6362 T: std::convert::Into<crate::model::Access>,
6363 {
6364 self.access = v.map(|x| x.into());
6365 self
6366 }
6367
6368 /// Sets the value of [connections][crate::model::Finding::connections].
6369 ///
6370 /// # Example
6371 /// ```ignore,no_run
6372 /// # use google_cloud_securitycenter_v2::model::Finding;
6373 /// use google_cloud_securitycenter_v2::model::Connection;
6374 /// let x = Finding::new()
6375 /// .set_connections([
6376 /// Connection::default()/* use setters */,
6377 /// Connection::default()/* use (different) setters */,
6378 /// ]);
6379 /// ```
6380 pub fn set_connections<T, V>(mut self, v: T) -> Self
6381 where
6382 T: std::iter::IntoIterator<Item = V>,
6383 V: std::convert::Into<crate::model::Connection>,
6384 {
6385 use std::iter::Iterator;
6386 self.connections = v.into_iter().map(|i| i.into()).collect();
6387 self
6388 }
6389
6390 /// Sets the value of [mute_initiator][crate::model::Finding::mute_initiator].
6391 ///
6392 /// # Example
6393 /// ```ignore,no_run
6394 /// # use google_cloud_securitycenter_v2::model::Finding;
6395 /// let x = Finding::new().set_mute_initiator("example");
6396 /// ```
6397 pub fn set_mute_initiator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6398 self.mute_initiator = v.into();
6399 self
6400 }
6401
6402 /// Sets the value of [processes][crate::model::Finding::processes].
6403 ///
6404 /// # Example
6405 /// ```ignore,no_run
6406 /// # use google_cloud_securitycenter_v2::model::Finding;
6407 /// use google_cloud_securitycenter_v2::model::Process;
6408 /// let x = Finding::new()
6409 /// .set_processes([
6410 /// Process::default()/* use setters */,
6411 /// Process::default()/* use (different) setters */,
6412 /// ]);
6413 /// ```
6414 pub fn set_processes<T, V>(mut self, v: T) -> Self
6415 where
6416 T: std::iter::IntoIterator<Item = V>,
6417 V: std::convert::Into<crate::model::Process>,
6418 {
6419 use std::iter::Iterator;
6420 self.processes = v.into_iter().map(|i| i.into()).collect();
6421 self
6422 }
6423
6424 /// Sets the value of [contacts][crate::model::Finding::contacts].
6425 ///
6426 /// # Example
6427 /// ```ignore,no_run
6428 /// # use google_cloud_securitycenter_v2::model::Finding;
6429 /// use google_cloud_securitycenter_v2::model::ContactDetails;
6430 /// let x = Finding::new().set_contacts([
6431 /// ("key0", ContactDetails::default()/* use setters */),
6432 /// ("key1", ContactDetails::default()/* use (different) setters */),
6433 /// ]);
6434 /// ```
6435 pub fn set_contacts<T, K, V>(mut self, v: T) -> Self
6436 where
6437 T: std::iter::IntoIterator<Item = (K, V)>,
6438 K: std::convert::Into<std::string::String>,
6439 V: std::convert::Into<crate::model::ContactDetails>,
6440 {
6441 use std::iter::Iterator;
6442 self.contacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6443 self
6444 }
6445
6446 /// Sets the value of [compliances][crate::model::Finding::compliances].
6447 ///
6448 /// # Example
6449 /// ```ignore,no_run
6450 /// # use google_cloud_securitycenter_v2::model::Finding;
6451 /// use google_cloud_securitycenter_v2::model::Compliance;
6452 /// let x = Finding::new()
6453 /// .set_compliances([
6454 /// Compliance::default()/* use setters */,
6455 /// Compliance::default()/* use (different) setters */,
6456 /// ]);
6457 /// ```
6458 pub fn set_compliances<T, V>(mut self, v: T) -> Self
6459 where
6460 T: std::iter::IntoIterator<Item = V>,
6461 V: std::convert::Into<crate::model::Compliance>,
6462 {
6463 use std::iter::Iterator;
6464 self.compliances = v.into_iter().map(|i| i.into()).collect();
6465 self
6466 }
6467
6468 /// Sets the value of [parent_display_name][crate::model::Finding::parent_display_name].
6469 ///
6470 /// # Example
6471 /// ```ignore,no_run
6472 /// # use google_cloud_securitycenter_v2::model::Finding;
6473 /// let x = Finding::new().set_parent_display_name("example");
6474 /// ```
6475 pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
6476 mut self,
6477 v: T,
6478 ) -> Self {
6479 self.parent_display_name = v.into();
6480 self
6481 }
6482
6483 /// Sets the value of [description][crate::model::Finding::description].
6484 ///
6485 /// # Example
6486 /// ```ignore,no_run
6487 /// # use google_cloud_securitycenter_v2::model::Finding;
6488 /// let x = Finding::new().set_description("example");
6489 /// ```
6490 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6491 self.description = v.into();
6492 self
6493 }
6494
6495 /// Sets the value of [exfiltration][crate::model::Finding::exfiltration].
6496 ///
6497 /// # Example
6498 /// ```ignore,no_run
6499 /// # use google_cloud_securitycenter_v2::model::Finding;
6500 /// use google_cloud_securitycenter_v2::model::Exfiltration;
6501 /// let x = Finding::new().set_exfiltration(Exfiltration::default()/* use setters */);
6502 /// ```
6503 pub fn set_exfiltration<T>(mut self, v: T) -> Self
6504 where
6505 T: std::convert::Into<crate::model::Exfiltration>,
6506 {
6507 self.exfiltration = std::option::Option::Some(v.into());
6508 self
6509 }
6510
6511 /// Sets or clears the value of [exfiltration][crate::model::Finding::exfiltration].
6512 ///
6513 /// # Example
6514 /// ```ignore,no_run
6515 /// # use google_cloud_securitycenter_v2::model::Finding;
6516 /// use google_cloud_securitycenter_v2::model::Exfiltration;
6517 /// let x = Finding::new().set_or_clear_exfiltration(Some(Exfiltration::default()/* use setters */));
6518 /// let x = Finding::new().set_or_clear_exfiltration(None::<Exfiltration>);
6519 /// ```
6520 pub fn set_or_clear_exfiltration<T>(mut self, v: std::option::Option<T>) -> Self
6521 where
6522 T: std::convert::Into<crate::model::Exfiltration>,
6523 {
6524 self.exfiltration = v.map(|x| x.into());
6525 self
6526 }
6527
6528 /// Sets the value of [iam_bindings][crate::model::Finding::iam_bindings].
6529 ///
6530 /// # Example
6531 /// ```ignore,no_run
6532 /// # use google_cloud_securitycenter_v2::model::Finding;
6533 /// use google_cloud_securitycenter_v2::model::IamBinding;
6534 /// let x = Finding::new()
6535 /// .set_iam_bindings([
6536 /// IamBinding::default()/* use setters */,
6537 /// IamBinding::default()/* use (different) setters */,
6538 /// ]);
6539 /// ```
6540 pub fn set_iam_bindings<T, V>(mut self, v: T) -> Self
6541 where
6542 T: std::iter::IntoIterator<Item = V>,
6543 V: std::convert::Into<crate::model::IamBinding>,
6544 {
6545 use std::iter::Iterator;
6546 self.iam_bindings = v.into_iter().map(|i| i.into()).collect();
6547 self
6548 }
6549
6550 /// Sets the value of [next_steps][crate::model::Finding::next_steps].
6551 ///
6552 /// # Example
6553 /// ```ignore,no_run
6554 /// # use google_cloud_securitycenter_v2::model::Finding;
6555 /// let x = Finding::new().set_next_steps("example");
6556 /// ```
6557 pub fn set_next_steps<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6558 self.next_steps = v.into();
6559 self
6560 }
6561
6562 /// Sets the value of [module_name][crate::model::Finding::module_name].
6563 ///
6564 /// # Example
6565 /// ```ignore,no_run
6566 /// # use google_cloud_securitycenter_v2::model::Finding;
6567 /// let x = Finding::new().set_module_name("example");
6568 /// ```
6569 pub fn set_module_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6570 self.module_name = v.into();
6571 self
6572 }
6573
6574 /// Sets the value of [containers][crate::model::Finding::containers].
6575 ///
6576 /// # Example
6577 /// ```ignore,no_run
6578 /// # use google_cloud_securitycenter_v2::model::Finding;
6579 /// use google_cloud_securitycenter_v2::model::Container;
6580 /// let x = Finding::new()
6581 /// .set_containers([
6582 /// Container::default()/* use setters */,
6583 /// Container::default()/* use (different) setters */,
6584 /// ]);
6585 /// ```
6586 pub fn set_containers<T, V>(mut self, v: T) -> Self
6587 where
6588 T: std::iter::IntoIterator<Item = V>,
6589 V: std::convert::Into<crate::model::Container>,
6590 {
6591 use std::iter::Iterator;
6592 self.containers = v.into_iter().map(|i| i.into()).collect();
6593 self
6594 }
6595
6596 /// Sets the value of [kubernetes][crate::model::Finding::kubernetes].
6597 ///
6598 /// # Example
6599 /// ```ignore,no_run
6600 /// # use google_cloud_securitycenter_v2::model::Finding;
6601 /// use google_cloud_securitycenter_v2::model::Kubernetes;
6602 /// let x = Finding::new().set_kubernetes(Kubernetes::default()/* use setters */);
6603 /// ```
6604 pub fn set_kubernetes<T>(mut self, v: T) -> Self
6605 where
6606 T: std::convert::Into<crate::model::Kubernetes>,
6607 {
6608 self.kubernetes = std::option::Option::Some(v.into());
6609 self
6610 }
6611
6612 /// Sets or clears the value of [kubernetes][crate::model::Finding::kubernetes].
6613 ///
6614 /// # Example
6615 /// ```ignore,no_run
6616 /// # use google_cloud_securitycenter_v2::model::Finding;
6617 /// use google_cloud_securitycenter_v2::model::Kubernetes;
6618 /// let x = Finding::new().set_or_clear_kubernetes(Some(Kubernetes::default()/* use setters */));
6619 /// let x = Finding::new().set_or_clear_kubernetes(None::<Kubernetes>);
6620 /// ```
6621 pub fn set_or_clear_kubernetes<T>(mut self, v: std::option::Option<T>) -> Self
6622 where
6623 T: std::convert::Into<crate::model::Kubernetes>,
6624 {
6625 self.kubernetes = v.map(|x| x.into());
6626 self
6627 }
6628
6629 /// Sets the value of [database][crate::model::Finding::database].
6630 ///
6631 /// # Example
6632 /// ```ignore,no_run
6633 /// # use google_cloud_securitycenter_v2::model::Finding;
6634 /// use google_cloud_securitycenter_v2::model::Database;
6635 /// let x = Finding::new().set_database(Database::default()/* use setters */);
6636 /// ```
6637 pub fn set_database<T>(mut self, v: T) -> Self
6638 where
6639 T: std::convert::Into<crate::model::Database>,
6640 {
6641 self.database = std::option::Option::Some(v.into());
6642 self
6643 }
6644
6645 /// Sets or clears the value of [database][crate::model::Finding::database].
6646 ///
6647 /// # Example
6648 /// ```ignore,no_run
6649 /// # use google_cloud_securitycenter_v2::model::Finding;
6650 /// use google_cloud_securitycenter_v2::model::Database;
6651 /// let x = Finding::new().set_or_clear_database(Some(Database::default()/* use setters */));
6652 /// let x = Finding::new().set_or_clear_database(None::<Database>);
6653 /// ```
6654 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
6655 where
6656 T: std::convert::Into<crate::model::Database>,
6657 {
6658 self.database = v.map(|x| x.into());
6659 self
6660 }
6661
6662 /// Sets the value of [attack_exposure][crate::model::Finding::attack_exposure].
6663 ///
6664 /// # Example
6665 /// ```ignore,no_run
6666 /// # use google_cloud_securitycenter_v2::model::Finding;
6667 /// use google_cloud_securitycenter_v2::model::AttackExposure;
6668 /// let x = Finding::new().set_attack_exposure(AttackExposure::default()/* use setters */);
6669 /// ```
6670 pub fn set_attack_exposure<T>(mut self, v: T) -> Self
6671 where
6672 T: std::convert::Into<crate::model::AttackExposure>,
6673 {
6674 self.attack_exposure = std::option::Option::Some(v.into());
6675 self
6676 }
6677
6678 /// Sets or clears the value of [attack_exposure][crate::model::Finding::attack_exposure].
6679 ///
6680 /// # Example
6681 /// ```ignore,no_run
6682 /// # use google_cloud_securitycenter_v2::model::Finding;
6683 /// use google_cloud_securitycenter_v2::model::AttackExposure;
6684 /// let x = Finding::new().set_or_clear_attack_exposure(Some(AttackExposure::default()/* use setters */));
6685 /// let x = Finding::new().set_or_clear_attack_exposure(None::<AttackExposure>);
6686 /// ```
6687 pub fn set_or_clear_attack_exposure<T>(mut self, v: std::option::Option<T>) -> Self
6688 where
6689 T: std::convert::Into<crate::model::AttackExposure>,
6690 {
6691 self.attack_exposure = v.map(|x| x.into());
6692 self
6693 }
6694
6695 /// Sets the value of [files][crate::model::Finding::files].
6696 ///
6697 /// # Example
6698 /// ```ignore,no_run
6699 /// # use google_cloud_securitycenter_v2::model::Finding;
6700 /// use google_cloud_securitycenter_v2::model::File;
6701 /// let x = Finding::new()
6702 /// .set_files([
6703 /// File::default()/* use setters */,
6704 /// File::default()/* use (different) setters */,
6705 /// ]);
6706 /// ```
6707 pub fn set_files<T, V>(mut self, v: T) -> Self
6708 where
6709 T: std::iter::IntoIterator<Item = V>,
6710 V: std::convert::Into<crate::model::File>,
6711 {
6712 use std::iter::Iterator;
6713 self.files = v.into_iter().map(|i| i.into()).collect();
6714 self
6715 }
6716
6717 /// Sets the value of [cloud_dlp_inspection][crate::model::Finding::cloud_dlp_inspection].
6718 ///
6719 /// # Example
6720 /// ```ignore,no_run
6721 /// # use google_cloud_securitycenter_v2::model::Finding;
6722 /// use google_cloud_securitycenter_v2::model::CloudDlpInspection;
6723 /// let x = Finding::new().set_cloud_dlp_inspection(CloudDlpInspection::default()/* use setters */);
6724 /// ```
6725 pub fn set_cloud_dlp_inspection<T>(mut self, v: T) -> Self
6726 where
6727 T: std::convert::Into<crate::model::CloudDlpInspection>,
6728 {
6729 self.cloud_dlp_inspection = std::option::Option::Some(v.into());
6730 self
6731 }
6732
6733 /// Sets or clears the value of [cloud_dlp_inspection][crate::model::Finding::cloud_dlp_inspection].
6734 ///
6735 /// # Example
6736 /// ```ignore,no_run
6737 /// # use google_cloud_securitycenter_v2::model::Finding;
6738 /// use google_cloud_securitycenter_v2::model::CloudDlpInspection;
6739 /// let x = Finding::new().set_or_clear_cloud_dlp_inspection(Some(CloudDlpInspection::default()/* use setters */));
6740 /// let x = Finding::new().set_or_clear_cloud_dlp_inspection(None::<CloudDlpInspection>);
6741 /// ```
6742 pub fn set_or_clear_cloud_dlp_inspection<T>(mut self, v: std::option::Option<T>) -> Self
6743 where
6744 T: std::convert::Into<crate::model::CloudDlpInspection>,
6745 {
6746 self.cloud_dlp_inspection = v.map(|x| x.into());
6747 self
6748 }
6749
6750 /// Sets the value of [cloud_dlp_data_profile][crate::model::Finding::cloud_dlp_data_profile].
6751 ///
6752 /// # Example
6753 /// ```ignore,no_run
6754 /// # use google_cloud_securitycenter_v2::model::Finding;
6755 /// use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
6756 /// let x = Finding::new().set_cloud_dlp_data_profile(CloudDlpDataProfile::default()/* use setters */);
6757 /// ```
6758 pub fn set_cloud_dlp_data_profile<T>(mut self, v: T) -> Self
6759 where
6760 T: std::convert::Into<crate::model::CloudDlpDataProfile>,
6761 {
6762 self.cloud_dlp_data_profile = std::option::Option::Some(v.into());
6763 self
6764 }
6765
6766 /// Sets or clears the value of [cloud_dlp_data_profile][crate::model::Finding::cloud_dlp_data_profile].
6767 ///
6768 /// # Example
6769 /// ```ignore,no_run
6770 /// # use google_cloud_securitycenter_v2::model::Finding;
6771 /// use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
6772 /// let x = Finding::new().set_or_clear_cloud_dlp_data_profile(Some(CloudDlpDataProfile::default()/* use setters */));
6773 /// let x = Finding::new().set_or_clear_cloud_dlp_data_profile(None::<CloudDlpDataProfile>);
6774 /// ```
6775 pub fn set_or_clear_cloud_dlp_data_profile<T>(mut self, v: std::option::Option<T>) -> Self
6776 where
6777 T: std::convert::Into<crate::model::CloudDlpDataProfile>,
6778 {
6779 self.cloud_dlp_data_profile = v.map(|x| x.into());
6780 self
6781 }
6782
6783 /// Sets the value of [kernel_rootkit][crate::model::Finding::kernel_rootkit].
6784 ///
6785 /// # Example
6786 /// ```ignore,no_run
6787 /// # use google_cloud_securitycenter_v2::model::Finding;
6788 /// use google_cloud_securitycenter_v2::model::KernelRootkit;
6789 /// let x = Finding::new().set_kernel_rootkit(KernelRootkit::default()/* use setters */);
6790 /// ```
6791 pub fn set_kernel_rootkit<T>(mut self, v: T) -> Self
6792 where
6793 T: std::convert::Into<crate::model::KernelRootkit>,
6794 {
6795 self.kernel_rootkit = std::option::Option::Some(v.into());
6796 self
6797 }
6798
6799 /// Sets or clears the value of [kernel_rootkit][crate::model::Finding::kernel_rootkit].
6800 ///
6801 /// # Example
6802 /// ```ignore,no_run
6803 /// # use google_cloud_securitycenter_v2::model::Finding;
6804 /// use google_cloud_securitycenter_v2::model::KernelRootkit;
6805 /// let x = Finding::new().set_or_clear_kernel_rootkit(Some(KernelRootkit::default()/* use setters */));
6806 /// let x = Finding::new().set_or_clear_kernel_rootkit(None::<KernelRootkit>);
6807 /// ```
6808 pub fn set_or_clear_kernel_rootkit<T>(mut self, v: std::option::Option<T>) -> Self
6809 where
6810 T: std::convert::Into<crate::model::KernelRootkit>,
6811 {
6812 self.kernel_rootkit = v.map(|x| x.into());
6813 self
6814 }
6815
6816 /// Sets the value of [org_policies][crate::model::Finding::org_policies].
6817 ///
6818 /// # Example
6819 /// ```ignore,no_run
6820 /// # use google_cloud_securitycenter_v2::model::Finding;
6821 /// use google_cloud_securitycenter_v2::model::OrgPolicy;
6822 /// let x = Finding::new()
6823 /// .set_org_policies([
6824 /// OrgPolicy::default()/* use setters */,
6825 /// OrgPolicy::default()/* use (different) setters */,
6826 /// ]);
6827 /// ```
6828 pub fn set_org_policies<T, V>(mut self, v: T) -> Self
6829 where
6830 T: std::iter::IntoIterator<Item = V>,
6831 V: std::convert::Into<crate::model::OrgPolicy>,
6832 {
6833 use std::iter::Iterator;
6834 self.org_policies = v.into_iter().map(|i| i.into()).collect();
6835 self
6836 }
6837
6838 /// Sets the value of [job][crate::model::Finding::job].
6839 ///
6840 /// # Example
6841 /// ```ignore,no_run
6842 /// # use google_cloud_securitycenter_v2::model::Finding;
6843 /// use google_cloud_securitycenter_v2::model::Job;
6844 /// let x = Finding::new().set_job(Job::default()/* use setters */);
6845 /// ```
6846 pub fn set_job<T>(mut self, v: T) -> Self
6847 where
6848 T: std::convert::Into<crate::model::Job>,
6849 {
6850 self.job = std::option::Option::Some(v.into());
6851 self
6852 }
6853
6854 /// Sets or clears the value of [job][crate::model::Finding::job].
6855 ///
6856 /// # Example
6857 /// ```ignore,no_run
6858 /// # use google_cloud_securitycenter_v2::model::Finding;
6859 /// use google_cloud_securitycenter_v2::model::Job;
6860 /// let x = Finding::new().set_or_clear_job(Some(Job::default()/* use setters */));
6861 /// let x = Finding::new().set_or_clear_job(None::<Job>);
6862 /// ```
6863 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
6864 where
6865 T: std::convert::Into<crate::model::Job>,
6866 {
6867 self.job = v.map(|x| x.into());
6868 self
6869 }
6870
6871 /// Sets the value of [application][crate::model::Finding::application].
6872 ///
6873 /// # Example
6874 /// ```ignore,no_run
6875 /// # use google_cloud_securitycenter_v2::model::Finding;
6876 /// use google_cloud_securitycenter_v2::model::Application;
6877 /// let x = Finding::new().set_application(Application::default()/* use setters */);
6878 /// ```
6879 pub fn set_application<T>(mut self, v: T) -> Self
6880 where
6881 T: std::convert::Into<crate::model::Application>,
6882 {
6883 self.application = std::option::Option::Some(v.into());
6884 self
6885 }
6886
6887 /// Sets or clears the value of [application][crate::model::Finding::application].
6888 ///
6889 /// # Example
6890 /// ```ignore,no_run
6891 /// # use google_cloud_securitycenter_v2::model::Finding;
6892 /// use google_cloud_securitycenter_v2::model::Application;
6893 /// let x = Finding::new().set_or_clear_application(Some(Application::default()/* use setters */));
6894 /// let x = Finding::new().set_or_clear_application(None::<Application>);
6895 /// ```
6896 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
6897 where
6898 T: std::convert::Into<crate::model::Application>,
6899 {
6900 self.application = v.map(|x| x.into());
6901 self
6902 }
6903
6904 /// Sets the value of [ip_rules][crate::model::Finding::ip_rules].
6905 ///
6906 /// # Example
6907 /// ```ignore,no_run
6908 /// # use google_cloud_securitycenter_v2::model::Finding;
6909 /// use google_cloud_securitycenter_v2::model::IpRules;
6910 /// let x = Finding::new().set_ip_rules(IpRules::default()/* use setters */);
6911 /// ```
6912 pub fn set_ip_rules<T>(mut self, v: T) -> Self
6913 where
6914 T: std::convert::Into<crate::model::IpRules>,
6915 {
6916 self.ip_rules = std::option::Option::Some(v.into());
6917 self
6918 }
6919
6920 /// Sets or clears the value of [ip_rules][crate::model::Finding::ip_rules].
6921 ///
6922 /// # Example
6923 /// ```ignore,no_run
6924 /// # use google_cloud_securitycenter_v2::model::Finding;
6925 /// use google_cloud_securitycenter_v2::model::IpRules;
6926 /// let x = Finding::new().set_or_clear_ip_rules(Some(IpRules::default()/* use setters */));
6927 /// let x = Finding::new().set_or_clear_ip_rules(None::<IpRules>);
6928 /// ```
6929 pub fn set_or_clear_ip_rules<T>(mut self, v: std::option::Option<T>) -> Self
6930 where
6931 T: std::convert::Into<crate::model::IpRules>,
6932 {
6933 self.ip_rules = v.map(|x| x.into());
6934 self
6935 }
6936
6937 /// Sets the value of [backup_disaster_recovery][crate::model::Finding::backup_disaster_recovery].
6938 ///
6939 /// # Example
6940 /// ```ignore,no_run
6941 /// # use google_cloud_securitycenter_v2::model::Finding;
6942 /// use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
6943 /// let x = Finding::new().set_backup_disaster_recovery(BackupDisasterRecovery::default()/* use setters */);
6944 /// ```
6945 pub fn set_backup_disaster_recovery<T>(mut self, v: T) -> Self
6946 where
6947 T: std::convert::Into<crate::model::BackupDisasterRecovery>,
6948 {
6949 self.backup_disaster_recovery = std::option::Option::Some(v.into());
6950 self
6951 }
6952
6953 /// Sets or clears the value of [backup_disaster_recovery][crate::model::Finding::backup_disaster_recovery].
6954 ///
6955 /// # Example
6956 /// ```ignore,no_run
6957 /// # use google_cloud_securitycenter_v2::model::Finding;
6958 /// use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
6959 /// let x = Finding::new().set_or_clear_backup_disaster_recovery(Some(BackupDisasterRecovery::default()/* use setters */));
6960 /// let x = Finding::new().set_or_clear_backup_disaster_recovery(None::<BackupDisasterRecovery>);
6961 /// ```
6962 pub fn set_or_clear_backup_disaster_recovery<T>(mut self, v: std::option::Option<T>) -> Self
6963 where
6964 T: std::convert::Into<crate::model::BackupDisasterRecovery>,
6965 {
6966 self.backup_disaster_recovery = v.map(|x| x.into());
6967 self
6968 }
6969
6970 /// Sets the value of [security_posture][crate::model::Finding::security_posture].
6971 ///
6972 /// # Example
6973 /// ```ignore,no_run
6974 /// # use google_cloud_securitycenter_v2::model::Finding;
6975 /// use google_cloud_securitycenter_v2::model::SecurityPosture;
6976 /// let x = Finding::new().set_security_posture(SecurityPosture::default()/* use setters */);
6977 /// ```
6978 pub fn set_security_posture<T>(mut self, v: T) -> Self
6979 where
6980 T: std::convert::Into<crate::model::SecurityPosture>,
6981 {
6982 self.security_posture = std::option::Option::Some(v.into());
6983 self
6984 }
6985
6986 /// Sets or clears the value of [security_posture][crate::model::Finding::security_posture].
6987 ///
6988 /// # Example
6989 /// ```ignore,no_run
6990 /// # use google_cloud_securitycenter_v2::model::Finding;
6991 /// use google_cloud_securitycenter_v2::model::SecurityPosture;
6992 /// let x = Finding::new().set_or_clear_security_posture(Some(SecurityPosture::default()/* use setters */));
6993 /// let x = Finding::new().set_or_clear_security_posture(None::<SecurityPosture>);
6994 /// ```
6995 pub fn set_or_clear_security_posture<T>(mut self, v: std::option::Option<T>) -> Self
6996 where
6997 T: std::convert::Into<crate::model::SecurityPosture>,
6998 {
6999 self.security_posture = v.map(|x| x.into());
7000 self
7001 }
7002
7003 /// Sets the value of [log_entries][crate::model::Finding::log_entries].
7004 ///
7005 /// # Example
7006 /// ```ignore,no_run
7007 /// # use google_cloud_securitycenter_v2::model::Finding;
7008 /// use google_cloud_securitycenter_v2::model::LogEntry;
7009 /// let x = Finding::new()
7010 /// .set_log_entries([
7011 /// LogEntry::default()/* use setters */,
7012 /// LogEntry::default()/* use (different) setters */,
7013 /// ]);
7014 /// ```
7015 pub fn set_log_entries<T, V>(mut self, v: T) -> Self
7016 where
7017 T: std::iter::IntoIterator<Item = V>,
7018 V: std::convert::Into<crate::model::LogEntry>,
7019 {
7020 use std::iter::Iterator;
7021 self.log_entries = v.into_iter().map(|i| i.into()).collect();
7022 self
7023 }
7024
7025 /// Sets the value of [load_balancers][crate::model::Finding::load_balancers].
7026 ///
7027 /// # Example
7028 /// ```ignore,no_run
7029 /// # use google_cloud_securitycenter_v2::model::Finding;
7030 /// use google_cloud_securitycenter_v2::model::LoadBalancer;
7031 /// let x = Finding::new()
7032 /// .set_load_balancers([
7033 /// LoadBalancer::default()/* use setters */,
7034 /// LoadBalancer::default()/* use (different) setters */,
7035 /// ]);
7036 /// ```
7037 pub fn set_load_balancers<T, V>(mut self, v: T) -> Self
7038 where
7039 T: std::iter::IntoIterator<Item = V>,
7040 V: std::convert::Into<crate::model::LoadBalancer>,
7041 {
7042 use std::iter::Iterator;
7043 self.load_balancers = v.into_iter().map(|i| i.into()).collect();
7044 self
7045 }
7046
7047 /// Sets the value of [cloud_armor][crate::model::Finding::cloud_armor].
7048 ///
7049 /// # Example
7050 /// ```ignore,no_run
7051 /// # use google_cloud_securitycenter_v2::model::Finding;
7052 /// use google_cloud_securitycenter_v2::model::CloudArmor;
7053 /// let x = Finding::new().set_cloud_armor(CloudArmor::default()/* use setters */);
7054 /// ```
7055 pub fn set_cloud_armor<T>(mut self, v: T) -> Self
7056 where
7057 T: std::convert::Into<crate::model::CloudArmor>,
7058 {
7059 self.cloud_armor = std::option::Option::Some(v.into());
7060 self
7061 }
7062
7063 /// Sets or clears the value of [cloud_armor][crate::model::Finding::cloud_armor].
7064 ///
7065 /// # Example
7066 /// ```ignore,no_run
7067 /// # use google_cloud_securitycenter_v2::model::Finding;
7068 /// use google_cloud_securitycenter_v2::model::CloudArmor;
7069 /// let x = Finding::new().set_or_clear_cloud_armor(Some(CloudArmor::default()/* use setters */));
7070 /// let x = Finding::new().set_or_clear_cloud_armor(None::<CloudArmor>);
7071 /// ```
7072 pub fn set_or_clear_cloud_armor<T>(mut self, v: std::option::Option<T>) -> Self
7073 where
7074 T: std::convert::Into<crate::model::CloudArmor>,
7075 {
7076 self.cloud_armor = v.map(|x| x.into());
7077 self
7078 }
7079
7080 /// Sets the value of [notebook][crate::model::Finding::notebook].
7081 ///
7082 /// # Example
7083 /// ```ignore,no_run
7084 /// # use google_cloud_securitycenter_v2::model::Finding;
7085 /// use google_cloud_securitycenter_v2::model::Notebook;
7086 /// let x = Finding::new().set_notebook(Notebook::default()/* use setters */);
7087 /// ```
7088 pub fn set_notebook<T>(mut self, v: T) -> Self
7089 where
7090 T: std::convert::Into<crate::model::Notebook>,
7091 {
7092 self.notebook = std::option::Option::Some(v.into());
7093 self
7094 }
7095
7096 /// Sets or clears the value of [notebook][crate::model::Finding::notebook].
7097 ///
7098 /// # Example
7099 /// ```ignore,no_run
7100 /// # use google_cloud_securitycenter_v2::model::Finding;
7101 /// use google_cloud_securitycenter_v2::model::Notebook;
7102 /// let x = Finding::new().set_or_clear_notebook(Some(Notebook::default()/* use setters */));
7103 /// let x = Finding::new().set_or_clear_notebook(None::<Notebook>);
7104 /// ```
7105 pub fn set_or_clear_notebook<T>(mut self, v: std::option::Option<T>) -> Self
7106 where
7107 T: std::convert::Into<crate::model::Notebook>,
7108 {
7109 self.notebook = v.map(|x| x.into());
7110 self
7111 }
7112
7113 /// Sets the value of [toxic_combination][crate::model::Finding::toxic_combination].
7114 ///
7115 /// # Example
7116 /// ```ignore,no_run
7117 /// # use google_cloud_securitycenter_v2::model::Finding;
7118 /// use google_cloud_securitycenter_v2::model::ToxicCombination;
7119 /// let x = Finding::new().set_toxic_combination(ToxicCombination::default()/* use setters */);
7120 /// ```
7121 pub fn set_toxic_combination<T>(mut self, v: T) -> Self
7122 where
7123 T: std::convert::Into<crate::model::ToxicCombination>,
7124 {
7125 self.toxic_combination = std::option::Option::Some(v.into());
7126 self
7127 }
7128
7129 /// Sets or clears the value of [toxic_combination][crate::model::Finding::toxic_combination].
7130 ///
7131 /// # Example
7132 /// ```ignore,no_run
7133 /// # use google_cloud_securitycenter_v2::model::Finding;
7134 /// use google_cloud_securitycenter_v2::model::ToxicCombination;
7135 /// let x = Finding::new().set_or_clear_toxic_combination(Some(ToxicCombination::default()/* use setters */));
7136 /// let x = Finding::new().set_or_clear_toxic_combination(None::<ToxicCombination>);
7137 /// ```
7138 pub fn set_or_clear_toxic_combination<T>(mut self, v: std::option::Option<T>) -> Self
7139 where
7140 T: std::convert::Into<crate::model::ToxicCombination>,
7141 {
7142 self.toxic_combination = v.map(|x| x.into());
7143 self
7144 }
7145
7146 /// Sets the value of [group_memberships][crate::model::Finding::group_memberships].
7147 ///
7148 /// # Example
7149 /// ```ignore,no_run
7150 /// # use google_cloud_securitycenter_v2::model::Finding;
7151 /// use google_cloud_securitycenter_v2::model::GroupMembership;
7152 /// let x = Finding::new()
7153 /// .set_group_memberships([
7154 /// GroupMembership::default()/* use setters */,
7155 /// GroupMembership::default()/* use (different) setters */,
7156 /// ]);
7157 /// ```
7158 pub fn set_group_memberships<T, V>(mut self, v: T) -> Self
7159 where
7160 T: std::iter::IntoIterator<Item = V>,
7161 V: std::convert::Into<crate::model::GroupMembership>,
7162 {
7163 use std::iter::Iterator;
7164 self.group_memberships = v.into_iter().map(|i| i.into()).collect();
7165 self
7166 }
7167
7168 /// Sets the value of [disk][crate::model::Finding::disk].
7169 ///
7170 /// # Example
7171 /// ```ignore,no_run
7172 /// # use google_cloud_securitycenter_v2::model::Finding;
7173 /// use google_cloud_securitycenter_v2::model::Disk;
7174 /// let x = Finding::new().set_disk(Disk::default()/* use setters */);
7175 /// ```
7176 pub fn set_disk<T>(mut self, v: T) -> Self
7177 where
7178 T: std::convert::Into<crate::model::Disk>,
7179 {
7180 self.disk = std::option::Option::Some(v.into());
7181 self
7182 }
7183
7184 /// Sets or clears the value of [disk][crate::model::Finding::disk].
7185 ///
7186 /// # Example
7187 /// ```ignore,no_run
7188 /// # use google_cloud_securitycenter_v2::model::Finding;
7189 /// use google_cloud_securitycenter_v2::model::Disk;
7190 /// let x = Finding::new().set_or_clear_disk(Some(Disk::default()/* use setters */));
7191 /// let x = Finding::new().set_or_clear_disk(None::<Disk>);
7192 /// ```
7193 pub fn set_or_clear_disk<T>(mut self, v: std::option::Option<T>) -> Self
7194 where
7195 T: std::convert::Into<crate::model::Disk>,
7196 {
7197 self.disk = v.map(|x| x.into());
7198 self
7199 }
7200
7201 /// Sets the value of [data_access_events][crate::model::Finding::data_access_events].
7202 ///
7203 /// # Example
7204 /// ```ignore,no_run
7205 /// # use google_cloud_securitycenter_v2::model::Finding;
7206 /// use google_cloud_securitycenter_v2::model::DataAccessEvent;
7207 /// let x = Finding::new()
7208 /// .set_data_access_events([
7209 /// DataAccessEvent::default()/* use setters */,
7210 /// DataAccessEvent::default()/* use (different) setters */,
7211 /// ]);
7212 /// ```
7213 pub fn set_data_access_events<T, V>(mut self, v: T) -> Self
7214 where
7215 T: std::iter::IntoIterator<Item = V>,
7216 V: std::convert::Into<crate::model::DataAccessEvent>,
7217 {
7218 use std::iter::Iterator;
7219 self.data_access_events = v.into_iter().map(|i| i.into()).collect();
7220 self
7221 }
7222
7223 /// Sets the value of [data_flow_events][crate::model::Finding::data_flow_events].
7224 ///
7225 /// # Example
7226 /// ```ignore,no_run
7227 /// # use google_cloud_securitycenter_v2::model::Finding;
7228 /// use google_cloud_securitycenter_v2::model::DataFlowEvent;
7229 /// let x = Finding::new()
7230 /// .set_data_flow_events([
7231 /// DataFlowEvent::default()/* use setters */,
7232 /// DataFlowEvent::default()/* use (different) setters */,
7233 /// ]);
7234 /// ```
7235 pub fn set_data_flow_events<T, V>(mut self, v: T) -> Self
7236 where
7237 T: std::iter::IntoIterator<Item = V>,
7238 V: std::convert::Into<crate::model::DataFlowEvent>,
7239 {
7240 use std::iter::Iterator;
7241 self.data_flow_events = v.into_iter().map(|i| i.into()).collect();
7242 self
7243 }
7244
7245 /// Sets the value of [networks][crate::model::Finding::networks].
7246 ///
7247 /// # Example
7248 /// ```ignore,no_run
7249 /// # use google_cloud_securitycenter_v2::model::Finding;
7250 /// use google_cloud_securitycenter_v2::model::Network;
7251 /// let x = Finding::new()
7252 /// .set_networks([
7253 /// Network::default()/* use setters */,
7254 /// Network::default()/* use (different) setters */,
7255 /// ]);
7256 /// ```
7257 pub fn set_networks<T, V>(mut self, v: T) -> Self
7258 where
7259 T: std::iter::IntoIterator<Item = V>,
7260 V: std::convert::Into<crate::model::Network>,
7261 {
7262 use std::iter::Iterator;
7263 self.networks = v.into_iter().map(|i| i.into()).collect();
7264 self
7265 }
7266
7267 /// Sets the value of [data_retention_deletion_events][crate::model::Finding::data_retention_deletion_events].
7268 ///
7269 /// # Example
7270 /// ```ignore,no_run
7271 /// # use google_cloud_securitycenter_v2::model::Finding;
7272 /// use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
7273 /// let x = Finding::new()
7274 /// .set_data_retention_deletion_events([
7275 /// DataRetentionDeletionEvent::default()/* use setters */,
7276 /// DataRetentionDeletionEvent::default()/* use (different) setters */,
7277 /// ]);
7278 /// ```
7279 pub fn set_data_retention_deletion_events<T, V>(mut self, v: T) -> Self
7280 where
7281 T: std::iter::IntoIterator<Item = V>,
7282 V: std::convert::Into<crate::model::DataRetentionDeletionEvent>,
7283 {
7284 use std::iter::Iterator;
7285 self.data_retention_deletion_events = v.into_iter().map(|i| i.into()).collect();
7286 self
7287 }
7288
7289 /// Sets the value of [affected_resources][crate::model::Finding::affected_resources].
7290 ///
7291 /// # Example
7292 /// ```ignore,no_run
7293 /// # use google_cloud_securitycenter_v2::model::Finding;
7294 /// use google_cloud_securitycenter_v2::model::AffectedResources;
7295 /// let x = Finding::new().set_affected_resources(AffectedResources::default()/* use setters */);
7296 /// ```
7297 pub fn set_affected_resources<T>(mut self, v: T) -> Self
7298 where
7299 T: std::convert::Into<crate::model::AffectedResources>,
7300 {
7301 self.affected_resources = std::option::Option::Some(v.into());
7302 self
7303 }
7304
7305 /// Sets or clears the value of [affected_resources][crate::model::Finding::affected_resources].
7306 ///
7307 /// # Example
7308 /// ```ignore,no_run
7309 /// # use google_cloud_securitycenter_v2::model::Finding;
7310 /// use google_cloud_securitycenter_v2::model::AffectedResources;
7311 /// let x = Finding::new().set_or_clear_affected_resources(Some(AffectedResources::default()/* use setters */));
7312 /// let x = Finding::new().set_or_clear_affected_resources(None::<AffectedResources>);
7313 /// ```
7314 pub fn set_or_clear_affected_resources<T>(mut self, v: std::option::Option<T>) -> Self
7315 where
7316 T: std::convert::Into<crate::model::AffectedResources>,
7317 {
7318 self.affected_resources = v.map(|x| x.into());
7319 self
7320 }
7321
7322 /// Sets the value of [ai_model][crate::model::Finding::ai_model].
7323 ///
7324 /// # Example
7325 /// ```ignore,no_run
7326 /// # use google_cloud_securitycenter_v2::model::Finding;
7327 /// use google_cloud_securitycenter_v2::model::AiModel;
7328 /// let x = Finding::new().set_ai_model(AiModel::default()/* use setters */);
7329 /// ```
7330 pub fn set_ai_model<T>(mut self, v: T) -> Self
7331 where
7332 T: std::convert::Into<crate::model::AiModel>,
7333 {
7334 self.ai_model = std::option::Option::Some(v.into());
7335 self
7336 }
7337
7338 /// Sets or clears the value of [ai_model][crate::model::Finding::ai_model].
7339 ///
7340 /// # Example
7341 /// ```ignore,no_run
7342 /// # use google_cloud_securitycenter_v2::model::Finding;
7343 /// use google_cloud_securitycenter_v2::model::AiModel;
7344 /// let x = Finding::new().set_or_clear_ai_model(Some(AiModel::default()/* use setters */));
7345 /// let x = Finding::new().set_or_clear_ai_model(None::<AiModel>);
7346 /// ```
7347 pub fn set_or_clear_ai_model<T>(mut self, v: std::option::Option<T>) -> Self
7348 where
7349 T: std::convert::Into<crate::model::AiModel>,
7350 {
7351 self.ai_model = v.map(|x| x.into());
7352 self
7353 }
7354
7355 /// Sets the value of [chokepoint][crate::model::Finding::chokepoint].
7356 ///
7357 /// # Example
7358 /// ```ignore,no_run
7359 /// # use google_cloud_securitycenter_v2::model::Finding;
7360 /// use google_cloud_securitycenter_v2::model::Chokepoint;
7361 /// let x = Finding::new().set_chokepoint(Chokepoint::default()/* use setters */);
7362 /// ```
7363 pub fn set_chokepoint<T>(mut self, v: T) -> Self
7364 where
7365 T: std::convert::Into<crate::model::Chokepoint>,
7366 {
7367 self.chokepoint = std::option::Option::Some(v.into());
7368 self
7369 }
7370
7371 /// Sets or clears the value of [chokepoint][crate::model::Finding::chokepoint].
7372 ///
7373 /// # Example
7374 /// ```ignore,no_run
7375 /// # use google_cloud_securitycenter_v2::model::Finding;
7376 /// use google_cloud_securitycenter_v2::model::Chokepoint;
7377 /// let x = Finding::new().set_or_clear_chokepoint(Some(Chokepoint::default()/* use setters */));
7378 /// let x = Finding::new().set_or_clear_chokepoint(None::<Chokepoint>);
7379 /// ```
7380 pub fn set_or_clear_chokepoint<T>(mut self, v: std::option::Option<T>) -> Self
7381 where
7382 T: std::convert::Into<crate::model::Chokepoint>,
7383 {
7384 self.chokepoint = v.map(|x| x.into());
7385 self
7386 }
7387
7388 /// Sets the value of [vertex_ai][crate::model::Finding::vertex_ai].
7389 ///
7390 /// # Example
7391 /// ```ignore,no_run
7392 /// # use google_cloud_securitycenter_v2::model::Finding;
7393 /// use google_cloud_securitycenter_v2::model::VertexAi;
7394 /// let x = Finding::new().set_vertex_ai(VertexAi::default()/* use setters */);
7395 /// ```
7396 pub fn set_vertex_ai<T>(mut self, v: T) -> Self
7397 where
7398 T: std::convert::Into<crate::model::VertexAi>,
7399 {
7400 self.vertex_ai = std::option::Option::Some(v.into());
7401 self
7402 }
7403
7404 /// Sets or clears the value of [vertex_ai][crate::model::Finding::vertex_ai].
7405 ///
7406 /// # Example
7407 /// ```ignore,no_run
7408 /// # use google_cloud_securitycenter_v2::model::Finding;
7409 /// use google_cloud_securitycenter_v2::model::VertexAi;
7410 /// let x = Finding::new().set_or_clear_vertex_ai(Some(VertexAi::default()/* use setters */));
7411 /// let x = Finding::new().set_or_clear_vertex_ai(None::<VertexAi>);
7412 /// ```
7413 pub fn set_or_clear_vertex_ai<T>(mut self, v: std::option::Option<T>) -> Self
7414 where
7415 T: std::convert::Into<crate::model::VertexAi>,
7416 {
7417 self.vertex_ai = v.map(|x| x.into());
7418 self
7419 }
7420}
7421
7422impl wkt::message::Message for Finding {
7423 fn typename() -> &'static str {
7424 "type.googleapis.com/google.cloud.securitycenter.v2.Finding"
7425 }
7426}
7427
7428/// Defines additional types related to [Finding].
7429pub mod finding {
7430 #[allow(unused_imports)]
7431 use super::*;
7432
7433 /// Mute information about the finding, including whether the finding has a
7434 /// static mute or any matching dynamic mute rules.
7435 #[derive(Clone, Default, PartialEq)]
7436 #[non_exhaustive]
7437 pub struct MuteInfo {
7438 /// If set, the static mute applied to this finding. Static mutes override
7439 /// dynamic mutes. If unset, there is no static mute.
7440 pub static_mute: std::option::Option<crate::model::finding::mute_info::StaticMute>,
7441
7442 /// The list of dynamic mute rules that currently match the finding.
7443 pub dynamic_mute_records:
7444 std::vec::Vec<crate::model::finding::mute_info::DynamicMuteRecord>,
7445
7446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7447 }
7448
7449 impl MuteInfo {
7450 /// Creates a new default instance.
7451 pub fn new() -> Self {
7452 std::default::Default::default()
7453 }
7454
7455 /// Sets the value of [static_mute][crate::model::finding::MuteInfo::static_mute].
7456 ///
7457 /// # Example
7458 /// ```ignore,no_run
7459 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7460 /// use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7461 /// let x = MuteInfo::new().set_static_mute(StaticMute::default()/* use setters */);
7462 /// ```
7463 pub fn set_static_mute<T>(mut self, v: T) -> Self
7464 where
7465 T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
7466 {
7467 self.static_mute = std::option::Option::Some(v.into());
7468 self
7469 }
7470
7471 /// Sets or clears the value of [static_mute][crate::model::finding::MuteInfo::static_mute].
7472 ///
7473 /// # Example
7474 /// ```ignore,no_run
7475 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7476 /// use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7477 /// let x = MuteInfo::new().set_or_clear_static_mute(Some(StaticMute::default()/* use setters */));
7478 /// let x = MuteInfo::new().set_or_clear_static_mute(None::<StaticMute>);
7479 /// ```
7480 pub fn set_or_clear_static_mute<T>(mut self, v: std::option::Option<T>) -> Self
7481 where
7482 T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
7483 {
7484 self.static_mute = v.map(|x| x.into());
7485 self
7486 }
7487
7488 /// Sets the value of [dynamic_mute_records][crate::model::finding::MuteInfo::dynamic_mute_records].
7489 ///
7490 /// # Example
7491 /// ```ignore,no_run
7492 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7493 /// use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7494 /// let x = MuteInfo::new()
7495 /// .set_dynamic_mute_records([
7496 /// DynamicMuteRecord::default()/* use setters */,
7497 /// DynamicMuteRecord::default()/* use (different) setters */,
7498 /// ]);
7499 /// ```
7500 pub fn set_dynamic_mute_records<T, V>(mut self, v: T) -> Self
7501 where
7502 T: std::iter::IntoIterator<Item = V>,
7503 V: std::convert::Into<crate::model::finding::mute_info::DynamicMuteRecord>,
7504 {
7505 use std::iter::Iterator;
7506 self.dynamic_mute_records = v.into_iter().map(|i| i.into()).collect();
7507 self
7508 }
7509 }
7510
7511 impl wkt::message::Message for MuteInfo {
7512 fn typename() -> &'static str {
7513 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo"
7514 }
7515 }
7516
7517 /// Defines additional types related to [MuteInfo].
7518 pub mod mute_info {
7519 #[allow(unused_imports)]
7520 use super::*;
7521
7522 /// Information about the static mute state. A static mute state overrides
7523 /// any dynamic mute rules that apply to this finding. The static mute state
7524 /// can be set by a static mute rule or by muting the finding directly.
7525 #[derive(Clone, Default, PartialEq)]
7526 #[non_exhaustive]
7527 pub struct StaticMute {
7528 /// The static mute state. If the value is `MUTED` or `UNMUTED`, then the
7529 /// finding's overall mute state will have the same value.
7530 pub state: crate::model::finding::Mute,
7531
7532 /// When the static mute was applied.
7533 pub apply_time: std::option::Option<wkt::Timestamp>,
7534
7535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7536 }
7537
7538 impl StaticMute {
7539 /// Creates a new default instance.
7540 pub fn new() -> Self {
7541 std::default::Default::default()
7542 }
7543
7544 /// Sets the value of [state][crate::model::finding::mute_info::StaticMute::state].
7545 ///
7546 /// # Example
7547 /// ```ignore,no_run
7548 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7549 /// use google_cloud_securitycenter_v2::model::finding::Mute;
7550 /// let x0 = StaticMute::new().set_state(Mute::Muted);
7551 /// let x1 = StaticMute::new().set_state(Mute::Unmuted);
7552 /// let x2 = StaticMute::new().set_state(Mute::Undefined);
7553 /// ```
7554 pub fn set_state<T: std::convert::Into<crate::model::finding::Mute>>(
7555 mut self,
7556 v: T,
7557 ) -> Self {
7558 self.state = v.into();
7559 self
7560 }
7561
7562 /// Sets the value of [apply_time][crate::model::finding::mute_info::StaticMute::apply_time].
7563 ///
7564 /// # Example
7565 /// ```ignore,no_run
7566 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7567 /// use wkt::Timestamp;
7568 /// let x = StaticMute::new().set_apply_time(Timestamp::default()/* use setters */);
7569 /// ```
7570 pub fn set_apply_time<T>(mut self, v: T) -> Self
7571 where
7572 T: std::convert::Into<wkt::Timestamp>,
7573 {
7574 self.apply_time = std::option::Option::Some(v.into());
7575 self
7576 }
7577
7578 /// Sets or clears the value of [apply_time][crate::model::finding::mute_info::StaticMute::apply_time].
7579 ///
7580 /// # Example
7581 /// ```ignore,no_run
7582 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7583 /// use wkt::Timestamp;
7584 /// let x = StaticMute::new().set_or_clear_apply_time(Some(Timestamp::default()/* use setters */));
7585 /// let x = StaticMute::new().set_or_clear_apply_time(None::<Timestamp>);
7586 /// ```
7587 pub fn set_or_clear_apply_time<T>(mut self, v: std::option::Option<T>) -> Self
7588 where
7589 T: std::convert::Into<wkt::Timestamp>,
7590 {
7591 self.apply_time = v.map(|x| x.into());
7592 self
7593 }
7594 }
7595
7596 impl wkt::message::Message for StaticMute {
7597 fn typename() -> &'static str {
7598 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute"
7599 }
7600 }
7601
7602 /// The record of a dynamic mute rule that matches the finding.
7603 #[derive(Clone, Default, PartialEq)]
7604 #[non_exhaustive]
7605 pub struct DynamicMuteRecord {
7606 /// The relative resource name of the mute rule, represented by a mute
7607 /// config, that created this record, for example
7608 /// `organizations/123/muteConfigs/mymuteconfig` or
7609 /// `organizations/123/locations/global/muteConfigs/mymuteconfig`.
7610 pub mute_config: std::string::String,
7611
7612 /// When the dynamic mute rule first matched the finding.
7613 pub match_time: std::option::Option<wkt::Timestamp>,
7614
7615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7616 }
7617
7618 impl DynamicMuteRecord {
7619 /// Creates a new default instance.
7620 pub fn new() -> Self {
7621 std::default::Default::default()
7622 }
7623
7624 /// Sets the value of [mute_config][crate::model::finding::mute_info::DynamicMuteRecord::mute_config].
7625 ///
7626 /// # Example
7627 /// ```ignore,no_run
7628 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7629 /// let x = DynamicMuteRecord::new().set_mute_config("example");
7630 /// ```
7631 pub fn set_mute_config<T: std::convert::Into<std::string::String>>(
7632 mut self,
7633 v: T,
7634 ) -> Self {
7635 self.mute_config = v.into();
7636 self
7637 }
7638
7639 /// Sets the value of [match_time][crate::model::finding::mute_info::DynamicMuteRecord::match_time].
7640 ///
7641 /// # Example
7642 /// ```ignore,no_run
7643 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7644 /// use wkt::Timestamp;
7645 /// let x = DynamicMuteRecord::new().set_match_time(Timestamp::default()/* use setters */);
7646 /// ```
7647 pub fn set_match_time<T>(mut self, v: T) -> Self
7648 where
7649 T: std::convert::Into<wkt::Timestamp>,
7650 {
7651 self.match_time = std::option::Option::Some(v.into());
7652 self
7653 }
7654
7655 /// Sets or clears the value of [match_time][crate::model::finding::mute_info::DynamicMuteRecord::match_time].
7656 ///
7657 /// # Example
7658 /// ```ignore,no_run
7659 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7660 /// use wkt::Timestamp;
7661 /// let x = DynamicMuteRecord::new().set_or_clear_match_time(Some(Timestamp::default()/* use setters */));
7662 /// let x = DynamicMuteRecord::new().set_or_clear_match_time(None::<Timestamp>);
7663 /// ```
7664 pub fn set_or_clear_match_time<T>(mut self, v: std::option::Option<T>) -> Self
7665 where
7666 T: std::convert::Into<wkt::Timestamp>,
7667 {
7668 self.match_time = v.map(|x| x.into());
7669 self
7670 }
7671 }
7672
7673 impl wkt::message::Message for DynamicMuteRecord {
7674 fn typename() -> &'static str {
7675 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord"
7676 }
7677 }
7678 }
7679
7680 /// The state of the finding.
7681 ///
7682 /// # Working with unknown values
7683 ///
7684 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7685 /// additional enum variants at any time. Adding new variants is not considered
7686 /// a breaking change. Applications should write their code in anticipation of:
7687 ///
7688 /// - New values appearing in future releases of the client library, **and**
7689 /// - New values received dynamically, without application changes.
7690 ///
7691 /// Please consult the [Working with enums] section in the user guide for some
7692 /// guidelines.
7693 ///
7694 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7695 #[derive(Clone, Debug, PartialEq)]
7696 #[non_exhaustive]
7697 pub enum State {
7698 /// Unspecified state.
7699 Unspecified,
7700 /// The finding requires attention and has not been addressed yet.
7701 Active,
7702 /// The finding has been fixed, triaged as a non-issue or otherwise addressed
7703 /// and is no longer active.
7704 Inactive,
7705 /// If set, the enum was initialized with an unknown value.
7706 ///
7707 /// Applications can examine the value using [State::value] or
7708 /// [State::name].
7709 UnknownValue(state::UnknownValue),
7710 }
7711
7712 #[doc(hidden)]
7713 pub mod state {
7714 #[allow(unused_imports)]
7715 use super::*;
7716 #[derive(Clone, Debug, PartialEq)]
7717 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7718 }
7719
7720 impl State {
7721 /// Gets the enum value.
7722 ///
7723 /// Returns `None` if the enum contains an unknown value deserialized from
7724 /// the string representation of enums.
7725 pub fn value(&self) -> std::option::Option<i32> {
7726 match self {
7727 Self::Unspecified => std::option::Option::Some(0),
7728 Self::Active => std::option::Option::Some(1),
7729 Self::Inactive => std::option::Option::Some(2),
7730 Self::UnknownValue(u) => u.0.value(),
7731 }
7732 }
7733
7734 /// Gets the enum value as a string.
7735 ///
7736 /// Returns `None` if the enum contains an unknown value deserialized from
7737 /// the integer representation of enums.
7738 pub fn name(&self) -> std::option::Option<&str> {
7739 match self {
7740 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7741 Self::Active => std::option::Option::Some("ACTIVE"),
7742 Self::Inactive => std::option::Option::Some("INACTIVE"),
7743 Self::UnknownValue(u) => u.0.name(),
7744 }
7745 }
7746 }
7747
7748 impl std::default::Default for State {
7749 fn default() -> Self {
7750 use std::convert::From;
7751 Self::from(0)
7752 }
7753 }
7754
7755 impl std::fmt::Display for State {
7756 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7757 wkt::internal::display_enum(f, self.name(), self.value())
7758 }
7759 }
7760
7761 impl std::convert::From<i32> for State {
7762 fn from(value: i32) -> Self {
7763 match value {
7764 0 => Self::Unspecified,
7765 1 => Self::Active,
7766 2 => Self::Inactive,
7767 _ => Self::UnknownValue(state::UnknownValue(
7768 wkt::internal::UnknownEnumValue::Integer(value),
7769 )),
7770 }
7771 }
7772 }
7773
7774 impl std::convert::From<&str> for State {
7775 fn from(value: &str) -> Self {
7776 use std::string::ToString;
7777 match value {
7778 "STATE_UNSPECIFIED" => Self::Unspecified,
7779 "ACTIVE" => Self::Active,
7780 "INACTIVE" => Self::Inactive,
7781 _ => Self::UnknownValue(state::UnknownValue(
7782 wkt::internal::UnknownEnumValue::String(value.to_string()),
7783 )),
7784 }
7785 }
7786 }
7787
7788 impl serde::ser::Serialize for State {
7789 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7790 where
7791 S: serde::Serializer,
7792 {
7793 match self {
7794 Self::Unspecified => serializer.serialize_i32(0),
7795 Self::Active => serializer.serialize_i32(1),
7796 Self::Inactive => serializer.serialize_i32(2),
7797 Self::UnknownValue(u) => u.0.serialize(serializer),
7798 }
7799 }
7800 }
7801
7802 impl<'de> serde::de::Deserialize<'de> for State {
7803 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7804 where
7805 D: serde::Deserializer<'de>,
7806 {
7807 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7808 ".google.cloud.securitycenter.v2.Finding.State",
7809 ))
7810 }
7811 }
7812
7813 /// The severity of the finding.
7814 ///
7815 /// # Working with unknown values
7816 ///
7817 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7818 /// additional enum variants at any time. Adding new variants is not considered
7819 /// a breaking change. Applications should write their code in anticipation of:
7820 ///
7821 /// - New values appearing in future releases of the client library, **and**
7822 /// - New values received dynamically, without application changes.
7823 ///
7824 /// Please consult the [Working with enums] section in the user guide for some
7825 /// guidelines.
7826 ///
7827 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7828 #[derive(Clone, Debug, PartialEq)]
7829 #[non_exhaustive]
7830 pub enum Severity {
7831 /// This value is used for findings when a source doesn't write a severity
7832 /// value.
7833 Unspecified,
7834 /// Vulnerability:
7835 /// A critical vulnerability is easily discoverable by an external actor,
7836 /// exploitable, and results in the direct ability to execute arbitrary code,
7837 /// exfiltrate data, and otherwise gain additional access and privileges to
7838 /// cloud resources and workloads. Examples include publicly accessible
7839 /// unprotected user data and public SSH access with weak or no
7840 /// passwords.
7841 ///
7842 /// Threat:
7843 /// Indicates a threat that is able to access, modify, or delete data or
7844 /// execute unauthorized code within existing resources.
7845 Critical,
7846 /// Vulnerability:
7847 /// A high risk vulnerability can be easily discovered and exploited in
7848 /// combination with other vulnerabilities in order to gain direct access and
7849 /// the ability to execute arbitrary code, exfiltrate data, and otherwise
7850 /// gain additional access and privileges to cloud resources and workloads.
7851 /// An example is a database with weak or no passwords that is only
7852 /// accessible internally. This database could easily be compromised by an
7853 /// actor that had access to the internal network.
7854 ///
7855 /// Threat:
7856 /// Indicates a threat that is able to create new computational resources in
7857 /// an environment but not able to access data or execute code in existing
7858 /// resources.
7859 High,
7860 /// Vulnerability:
7861 /// A medium risk vulnerability could be used by an actor to gain access to
7862 /// resources or privileges that enable them to eventually (through multiple
7863 /// steps or a complex exploit) gain access and the ability to execute
7864 /// arbitrary code or exfiltrate data. An example is a service account with
7865 /// access to more projects than it should have. If an actor gains access to
7866 /// the service account, they could potentially use that access to manipulate
7867 /// a project the service account was not intended to.
7868 ///
7869 /// Threat:
7870 /// Indicates a threat that is able to cause operational impact but may not
7871 /// access data or execute unauthorized code.
7872 Medium,
7873 /// Vulnerability:
7874 /// A low risk vulnerability hampers a security organization's ability to
7875 /// detect vulnerabilities or active threats in their deployment, or prevents
7876 /// the root cause investigation of security issues. An example is monitoring
7877 /// and logs being disabled for resource configurations and access.
7878 ///
7879 /// Threat:
7880 /// Indicates a threat that has obtained minimal access to an environment but
7881 /// is not able to access data, execute code, or create resources.
7882 Low,
7883 /// If set, the enum was initialized with an unknown value.
7884 ///
7885 /// Applications can examine the value using [Severity::value] or
7886 /// [Severity::name].
7887 UnknownValue(severity::UnknownValue),
7888 }
7889
7890 #[doc(hidden)]
7891 pub mod severity {
7892 #[allow(unused_imports)]
7893 use super::*;
7894 #[derive(Clone, Debug, PartialEq)]
7895 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7896 }
7897
7898 impl Severity {
7899 /// Gets the enum value.
7900 ///
7901 /// Returns `None` if the enum contains an unknown value deserialized from
7902 /// the string representation of enums.
7903 pub fn value(&self) -> std::option::Option<i32> {
7904 match self {
7905 Self::Unspecified => std::option::Option::Some(0),
7906 Self::Critical => std::option::Option::Some(1),
7907 Self::High => std::option::Option::Some(2),
7908 Self::Medium => std::option::Option::Some(3),
7909 Self::Low => std::option::Option::Some(4),
7910 Self::UnknownValue(u) => u.0.value(),
7911 }
7912 }
7913
7914 /// Gets the enum value as a string.
7915 ///
7916 /// Returns `None` if the enum contains an unknown value deserialized from
7917 /// the integer representation of enums.
7918 pub fn name(&self) -> std::option::Option<&str> {
7919 match self {
7920 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
7921 Self::Critical => std::option::Option::Some("CRITICAL"),
7922 Self::High => std::option::Option::Some("HIGH"),
7923 Self::Medium => std::option::Option::Some("MEDIUM"),
7924 Self::Low => std::option::Option::Some("LOW"),
7925 Self::UnknownValue(u) => u.0.name(),
7926 }
7927 }
7928 }
7929
7930 impl std::default::Default for Severity {
7931 fn default() -> Self {
7932 use std::convert::From;
7933 Self::from(0)
7934 }
7935 }
7936
7937 impl std::fmt::Display for Severity {
7938 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7939 wkt::internal::display_enum(f, self.name(), self.value())
7940 }
7941 }
7942
7943 impl std::convert::From<i32> for Severity {
7944 fn from(value: i32) -> Self {
7945 match value {
7946 0 => Self::Unspecified,
7947 1 => Self::Critical,
7948 2 => Self::High,
7949 3 => Self::Medium,
7950 4 => Self::Low,
7951 _ => Self::UnknownValue(severity::UnknownValue(
7952 wkt::internal::UnknownEnumValue::Integer(value),
7953 )),
7954 }
7955 }
7956 }
7957
7958 impl std::convert::From<&str> for Severity {
7959 fn from(value: &str) -> Self {
7960 use std::string::ToString;
7961 match value {
7962 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
7963 "CRITICAL" => Self::Critical,
7964 "HIGH" => Self::High,
7965 "MEDIUM" => Self::Medium,
7966 "LOW" => Self::Low,
7967 _ => Self::UnknownValue(severity::UnknownValue(
7968 wkt::internal::UnknownEnumValue::String(value.to_string()),
7969 )),
7970 }
7971 }
7972 }
7973
7974 impl serde::ser::Serialize for Severity {
7975 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7976 where
7977 S: serde::Serializer,
7978 {
7979 match self {
7980 Self::Unspecified => serializer.serialize_i32(0),
7981 Self::Critical => serializer.serialize_i32(1),
7982 Self::High => serializer.serialize_i32(2),
7983 Self::Medium => serializer.serialize_i32(3),
7984 Self::Low => serializer.serialize_i32(4),
7985 Self::UnknownValue(u) => u.0.serialize(serializer),
7986 }
7987 }
7988 }
7989
7990 impl<'de> serde::de::Deserialize<'de> for Severity {
7991 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7992 where
7993 D: serde::Deserializer<'de>,
7994 {
7995 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
7996 ".google.cloud.securitycenter.v2.Finding.Severity",
7997 ))
7998 }
7999 }
8000
8001 /// Mute state a finding can be in.
8002 ///
8003 /// # Working with unknown values
8004 ///
8005 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8006 /// additional enum variants at any time. Adding new variants is not considered
8007 /// a breaking change. Applications should write their code in anticipation of:
8008 ///
8009 /// - New values appearing in future releases of the client library, **and**
8010 /// - New values received dynamically, without application changes.
8011 ///
8012 /// Please consult the [Working with enums] section in the user guide for some
8013 /// guidelines.
8014 ///
8015 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8016 #[derive(Clone, Debug, PartialEq)]
8017 #[non_exhaustive]
8018 pub enum Mute {
8019 /// Unspecified.
8020 Unspecified,
8021 /// Finding has been muted.
8022 Muted,
8023 /// Finding has been unmuted.
8024 Unmuted,
8025 /// Finding has never been muted/unmuted.
8026 Undefined,
8027 /// If set, the enum was initialized with an unknown value.
8028 ///
8029 /// Applications can examine the value using [Mute::value] or
8030 /// [Mute::name].
8031 UnknownValue(mute::UnknownValue),
8032 }
8033
8034 #[doc(hidden)]
8035 pub mod mute {
8036 #[allow(unused_imports)]
8037 use super::*;
8038 #[derive(Clone, Debug, PartialEq)]
8039 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8040 }
8041
8042 impl Mute {
8043 /// Gets the enum value.
8044 ///
8045 /// Returns `None` if the enum contains an unknown value deserialized from
8046 /// the string representation of enums.
8047 pub fn value(&self) -> std::option::Option<i32> {
8048 match self {
8049 Self::Unspecified => std::option::Option::Some(0),
8050 Self::Muted => std::option::Option::Some(1),
8051 Self::Unmuted => std::option::Option::Some(2),
8052 Self::Undefined => std::option::Option::Some(3),
8053 Self::UnknownValue(u) => u.0.value(),
8054 }
8055 }
8056
8057 /// Gets the enum value as a string.
8058 ///
8059 /// Returns `None` if the enum contains an unknown value deserialized from
8060 /// the integer representation of enums.
8061 pub fn name(&self) -> std::option::Option<&str> {
8062 match self {
8063 Self::Unspecified => std::option::Option::Some("MUTE_UNSPECIFIED"),
8064 Self::Muted => std::option::Option::Some("MUTED"),
8065 Self::Unmuted => std::option::Option::Some("UNMUTED"),
8066 Self::Undefined => std::option::Option::Some("UNDEFINED"),
8067 Self::UnknownValue(u) => u.0.name(),
8068 }
8069 }
8070 }
8071
8072 impl std::default::Default for Mute {
8073 fn default() -> Self {
8074 use std::convert::From;
8075 Self::from(0)
8076 }
8077 }
8078
8079 impl std::fmt::Display for Mute {
8080 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8081 wkt::internal::display_enum(f, self.name(), self.value())
8082 }
8083 }
8084
8085 impl std::convert::From<i32> for Mute {
8086 fn from(value: i32) -> Self {
8087 match value {
8088 0 => Self::Unspecified,
8089 1 => Self::Muted,
8090 2 => Self::Unmuted,
8091 3 => Self::Undefined,
8092 _ => Self::UnknownValue(mute::UnknownValue(
8093 wkt::internal::UnknownEnumValue::Integer(value),
8094 )),
8095 }
8096 }
8097 }
8098
8099 impl std::convert::From<&str> for Mute {
8100 fn from(value: &str) -> Self {
8101 use std::string::ToString;
8102 match value {
8103 "MUTE_UNSPECIFIED" => Self::Unspecified,
8104 "MUTED" => Self::Muted,
8105 "UNMUTED" => Self::Unmuted,
8106 "UNDEFINED" => Self::Undefined,
8107 _ => Self::UnknownValue(mute::UnknownValue(
8108 wkt::internal::UnknownEnumValue::String(value.to_string()),
8109 )),
8110 }
8111 }
8112 }
8113
8114 impl serde::ser::Serialize for Mute {
8115 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8116 where
8117 S: serde::Serializer,
8118 {
8119 match self {
8120 Self::Unspecified => serializer.serialize_i32(0),
8121 Self::Muted => serializer.serialize_i32(1),
8122 Self::Unmuted => serializer.serialize_i32(2),
8123 Self::Undefined => serializer.serialize_i32(3),
8124 Self::UnknownValue(u) => u.0.serialize(serializer),
8125 }
8126 }
8127 }
8128
8129 impl<'de> serde::de::Deserialize<'de> for Mute {
8130 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8131 where
8132 D: serde::Deserializer<'de>,
8133 {
8134 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mute>::new(
8135 ".google.cloud.securitycenter.v2.Finding.Mute",
8136 ))
8137 }
8138 }
8139
8140 /// Represents what kind of Finding it is.
8141 ///
8142 /// # Working with unknown values
8143 ///
8144 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8145 /// additional enum variants at any time. Adding new variants is not considered
8146 /// a breaking change. Applications should write their code in anticipation of:
8147 ///
8148 /// - New values appearing in future releases of the client library, **and**
8149 /// - New values received dynamically, without application changes.
8150 ///
8151 /// Please consult the [Working with enums] section in the user guide for some
8152 /// guidelines.
8153 ///
8154 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8155 #[derive(Clone, Debug, PartialEq)]
8156 #[non_exhaustive]
8157 pub enum FindingClass {
8158 /// Unspecified finding class.
8159 Unspecified,
8160 /// Describes unwanted or malicious activity.
8161 Threat,
8162 /// Describes a potential weakness in software that increases risk to
8163 /// Confidentiality & Integrity & Availability.
8164 Vulnerability,
8165 /// Describes a potential weakness in cloud resource/asset configuration that
8166 /// increases risk.
8167 Misconfiguration,
8168 /// Describes a security observation that is for informational purposes.
8169 Observation,
8170 /// Describes an error that prevents some SCC functionality.
8171 SccError,
8172 /// Describes a potential security risk due to a change in the security
8173 /// posture.
8174 PostureViolation,
8175 /// Describes a combination of security issues that represent a more severe
8176 /// security problem when taken together.
8177 ToxicCombination,
8178 /// Describes a potential security risk to data assets that contain sensitive
8179 /// data.
8180 SensitiveDataRisk,
8181 /// Describes a resource or resource group where high risk attack paths
8182 /// converge, based on attack path simulations (APS).
8183 Chokepoint,
8184 /// If set, the enum was initialized with an unknown value.
8185 ///
8186 /// Applications can examine the value using [FindingClass::value] or
8187 /// [FindingClass::name].
8188 UnknownValue(finding_class::UnknownValue),
8189 }
8190
8191 #[doc(hidden)]
8192 pub mod finding_class {
8193 #[allow(unused_imports)]
8194 use super::*;
8195 #[derive(Clone, Debug, PartialEq)]
8196 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8197 }
8198
8199 impl FindingClass {
8200 /// Gets the enum value.
8201 ///
8202 /// Returns `None` if the enum contains an unknown value deserialized from
8203 /// the string representation of enums.
8204 pub fn value(&self) -> std::option::Option<i32> {
8205 match self {
8206 Self::Unspecified => std::option::Option::Some(0),
8207 Self::Threat => std::option::Option::Some(1),
8208 Self::Vulnerability => std::option::Option::Some(2),
8209 Self::Misconfiguration => std::option::Option::Some(3),
8210 Self::Observation => std::option::Option::Some(4),
8211 Self::SccError => std::option::Option::Some(5),
8212 Self::PostureViolation => std::option::Option::Some(6),
8213 Self::ToxicCombination => std::option::Option::Some(7),
8214 Self::SensitiveDataRisk => std::option::Option::Some(8),
8215 Self::Chokepoint => std::option::Option::Some(9),
8216 Self::UnknownValue(u) => u.0.value(),
8217 }
8218 }
8219
8220 /// Gets the enum value as a string.
8221 ///
8222 /// Returns `None` if the enum contains an unknown value deserialized from
8223 /// the integer representation of enums.
8224 pub fn name(&self) -> std::option::Option<&str> {
8225 match self {
8226 Self::Unspecified => std::option::Option::Some("FINDING_CLASS_UNSPECIFIED"),
8227 Self::Threat => std::option::Option::Some("THREAT"),
8228 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
8229 Self::Misconfiguration => std::option::Option::Some("MISCONFIGURATION"),
8230 Self::Observation => std::option::Option::Some("OBSERVATION"),
8231 Self::SccError => std::option::Option::Some("SCC_ERROR"),
8232 Self::PostureViolation => std::option::Option::Some("POSTURE_VIOLATION"),
8233 Self::ToxicCombination => std::option::Option::Some("TOXIC_COMBINATION"),
8234 Self::SensitiveDataRisk => std::option::Option::Some("SENSITIVE_DATA_RISK"),
8235 Self::Chokepoint => std::option::Option::Some("CHOKEPOINT"),
8236 Self::UnknownValue(u) => u.0.name(),
8237 }
8238 }
8239 }
8240
8241 impl std::default::Default for FindingClass {
8242 fn default() -> Self {
8243 use std::convert::From;
8244 Self::from(0)
8245 }
8246 }
8247
8248 impl std::fmt::Display for FindingClass {
8249 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8250 wkt::internal::display_enum(f, self.name(), self.value())
8251 }
8252 }
8253
8254 impl std::convert::From<i32> for FindingClass {
8255 fn from(value: i32) -> Self {
8256 match value {
8257 0 => Self::Unspecified,
8258 1 => Self::Threat,
8259 2 => Self::Vulnerability,
8260 3 => Self::Misconfiguration,
8261 4 => Self::Observation,
8262 5 => Self::SccError,
8263 6 => Self::PostureViolation,
8264 7 => Self::ToxicCombination,
8265 8 => Self::SensitiveDataRisk,
8266 9 => Self::Chokepoint,
8267 _ => Self::UnknownValue(finding_class::UnknownValue(
8268 wkt::internal::UnknownEnumValue::Integer(value),
8269 )),
8270 }
8271 }
8272 }
8273
8274 impl std::convert::From<&str> for FindingClass {
8275 fn from(value: &str) -> Self {
8276 use std::string::ToString;
8277 match value {
8278 "FINDING_CLASS_UNSPECIFIED" => Self::Unspecified,
8279 "THREAT" => Self::Threat,
8280 "VULNERABILITY" => Self::Vulnerability,
8281 "MISCONFIGURATION" => Self::Misconfiguration,
8282 "OBSERVATION" => Self::Observation,
8283 "SCC_ERROR" => Self::SccError,
8284 "POSTURE_VIOLATION" => Self::PostureViolation,
8285 "TOXIC_COMBINATION" => Self::ToxicCombination,
8286 "SENSITIVE_DATA_RISK" => Self::SensitiveDataRisk,
8287 "CHOKEPOINT" => Self::Chokepoint,
8288 _ => Self::UnknownValue(finding_class::UnknownValue(
8289 wkt::internal::UnknownEnumValue::String(value.to_string()),
8290 )),
8291 }
8292 }
8293 }
8294
8295 impl serde::ser::Serialize for FindingClass {
8296 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8297 where
8298 S: serde::Serializer,
8299 {
8300 match self {
8301 Self::Unspecified => serializer.serialize_i32(0),
8302 Self::Threat => serializer.serialize_i32(1),
8303 Self::Vulnerability => serializer.serialize_i32(2),
8304 Self::Misconfiguration => serializer.serialize_i32(3),
8305 Self::Observation => serializer.serialize_i32(4),
8306 Self::SccError => serializer.serialize_i32(5),
8307 Self::PostureViolation => serializer.serialize_i32(6),
8308 Self::ToxicCombination => serializer.serialize_i32(7),
8309 Self::SensitiveDataRisk => serializer.serialize_i32(8),
8310 Self::Chokepoint => serializer.serialize_i32(9),
8311 Self::UnknownValue(u) => u.0.serialize(serializer),
8312 }
8313 }
8314 }
8315
8316 impl<'de> serde::de::Deserialize<'de> for FindingClass {
8317 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8318 where
8319 D: serde::Deserializer<'de>,
8320 {
8321 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingClass>::new(
8322 ".google.cloud.securitycenter.v2.Finding.FindingClass",
8323 ))
8324 }
8325 }
8326}
8327
8328/// Message that contains the resource name and display name of a folder
8329/// resource.
8330#[derive(Clone, Default, PartialEq)]
8331#[non_exhaustive]
8332pub struct Folder {
8333 /// Full resource name of this folder. See:
8334 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
8335 pub resource_folder: std::string::String,
8336
8337 /// The user defined display name for this folder.
8338 pub resource_folder_display_name: std::string::String,
8339
8340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8341}
8342
8343impl Folder {
8344 /// Creates a new default instance.
8345 pub fn new() -> Self {
8346 std::default::Default::default()
8347 }
8348
8349 /// Sets the value of [resource_folder][crate::model::Folder::resource_folder].
8350 ///
8351 /// # Example
8352 /// ```ignore,no_run
8353 /// # use google_cloud_securitycenter_v2::model::Folder;
8354 /// let x = Folder::new().set_resource_folder("example");
8355 /// ```
8356 pub fn set_resource_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8357 self.resource_folder = v.into();
8358 self
8359 }
8360
8361 /// Sets the value of [resource_folder_display_name][crate::model::Folder::resource_folder_display_name].
8362 ///
8363 /// # Example
8364 /// ```ignore,no_run
8365 /// # use google_cloud_securitycenter_v2::model::Folder;
8366 /// let x = Folder::new().set_resource_folder_display_name("example");
8367 /// ```
8368 pub fn set_resource_folder_display_name<T: std::convert::Into<std::string::String>>(
8369 mut self,
8370 v: T,
8371 ) -> Self {
8372 self.resource_folder_display_name = v.into();
8373 self
8374 }
8375}
8376
8377impl wkt::message::Message for Folder {
8378 fn typename() -> &'static str {
8379 "type.googleapis.com/google.cloud.securitycenter.v2.Folder"
8380 }
8381}
8382
8383/// Contains details about groups of which this finding is a member. A group is a
8384/// collection of findings that are related in some way.
8385#[derive(Clone, Default, PartialEq)]
8386#[non_exhaustive]
8387pub struct GroupMembership {
8388 /// Type of group.
8389 pub group_type: crate::model::group_membership::GroupType,
8390
8391 /// ID of the group.
8392 pub group_id: std::string::String,
8393
8394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8395}
8396
8397impl GroupMembership {
8398 /// Creates a new default instance.
8399 pub fn new() -> Self {
8400 std::default::Default::default()
8401 }
8402
8403 /// Sets the value of [group_type][crate::model::GroupMembership::group_type].
8404 ///
8405 /// # Example
8406 /// ```ignore,no_run
8407 /// # use google_cloud_securitycenter_v2::model::GroupMembership;
8408 /// use google_cloud_securitycenter_v2::model::group_membership::GroupType;
8409 /// let x0 = GroupMembership::new().set_group_type(GroupType::ToxicCombination);
8410 /// let x1 = GroupMembership::new().set_group_type(GroupType::Chokepoint);
8411 /// ```
8412 pub fn set_group_type<T: std::convert::Into<crate::model::group_membership::GroupType>>(
8413 mut self,
8414 v: T,
8415 ) -> Self {
8416 self.group_type = v.into();
8417 self
8418 }
8419
8420 /// Sets the value of [group_id][crate::model::GroupMembership::group_id].
8421 ///
8422 /// # Example
8423 /// ```ignore,no_run
8424 /// # use google_cloud_securitycenter_v2::model::GroupMembership;
8425 /// let x = GroupMembership::new().set_group_id("example");
8426 /// ```
8427 pub fn set_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8428 self.group_id = v.into();
8429 self
8430 }
8431}
8432
8433impl wkt::message::Message for GroupMembership {
8434 fn typename() -> &'static str {
8435 "type.googleapis.com/google.cloud.securitycenter.v2.GroupMembership"
8436 }
8437}
8438
8439/// Defines additional types related to [GroupMembership].
8440pub mod group_membership {
8441 #[allow(unused_imports)]
8442 use super::*;
8443
8444 /// Possible types of groups.
8445 ///
8446 /// # Working with unknown values
8447 ///
8448 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8449 /// additional enum variants at any time. Adding new variants is not considered
8450 /// a breaking change. Applications should write their code in anticipation of:
8451 ///
8452 /// - New values appearing in future releases of the client library, **and**
8453 /// - New values received dynamically, without application changes.
8454 ///
8455 /// Please consult the [Working with enums] section in the user guide for some
8456 /// guidelines.
8457 ///
8458 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8459 #[derive(Clone, Debug, PartialEq)]
8460 #[non_exhaustive]
8461 pub enum GroupType {
8462 /// Default value.
8463 Unspecified,
8464 /// Group represents a toxic combination.
8465 ToxicCombination,
8466 /// Group represents a chokepoint.
8467 Chokepoint,
8468 /// If set, the enum was initialized with an unknown value.
8469 ///
8470 /// Applications can examine the value using [GroupType::value] or
8471 /// [GroupType::name].
8472 UnknownValue(group_type::UnknownValue),
8473 }
8474
8475 #[doc(hidden)]
8476 pub mod group_type {
8477 #[allow(unused_imports)]
8478 use super::*;
8479 #[derive(Clone, Debug, PartialEq)]
8480 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8481 }
8482
8483 impl GroupType {
8484 /// Gets the enum value.
8485 ///
8486 /// Returns `None` if the enum contains an unknown value deserialized from
8487 /// the string representation of enums.
8488 pub fn value(&self) -> std::option::Option<i32> {
8489 match self {
8490 Self::Unspecified => std::option::Option::Some(0),
8491 Self::ToxicCombination => std::option::Option::Some(1),
8492 Self::Chokepoint => std::option::Option::Some(3),
8493 Self::UnknownValue(u) => u.0.value(),
8494 }
8495 }
8496
8497 /// Gets the enum value as a string.
8498 ///
8499 /// Returns `None` if the enum contains an unknown value deserialized from
8500 /// the integer representation of enums.
8501 pub fn name(&self) -> std::option::Option<&str> {
8502 match self {
8503 Self::Unspecified => std::option::Option::Some("GROUP_TYPE_UNSPECIFIED"),
8504 Self::ToxicCombination => std::option::Option::Some("GROUP_TYPE_TOXIC_COMBINATION"),
8505 Self::Chokepoint => std::option::Option::Some("GROUP_TYPE_CHOKEPOINT"),
8506 Self::UnknownValue(u) => u.0.name(),
8507 }
8508 }
8509 }
8510
8511 impl std::default::Default for GroupType {
8512 fn default() -> Self {
8513 use std::convert::From;
8514 Self::from(0)
8515 }
8516 }
8517
8518 impl std::fmt::Display for GroupType {
8519 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8520 wkt::internal::display_enum(f, self.name(), self.value())
8521 }
8522 }
8523
8524 impl std::convert::From<i32> for GroupType {
8525 fn from(value: i32) -> Self {
8526 match value {
8527 0 => Self::Unspecified,
8528 1 => Self::ToxicCombination,
8529 3 => Self::Chokepoint,
8530 _ => Self::UnknownValue(group_type::UnknownValue(
8531 wkt::internal::UnknownEnumValue::Integer(value),
8532 )),
8533 }
8534 }
8535 }
8536
8537 impl std::convert::From<&str> for GroupType {
8538 fn from(value: &str) -> Self {
8539 use std::string::ToString;
8540 match value {
8541 "GROUP_TYPE_UNSPECIFIED" => Self::Unspecified,
8542 "GROUP_TYPE_TOXIC_COMBINATION" => Self::ToxicCombination,
8543 "GROUP_TYPE_CHOKEPOINT" => Self::Chokepoint,
8544 _ => Self::UnknownValue(group_type::UnknownValue(
8545 wkt::internal::UnknownEnumValue::String(value.to_string()),
8546 )),
8547 }
8548 }
8549 }
8550
8551 impl serde::ser::Serialize for GroupType {
8552 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8553 where
8554 S: serde::Serializer,
8555 {
8556 match self {
8557 Self::Unspecified => serializer.serialize_i32(0),
8558 Self::ToxicCombination => serializer.serialize_i32(1),
8559 Self::Chokepoint => serializer.serialize_i32(3),
8560 Self::UnknownValue(u) => u.0.serialize(serializer),
8561 }
8562 }
8563 }
8564
8565 impl<'de> serde::de::Deserialize<'de> for GroupType {
8566 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8567 where
8568 D: serde::Deserializer<'de>,
8569 {
8570 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GroupType>::new(
8571 ".google.cloud.securitycenter.v2.GroupMembership.GroupType",
8572 ))
8573 }
8574 }
8575}
8576
8577/// Represents a particular IAM binding, which captures a member's role addition,
8578/// removal, or state.
8579#[derive(Clone, Default, PartialEq)]
8580#[non_exhaustive]
8581pub struct IamBinding {
8582 /// The action that was performed on a Binding.
8583 pub action: crate::model::iam_binding::Action,
8584
8585 /// Role that is assigned to "members".
8586 /// For example, "roles/viewer", "roles/editor", or "roles/owner".
8587 pub role: std::string::String,
8588
8589 /// A single identity requesting access for a Cloud Platform resource, for
8590 /// example, "foo@google.com".
8591 pub member: std::string::String,
8592
8593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8594}
8595
8596impl IamBinding {
8597 /// Creates a new default instance.
8598 pub fn new() -> Self {
8599 std::default::Default::default()
8600 }
8601
8602 /// Sets the value of [action][crate::model::IamBinding::action].
8603 ///
8604 /// # Example
8605 /// ```ignore,no_run
8606 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8607 /// use google_cloud_securitycenter_v2::model::iam_binding::Action;
8608 /// let x0 = IamBinding::new().set_action(Action::Add);
8609 /// let x1 = IamBinding::new().set_action(Action::Remove);
8610 /// ```
8611 pub fn set_action<T: std::convert::Into<crate::model::iam_binding::Action>>(
8612 mut self,
8613 v: T,
8614 ) -> Self {
8615 self.action = v.into();
8616 self
8617 }
8618
8619 /// Sets the value of [role][crate::model::IamBinding::role].
8620 ///
8621 /// # Example
8622 /// ```ignore,no_run
8623 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8624 /// let x = IamBinding::new().set_role("example");
8625 /// ```
8626 pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8627 self.role = v.into();
8628 self
8629 }
8630
8631 /// Sets the value of [member][crate::model::IamBinding::member].
8632 ///
8633 /// # Example
8634 /// ```ignore,no_run
8635 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8636 /// let x = IamBinding::new().set_member("example");
8637 /// ```
8638 pub fn set_member<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8639 self.member = v.into();
8640 self
8641 }
8642}
8643
8644impl wkt::message::Message for IamBinding {
8645 fn typename() -> &'static str {
8646 "type.googleapis.com/google.cloud.securitycenter.v2.IamBinding"
8647 }
8648}
8649
8650/// Defines additional types related to [IamBinding].
8651pub mod iam_binding {
8652 #[allow(unused_imports)]
8653 use super::*;
8654
8655 /// The type of action performed on a Binding in a policy.
8656 ///
8657 /// # Working with unknown values
8658 ///
8659 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8660 /// additional enum variants at any time. Adding new variants is not considered
8661 /// a breaking change. Applications should write their code in anticipation of:
8662 ///
8663 /// - New values appearing in future releases of the client library, **and**
8664 /// - New values received dynamically, without application changes.
8665 ///
8666 /// Please consult the [Working with enums] section in the user guide for some
8667 /// guidelines.
8668 ///
8669 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8670 #[derive(Clone, Debug, PartialEq)]
8671 #[non_exhaustive]
8672 pub enum Action {
8673 /// Unspecified.
8674 Unspecified,
8675 /// Addition of a Binding.
8676 Add,
8677 /// Removal of a Binding.
8678 Remove,
8679 /// If set, the enum was initialized with an unknown value.
8680 ///
8681 /// Applications can examine the value using [Action::value] or
8682 /// [Action::name].
8683 UnknownValue(action::UnknownValue),
8684 }
8685
8686 #[doc(hidden)]
8687 pub mod action {
8688 #[allow(unused_imports)]
8689 use super::*;
8690 #[derive(Clone, Debug, PartialEq)]
8691 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8692 }
8693
8694 impl Action {
8695 /// Gets the enum value.
8696 ///
8697 /// Returns `None` if the enum contains an unknown value deserialized from
8698 /// the string representation of enums.
8699 pub fn value(&self) -> std::option::Option<i32> {
8700 match self {
8701 Self::Unspecified => std::option::Option::Some(0),
8702 Self::Add => std::option::Option::Some(1),
8703 Self::Remove => std::option::Option::Some(2),
8704 Self::UnknownValue(u) => u.0.value(),
8705 }
8706 }
8707
8708 /// Gets the enum value as a string.
8709 ///
8710 /// Returns `None` if the enum contains an unknown value deserialized from
8711 /// the integer representation of enums.
8712 pub fn name(&self) -> std::option::Option<&str> {
8713 match self {
8714 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
8715 Self::Add => std::option::Option::Some("ADD"),
8716 Self::Remove => std::option::Option::Some("REMOVE"),
8717 Self::UnknownValue(u) => u.0.name(),
8718 }
8719 }
8720 }
8721
8722 impl std::default::Default for Action {
8723 fn default() -> Self {
8724 use std::convert::From;
8725 Self::from(0)
8726 }
8727 }
8728
8729 impl std::fmt::Display for Action {
8730 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8731 wkt::internal::display_enum(f, self.name(), self.value())
8732 }
8733 }
8734
8735 impl std::convert::From<i32> for Action {
8736 fn from(value: i32) -> Self {
8737 match value {
8738 0 => Self::Unspecified,
8739 1 => Self::Add,
8740 2 => Self::Remove,
8741 _ => Self::UnknownValue(action::UnknownValue(
8742 wkt::internal::UnknownEnumValue::Integer(value),
8743 )),
8744 }
8745 }
8746 }
8747
8748 impl std::convert::From<&str> for Action {
8749 fn from(value: &str) -> Self {
8750 use std::string::ToString;
8751 match value {
8752 "ACTION_UNSPECIFIED" => Self::Unspecified,
8753 "ADD" => Self::Add,
8754 "REMOVE" => Self::Remove,
8755 _ => Self::UnknownValue(action::UnknownValue(
8756 wkt::internal::UnknownEnumValue::String(value.to_string()),
8757 )),
8758 }
8759 }
8760 }
8761
8762 impl serde::ser::Serialize for Action {
8763 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8764 where
8765 S: serde::Serializer,
8766 {
8767 match self {
8768 Self::Unspecified => serializer.serialize_i32(0),
8769 Self::Add => serializer.serialize_i32(1),
8770 Self::Remove => serializer.serialize_i32(2),
8771 Self::UnknownValue(u) => u.0.serialize(serializer),
8772 }
8773 }
8774 }
8775
8776 impl<'de> serde::de::Deserialize<'de> for Action {
8777 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8778 where
8779 D: serde::Deserializer<'de>,
8780 {
8781 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
8782 ".google.cloud.securitycenter.v2.IamBinding.Action",
8783 ))
8784 }
8785 }
8786}
8787
8788/// Represents what's commonly known as an _indicator of compromise_ (IoC) in
8789/// computer forensics. This is an artifact observed on a network or in an
8790/// operating system that, with high confidence, indicates a computer intrusion.
8791/// For more information, see [Indicator of
8792/// compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise).
8793#[derive(Clone, Default, PartialEq)]
8794#[non_exhaustive]
8795pub struct Indicator {
8796 /// The list of IP addresses that are associated with the finding.
8797 pub ip_addresses: std::vec::Vec<std::string::String>,
8798
8799 /// List of domains associated to the Finding.
8800 pub domains: std::vec::Vec<std::string::String>,
8801
8802 /// The list of matched signatures indicating that the given
8803 /// process is present in the environment.
8804 pub signatures: std::vec::Vec<crate::model::indicator::ProcessSignature>,
8805
8806 /// The list of URIs associated to the Findings.
8807 pub uris: std::vec::Vec<std::string::String>,
8808
8809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8810}
8811
8812impl Indicator {
8813 /// Creates a new default instance.
8814 pub fn new() -> Self {
8815 std::default::Default::default()
8816 }
8817
8818 /// Sets the value of [ip_addresses][crate::model::Indicator::ip_addresses].
8819 ///
8820 /// # Example
8821 /// ```ignore,no_run
8822 /// # use google_cloud_securitycenter_v2::model::Indicator;
8823 /// let x = Indicator::new().set_ip_addresses(["a", "b", "c"]);
8824 /// ```
8825 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
8826 where
8827 T: std::iter::IntoIterator<Item = V>,
8828 V: std::convert::Into<std::string::String>,
8829 {
8830 use std::iter::Iterator;
8831 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
8832 self
8833 }
8834
8835 /// Sets the value of [domains][crate::model::Indicator::domains].
8836 ///
8837 /// # Example
8838 /// ```ignore,no_run
8839 /// # use google_cloud_securitycenter_v2::model::Indicator;
8840 /// let x = Indicator::new().set_domains(["a", "b", "c"]);
8841 /// ```
8842 pub fn set_domains<T, V>(mut self, v: T) -> Self
8843 where
8844 T: std::iter::IntoIterator<Item = V>,
8845 V: std::convert::Into<std::string::String>,
8846 {
8847 use std::iter::Iterator;
8848 self.domains = v.into_iter().map(|i| i.into()).collect();
8849 self
8850 }
8851
8852 /// Sets the value of [signatures][crate::model::Indicator::signatures].
8853 ///
8854 /// # Example
8855 /// ```ignore,no_run
8856 /// # use google_cloud_securitycenter_v2::model::Indicator;
8857 /// use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8858 /// let x = Indicator::new()
8859 /// .set_signatures([
8860 /// ProcessSignature::default()/* use setters */,
8861 /// ProcessSignature::default()/* use (different) setters */,
8862 /// ]);
8863 /// ```
8864 pub fn set_signatures<T, V>(mut self, v: T) -> Self
8865 where
8866 T: std::iter::IntoIterator<Item = V>,
8867 V: std::convert::Into<crate::model::indicator::ProcessSignature>,
8868 {
8869 use std::iter::Iterator;
8870 self.signatures = v.into_iter().map(|i| i.into()).collect();
8871 self
8872 }
8873
8874 /// Sets the value of [uris][crate::model::Indicator::uris].
8875 ///
8876 /// # Example
8877 /// ```ignore,no_run
8878 /// # use google_cloud_securitycenter_v2::model::Indicator;
8879 /// let x = Indicator::new().set_uris(["a", "b", "c"]);
8880 /// ```
8881 pub fn set_uris<T, V>(mut self, v: T) -> Self
8882 where
8883 T: std::iter::IntoIterator<Item = V>,
8884 V: std::convert::Into<std::string::String>,
8885 {
8886 use std::iter::Iterator;
8887 self.uris = v.into_iter().map(|i| i.into()).collect();
8888 self
8889 }
8890}
8891
8892impl wkt::message::Message for Indicator {
8893 fn typename() -> &'static str {
8894 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator"
8895 }
8896}
8897
8898/// Defines additional types related to [Indicator].
8899pub mod indicator {
8900 #[allow(unused_imports)]
8901 use super::*;
8902
8903 /// Indicates what signature matched this process.
8904 #[derive(Clone, Default, PartialEq)]
8905 #[non_exhaustive]
8906 pub struct ProcessSignature {
8907 /// Describes the type of resource associated with the signature.
8908 pub signature_type: crate::model::indicator::process_signature::SignatureType,
8909
8910 /// The signature.
8911 pub signature: std::option::Option<crate::model::indicator::process_signature::Signature>,
8912
8913 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8914 }
8915
8916 impl ProcessSignature {
8917 /// Creates a new default instance.
8918 pub fn new() -> Self {
8919 std::default::Default::default()
8920 }
8921
8922 /// Sets the value of [signature_type][crate::model::indicator::ProcessSignature::signature_type].
8923 ///
8924 /// # Example
8925 /// ```ignore,no_run
8926 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8927 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::SignatureType;
8928 /// let x0 = ProcessSignature::new().set_signature_type(SignatureType::Process);
8929 /// let x1 = ProcessSignature::new().set_signature_type(SignatureType::File);
8930 /// ```
8931 pub fn set_signature_type<
8932 T: std::convert::Into<crate::model::indicator::process_signature::SignatureType>,
8933 >(
8934 mut self,
8935 v: T,
8936 ) -> Self {
8937 self.signature_type = v.into();
8938 self
8939 }
8940
8941 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature].
8942 ///
8943 /// Note that all the setters affecting `signature` are mutually
8944 /// exclusive.
8945 ///
8946 /// # Example
8947 /// ```ignore,no_run
8948 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8949 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
8950 /// let x = ProcessSignature::new().set_signature(Some(
8951 /// google_cloud_securitycenter_v2::model::indicator::process_signature::Signature::MemoryHashSignature(MemoryHashSignature::default().into())));
8952 /// ```
8953 pub fn set_signature<
8954 T: std::convert::Into<
8955 std::option::Option<crate::model::indicator::process_signature::Signature>,
8956 >,
8957 >(
8958 mut self,
8959 v: T,
8960 ) -> Self {
8961 self.signature = v.into();
8962 self
8963 }
8964
8965 /// The value of [signature][crate::model::indicator::ProcessSignature::signature]
8966 /// if it holds a `MemoryHashSignature`, `None` if the field is not set or
8967 /// holds a different branch.
8968 pub fn memory_hash_signature(
8969 &self,
8970 ) -> std::option::Option<
8971 &std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
8972 > {
8973 #[allow(unreachable_patterns)]
8974 self.signature.as_ref().and_then(|v| match v {
8975 crate::model::indicator::process_signature::Signature::MemoryHashSignature(v) => {
8976 std::option::Option::Some(v)
8977 }
8978 _ => std::option::Option::None,
8979 })
8980 }
8981
8982 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature]
8983 /// to hold a `MemoryHashSignature`.
8984 ///
8985 /// Note that all the setters affecting `signature` are
8986 /// mutually exclusive.
8987 ///
8988 /// # Example
8989 /// ```ignore,no_run
8990 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8991 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
8992 /// let x = ProcessSignature::new().set_memory_hash_signature(MemoryHashSignature::default()/* use setters */);
8993 /// assert!(x.memory_hash_signature().is_some());
8994 /// assert!(x.yara_rule_signature().is_none());
8995 /// ```
8996 pub fn set_memory_hash_signature<
8997 T: std::convert::Into<
8998 std::boxed::Box<
8999 crate::model::indicator::process_signature::MemoryHashSignature,
9000 >,
9001 >,
9002 >(
9003 mut self,
9004 v: T,
9005 ) -> Self {
9006 self.signature = std::option::Option::Some(
9007 crate::model::indicator::process_signature::Signature::MemoryHashSignature(
9008 v.into(),
9009 ),
9010 );
9011 self
9012 }
9013
9014 /// The value of [signature][crate::model::indicator::ProcessSignature::signature]
9015 /// if it holds a `YaraRuleSignature`, `None` if the field is not set or
9016 /// holds a different branch.
9017 pub fn yara_rule_signature(
9018 &self,
9019 ) -> std::option::Option<
9020 &std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
9021 > {
9022 #[allow(unreachable_patterns)]
9023 self.signature.as_ref().and_then(|v| match v {
9024 crate::model::indicator::process_signature::Signature::YaraRuleSignature(v) => {
9025 std::option::Option::Some(v)
9026 }
9027 _ => std::option::Option::None,
9028 })
9029 }
9030
9031 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature]
9032 /// to hold a `YaraRuleSignature`.
9033 ///
9034 /// Note that all the setters affecting `signature` are
9035 /// mutually exclusive.
9036 ///
9037 /// # Example
9038 /// ```ignore,no_run
9039 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
9040 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::YaraRuleSignature;
9041 /// let x = ProcessSignature::new().set_yara_rule_signature(YaraRuleSignature::default()/* use setters */);
9042 /// assert!(x.yara_rule_signature().is_some());
9043 /// assert!(x.memory_hash_signature().is_none());
9044 /// ```
9045 pub fn set_yara_rule_signature<
9046 T: std::convert::Into<
9047 std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
9048 >,
9049 >(
9050 mut self,
9051 v: T,
9052 ) -> Self {
9053 self.signature = std::option::Option::Some(
9054 crate::model::indicator::process_signature::Signature::YaraRuleSignature(v.into()),
9055 );
9056 self
9057 }
9058 }
9059
9060 impl wkt::message::Message for ProcessSignature {
9061 fn typename() -> &'static str {
9062 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature"
9063 }
9064 }
9065
9066 /// Defines additional types related to [ProcessSignature].
9067 pub mod process_signature {
9068 #[allow(unused_imports)]
9069 use super::*;
9070
9071 /// A signature corresponding to memory page hashes.
9072 #[derive(Clone, Default, PartialEq)]
9073 #[non_exhaustive]
9074 pub struct MemoryHashSignature {
9075 /// The binary family.
9076 pub binary_family: std::string::String,
9077
9078 /// The list of memory hash detections contributing to the binary family
9079 /// match.
9080 pub detections: std::vec::Vec<
9081 crate::model::indicator::process_signature::memory_hash_signature::Detection,
9082 >,
9083
9084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9085 }
9086
9087 impl MemoryHashSignature {
9088 /// Creates a new default instance.
9089 pub fn new() -> Self {
9090 std::default::Default::default()
9091 }
9092
9093 /// Sets the value of [binary_family][crate::model::indicator::process_signature::MemoryHashSignature::binary_family].
9094 ///
9095 /// # Example
9096 /// ```ignore,no_run
9097 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
9098 /// let x = MemoryHashSignature::new().set_binary_family("example");
9099 /// ```
9100 pub fn set_binary_family<T: std::convert::Into<std::string::String>>(
9101 mut self,
9102 v: T,
9103 ) -> Self {
9104 self.binary_family = v.into();
9105 self
9106 }
9107
9108 /// Sets the value of [detections][crate::model::indicator::process_signature::MemoryHashSignature::detections].
9109 ///
9110 /// # Example
9111 /// ```ignore,no_run
9112 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
9113 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9114 /// let x = MemoryHashSignature::new()
9115 /// .set_detections([
9116 /// Detection::default()/* use setters */,
9117 /// Detection::default()/* use (different) setters */,
9118 /// ]);
9119 /// ```
9120 pub fn set_detections<T, V>(mut self, v: T) -> Self
9121 where
9122 T: std::iter::IntoIterator<Item = V>,
9123 V: std::convert::Into<crate::model::indicator::process_signature::memory_hash_signature::Detection>
9124 {
9125 use std::iter::Iterator;
9126 self.detections = v.into_iter().map(|i| i.into()).collect();
9127 self
9128 }
9129 }
9130
9131 impl wkt::message::Message for MemoryHashSignature {
9132 fn typename() -> &'static str {
9133 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature"
9134 }
9135 }
9136
9137 /// Defines additional types related to [MemoryHashSignature].
9138 pub mod memory_hash_signature {
9139 #[allow(unused_imports)]
9140 use super::*;
9141
9142 /// Memory hash detection contributing to the binary family match.
9143 #[derive(Clone, Default, PartialEq)]
9144 #[non_exhaustive]
9145 pub struct Detection {
9146 /// The name of the binary associated with the memory hash
9147 /// signature detection.
9148 pub binary: std::string::String,
9149
9150 /// The percentage of memory page hashes in the signature
9151 /// that were matched.
9152 pub percent_pages_matched: f64,
9153
9154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9155 }
9156
9157 impl Detection {
9158 /// Creates a new default instance.
9159 pub fn new() -> Self {
9160 std::default::Default::default()
9161 }
9162
9163 /// Sets the value of [binary][crate::model::indicator::process_signature::memory_hash_signature::Detection::binary].
9164 ///
9165 /// # Example
9166 /// ```ignore,no_run
9167 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9168 /// let x = Detection::new().set_binary("example");
9169 /// ```
9170 pub fn set_binary<T: std::convert::Into<std::string::String>>(
9171 mut self,
9172 v: T,
9173 ) -> Self {
9174 self.binary = v.into();
9175 self
9176 }
9177
9178 /// Sets the value of [percent_pages_matched][crate::model::indicator::process_signature::memory_hash_signature::Detection::percent_pages_matched].
9179 ///
9180 /// # Example
9181 /// ```ignore,no_run
9182 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9183 /// let x = Detection::new().set_percent_pages_matched(42.0);
9184 /// ```
9185 pub fn set_percent_pages_matched<T: std::convert::Into<f64>>(
9186 mut self,
9187 v: T,
9188 ) -> Self {
9189 self.percent_pages_matched = v.into();
9190 self
9191 }
9192 }
9193
9194 impl wkt::message::Message for Detection {
9195 fn typename() -> &'static str {
9196 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection"
9197 }
9198 }
9199 }
9200
9201 /// A signature corresponding to a YARA rule.
9202 #[derive(Clone, Default, PartialEq)]
9203 #[non_exhaustive]
9204 pub struct YaraRuleSignature {
9205 /// The name of the YARA rule.
9206 pub yara_rule: std::string::String,
9207
9208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9209 }
9210
9211 impl YaraRuleSignature {
9212 /// Creates a new default instance.
9213 pub fn new() -> Self {
9214 std::default::Default::default()
9215 }
9216
9217 /// Sets the value of [yara_rule][crate::model::indicator::process_signature::YaraRuleSignature::yara_rule].
9218 ///
9219 /// # Example
9220 /// ```ignore,no_run
9221 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::YaraRuleSignature;
9222 /// let x = YaraRuleSignature::new().set_yara_rule("example");
9223 /// ```
9224 pub fn set_yara_rule<T: std::convert::Into<std::string::String>>(
9225 mut self,
9226 v: T,
9227 ) -> Self {
9228 self.yara_rule = v.into();
9229 self
9230 }
9231 }
9232
9233 impl wkt::message::Message for YaraRuleSignature {
9234 fn typename() -> &'static str {
9235 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature"
9236 }
9237 }
9238
9239 /// Possible resource types to be associated with a signature.
9240 ///
9241 /// # Working with unknown values
9242 ///
9243 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9244 /// additional enum variants at any time. Adding new variants is not considered
9245 /// a breaking change. Applications should write their code in anticipation of:
9246 ///
9247 /// - New values appearing in future releases of the client library, **and**
9248 /// - New values received dynamically, without application changes.
9249 ///
9250 /// Please consult the [Working with enums] section in the user guide for some
9251 /// guidelines.
9252 ///
9253 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9254 #[derive(Clone, Debug, PartialEq)]
9255 #[non_exhaustive]
9256 pub enum SignatureType {
9257 /// The default signature type.
9258 Unspecified,
9259 /// Used for signatures concerning processes.
9260 Process,
9261 /// Used for signatures concerning disks.
9262 File,
9263 /// If set, the enum was initialized with an unknown value.
9264 ///
9265 /// Applications can examine the value using [SignatureType::value] or
9266 /// [SignatureType::name].
9267 UnknownValue(signature_type::UnknownValue),
9268 }
9269
9270 #[doc(hidden)]
9271 pub mod signature_type {
9272 #[allow(unused_imports)]
9273 use super::*;
9274 #[derive(Clone, Debug, PartialEq)]
9275 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9276 }
9277
9278 impl SignatureType {
9279 /// Gets the enum value.
9280 ///
9281 /// Returns `None` if the enum contains an unknown value deserialized from
9282 /// the string representation of enums.
9283 pub fn value(&self) -> std::option::Option<i32> {
9284 match self {
9285 Self::Unspecified => std::option::Option::Some(0),
9286 Self::Process => std::option::Option::Some(1),
9287 Self::File => std::option::Option::Some(2),
9288 Self::UnknownValue(u) => u.0.value(),
9289 }
9290 }
9291
9292 /// Gets the enum value as a string.
9293 ///
9294 /// Returns `None` if the enum contains an unknown value deserialized from
9295 /// the integer representation of enums.
9296 pub fn name(&self) -> std::option::Option<&str> {
9297 match self {
9298 Self::Unspecified => std::option::Option::Some("SIGNATURE_TYPE_UNSPECIFIED"),
9299 Self::Process => std::option::Option::Some("SIGNATURE_TYPE_PROCESS"),
9300 Self::File => std::option::Option::Some("SIGNATURE_TYPE_FILE"),
9301 Self::UnknownValue(u) => u.0.name(),
9302 }
9303 }
9304 }
9305
9306 impl std::default::Default for SignatureType {
9307 fn default() -> Self {
9308 use std::convert::From;
9309 Self::from(0)
9310 }
9311 }
9312
9313 impl std::fmt::Display for SignatureType {
9314 fn fmt(
9315 &self,
9316 f: &mut std::fmt::Formatter<'_>,
9317 ) -> std::result::Result<(), std::fmt::Error> {
9318 wkt::internal::display_enum(f, self.name(), self.value())
9319 }
9320 }
9321
9322 impl std::convert::From<i32> for SignatureType {
9323 fn from(value: i32) -> Self {
9324 match value {
9325 0 => Self::Unspecified,
9326 1 => Self::Process,
9327 2 => Self::File,
9328 _ => Self::UnknownValue(signature_type::UnknownValue(
9329 wkt::internal::UnknownEnumValue::Integer(value),
9330 )),
9331 }
9332 }
9333 }
9334
9335 impl std::convert::From<&str> for SignatureType {
9336 fn from(value: &str) -> Self {
9337 use std::string::ToString;
9338 match value {
9339 "SIGNATURE_TYPE_UNSPECIFIED" => Self::Unspecified,
9340 "SIGNATURE_TYPE_PROCESS" => Self::Process,
9341 "SIGNATURE_TYPE_FILE" => Self::File,
9342 _ => Self::UnknownValue(signature_type::UnknownValue(
9343 wkt::internal::UnknownEnumValue::String(value.to_string()),
9344 )),
9345 }
9346 }
9347 }
9348
9349 impl serde::ser::Serialize for SignatureType {
9350 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9351 where
9352 S: serde::Serializer,
9353 {
9354 match self {
9355 Self::Unspecified => serializer.serialize_i32(0),
9356 Self::Process => serializer.serialize_i32(1),
9357 Self::File => serializer.serialize_i32(2),
9358 Self::UnknownValue(u) => u.0.serialize(serializer),
9359 }
9360 }
9361 }
9362
9363 impl<'de> serde::de::Deserialize<'de> for SignatureType {
9364 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9365 where
9366 D: serde::Deserializer<'de>,
9367 {
9368 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignatureType>::new(
9369 ".google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType",
9370 ))
9371 }
9372 }
9373
9374 /// The signature.
9375 #[derive(Clone, Debug, PartialEq)]
9376 #[non_exhaustive]
9377 pub enum Signature {
9378 /// Signature indicating that a binary family was matched.
9379 MemoryHashSignature(
9380 std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
9381 ),
9382 /// Signature indicating that a YARA rule was matched.
9383 YaraRuleSignature(
9384 std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
9385 ),
9386 }
9387 }
9388}
9389
9390/// IP rules associated with the finding.
9391#[derive(Clone, Default, PartialEq)]
9392#[non_exhaustive]
9393pub struct IpRules {
9394 /// The direction that the rule is applicable to, one of ingress or egress.
9395 pub direction: crate::model::ip_rules::Direction,
9396
9397 /// If source IP ranges are specified, the firewall rule applies only to
9398 /// traffic that has a source IP address in these ranges. These ranges must be
9399 /// expressed in CIDR format. Only supports IPv4.
9400 pub source_ip_ranges: std::vec::Vec<std::string::String>,
9401
9402 /// If destination IP ranges are specified, the firewall rule applies only to
9403 /// traffic that has a destination IP address in these ranges. These ranges
9404 /// must be expressed in CIDR format. Only supports IPv4.
9405 pub destination_ip_ranges: std::vec::Vec<std::string::String>,
9406
9407 /// Name of the network protocol service, such as FTP, that is exposed by the
9408 /// open port. Follows the naming convention available at:
9409 /// <https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml>.
9410 pub exposed_services: std::vec::Vec<std::string::String>,
9411
9412 /// The list of allow rules specified by this firewall. Each rule specifies a
9413 /// protocol and port-range tuple that describes a permitted connection.
9414 pub rules: std::option::Option<crate::model::ip_rules::Rules>,
9415
9416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9417}
9418
9419impl IpRules {
9420 /// Creates a new default instance.
9421 pub fn new() -> Self {
9422 std::default::Default::default()
9423 }
9424
9425 /// Sets the value of [direction][crate::model::IpRules::direction].
9426 ///
9427 /// # Example
9428 /// ```ignore,no_run
9429 /// # use google_cloud_securitycenter_v2::model::IpRules;
9430 /// use google_cloud_securitycenter_v2::model::ip_rules::Direction;
9431 /// let x0 = IpRules::new().set_direction(Direction::Ingress);
9432 /// let x1 = IpRules::new().set_direction(Direction::Egress);
9433 /// ```
9434 pub fn set_direction<T: std::convert::Into<crate::model::ip_rules::Direction>>(
9435 mut self,
9436 v: T,
9437 ) -> Self {
9438 self.direction = v.into();
9439 self
9440 }
9441
9442 /// Sets the value of [source_ip_ranges][crate::model::IpRules::source_ip_ranges].
9443 ///
9444 /// # Example
9445 /// ```ignore,no_run
9446 /// # use google_cloud_securitycenter_v2::model::IpRules;
9447 /// let x = IpRules::new().set_source_ip_ranges(["a", "b", "c"]);
9448 /// ```
9449 pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
9450 where
9451 T: std::iter::IntoIterator<Item = V>,
9452 V: std::convert::Into<std::string::String>,
9453 {
9454 use std::iter::Iterator;
9455 self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
9456 self
9457 }
9458
9459 /// Sets the value of [destination_ip_ranges][crate::model::IpRules::destination_ip_ranges].
9460 ///
9461 /// # Example
9462 /// ```ignore,no_run
9463 /// # use google_cloud_securitycenter_v2::model::IpRules;
9464 /// let x = IpRules::new().set_destination_ip_ranges(["a", "b", "c"]);
9465 /// ```
9466 pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
9467 where
9468 T: std::iter::IntoIterator<Item = V>,
9469 V: std::convert::Into<std::string::String>,
9470 {
9471 use std::iter::Iterator;
9472 self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
9473 self
9474 }
9475
9476 /// Sets the value of [exposed_services][crate::model::IpRules::exposed_services].
9477 ///
9478 /// # Example
9479 /// ```ignore,no_run
9480 /// # use google_cloud_securitycenter_v2::model::IpRules;
9481 /// let x = IpRules::new().set_exposed_services(["a", "b", "c"]);
9482 /// ```
9483 pub fn set_exposed_services<T, V>(mut self, v: T) -> Self
9484 where
9485 T: std::iter::IntoIterator<Item = V>,
9486 V: std::convert::Into<std::string::String>,
9487 {
9488 use std::iter::Iterator;
9489 self.exposed_services = v.into_iter().map(|i| i.into()).collect();
9490 self
9491 }
9492
9493 /// Sets the value of [rules][crate::model::IpRules::rules].
9494 ///
9495 /// Note that all the setters affecting `rules` are mutually
9496 /// exclusive.
9497 ///
9498 /// # Example
9499 /// ```ignore,no_run
9500 /// # use google_cloud_securitycenter_v2::model::IpRules;
9501 /// use google_cloud_securitycenter_v2::model::Allowed;
9502 /// let x = IpRules::new().set_rules(Some(
9503 /// google_cloud_securitycenter_v2::model::ip_rules::Rules::Allowed(Allowed::default().into())));
9504 /// ```
9505 pub fn set_rules<T: std::convert::Into<std::option::Option<crate::model::ip_rules::Rules>>>(
9506 mut self,
9507 v: T,
9508 ) -> Self {
9509 self.rules = v.into();
9510 self
9511 }
9512
9513 /// The value of [rules][crate::model::IpRules::rules]
9514 /// if it holds a `Allowed`, `None` if the field is not set or
9515 /// holds a different branch.
9516 pub fn allowed(&self) -> std::option::Option<&std::boxed::Box<crate::model::Allowed>> {
9517 #[allow(unreachable_patterns)]
9518 self.rules.as_ref().and_then(|v| match v {
9519 crate::model::ip_rules::Rules::Allowed(v) => std::option::Option::Some(v),
9520 _ => std::option::Option::None,
9521 })
9522 }
9523
9524 /// Sets the value of [rules][crate::model::IpRules::rules]
9525 /// to hold a `Allowed`.
9526 ///
9527 /// Note that all the setters affecting `rules` are
9528 /// mutually exclusive.
9529 ///
9530 /// # Example
9531 /// ```ignore,no_run
9532 /// # use google_cloud_securitycenter_v2::model::IpRules;
9533 /// use google_cloud_securitycenter_v2::model::Allowed;
9534 /// let x = IpRules::new().set_allowed(Allowed::default()/* use setters */);
9535 /// assert!(x.allowed().is_some());
9536 /// assert!(x.denied().is_none());
9537 /// ```
9538 pub fn set_allowed<T: std::convert::Into<std::boxed::Box<crate::model::Allowed>>>(
9539 mut self,
9540 v: T,
9541 ) -> Self {
9542 self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Allowed(v.into()));
9543 self
9544 }
9545
9546 /// The value of [rules][crate::model::IpRules::rules]
9547 /// if it holds a `Denied`, `None` if the field is not set or
9548 /// holds a different branch.
9549 pub fn denied(&self) -> std::option::Option<&std::boxed::Box<crate::model::Denied>> {
9550 #[allow(unreachable_patterns)]
9551 self.rules.as_ref().and_then(|v| match v {
9552 crate::model::ip_rules::Rules::Denied(v) => std::option::Option::Some(v),
9553 _ => std::option::Option::None,
9554 })
9555 }
9556
9557 /// Sets the value of [rules][crate::model::IpRules::rules]
9558 /// to hold a `Denied`.
9559 ///
9560 /// Note that all the setters affecting `rules` are
9561 /// mutually exclusive.
9562 ///
9563 /// # Example
9564 /// ```ignore,no_run
9565 /// # use google_cloud_securitycenter_v2::model::IpRules;
9566 /// use google_cloud_securitycenter_v2::model::Denied;
9567 /// let x = IpRules::new().set_denied(Denied::default()/* use setters */);
9568 /// assert!(x.denied().is_some());
9569 /// assert!(x.allowed().is_none());
9570 /// ```
9571 pub fn set_denied<T: std::convert::Into<std::boxed::Box<crate::model::Denied>>>(
9572 mut self,
9573 v: T,
9574 ) -> Self {
9575 self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Denied(v.into()));
9576 self
9577 }
9578}
9579
9580impl wkt::message::Message for IpRules {
9581 fn typename() -> &'static str {
9582 "type.googleapis.com/google.cloud.securitycenter.v2.IpRules"
9583 }
9584}
9585
9586/// Defines additional types related to [IpRules].
9587pub mod ip_rules {
9588 #[allow(unused_imports)]
9589 use super::*;
9590
9591 /// The type of direction that the rule is applicable to, one of ingress or
9592 /// egress. Not applicable to OPEN_X_PORT findings.
9593 ///
9594 /// # Working with unknown values
9595 ///
9596 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9597 /// additional enum variants at any time. Adding new variants is not considered
9598 /// a breaking change. Applications should write their code in anticipation of:
9599 ///
9600 /// - New values appearing in future releases of the client library, **and**
9601 /// - New values received dynamically, without application changes.
9602 ///
9603 /// Please consult the [Working with enums] section in the user guide for some
9604 /// guidelines.
9605 ///
9606 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9607 #[derive(Clone, Debug, PartialEq)]
9608 #[non_exhaustive]
9609 pub enum Direction {
9610 /// Unspecified direction value.
9611 Unspecified,
9612 /// Ingress direction value.
9613 Ingress,
9614 /// Egress direction value.
9615 Egress,
9616 /// If set, the enum was initialized with an unknown value.
9617 ///
9618 /// Applications can examine the value using [Direction::value] or
9619 /// [Direction::name].
9620 UnknownValue(direction::UnknownValue),
9621 }
9622
9623 #[doc(hidden)]
9624 pub mod direction {
9625 #[allow(unused_imports)]
9626 use super::*;
9627 #[derive(Clone, Debug, PartialEq)]
9628 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9629 }
9630
9631 impl Direction {
9632 /// Gets the enum value.
9633 ///
9634 /// Returns `None` if the enum contains an unknown value deserialized from
9635 /// the string representation of enums.
9636 pub fn value(&self) -> std::option::Option<i32> {
9637 match self {
9638 Self::Unspecified => std::option::Option::Some(0),
9639 Self::Ingress => std::option::Option::Some(1),
9640 Self::Egress => std::option::Option::Some(2),
9641 Self::UnknownValue(u) => u.0.value(),
9642 }
9643 }
9644
9645 /// Gets the enum value as a string.
9646 ///
9647 /// Returns `None` if the enum contains an unknown value deserialized from
9648 /// the integer representation of enums.
9649 pub fn name(&self) -> std::option::Option<&str> {
9650 match self {
9651 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
9652 Self::Ingress => std::option::Option::Some("INGRESS"),
9653 Self::Egress => std::option::Option::Some("EGRESS"),
9654 Self::UnknownValue(u) => u.0.name(),
9655 }
9656 }
9657 }
9658
9659 impl std::default::Default for Direction {
9660 fn default() -> Self {
9661 use std::convert::From;
9662 Self::from(0)
9663 }
9664 }
9665
9666 impl std::fmt::Display for Direction {
9667 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9668 wkt::internal::display_enum(f, self.name(), self.value())
9669 }
9670 }
9671
9672 impl std::convert::From<i32> for Direction {
9673 fn from(value: i32) -> Self {
9674 match value {
9675 0 => Self::Unspecified,
9676 1 => Self::Ingress,
9677 2 => Self::Egress,
9678 _ => Self::UnknownValue(direction::UnknownValue(
9679 wkt::internal::UnknownEnumValue::Integer(value),
9680 )),
9681 }
9682 }
9683 }
9684
9685 impl std::convert::From<&str> for Direction {
9686 fn from(value: &str) -> Self {
9687 use std::string::ToString;
9688 match value {
9689 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
9690 "INGRESS" => Self::Ingress,
9691 "EGRESS" => Self::Egress,
9692 _ => Self::UnknownValue(direction::UnknownValue(
9693 wkt::internal::UnknownEnumValue::String(value.to_string()),
9694 )),
9695 }
9696 }
9697 }
9698
9699 impl serde::ser::Serialize for Direction {
9700 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9701 where
9702 S: serde::Serializer,
9703 {
9704 match self {
9705 Self::Unspecified => serializer.serialize_i32(0),
9706 Self::Ingress => serializer.serialize_i32(1),
9707 Self::Egress => serializer.serialize_i32(2),
9708 Self::UnknownValue(u) => u.0.serialize(serializer),
9709 }
9710 }
9711 }
9712
9713 impl<'de> serde::de::Deserialize<'de> for Direction {
9714 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9715 where
9716 D: serde::Deserializer<'de>,
9717 {
9718 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
9719 ".google.cloud.securitycenter.v2.IpRules.Direction",
9720 ))
9721 }
9722 }
9723
9724 /// The list of allow rules specified by this firewall. Each rule specifies a
9725 /// protocol and port-range tuple that describes a permitted connection.
9726 #[derive(Clone, Debug, PartialEq)]
9727 #[non_exhaustive]
9728 pub enum Rules {
9729 /// Tuple with allowed rules.
9730 Allowed(std::boxed::Box<crate::model::Allowed>),
9731 /// Tuple with denied rules.
9732 Denied(std::boxed::Box<crate::model::Denied>),
9733 }
9734}
9735
9736/// IP rule information.
9737#[derive(Clone, Default, PartialEq)]
9738#[non_exhaustive]
9739pub struct IpRule {
9740 /// The IP protocol this rule applies to. This value can either be one of the
9741 /// following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,
9742 /// SCTP) or a string representation of the integer value.
9743 pub protocol: std::string::String,
9744
9745 /// Optional. An optional list of ports to which this rule applies. This field
9746 /// is only applicable for the UDP or (S)TCP protocols. Each entry must be
9747 /// either an integer or a range including a min and max port number.
9748 pub port_ranges: std::vec::Vec<crate::model::ip_rule::PortRange>,
9749
9750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9751}
9752
9753impl IpRule {
9754 /// Creates a new default instance.
9755 pub fn new() -> Self {
9756 std::default::Default::default()
9757 }
9758
9759 /// Sets the value of [protocol][crate::model::IpRule::protocol].
9760 ///
9761 /// # Example
9762 /// ```ignore,no_run
9763 /// # use google_cloud_securitycenter_v2::model::IpRule;
9764 /// let x = IpRule::new().set_protocol("example");
9765 /// ```
9766 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9767 self.protocol = v.into();
9768 self
9769 }
9770
9771 /// Sets the value of [port_ranges][crate::model::IpRule::port_ranges].
9772 ///
9773 /// # Example
9774 /// ```ignore,no_run
9775 /// # use google_cloud_securitycenter_v2::model::IpRule;
9776 /// use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9777 /// let x = IpRule::new()
9778 /// .set_port_ranges([
9779 /// PortRange::default()/* use setters */,
9780 /// PortRange::default()/* use (different) setters */,
9781 /// ]);
9782 /// ```
9783 pub fn set_port_ranges<T, V>(mut self, v: T) -> Self
9784 where
9785 T: std::iter::IntoIterator<Item = V>,
9786 V: std::convert::Into<crate::model::ip_rule::PortRange>,
9787 {
9788 use std::iter::Iterator;
9789 self.port_ranges = v.into_iter().map(|i| i.into()).collect();
9790 self
9791 }
9792}
9793
9794impl wkt::message::Message for IpRule {
9795 fn typename() -> &'static str {
9796 "type.googleapis.com/google.cloud.securitycenter.v2.IpRule"
9797 }
9798}
9799
9800/// Defines additional types related to [IpRule].
9801pub mod ip_rule {
9802 #[allow(unused_imports)]
9803 use super::*;
9804
9805 /// A port range which is inclusive of the min and max values.
9806 /// Values are between 0 and 2^16-1. The max can be equal / must be not smaller
9807 /// than the min value. If min and max are equal this indicates that it is a
9808 /// single port.
9809 #[derive(Clone, Default, PartialEq)]
9810 #[non_exhaustive]
9811 pub struct PortRange {
9812 /// Minimum port value.
9813 pub min: i64,
9814
9815 /// Maximum port value.
9816 pub max: i64,
9817
9818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9819 }
9820
9821 impl PortRange {
9822 /// Creates a new default instance.
9823 pub fn new() -> Self {
9824 std::default::Default::default()
9825 }
9826
9827 /// Sets the value of [min][crate::model::ip_rule::PortRange::min].
9828 ///
9829 /// # Example
9830 /// ```ignore,no_run
9831 /// # use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9832 /// let x = PortRange::new().set_min(42);
9833 /// ```
9834 pub fn set_min<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9835 self.min = v.into();
9836 self
9837 }
9838
9839 /// Sets the value of [max][crate::model::ip_rule::PortRange::max].
9840 ///
9841 /// # Example
9842 /// ```ignore,no_run
9843 /// # use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9844 /// let x = PortRange::new().set_max(42);
9845 /// ```
9846 pub fn set_max<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9847 self.max = v.into();
9848 self
9849 }
9850 }
9851
9852 impl wkt::message::Message for PortRange {
9853 fn typename() -> &'static str {
9854 "type.googleapis.com/google.cloud.securitycenter.v2.IpRule.PortRange"
9855 }
9856 }
9857}
9858
9859/// Allowed IP rule.
9860#[derive(Clone, Default, PartialEq)]
9861#[non_exhaustive]
9862pub struct Allowed {
9863 /// Optional. Optional list of allowed IP rules.
9864 pub ip_rules: std::vec::Vec<crate::model::IpRule>,
9865
9866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9867}
9868
9869impl Allowed {
9870 /// Creates a new default instance.
9871 pub fn new() -> Self {
9872 std::default::Default::default()
9873 }
9874
9875 /// Sets the value of [ip_rules][crate::model::Allowed::ip_rules].
9876 ///
9877 /// # Example
9878 /// ```ignore,no_run
9879 /// # use google_cloud_securitycenter_v2::model::Allowed;
9880 /// use google_cloud_securitycenter_v2::model::IpRule;
9881 /// let x = Allowed::new()
9882 /// .set_ip_rules([
9883 /// IpRule::default()/* use setters */,
9884 /// IpRule::default()/* use (different) setters */,
9885 /// ]);
9886 /// ```
9887 pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
9888 where
9889 T: std::iter::IntoIterator<Item = V>,
9890 V: std::convert::Into<crate::model::IpRule>,
9891 {
9892 use std::iter::Iterator;
9893 self.ip_rules = v.into_iter().map(|i| i.into()).collect();
9894 self
9895 }
9896}
9897
9898impl wkt::message::Message for Allowed {
9899 fn typename() -> &'static str {
9900 "type.googleapis.com/google.cloud.securitycenter.v2.Allowed"
9901 }
9902}
9903
9904/// Denied IP rule.
9905#[derive(Clone, Default, PartialEq)]
9906#[non_exhaustive]
9907pub struct Denied {
9908 /// Optional. Optional list of denied IP rules.
9909 pub ip_rules: std::vec::Vec<crate::model::IpRule>,
9910
9911 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9912}
9913
9914impl Denied {
9915 /// Creates a new default instance.
9916 pub fn new() -> Self {
9917 std::default::Default::default()
9918 }
9919
9920 /// Sets the value of [ip_rules][crate::model::Denied::ip_rules].
9921 ///
9922 /// # Example
9923 /// ```ignore,no_run
9924 /// # use google_cloud_securitycenter_v2::model::Denied;
9925 /// use google_cloud_securitycenter_v2::model::IpRule;
9926 /// let x = Denied::new()
9927 /// .set_ip_rules([
9928 /// IpRule::default()/* use setters */,
9929 /// IpRule::default()/* use (different) setters */,
9930 /// ]);
9931 /// ```
9932 pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
9933 where
9934 T: std::iter::IntoIterator<Item = V>,
9935 V: std::convert::Into<crate::model::IpRule>,
9936 {
9937 use std::iter::Iterator;
9938 self.ip_rules = v.into_iter().map(|i| i.into()).collect();
9939 self
9940 }
9941}
9942
9943impl wkt::message::Message for Denied {
9944 fn typename() -> &'static str {
9945 "type.googleapis.com/google.cloud.securitycenter.v2.Denied"
9946 }
9947}
9948
9949/// Describes a job
9950#[derive(Clone, Default, PartialEq)]
9951#[non_exhaustive]
9952pub struct Job {
9953 /// The fully-qualified name for a job.
9954 /// e.g. `projects/<project_id>/jobs/<job_id>`
9955 pub name: std::string::String,
9956
9957 /// Output only. State of the job, such as `RUNNING` or `PENDING`.
9958 pub state: crate::model::JobState,
9959
9960 /// Optional. If the job did not complete successfully, this field describes
9961 /// why.
9962 pub error_code: i32,
9963
9964 /// Optional. Gives the location where the job ran, such as `US` or
9965 /// `europe-west1`
9966 pub location: std::string::String,
9967
9968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9969}
9970
9971impl Job {
9972 /// Creates a new default instance.
9973 pub fn new() -> Self {
9974 std::default::Default::default()
9975 }
9976
9977 /// Sets the value of [name][crate::model::Job::name].
9978 ///
9979 /// # Example
9980 /// ```ignore,no_run
9981 /// # use google_cloud_securitycenter_v2::model::Job;
9982 /// let x = Job::new().set_name("example");
9983 /// ```
9984 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9985 self.name = v.into();
9986 self
9987 }
9988
9989 /// Sets the value of [state][crate::model::Job::state].
9990 ///
9991 /// # Example
9992 /// ```ignore,no_run
9993 /// # use google_cloud_securitycenter_v2::model::Job;
9994 /// use google_cloud_securitycenter_v2::model::JobState;
9995 /// let x0 = Job::new().set_state(JobState::Pending);
9996 /// let x1 = Job::new().set_state(JobState::Running);
9997 /// let x2 = Job::new().set_state(JobState::Succeeded);
9998 /// ```
9999 pub fn set_state<T: std::convert::Into<crate::model::JobState>>(mut self, v: T) -> Self {
10000 self.state = v.into();
10001 self
10002 }
10003
10004 /// Sets the value of [error_code][crate::model::Job::error_code].
10005 ///
10006 /// # Example
10007 /// ```ignore,no_run
10008 /// # use google_cloud_securitycenter_v2::model::Job;
10009 /// let x = Job::new().set_error_code(42);
10010 /// ```
10011 pub fn set_error_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10012 self.error_code = v.into();
10013 self
10014 }
10015
10016 /// Sets the value of [location][crate::model::Job::location].
10017 ///
10018 /// # Example
10019 /// ```ignore,no_run
10020 /// # use google_cloud_securitycenter_v2::model::Job;
10021 /// let x = Job::new().set_location("example");
10022 /// ```
10023 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10024 self.location = v.into();
10025 self
10026 }
10027}
10028
10029impl wkt::message::Message for Job {
10030 fn typename() -> &'static str {
10031 "type.googleapis.com/google.cloud.securitycenter.v2.Job"
10032 }
10033}
10034
10035/// Kernel mode rootkit signatures.
10036#[derive(Clone, Default, PartialEq)]
10037#[non_exhaustive]
10038pub struct KernelRootkit {
10039 /// Rootkit name, when available.
10040 pub name: std::string::String,
10041
10042 /// True if unexpected modifications of kernel code memory are present.
10043 pub unexpected_code_modification: bool,
10044
10045 /// True if unexpected modifications of kernel read-only data memory are
10046 /// present.
10047 pub unexpected_read_only_data_modification: bool,
10048
10049 /// True if `ftrace` points are present with callbacks pointing to regions
10050 /// that are not in the expected kernel or module code range.
10051 pub unexpected_ftrace_handler: bool,
10052
10053 /// True if `kprobe` points are present with callbacks pointing to regions
10054 /// that are not in the expected kernel or module code range.
10055 pub unexpected_kprobe_handler: bool,
10056
10057 /// True if kernel code pages that are not in the expected kernel or module
10058 /// code regions are present.
10059 pub unexpected_kernel_code_pages: bool,
10060
10061 /// True if system call handlers that are are not in the expected kernel or
10062 /// module code regions are present.
10063 pub unexpected_system_call_handler: bool,
10064
10065 /// True if interrupt handlers that are are not in the expected kernel or
10066 /// module code regions are present.
10067 pub unexpected_interrupt_handler: bool,
10068
10069 /// True if unexpected processes in the scheduler run queue are present. Such
10070 /// processes are in the run queue, but not in the process task list.
10071 pub unexpected_processes_in_runqueue: bool,
10072
10073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10074}
10075
10076impl KernelRootkit {
10077 /// Creates a new default instance.
10078 pub fn new() -> Self {
10079 std::default::Default::default()
10080 }
10081
10082 /// Sets the value of [name][crate::model::KernelRootkit::name].
10083 ///
10084 /// # Example
10085 /// ```ignore,no_run
10086 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10087 /// let x = KernelRootkit::new().set_name("example");
10088 /// ```
10089 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10090 self.name = v.into();
10091 self
10092 }
10093
10094 /// Sets the value of [unexpected_code_modification][crate::model::KernelRootkit::unexpected_code_modification].
10095 ///
10096 /// # Example
10097 /// ```ignore,no_run
10098 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10099 /// let x = KernelRootkit::new().set_unexpected_code_modification(true);
10100 /// ```
10101 pub fn set_unexpected_code_modification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10102 self.unexpected_code_modification = v.into();
10103 self
10104 }
10105
10106 /// Sets the value of [unexpected_read_only_data_modification][crate::model::KernelRootkit::unexpected_read_only_data_modification].
10107 ///
10108 /// # Example
10109 /// ```ignore,no_run
10110 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10111 /// let x = KernelRootkit::new().set_unexpected_read_only_data_modification(true);
10112 /// ```
10113 pub fn set_unexpected_read_only_data_modification<T: std::convert::Into<bool>>(
10114 mut self,
10115 v: T,
10116 ) -> Self {
10117 self.unexpected_read_only_data_modification = v.into();
10118 self
10119 }
10120
10121 /// Sets the value of [unexpected_ftrace_handler][crate::model::KernelRootkit::unexpected_ftrace_handler].
10122 ///
10123 /// # Example
10124 /// ```ignore,no_run
10125 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10126 /// let x = KernelRootkit::new().set_unexpected_ftrace_handler(true);
10127 /// ```
10128 pub fn set_unexpected_ftrace_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10129 self.unexpected_ftrace_handler = v.into();
10130 self
10131 }
10132
10133 /// Sets the value of [unexpected_kprobe_handler][crate::model::KernelRootkit::unexpected_kprobe_handler].
10134 ///
10135 /// # Example
10136 /// ```ignore,no_run
10137 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10138 /// let x = KernelRootkit::new().set_unexpected_kprobe_handler(true);
10139 /// ```
10140 pub fn set_unexpected_kprobe_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10141 self.unexpected_kprobe_handler = v.into();
10142 self
10143 }
10144
10145 /// Sets the value of [unexpected_kernel_code_pages][crate::model::KernelRootkit::unexpected_kernel_code_pages].
10146 ///
10147 /// # Example
10148 /// ```ignore,no_run
10149 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10150 /// let x = KernelRootkit::new().set_unexpected_kernel_code_pages(true);
10151 /// ```
10152 pub fn set_unexpected_kernel_code_pages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10153 self.unexpected_kernel_code_pages = v.into();
10154 self
10155 }
10156
10157 /// Sets the value of [unexpected_system_call_handler][crate::model::KernelRootkit::unexpected_system_call_handler].
10158 ///
10159 /// # Example
10160 /// ```ignore,no_run
10161 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10162 /// let x = KernelRootkit::new().set_unexpected_system_call_handler(true);
10163 /// ```
10164 pub fn set_unexpected_system_call_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10165 self.unexpected_system_call_handler = v.into();
10166 self
10167 }
10168
10169 /// Sets the value of [unexpected_interrupt_handler][crate::model::KernelRootkit::unexpected_interrupt_handler].
10170 ///
10171 /// # Example
10172 /// ```ignore,no_run
10173 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10174 /// let x = KernelRootkit::new().set_unexpected_interrupt_handler(true);
10175 /// ```
10176 pub fn set_unexpected_interrupt_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10177 self.unexpected_interrupt_handler = v.into();
10178 self
10179 }
10180
10181 /// Sets the value of [unexpected_processes_in_runqueue][crate::model::KernelRootkit::unexpected_processes_in_runqueue].
10182 ///
10183 /// # Example
10184 /// ```ignore,no_run
10185 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10186 /// let x = KernelRootkit::new().set_unexpected_processes_in_runqueue(true);
10187 /// ```
10188 pub fn set_unexpected_processes_in_runqueue<T: std::convert::Into<bool>>(
10189 mut self,
10190 v: T,
10191 ) -> Self {
10192 self.unexpected_processes_in_runqueue = v.into();
10193 self
10194 }
10195}
10196
10197impl wkt::message::Message for KernelRootkit {
10198 fn typename() -> &'static str {
10199 "type.googleapis.com/google.cloud.securitycenter.v2.KernelRootkit"
10200 }
10201}
10202
10203/// Kubernetes-related attributes.
10204#[derive(Clone, Default, PartialEq)]
10205#[non_exhaustive]
10206pub struct Kubernetes {
10207 /// Kubernetes
10208 /// [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
10209 /// associated with the finding. This field contains Pod records for each
10210 /// container that is owned by a Pod.
10211 pub pods: std::vec::Vec<crate::model::kubernetes::Pod>,
10212
10213 /// Provides Kubernetes
10214 /// [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes)
10215 /// information.
10216 pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
10217
10218 /// GKE [node
10219 /// pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools)
10220 /// associated with the finding. This field contains node pool information for
10221 /// each node, when it is available.
10222 pub node_pools: std::vec::Vec<crate::model::kubernetes::NodePool>,
10223
10224 /// Provides Kubernetes role information for findings that involve [Roles or
10225 /// ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control).
10226 pub roles: std::vec::Vec<crate::model::kubernetes::Role>,
10227
10228 /// Provides Kubernetes role binding information for findings that involve
10229 /// [RoleBindings or
10230 /// ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control).
10231 pub bindings: std::vec::Vec<crate::model::kubernetes::Binding>,
10232
10233 /// Provides information on any Kubernetes access reviews (privilege checks)
10234 /// relevant to the finding.
10235 pub access_reviews: std::vec::Vec<crate::model::kubernetes::AccessReview>,
10236
10237 /// Kubernetes objects related to the finding.
10238 pub objects: std::vec::Vec<crate::model::kubernetes::Object>,
10239
10240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10241}
10242
10243impl Kubernetes {
10244 /// Creates a new default instance.
10245 pub fn new() -> Self {
10246 std::default::Default::default()
10247 }
10248
10249 /// Sets the value of [pods][crate::model::Kubernetes::pods].
10250 ///
10251 /// # Example
10252 /// ```ignore,no_run
10253 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10254 /// use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10255 /// let x = Kubernetes::new()
10256 /// .set_pods([
10257 /// Pod::default()/* use setters */,
10258 /// Pod::default()/* use (different) setters */,
10259 /// ]);
10260 /// ```
10261 pub fn set_pods<T, V>(mut self, v: T) -> Self
10262 where
10263 T: std::iter::IntoIterator<Item = V>,
10264 V: std::convert::Into<crate::model::kubernetes::Pod>,
10265 {
10266 use std::iter::Iterator;
10267 self.pods = v.into_iter().map(|i| i.into()).collect();
10268 self
10269 }
10270
10271 /// Sets the value of [nodes][crate::model::Kubernetes::nodes].
10272 ///
10273 /// # Example
10274 /// ```ignore,no_run
10275 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10276 /// use google_cloud_securitycenter_v2::model::kubernetes::Node;
10277 /// let x = Kubernetes::new()
10278 /// .set_nodes([
10279 /// Node::default()/* use setters */,
10280 /// Node::default()/* use (different) setters */,
10281 /// ]);
10282 /// ```
10283 pub fn set_nodes<T, V>(mut self, v: T) -> Self
10284 where
10285 T: std::iter::IntoIterator<Item = V>,
10286 V: std::convert::Into<crate::model::kubernetes::Node>,
10287 {
10288 use std::iter::Iterator;
10289 self.nodes = v.into_iter().map(|i| i.into()).collect();
10290 self
10291 }
10292
10293 /// Sets the value of [node_pools][crate::model::Kubernetes::node_pools].
10294 ///
10295 /// # Example
10296 /// ```ignore,no_run
10297 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10298 /// use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10299 /// let x = Kubernetes::new()
10300 /// .set_node_pools([
10301 /// NodePool::default()/* use setters */,
10302 /// NodePool::default()/* use (different) setters */,
10303 /// ]);
10304 /// ```
10305 pub fn set_node_pools<T, V>(mut self, v: T) -> Self
10306 where
10307 T: std::iter::IntoIterator<Item = V>,
10308 V: std::convert::Into<crate::model::kubernetes::NodePool>,
10309 {
10310 use std::iter::Iterator;
10311 self.node_pools = v.into_iter().map(|i| i.into()).collect();
10312 self
10313 }
10314
10315 /// Sets the value of [roles][crate::model::Kubernetes::roles].
10316 ///
10317 /// # Example
10318 /// ```ignore,no_run
10319 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10320 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10321 /// let x = Kubernetes::new()
10322 /// .set_roles([
10323 /// Role::default()/* use setters */,
10324 /// Role::default()/* use (different) setters */,
10325 /// ]);
10326 /// ```
10327 pub fn set_roles<T, V>(mut self, v: T) -> Self
10328 where
10329 T: std::iter::IntoIterator<Item = V>,
10330 V: std::convert::Into<crate::model::kubernetes::Role>,
10331 {
10332 use std::iter::Iterator;
10333 self.roles = v.into_iter().map(|i| i.into()).collect();
10334 self
10335 }
10336
10337 /// Sets the value of [bindings][crate::model::Kubernetes::bindings].
10338 ///
10339 /// # Example
10340 /// ```ignore,no_run
10341 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10342 /// use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10343 /// let x = Kubernetes::new()
10344 /// .set_bindings([
10345 /// Binding::default()/* use setters */,
10346 /// Binding::default()/* use (different) setters */,
10347 /// ]);
10348 /// ```
10349 pub fn set_bindings<T, V>(mut self, v: T) -> Self
10350 where
10351 T: std::iter::IntoIterator<Item = V>,
10352 V: std::convert::Into<crate::model::kubernetes::Binding>,
10353 {
10354 use std::iter::Iterator;
10355 self.bindings = v.into_iter().map(|i| i.into()).collect();
10356 self
10357 }
10358
10359 /// Sets the value of [access_reviews][crate::model::Kubernetes::access_reviews].
10360 ///
10361 /// # Example
10362 /// ```ignore,no_run
10363 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10364 /// use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
10365 /// let x = Kubernetes::new()
10366 /// .set_access_reviews([
10367 /// AccessReview::default()/* use setters */,
10368 /// AccessReview::default()/* use (different) setters */,
10369 /// ]);
10370 /// ```
10371 pub fn set_access_reviews<T, V>(mut self, v: T) -> Self
10372 where
10373 T: std::iter::IntoIterator<Item = V>,
10374 V: std::convert::Into<crate::model::kubernetes::AccessReview>,
10375 {
10376 use std::iter::Iterator;
10377 self.access_reviews = v.into_iter().map(|i| i.into()).collect();
10378 self
10379 }
10380
10381 /// Sets the value of [objects][crate::model::Kubernetes::objects].
10382 ///
10383 /// # Example
10384 /// ```ignore,no_run
10385 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10386 /// use google_cloud_securitycenter_v2::model::kubernetes::Object;
10387 /// let x = Kubernetes::new()
10388 /// .set_objects([
10389 /// Object::default()/* use setters */,
10390 /// Object::default()/* use (different) setters */,
10391 /// ]);
10392 /// ```
10393 pub fn set_objects<T, V>(mut self, v: T) -> Self
10394 where
10395 T: std::iter::IntoIterator<Item = V>,
10396 V: std::convert::Into<crate::model::kubernetes::Object>,
10397 {
10398 use std::iter::Iterator;
10399 self.objects = v.into_iter().map(|i| i.into()).collect();
10400 self
10401 }
10402}
10403
10404impl wkt::message::Message for Kubernetes {
10405 fn typename() -> &'static str {
10406 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes"
10407 }
10408}
10409
10410/// Defines additional types related to [Kubernetes].
10411pub mod kubernetes {
10412 #[allow(unused_imports)]
10413 use super::*;
10414
10415 /// A Kubernetes Pod.
10416 #[derive(Clone, Default, PartialEq)]
10417 #[non_exhaustive]
10418 pub struct Pod {
10419 /// Kubernetes Pod namespace.
10420 pub ns: std::string::String,
10421
10422 /// Kubernetes Pod name.
10423 pub name: std::string::String,
10424
10425 /// Pod labels. For Kubernetes containers, these are applied to the
10426 /// container.
10427 pub labels: std::vec::Vec<crate::model::Label>,
10428
10429 /// Pod containers associated with this finding, if any.
10430 pub containers: std::vec::Vec<crate::model::Container>,
10431
10432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10433 }
10434
10435 impl Pod {
10436 /// Creates a new default instance.
10437 pub fn new() -> Self {
10438 std::default::Default::default()
10439 }
10440
10441 /// Sets the value of [ns][crate::model::kubernetes::Pod::ns].
10442 ///
10443 /// # Example
10444 /// ```ignore,no_run
10445 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10446 /// let x = Pod::new().set_ns("example");
10447 /// ```
10448 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10449 self.ns = v.into();
10450 self
10451 }
10452
10453 /// Sets the value of [name][crate::model::kubernetes::Pod::name].
10454 ///
10455 /// # Example
10456 /// ```ignore,no_run
10457 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10458 /// let x = Pod::new().set_name("example");
10459 /// ```
10460 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10461 self.name = v.into();
10462 self
10463 }
10464
10465 /// Sets the value of [labels][crate::model::kubernetes::Pod::labels].
10466 ///
10467 /// # Example
10468 /// ```ignore,no_run
10469 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10470 /// use google_cloud_securitycenter_v2::model::Label;
10471 /// let x = Pod::new()
10472 /// .set_labels([
10473 /// Label::default()/* use setters */,
10474 /// Label::default()/* use (different) setters */,
10475 /// ]);
10476 /// ```
10477 pub fn set_labels<T, V>(mut self, v: T) -> Self
10478 where
10479 T: std::iter::IntoIterator<Item = V>,
10480 V: std::convert::Into<crate::model::Label>,
10481 {
10482 use std::iter::Iterator;
10483 self.labels = v.into_iter().map(|i| i.into()).collect();
10484 self
10485 }
10486
10487 /// Sets the value of [containers][crate::model::kubernetes::Pod::containers].
10488 ///
10489 /// # Example
10490 /// ```ignore,no_run
10491 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10492 /// use google_cloud_securitycenter_v2::model::Container;
10493 /// let x = Pod::new()
10494 /// .set_containers([
10495 /// Container::default()/* use setters */,
10496 /// Container::default()/* use (different) setters */,
10497 /// ]);
10498 /// ```
10499 pub fn set_containers<T, V>(mut self, v: T) -> Self
10500 where
10501 T: std::iter::IntoIterator<Item = V>,
10502 V: std::convert::Into<crate::model::Container>,
10503 {
10504 use std::iter::Iterator;
10505 self.containers = v.into_iter().map(|i| i.into()).collect();
10506 self
10507 }
10508 }
10509
10510 impl wkt::message::Message for Pod {
10511 fn typename() -> &'static str {
10512 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Pod"
10513 }
10514 }
10515
10516 /// Kubernetes nodes associated with the finding.
10517 #[derive(Clone, Default, PartialEq)]
10518 #[non_exhaustive]
10519 pub struct Node {
10520 /// [Full resource name](https://google.aip.dev/122#full-resource-names) of
10521 /// the Compute Engine VM running the cluster node.
10522 pub name: std::string::String,
10523
10524 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10525 }
10526
10527 impl Node {
10528 /// Creates a new default instance.
10529 pub fn new() -> Self {
10530 std::default::Default::default()
10531 }
10532
10533 /// Sets the value of [name][crate::model::kubernetes::Node::name].
10534 ///
10535 /// # Example
10536 /// ```ignore,no_run
10537 /// # use google_cloud_securitycenter_v2::model::kubernetes::Node;
10538 /// let x = Node::new().set_name("example");
10539 /// ```
10540 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10541 self.name = v.into();
10542 self
10543 }
10544 }
10545
10546 impl wkt::message::Message for Node {
10547 fn typename() -> &'static str {
10548 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Node"
10549 }
10550 }
10551
10552 /// Provides GKE node pool information.
10553 #[derive(Clone, Default, PartialEq)]
10554 #[non_exhaustive]
10555 pub struct NodePool {
10556 /// Kubernetes node pool name.
10557 pub name: std::string::String,
10558
10559 /// Nodes associated with the finding.
10560 pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
10561
10562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10563 }
10564
10565 impl NodePool {
10566 /// Creates a new default instance.
10567 pub fn new() -> Self {
10568 std::default::Default::default()
10569 }
10570
10571 /// Sets the value of [name][crate::model::kubernetes::NodePool::name].
10572 ///
10573 /// # Example
10574 /// ```ignore,no_run
10575 /// # use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10576 /// let x = NodePool::new().set_name("example");
10577 /// ```
10578 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10579 self.name = v.into();
10580 self
10581 }
10582
10583 /// Sets the value of [nodes][crate::model::kubernetes::NodePool::nodes].
10584 ///
10585 /// # Example
10586 /// ```ignore,no_run
10587 /// # use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10588 /// use google_cloud_securitycenter_v2::model::kubernetes::Node;
10589 /// let x = NodePool::new()
10590 /// .set_nodes([
10591 /// Node::default()/* use setters */,
10592 /// Node::default()/* use (different) setters */,
10593 /// ]);
10594 /// ```
10595 pub fn set_nodes<T, V>(mut self, v: T) -> Self
10596 where
10597 T: std::iter::IntoIterator<Item = V>,
10598 V: std::convert::Into<crate::model::kubernetes::Node>,
10599 {
10600 use std::iter::Iterator;
10601 self.nodes = v.into_iter().map(|i| i.into()).collect();
10602 self
10603 }
10604 }
10605
10606 impl wkt::message::Message for NodePool {
10607 fn typename() -> &'static str {
10608 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.NodePool"
10609 }
10610 }
10611
10612 /// Kubernetes Role or ClusterRole.
10613 #[derive(Clone, Default, PartialEq)]
10614 #[non_exhaustive]
10615 pub struct Role {
10616 /// Role type.
10617 pub kind: crate::model::kubernetes::role::Kind,
10618
10619 /// Role namespace.
10620 pub ns: std::string::String,
10621
10622 /// Role name.
10623 pub name: std::string::String,
10624
10625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10626 }
10627
10628 impl Role {
10629 /// Creates a new default instance.
10630 pub fn new() -> Self {
10631 std::default::Default::default()
10632 }
10633
10634 /// Sets the value of [kind][crate::model::kubernetes::Role::kind].
10635 ///
10636 /// # Example
10637 /// ```ignore,no_run
10638 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10639 /// use google_cloud_securitycenter_v2::model::kubernetes::role::Kind;
10640 /// let x0 = Role::new().set_kind(Kind::Role);
10641 /// let x1 = Role::new().set_kind(Kind::ClusterRole);
10642 /// ```
10643 pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::role::Kind>>(
10644 mut self,
10645 v: T,
10646 ) -> Self {
10647 self.kind = v.into();
10648 self
10649 }
10650
10651 /// Sets the value of [ns][crate::model::kubernetes::Role::ns].
10652 ///
10653 /// # Example
10654 /// ```ignore,no_run
10655 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10656 /// let x = Role::new().set_ns("example");
10657 /// ```
10658 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10659 self.ns = v.into();
10660 self
10661 }
10662
10663 /// Sets the value of [name][crate::model::kubernetes::Role::name].
10664 ///
10665 /// # Example
10666 /// ```ignore,no_run
10667 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10668 /// let x = Role::new().set_name("example");
10669 /// ```
10670 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10671 self.name = v.into();
10672 self
10673 }
10674 }
10675
10676 impl wkt::message::Message for Role {
10677 fn typename() -> &'static str {
10678 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Role"
10679 }
10680 }
10681
10682 /// Defines additional types related to [Role].
10683 pub mod role {
10684 #[allow(unused_imports)]
10685 use super::*;
10686
10687 /// Types of Kubernetes roles.
10688 ///
10689 /// # Working with unknown values
10690 ///
10691 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10692 /// additional enum variants at any time. Adding new variants is not considered
10693 /// a breaking change. Applications should write their code in anticipation of:
10694 ///
10695 /// - New values appearing in future releases of the client library, **and**
10696 /// - New values received dynamically, without application changes.
10697 ///
10698 /// Please consult the [Working with enums] section in the user guide for some
10699 /// guidelines.
10700 ///
10701 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10702 #[derive(Clone, Debug, PartialEq)]
10703 #[non_exhaustive]
10704 pub enum Kind {
10705 /// Role type is not specified.
10706 Unspecified,
10707 /// Kubernetes Role.
10708 Role,
10709 /// Kubernetes ClusterRole.
10710 ClusterRole,
10711 /// If set, the enum was initialized with an unknown value.
10712 ///
10713 /// Applications can examine the value using [Kind::value] or
10714 /// [Kind::name].
10715 UnknownValue(kind::UnknownValue),
10716 }
10717
10718 #[doc(hidden)]
10719 pub mod kind {
10720 #[allow(unused_imports)]
10721 use super::*;
10722 #[derive(Clone, Debug, PartialEq)]
10723 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10724 }
10725
10726 impl Kind {
10727 /// Gets the enum value.
10728 ///
10729 /// Returns `None` if the enum contains an unknown value deserialized from
10730 /// the string representation of enums.
10731 pub fn value(&self) -> std::option::Option<i32> {
10732 match self {
10733 Self::Unspecified => std::option::Option::Some(0),
10734 Self::Role => std::option::Option::Some(1),
10735 Self::ClusterRole => std::option::Option::Some(2),
10736 Self::UnknownValue(u) => u.0.value(),
10737 }
10738 }
10739
10740 /// Gets the enum value as a string.
10741 ///
10742 /// Returns `None` if the enum contains an unknown value deserialized from
10743 /// the integer representation of enums.
10744 pub fn name(&self) -> std::option::Option<&str> {
10745 match self {
10746 Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
10747 Self::Role => std::option::Option::Some("ROLE"),
10748 Self::ClusterRole => std::option::Option::Some("CLUSTER_ROLE"),
10749 Self::UnknownValue(u) => u.0.name(),
10750 }
10751 }
10752 }
10753
10754 impl std::default::Default for Kind {
10755 fn default() -> Self {
10756 use std::convert::From;
10757 Self::from(0)
10758 }
10759 }
10760
10761 impl std::fmt::Display for Kind {
10762 fn fmt(
10763 &self,
10764 f: &mut std::fmt::Formatter<'_>,
10765 ) -> std::result::Result<(), std::fmt::Error> {
10766 wkt::internal::display_enum(f, self.name(), self.value())
10767 }
10768 }
10769
10770 impl std::convert::From<i32> for Kind {
10771 fn from(value: i32) -> Self {
10772 match value {
10773 0 => Self::Unspecified,
10774 1 => Self::Role,
10775 2 => Self::ClusterRole,
10776 _ => Self::UnknownValue(kind::UnknownValue(
10777 wkt::internal::UnknownEnumValue::Integer(value),
10778 )),
10779 }
10780 }
10781 }
10782
10783 impl std::convert::From<&str> for Kind {
10784 fn from(value: &str) -> Self {
10785 use std::string::ToString;
10786 match value {
10787 "KIND_UNSPECIFIED" => Self::Unspecified,
10788 "ROLE" => Self::Role,
10789 "CLUSTER_ROLE" => Self::ClusterRole,
10790 _ => Self::UnknownValue(kind::UnknownValue(
10791 wkt::internal::UnknownEnumValue::String(value.to_string()),
10792 )),
10793 }
10794 }
10795 }
10796
10797 impl serde::ser::Serialize for Kind {
10798 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10799 where
10800 S: serde::Serializer,
10801 {
10802 match self {
10803 Self::Unspecified => serializer.serialize_i32(0),
10804 Self::Role => serializer.serialize_i32(1),
10805 Self::ClusterRole => serializer.serialize_i32(2),
10806 Self::UnknownValue(u) => u.0.serialize(serializer),
10807 }
10808 }
10809 }
10810
10811 impl<'de> serde::de::Deserialize<'de> for Kind {
10812 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10813 where
10814 D: serde::Deserializer<'de>,
10815 {
10816 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
10817 ".google.cloud.securitycenter.v2.Kubernetes.Role.Kind",
10818 ))
10819 }
10820 }
10821 }
10822
10823 /// Represents a Kubernetes RoleBinding or ClusterRoleBinding.
10824 #[derive(Clone, Default, PartialEq)]
10825 #[non_exhaustive]
10826 pub struct Binding {
10827 /// Namespace for the binding.
10828 pub ns: std::string::String,
10829
10830 /// Name for the binding.
10831 pub name: std::string::String,
10832
10833 /// The Role or ClusterRole referenced by the binding.
10834 pub role: std::option::Option<crate::model::kubernetes::Role>,
10835
10836 /// Represents one or more subjects that are bound to the role. Not always
10837 /// available for PATCH requests.
10838 pub subjects: std::vec::Vec<crate::model::kubernetes::Subject>,
10839
10840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10841 }
10842
10843 impl Binding {
10844 /// Creates a new default instance.
10845 pub fn new() -> Self {
10846 std::default::Default::default()
10847 }
10848
10849 /// Sets the value of [ns][crate::model::kubernetes::Binding::ns].
10850 ///
10851 /// # Example
10852 /// ```ignore,no_run
10853 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10854 /// let x = Binding::new().set_ns("example");
10855 /// ```
10856 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10857 self.ns = v.into();
10858 self
10859 }
10860
10861 /// Sets the value of [name][crate::model::kubernetes::Binding::name].
10862 ///
10863 /// # Example
10864 /// ```ignore,no_run
10865 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10866 /// let x = Binding::new().set_name("example");
10867 /// ```
10868 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10869 self.name = v.into();
10870 self
10871 }
10872
10873 /// Sets the value of [role][crate::model::kubernetes::Binding::role].
10874 ///
10875 /// # Example
10876 /// ```ignore,no_run
10877 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10878 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10879 /// let x = Binding::new().set_role(Role::default()/* use setters */);
10880 /// ```
10881 pub fn set_role<T>(mut self, v: T) -> Self
10882 where
10883 T: std::convert::Into<crate::model::kubernetes::Role>,
10884 {
10885 self.role = std::option::Option::Some(v.into());
10886 self
10887 }
10888
10889 /// Sets or clears the value of [role][crate::model::kubernetes::Binding::role].
10890 ///
10891 /// # Example
10892 /// ```ignore,no_run
10893 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10894 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10895 /// let x = Binding::new().set_or_clear_role(Some(Role::default()/* use setters */));
10896 /// let x = Binding::new().set_or_clear_role(None::<Role>);
10897 /// ```
10898 pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
10899 where
10900 T: std::convert::Into<crate::model::kubernetes::Role>,
10901 {
10902 self.role = v.map(|x| x.into());
10903 self
10904 }
10905
10906 /// Sets the value of [subjects][crate::model::kubernetes::Binding::subjects].
10907 ///
10908 /// # Example
10909 /// ```ignore,no_run
10910 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10911 /// use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10912 /// let x = Binding::new()
10913 /// .set_subjects([
10914 /// Subject::default()/* use setters */,
10915 /// Subject::default()/* use (different) setters */,
10916 /// ]);
10917 /// ```
10918 pub fn set_subjects<T, V>(mut self, v: T) -> Self
10919 where
10920 T: std::iter::IntoIterator<Item = V>,
10921 V: std::convert::Into<crate::model::kubernetes::Subject>,
10922 {
10923 use std::iter::Iterator;
10924 self.subjects = v.into_iter().map(|i| i.into()).collect();
10925 self
10926 }
10927 }
10928
10929 impl wkt::message::Message for Binding {
10930 fn typename() -> &'static str {
10931 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Binding"
10932 }
10933 }
10934
10935 /// Represents a Kubernetes subject.
10936 #[derive(Clone, Default, PartialEq)]
10937 #[non_exhaustive]
10938 pub struct Subject {
10939 /// Authentication type for the subject.
10940 pub kind: crate::model::kubernetes::subject::AuthType,
10941
10942 /// Namespace for the subject.
10943 pub ns: std::string::String,
10944
10945 /// Name for the subject.
10946 pub name: std::string::String,
10947
10948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10949 }
10950
10951 impl Subject {
10952 /// Creates a new default instance.
10953 pub fn new() -> Self {
10954 std::default::Default::default()
10955 }
10956
10957 /// Sets the value of [kind][crate::model::kubernetes::Subject::kind].
10958 ///
10959 /// # Example
10960 /// ```ignore,no_run
10961 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10962 /// use google_cloud_securitycenter_v2::model::kubernetes::subject::AuthType;
10963 /// let x0 = Subject::new().set_kind(AuthType::User);
10964 /// let x1 = Subject::new().set_kind(AuthType::Serviceaccount);
10965 /// let x2 = Subject::new().set_kind(AuthType::Group);
10966 /// ```
10967 pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::subject::AuthType>>(
10968 mut self,
10969 v: T,
10970 ) -> Self {
10971 self.kind = v.into();
10972 self
10973 }
10974
10975 /// Sets the value of [ns][crate::model::kubernetes::Subject::ns].
10976 ///
10977 /// # Example
10978 /// ```ignore,no_run
10979 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10980 /// let x = Subject::new().set_ns("example");
10981 /// ```
10982 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10983 self.ns = v.into();
10984 self
10985 }
10986
10987 /// Sets the value of [name][crate::model::kubernetes::Subject::name].
10988 ///
10989 /// # Example
10990 /// ```ignore,no_run
10991 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10992 /// let x = Subject::new().set_name("example");
10993 /// ```
10994 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10995 self.name = v.into();
10996 self
10997 }
10998 }
10999
11000 impl wkt::message::Message for Subject {
11001 fn typename() -> &'static str {
11002 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Subject"
11003 }
11004 }
11005
11006 /// Defines additional types related to [Subject].
11007 pub mod subject {
11008 #[allow(unused_imports)]
11009 use super::*;
11010
11011 /// Auth types that can be used for the subject's kind field.
11012 ///
11013 /// # Working with unknown values
11014 ///
11015 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11016 /// additional enum variants at any time. Adding new variants is not considered
11017 /// a breaking change. Applications should write their code in anticipation of:
11018 ///
11019 /// - New values appearing in future releases of the client library, **and**
11020 /// - New values received dynamically, without application changes.
11021 ///
11022 /// Please consult the [Working with enums] section in the user guide for some
11023 /// guidelines.
11024 ///
11025 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11026 #[derive(Clone, Debug, PartialEq)]
11027 #[non_exhaustive]
11028 pub enum AuthType {
11029 /// Authentication is not specified.
11030 Unspecified,
11031 /// User with valid certificate.
11032 User,
11033 /// Users managed by Kubernetes API with credentials stored as secrets.
11034 Serviceaccount,
11035 /// Collection of users.
11036 Group,
11037 /// If set, the enum was initialized with an unknown value.
11038 ///
11039 /// Applications can examine the value using [AuthType::value] or
11040 /// [AuthType::name].
11041 UnknownValue(auth_type::UnknownValue),
11042 }
11043
11044 #[doc(hidden)]
11045 pub mod auth_type {
11046 #[allow(unused_imports)]
11047 use super::*;
11048 #[derive(Clone, Debug, PartialEq)]
11049 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11050 }
11051
11052 impl AuthType {
11053 /// Gets the enum value.
11054 ///
11055 /// Returns `None` if the enum contains an unknown value deserialized from
11056 /// the string representation of enums.
11057 pub fn value(&self) -> std::option::Option<i32> {
11058 match self {
11059 Self::Unspecified => std::option::Option::Some(0),
11060 Self::User => std::option::Option::Some(1),
11061 Self::Serviceaccount => std::option::Option::Some(2),
11062 Self::Group => std::option::Option::Some(3),
11063 Self::UnknownValue(u) => u.0.value(),
11064 }
11065 }
11066
11067 /// Gets the enum value as a string.
11068 ///
11069 /// Returns `None` if the enum contains an unknown value deserialized from
11070 /// the integer representation of enums.
11071 pub fn name(&self) -> std::option::Option<&str> {
11072 match self {
11073 Self::Unspecified => std::option::Option::Some("AUTH_TYPE_UNSPECIFIED"),
11074 Self::User => std::option::Option::Some("USER"),
11075 Self::Serviceaccount => std::option::Option::Some("SERVICEACCOUNT"),
11076 Self::Group => std::option::Option::Some("GROUP"),
11077 Self::UnknownValue(u) => u.0.name(),
11078 }
11079 }
11080 }
11081
11082 impl std::default::Default for AuthType {
11083 fn default() -> Self {
11084 use std::convert::From;
11085 Self::from(0)
11086 }
11087 }
11088
11089 impl std::fmt::Display for AuthType {
11090 fn fmt(
11091 &self,
11092 f: &mut std::fmt::Formatter<'_>,
11093 ) -> std::result::Result<(), std::fmt::Error> {
11094 wkt::internal::display_enum(f, self.name(), self.value())
11095 }
11096 }
11097
11098 impl std::convert::From<i32> for AuthType {
11099 fn from(value: i32) -> Self {
11100 match value {
11101 0 => Self::Unspecified,
11102 1 => Self::User,
11103 2 => Self::Serviceaccount,
11104 3 => Self::Group,
11105 _ => Self::UnknownValue(auth_type::UnknownValue(
11106 wkt::internal::UnknownEnumValue::Integer(value),
11107 )),
11108 }
11109 }
11110 }
11111
11112 impl std::convert::From<&str> for AuthType {
11113 fn from(value: &str) -> Self {
11114 use std::string::ToString;
11115 match value {
11116 "AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
11117 "USER" => Self::User,
11118 "SERVICEACCOUNT" => Self::Serviceaccount,
11119 "GROUP" => Self::Group,
11120 _ => Self::UnknownValue(auth_type::UnknownValue(
11121 wkt::internal::UnknownEnumValue::String(value.to_string()),
11122 )),
11123 }
11124 }
11125 }
11126
11127 impl serde::ser::Serialize for AuthType {
11128 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11129 where
11130 S: serde::Serializer,
11131 {
11132 match self {
11133 Self::Unspecified => serializer.serialize_i32(0),
11134 Self::User => serializer.serialize_i32(1),
11135 Self::Serviceaccount => serializer.serialize_i32(2),
11136 Self::Group => serializer.serialize_i32(3),
11137 Self::UnknownValue(u) => u.0.serialize(serializer),
11138 }
11139 }
11140 }
11141
11142 impl<'de> serde::de::Deserialize<'de> for AuthType {
11143 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11144 where
11145 D: serde::Deserializer<'de>,
11146 {
11147 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
11148 ".google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType",
11149 ))
11150 }
11151 }
11152 }
11153
11154 /// Conveys information about a Kubernetes access review (such as one returned
11155 /// by a [`kubectl auth
11156 /// can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access)
11157 /// command) that was involved in a finding.
11158 #[derive(Clone, Default, PartialEq)]
11159 #[non_exhaustive]
11160 pub struct AccessReview {
11161 /// The API group of the resource. "*" means all.
11162 pub group: std::string::String,
11163
11164 /// Namespace of the action being requested. Currently, there is no
11165 /// distinction between no namespace and all namespaces. Both
11166 /// are represented by "" (empty).
11167 pub ns: std::string::String,
11168
11169 /// The name of the resource being requested. Empty means all.
11170 pub name: std::string::String,
11171
11172 /// The optional resource type requested. "*" means all.
11173 pub resource: std::string::String,
11174
11175 /// The optional subresource type.
11176 pub subresource: std::string::String,
11177
11178 /// A Kubernetes resource API verb, like get, list, watch, create, update,
11179 /// delete, proxy. "*" means all.
11180 pub verb: std::string::String,
11181
11182 /// The API version of the resource. "*" means all.
11183 pub version: std::string::String,
11184
11185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11186 }
11187
11188 impl AccessReview {
11189 /// Creates a new default instance.
11190 pub fn new() -> Self {
11191 std::default::Default::default()
11192 }
11193
11194 /// Sets the value of [group][crate::model::kubernetes::AccessReview::group].
11195 ///
11196 /// # Example
11197 /// ```ignore,no_run
11198 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11199 /// let x = AccessReview::new().set_group("example");
11200 /// ```
11201 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11202 self.group = v.into();
11203 self
11204 }
11205
11206 /// Sets the value of [ns][crate::model::kubernetes::AccessReview::ns].
11207 ///
11208 /// # Example
11209 /// ```ignore,no_run
11210 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11211 /// let x = AccessReview::new().set_ns("example");
11212 /// ```
11213 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11214 self.ns = v.into();
11215 self
11216 }
11217
11218 /// Sets the value of [name][crate::model::kubernetes::AccessReview::name].
11219 ///
11220 /// # Example
11221 /// ```ignore,no_run
11222 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11223 /// let x = AccessReview::new().set_name("example");
11224 /// ```
11225 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11226 self.name = v.into();
11227 self
11228 }
11229
11230 /// Sets the value of [resource][crate::model::kubernetes::AccessReview::resource].
11231 ///
11232 /// # Example
11233 /// ```ignore,no_run
11234 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11235 /// let x = AccessReview::new().set_resource("example");
11236 /// ```
11237 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11238 self.resource = v.into();
11239 self
11240 }
11241
11242 /// Sets the value of [subresource][crate::model::kubernetes::AccessReview::subresource].
11243 ///
11244 /// # Example
11245 /// ```ignore,no_run
11246 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11247 /// let x = AccessReview::new().set_subresource("example");
11248 /// ```
11249 pub fn set_subresource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11250 self.subresource = v.into();
11251 self
11252 }
11253
11254 /// Sets the value of [verb][crate::model::kubernetes::AccessReview::verb].
11255 ///
11256 /// # Example
11257 /// ```ignore,no_run
11258 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11259 /// let x = AccessReview::new().set_verb("example");
11260 /// ```
11261 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11262 self.verb = v.into();
11263 self
11264 }
11265
11266 /// Sets the value of [version][crate::model::kubernetes::AccessReview::version].
11267 ///
11268 /// # Example
11269 /// ```ignore,no_run
11270 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11271 /// let x = AccessReview::new().set_version("example");
11272 /// ```
11273 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11274 self.version = v.into();
11275 self
11276 }
11277 }
11278
11279 impl wkt::message::Message for AccessReview {
11280 fn typename() -> &'static str {
11281 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.AccessReview"
11282 }
11283 }
11284
11285 /// Kubernetes object related to the finding, uniquely identified by GKNN.
11286 /// Used if the object Kind is not one of Pod, Node, NodePool, Binding, or
11287 /// AccessReview.
11288 #[derive(Clone, Default, PartialEq)]
11289 #[non_exhaustive]
11290 pub struct Object {
11291 /// Kubernetes object group, such as "policy.k8s.io/v1".
11292 pub group: std::string::String,
11293
11294 /// Kubernetes object kind, such as "Namespace".
11295 pub kind: std::string::String,
11296
11297 /// Kubernetes object namespace. Must be a valid DNS label. Named
11298 /// "ns" to avoid collision with C++ namespace keyword. For details see
11299 /// <https://kubernetes.io/docs/tasks/administer-cluster/namespaces/>.
11300 pub ns: std::string::String,
11301
11302 /// Kubernetes object name. For details see
11303 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/>.
11304 pub name: std::string::String,
11305
11306 /// Pod containers associated with this finding, if any.
11307 pub containers: std::vec::Vec<crate::model::Container>,
11308
11309 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11310 }
11311
11312 impl Object {
11313 /// Creates a new default instance.
11314 pub fn new() -> Self {
11315 std::default::Default::default()
11316 }
11317
11318 /// Sets the value of [group][crate::model::kubernetes::Object::group].
11319 ///
11320 /// # Example
11321 /// ```ignore,no_run
11322 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11323 /// let x = Object::new().set_group("example");
11324 /// ```
11325 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11326 self.group = v.into();
11327 self
11328 }
11329
11330 /// Sets the value of [kind][crate::model::kubernetes::Object::kind].
11331 ///
11332 /// # Example
11333 /// ```ignore,no_run
11334 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11335 /// let x = Object::new().set_kind("example");
11336 /// ```
11337 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11338 self.kind = v.into();
11339 self
11340 }
11341
11342 /// Sets the value of [ns][crate::model::kubernetes::Object::ns].
11343 ///
11344 /// # Example
11345 /// ```ignore,no_run
11346 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11347 /// let x = Object::new().set_ns("example");
11348 /// ```
11349 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11350 self.ns = v.into();
11351 self
11352 }
11353
11354 /// Sets the value of [name][crate::model::kubernetes::Object::name].
11355 ///
11356 /// # Example
11357 /// ```ignore,no_run
11358 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11359 /// let x = Object::new().set_name("example");
11360 /// ```
11361 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11362 self.name = v.into();
11363 self
11364 }
11365
11366 /// Sets the value of [containers][crate::model::kubernetes::Object::containers].
11367 ///
11368 /// # Example
11369 /// ```ignore,no_run
11370 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11371 /// use google_cloud_securitycenter_v2::model::Container;
11372 /// let x = Object::new()
11373 /// .set_containers([
11374 /// Container::default()/* use setters */,
11375 /// Container::default()/* use (different) setters */,
11376 /// ]);
11377 /// ```
11378 pub fn set_containers<T, V>(mut self, v: T) -> Self
11379 where
11380 T: std::iter::IntoIterator<Item = V>,
11381 V: std::convert::Into<crate::model::Container>,
11382 {
11383 use std::iter::Iterator;
11384 self.containers = v.into_iter().map(|i| i.into()).collect();
11385 self
11386 }
11387 }
11388
11389 impl wkt::message::Message for Object {
11390 fn typename() -> &'static str {
11391 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Object"
11392 }
11393 }
11394}
11395
11396/// Represents a generic name-value label. A label has separate name and value
11397/// fields to support filtering with the `contains()` function. For more
11398/// information, see [Filtering on array-type
11399/// fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering).
11400#[derive(Clone, Default, PartialEq)]
11401#[non_exhaustive]
11402pub struct Label {
11403 /// Name of the label.
11404 pub name: std::string::String,
11405
11406 /// Value that corresponds to the label's name.
11407 pub value: std::string::String,
11408
11409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11410}
11411
11412impl Label {
11413 /// Creates a new default instance.
11414 pub fn new() -> Self {
11415 std::default::Default::default()
11416 }
11417
11418 /// Sets the value of [name][crate::model::Label::name].
11419 ///
11420 /// # Example
11421 /// ```ignore,no_run
11422 /// # use google_cloud_securitycenter_v2::model::Label;
11423 /// let x = Label::new().set_name("example");
11424 /// ```
11425 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11426 self.name = v.into();
11427 self
11428 }
11429
11430 /// Sets the value of [value][crate::model::Label::value].
11431 ///
11432 /// # Example
11433 /// ```ignore,no_run
11434 /// # use google_cloud_securitycenter_v2::model::Label;
11435 /// let x = Label::new().set_value("example");
11436 /// ```
11437 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11438 self.value = v.into();
11439 self
11440 }
11441}
11442
11443impl wkt::message::Message for Label {
11444 fn typename() -> &'static str {
11445 "type.googleapis.com/google.cloud.securitycenter.v2.Label"
11446 }
11447}
11448
11449/// Contains information related to the load balancer associated with the
11450/// finding.
11451#[derive(Clone, Default, PartialEq)]
11452#[non_exhaustive]
11453pub struct LoadBalancer {
11454 /// The name of the load balancer associated with the finding.
11455 pub name: std::string::String,
11456
11457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11458}
11459
11460impl LoadBalancer {
11461 /// Creates a new default instance.
11462 pub fn new() -> Self {
11463 std::default::Default::default()
11464 }
11465
11466 /// Sets the value of [name][crate::model::LoadBalancer::name].
11467 ///
11468 /// # Example
11469 /// ```ignore,no_run
11470 /// # use google_cloud_securitycenter_v2::model::LoadBalancer;
11471 /// let x = LoadBalancer::new().set_name("example");
11472 /// ```
11473 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11474 self.name = v.into();
11475 self
11476 }
11477}
11478
11479impl wkt::message::Message for LoadBalancer {
11480 fn typename() -> &'static str {
11481 "type.googleapis.com/google.cloud.securitycenter.v2.LoadBalancer"
11482 }
11483}
11484
11485/// An individual entry in a log.
11486#[derive(Clone, Default, PartialEq)]
11487#[non_exhaustive]
11488pub struct LogEntry {
11489 /// The log entry.
11490 pub log_entry: std::option::Option<crate::model::log_entry::LogEntry>,
11491
11492 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11493}
11494
11495impl LogEntry {
11496 /// Creates a new default instance.
11497 pub fn new() -> Self {
11498 std::default::Default::default()
11499 }
11500
11501 /// Sets the value of [log_entry][crate::model::LogEntry::log_entry].
11502 ///
11503 /// Note that all the setters affecting `log_entry` are mutually
11504 /// exclusive.
11505 ///
11506 /// # Example
11507 /// ```ignore,no_run
11508 /// # use google_cloud_securitycenter_v2::model::LogEntry;
11509 /// use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11510 /// let x = LogEntry::new().set_log_entry(Some(
11511 /// google_cloud_securitycenter_v2::model::log_entry::LogEntry::CloudLoggingEntry(CloudLoggingEntry::default().into())));
11512 /// ```
11513 pub fn set_log_entry<
11514 T: std::convert::Into<std::option::Option<crate::model::log_entry::LogEntry>>,
11515 >(
11516 mut self,
11517 v: T,
11518 ) -> Self {
11519 self.log_entry = v.into();
11520 self
11521 }
11522
11523 /// The value of [log_entry][crate::model::LogEntry::log_entry]
11524 /// if it holds a `CloudLoggingEntry`, `None` if the field is not set or
11525 /// holds a different branch.
11526 pub fn cloud_logging_entry(
11527 &self,
11528 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudLoggingEntry>> {
11529 #[allow(unreachable_patterns)]
11530 self.log_entry.as_ref().and_then(|v| match v {
11531 crate::model::log_entry::LogEntry::CloudLoggingEntry(v) => std::option::Option::Some(v),
11532 _ => std::option::Option::None,
11533 })
11534 }
11535
11536 /// Sets the value of [log_entry][crate::model::LogEntry::log_entry]
11537 /// to hold a `CloudLoggingEntry`.
11538 ///
11539 /// Note that all the setters affecting `log_entry` are
11540 /// mutually exclusive.
11541 ///
11542 /// # Example
11543 /// ```ignore,no_run
11544 /// # use google_cloud_securitycenter_v2::model::LogEntry;
11545 /// use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11546 /// let x = LogEntry::new().set_cloud_logging_entry(CloudLoggingEntry::default()/* use setters */);
11547 /// assert!(x.cloud_logging_entry().is_some());
11548 /// ```
11549 pub fn set_cloud_logging_entry<
11550 T: std::convert::Into<std::boxed::Box<crate::model::CloudLoggingEntry>>,
11551 >(
11552 mut self,
11553 v: T,
11554 ) -> Self {
11555 self.log_entry = std::option::Option::Some(
11556 crate::model::log_entry::LogEntry::CloudLoggingEntry(v.into()),
11557 );
11558 self
11559 }
11560}
11561
11562impl wkt::message::Message for LogEntry {
11563 fn typename() -> &'static str {
11564 "type.googleapis.com/google.cloud.securitycenter.v2.LogEntry"
11565 }
11566}
11567
11568/// Defines additional types related to [LogEntry].
11569pub mod log_entry {
11570 #[allow(unused_imports)]
11571 use super::*;
11572
11573 /// The log entry.
11574 #[derive(Clone, Debug, PartialEq)]
11575 #[non_exhaustive]
11576 pub enum LogEntry {
11577 /// An individual entry in a log stored in Cloud Logging.
11578 CloudLoggingEntry(std::boxed::Box<crate::model::CloudLoggingEntry>),
11579 }
11580}
11581
11582/// Metadata taken from a [Cloud Logging
11583/// LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry)
11584#[derive(Clone, Default, PartialEq)]
11585#[non_exhaustive]
11586pub struct CloudLoggingEntry {
11587 /// A unique identifier for the log entry.
11588 pub insert_id: std::string::String,
11589
11590 /// The type of the log (part of `log_name`. `log_name` is the resource name of
11591 /// the log to which this log entry belongs). For example:
11592 /// `cloudresourcemanager.googleapis.com/activity` Note that this field is not
11593 /// URL-encoded, unlike in `LogEntry`.
11594 pub log_id: std::string::String,
11595
11596 /// The organization, folder, or project of the monitored resource that
11597 /// produced this log entry.
11598 pub resource_container: std::string::String,
11599
11600 /// The time the event described by the log entry occurred.
11601 pub timestamp: std::option::Option<wkt::Timestamp>,
11602
11603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11604}
11605
11606impl CloudLoggingEntry {
11607 /// Creates a new default instance.
11608 pub fn new() -> Self {
11609 std::default::Default::default()
11610 }
11611
11612 /// Sets the value of [insert_id][crate::model::CloudLoggingEntry::insert_id].
11613 ///
11614 /// # Example
11615 /// ```ignore,no_run
11616 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11617 /// let x = CloudLoggingEntry::new().set_insert_id("example");
11618 /// ```
11619 pub fn set_insert_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11620 self.insert_id = v.into();
11621 self
11622 }
11623
11624 /// Sets the value of [log_id][crate::model::CloudLoggingEntry::log_id].
11625 ///
11626 /// # Example
11627 /// ```ignore,no_run
11628 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11629 /// let x = CloudLoggingEntry::new().set_log_id("example");
11630 /// ```
11631 pub fn set_log_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11632 self.log_id = v.into();
11633 self
11634 }
11635
11636 /// Sets the value of [resource_container][crate::model::CloudLoggingEntry::resource_container].
11637 ///
11638 /// # Example
11639 /// ```ignore,no_run
11640 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11641 /// let x = CloudLoggingEntry::new().set_resource_container("example");
11642 /// ```
11643 pub fn set_resource_container<T: std::convert::Into<std::string::String>>(
11644 mut self,
11645 v: T,
11646 ) -> Self {
11647 self.resource_container = v.into();
11648 self
11649 }
11650
11651 /// Sets the value of [timestamp][crate::model::CloudLoggingEntry::timestamp].
11652 ///
11653 /// # Example
11654 /// ```ignore,no_run
11655 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11656 /// use wkt::Timestamp;
11657 /// let x = CloudLoggingEntry::new().set_timestamp(Timestamp::default()/* use setters */);
11658 /// ```
11659 pub fn set_timestamp<T>(mut self, v: T) -> Self
11660 where
11661 T: std::convert::Into<wkt::Timestamp>,
11662 {
11663 self.timestamp = std::option::Option::Some(v.into());
11664 self
11665 }
11666
11667 /// Sets or clears the value of [timestamp][crate::model::CloudLoggingEntry::timestamp].
11668 ///
11669 /// # Example
11670 /// ```ignore,no_run
11671 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11672 /// use wkt::Timestamp;
11673 /// let x = CloudLoggingEntry::new().set_or_clear_timestamp(Some(Timestamp::default()/* use setters */));
11674 /// let x = CloudLoggingEntry::new().set_or_clear_timestamp(None::<Timestamp>);
11675 /// ```
11676 pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
11677 where
11678 T: std::convert::Into<wkt::Timestamp>,
11679 {
11680 self.timestamp = v.map(|x| x.into());
11681 self
11682 }
11683}
11684
11685impl wkt::message::Message for CloudLoggingEntry {
11686 fn typename() -> &'static str {
11687 "type.googleapis.com/google.cloud.securitycenter.v2.CloudLoggingEntry"
11688 }
11689}
11690
11691/// MITRE ATT&CK tactics and techniques related to this finding.
11692/// See: <https://attack.mitre.org>
11693#[derive(Clone, Default, PartialEq)]
11694#[non_exhaustive]
11695pub struct MitreAttack {
11696 /// The MITRE ATT&CK tactic most closely represented by this finding, if any.
11697 pub primary_tactic: crate::model::mitre_attack::Tactic,
11698
11699 /// The MITRE ATT&CK technique most closely represented by this finding, if
11700 /// any. primary_techniques is a repeated field because there are multiple
11701 /// levels of MITRE ATT&CK techniques. If the technique most closely
11702 /// represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`),
11703 /// both the sub-technique and its parent technique(s) will be listed (e.g.
11704 /// `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`).
11705 pub primary_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
11706
11707 /// Additional MITRE ATT&CK tactics related to this finding, if any.
11708 pub additional_tactics: std::vec::Vec<crate::model::mitre_attack::Tactic>,
11709
11710 /// Additional MITRE ATT&CK techniques related to this finding, if any, along
11711 /// with any of their respective parent techniques.
11712 pub additional_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
11713
11714 /// The MITRE ATT&CK version referenced by the above fields. E.g. "8".
11715 pub version: std::string::String,
11716
11717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11718}
11719
11720impl MitreAttack {
11721 /// Creates a new default instance.
11722 pub fn new() -> Self {
11723 std::default::Default::default()
11724 }
11725
11726 /// Sets the value of [primary_tactic][crate::model::MitreAttack::primary_tactic].
11727 ///
11728 /// # Example
11729 /// ```ignore,no_run
11730 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11731 /// use google_cloud_securitycenter_v2::model::mitre_attack::Tactic;
11732 /// let x0 = MitreAttack::new().set_primary_tactic(Tactic::Reconnaissance);
11733 /// let x1 = MitreAttack::new().set_primary_tactic(Tactic::ResourceDevelopment);
11734 /// let x2 = MitreAttack::new().set_primary_tactic(Tactic::InitialAccess);
11735 /// ```
11736 pub fn set_primary_tactic<T: std::convert::Into<crate::model::mitre_attack::Tactic>>(
11737 mut self,
11738 v: T,
11739 ) -> Self {
11740 self.primary_tactic = v.into();
11741 self
11742 }
11743
11744 /// Sets the value of [primary_techniques][crate::model::MitreAttack::primary_techniques].
11745 ///
11746 /// # Example
11747 /// ```ignore,no_run
11748 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11749 /// use google_cloud_securitycenter_v2::model::mitre_attack::Technique;
11750 /// let x = MitreAttack::new().set_primary_techniques([
11751 /// Technique::DataObfuscation,
11752 /// Technique::DataObfuscationSteganography,
11753 /// Technique::OsCredentialDumping,
11754 /// ]);
11755 /// ```
11756 pub fn set_primary_techniques<T, V>(mut self, v: T) -> Self
11757 where
11758 T: std::iter::IntoIterator<Item = V>,
11759 V: std::convert::Into<crate::model::mitre_attack::Technique>,
11760 {
11761 use std::iter::Iterator;
11762 self.primary_techniques = v.into_iter().map(|i| i.into()).collect();
11763 self
11764 }
11765
11766 /// Sets the value of [additional_tactics][crate::model::MitreAttack::additional_tactics].
11767 ///
11768 /// # Example
11769 /// ```ignore,no_run
11770 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11771 /// use google_cloud_securitycenter_v2::model::mitre_attack::Tactic;
11772 /// let x = MitreAttack::new().set_additional_tactics([
11773 /// Tactic::Reconnaissance,
11774 /// Tactic::ResourceDevelopment,
11775 /// Tactic::InitialAccess,
11776 /// ]);
11777 /// ```
11778 pub fn set_additional_tactics<T, V>(mut self, v: T) -> Self
11779 where
11780 T: std::iter::IntoIterator<Item = V>,
11781 V: std::convert::Into<crate::model::mitre_attack::Tactic>,
11782 {
11783 use std::iter::Iterator;
11784 self.additional_tactics = v.into_iter().map(|i| i.into()).collect();
11785 self
11786 }
11787
11788 /// Sets the value of [additional_techniques][crate::model::MitreAttack::additional_techniques].
11789 ///
11790 /// # Example
11791 /// ```ignore,no_run
11792 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11793 /// use google_cloud_securitycenter_v2::model::mitre_attack::Technique;
11794 /// let x = MitreAttack::new().set_additional_techniques([
11795 /// Technique::DataObfuscation,
11796 /// Technique::DataObfuscationSteganography,
11797 /// Technique::OsCredentialDumping,
11798 /// ]);
11799 /// ```
11800 pub fn set_additional_techniques<T, V>(mut self, v: T) -> Self
11801 where
11802 T: std::iter::IntoIterator<Item = V>,
11803 V: std::convert::Into<crate::model::mitre_attack::Technique>,
11804 {
11805 use std::iter::Iterator;
11806 self.additional_techniques = v.into_iter().map(|i| i.into()).collect();
11807 self
11808 }
11809
11810 /// Sets the value of [version][crate::model::MitreAttack::version].
11811 ///
11812 /// # Example
11813 /// ```ignore,no_run
11814 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11815 /// let x = MitreAttack::new().set_version("example");
11816 /// ```
11817 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11818 self.version = v.into();
11819 self
11820 }
11821}
11822
11823impl wkt::message::Message for MitreAttack {
11824 fn typename() -> &'static str {
11825 "type.googleapis.com/google.cloud.securitycenter.v2.MitreAttack"
11826 }
11827}
11828
11829/// Defines additional types related to [MitreAttack].
11830pub mod mitre_attack {
11831 #[allow(unused_imports)]
11832 use super::*;
11833
11834 /// MITRE ATT&CK tactics that can be referenced by SCC findings.
11835 /// See: <https://attack.mitre.org/tactics/enterprise/>
11836 ///
11837 /// # Working with unknown values
11838 ///
11839 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11840 /// additional enum variants at any time. Adding new variants is not considered
11841 /// a breaking change. Applications should write their code in anticipation of:
11842 ///
11843 /// - New values appearing in future releases of the client library, **and**
11844 /// - New values received dynamically, without application changes.
11845 ///
11846 /// Please consult the [Working with enums] section in the user guide for some
11847 /// guidelines.
11848 ///
11849 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11850 #[derive(Clone, Debug, PartialEq)]
11851 #[non_exhaustive]
11852 pub enum Tactic {
11853 /// Unspecified value.
11854 Unspecified,
11855 /// TA0043
11856 Reconnaissance,
11857 /// TA0042
11858 ResourceDevelopment,
11859 /// TA0001
11860 InitialAccess,
11861 /// TA0002
11862 Execution,
11863 /// TA0003
11864 Persistence,
11865 /// TA0004
11866 PrivilegeEscalation,
11867 /// TA0005
11868 DefenseEvasion,
11869 /// TA0006
11870 CredentialAccess,
11871 /// TA0007
11872 Discovery,
11873 /// TA0008
11874 LateralMovement,
11875 /// TA0009
11876 Collection,
11877 /// TA0011
11878 CommandAndControl,
11879 /// TA0010
11880 Exfiltration,
11881 /// TA0040
11882 Impact,
11883 /// If set, the enum was initialized with an unknown value.
11884 ///
11885 /// Applications can examine the value using [Tactic::value] or
11886 /// [Tactic::name].
11887 UnknownValue(tactic::UnknownValue),
11888 }
11889
11890 #[doc(hidden)]
11891 pub mod tactic {
11892 #[allow(unused_imports)]
11893 use super::*;
11894 #[derive(Clone, Debug, PartialEq)]
11895 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11896 }
11897
11898 impl Tactic {
11899 /// Gets the enum value.
11900 ///
11901 /// Returns `None` if the enum contains an unknown value deserialized from
11902 /// the string representation of enums.
11903 pub fn value(&self) -> std::option::Option<i32> {
11904 match self {
11905 Self::Unspecified => std::option::Option::Some(0),
11906 Self::Reconnaissance => std::option::Option::Some(1),
11907 Self::ResourceDevelopment => std::option::Option::Some(2),
11908 Self::InitialAccess => std::option::Option::Some(5),
11909 Self::Execution => std::option::Option::Some(3),
11910 Self::Persistence => std::option::Option::Some(6),
11911 Self::PrivilegeEscalation => std::option::Option::Some(8),
11912 Self::DefenseEvasion => std::option::Option::Some(7),
11913 Self::CredentialAccess => std::option::Option::Some(9),
11914 Self::Discovery => std::option::Option::Some(10),
11915 Self::LateralMovement => std::option::Option::Some(11),
11916 Self::Collection => std::option::Option::Some(12),
11917 Self::CommandAndControl => std::option::Option::Some(4),
11918 Self::Exfiltration => std::option::Option::Some(13),
11919 Self::Impact => std::option::Option::Some(14),
11920 Self::UnknownValue(u) => u.0.value(),
11921 }
11922 }
11923
11924 /// Gets the enum value as a string.
11925 ///
11926 /// Returns `None` if the enum contains an unknown value deserialized from
11927 /// the integer representation of enums.
11928 pub fn name(&self) -> std::option::Option<&str> {
11929 match self {
11930 Self::Unspecified => std::option::Option::Some("TACTIC_UNSPECIFIED"),
11931 Self::Reconnaissance => std::option::Option::Some("RECONNAISSANCE"),
11932 Self::ResourceDevelopment => std::option::Option::Some("RESOURCE_DEVELOPMENT"),
11933 Self::InitialAccess => std::option::Option::Some("INITIAL_ACCESS"),
11934 Self::Execution => std::option::Option::Some("EXECUTION"),
11935 Self::Persistence => std::option::Option::Some("PERSISTENCE"),
11936 Self::PrivilegeEscalation => std::option::Option::Some("PRIVILEGE_ESCALATION"),
11937 Self::DefenseEvasion => std::option::Option::Some("DEFENSE_EVASION"),
11938 Self::CredentialAccess => std::option::Option::Some("CREDENTIAL_ACCESS"),
11939 Self::Discovery => std::option::Option::Some("DISCOVERY"),
11940 Self::LateralMovement => std::option::Option::Some("LATERAL_MOVEMENT"),
11941 Self::Collection => std::option::Option::Some("COLLECTION"),
11942 Self::CommandAndControl => std::option::Option::Some("COMMAND_AND_CONTROL"),
11943 Self::Exfiltration => std::option::Option::Some("EXFILTRATION"),
11944 Self::Impact => std::option::Option::Some("IMPACT"),
11945 Self::UnknownValue(u) => u.0.name(),
11946 }
11947 }
11948 }
11949
11950 impl std::default::Default for Tactic {
11951 fn default() -> Self {
11952 use std::convert::From;
11953 Self::from(0)
11954 }
11955 }
11956
11957 impl std::fmt::Display for Tactic {
11958 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11959 wkt::internal::display_enum(f, self.name(), self.value())
11960 }
11961 }
11962
11963 impl std::convert::From<i32> for Tactic {
11964 fn from(value: i32) -> Self {
11965 match value {
11966 0 => Self::Unspecified,
11967 1 => Self::Reconnaissance,
11968 2 => Self::ResourceDevelopment,
11969 3 => Self::Execution,
11970 4 => Self::CommandAndControl,
11971 5 => Self::InitialAccess,
11972 6 => Self::Persistence,
11973 7 => Self::DefenseEvasion,
11974 8 => Self::PrivilegeEscalation,
11975 9 => Self::CredentialAccess,
11976 10 => Self::Discovery,
11977 11 => Self::LateralMovement,
11978 12 => Self::Collection,
11979 13 => Self::Exfiltration,
11980 14 => Self::Impact,
11981 _ => Self::UnknownValue(tactic::UnknownValue(
11982 wkt::internal::UnknownEnumValue::Integer(value),
11983 )),
11984 }
11985 }
11986 }
11987
11988 impl std::convert::From<&str> for Tactic {
11989 fn from(value: &str) -> Self {
11990 use std::string::ToString;
11991 match value {
11992 "TACTIC_UNSPECIFIED" => Self::Unspecified,
11993 "RECONNAISSANCE" => Self::Reconnaissance,
11994 "RESOURCE_DEVELOPMENT" => Self::ResourceDevelopment,
11995 "INITIAL_ACCESS" => Self::InitialAccess,
11996 "EXECUTION" => Self::Execution,
11997 "PERSISTENCE" => Self::Persistence,
11998 "PRIVILEGE_ESCALATION" => Self::PrivilegeEscalation,
11999 "DEFENSE_EVASION" => Self::DefenseEvasion,
12000 "CREDENTIAL_ACCESS" => Self::CredentialAccess,
12001 "DISCOVERY" => Self::Discovery,
12002 "LATERAL_MOVEMENT" => Self::LateralMovement,
12003 "COLLECTION" => Self::Collection,
12004 "COMMAND_AND_CONTROL" => Self::CommandAndControl,
12005 "EXFILTRATION" => Self::Exfiltration,
12006 "IMPACT" => Self::Impact,
12007 _ => Self::UnknownValue(tactic::UnknownValue(
12008 wkt::internal::UnknownEnumValue::String(value.to_string()),
12009 )),
12010 }
12011 }
12012 }
12013
12014 impl serde::ser::Serialize for Tactic {
12015 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12016 where
12017 S: serde::Serializer,
12018 {
12019 match self {
12020 Self::Unspecified => serializer.serialize_i32(0),
12021 Self::Reconnaissance => serializer.serialize_i32(1),
12022 Self::ResourceDevelopment => serializer.serialize_i32(2),
12023 Self::InitialAccess => serializer.serialize_i32(5),
12024 Self::Execution => serializer.serialize_i32(3),
12025 Self::Persistence => serializer.serialize_i32(6),
12026 Self::PrivilegeEscalation => serializer.serialize_i32(8),
12027 Self::DefenseEvasion => serializer.serialize_i32(7),
12028 Self::CredentialAccess => serializer.serialize_i32(9),
12029 Self::Discovery => serializer.serialize_i32(10),
12030 Self::LateralMovement => serializer.serialize_i32(11),
12031 Self::Collection => serializer.serialize_i32(12),
12032 Self::CommandAndControl => serializer.serialize_i32(4),
12033 Self::Exfiltration => serializer.serialize_i32(13),
12034 Self::Impact => serializer.serialize_i32(14),
12035 Self::UnknownValue(u) => u.0.serialize(serializer),
12036 }
12037 }
12038 }
12039
12040 impl<'de> serde::de::Deserialize<'de> for Tactic {
12041 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12042 where
12043 D: serde::Deserializer<'de>,
12044 {
12045 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tactic>::new(
12046 ".google.cloud.securitycenter.v2.MitreAttack.Tactic",
12047 ))
12048 }
12049 }
12050
12051 /// MITRE ATT&CK techniques that can be referenced by Security Command Center
12052 /// findings. See: <https://attack.mitre.org/techniques/enterprise/>
12053 ///
12054 /// # Working with unknown values
12055 ///
12056 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12057 /// additional enum variants at any time. Adding new variants is not considered
12058 /// a breaking change. Applications should write their code in anticipation of:
12059 ///
12060 /// - New values appearing in future releases of the client library, **and**
12061 /// - New values received dynamically, without application changes.
12062 ///
12063 /// Please consult the [Working with enums] section in the user guide for some
12064 /// guidelines.
12065 ///
12066 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12067 #[derive(Clone, Debug, PartialEq)]
12068 #[non_exhaustive]
12069 pub enum Technique {
12070 /// Unspecified value.
12071 Unspecified,
12072 /// T1001
12073 DataObfuscation,
12074 /// T1001.002
12075 DataObfuscationSteganography,
12076 /// T1003
12077 OsCredentialDumping,
12078 /// T1003.007
12079 OsCredentialDumpingProcFilesystem,
12080 /// T1003.008
12081 OsCredentialDumpingEtcPasswordAndEtcShadow,
12082 /// T1005
12083 DataFromLocalSystem,
12084 /// T1020
12085 AutomatedExfiltration,
12086 /// T1027
12087 ObfuscatedFilesOrInfo,
12088 /// T1027.003
12089 Steganography,
12090 /// T1027.004
12091 CompileAfterDelivery,
12092 /// T1027.010
12093 CommandObfuscation,
12094 /// T1029
12095 ScheduledTransfer,
12096 /// T1033
12097 SystemOwnerUserDiscovery,
12098 /// T1036
12099 Masquerading,
12100 /// T1036.005
12101 MatchLegitimateNameOrLocation,
12102 /// T1037
12103 BootOrLogonInitializationScripts,
12104 /// T1037.005
12105 StartupItems,
12106 /// T1046
12107 NetworkServiceDiscovery,
12108 /// T1053
12109 ScheduledTaskJob,
12110 /// T1053.003
12111 ScheduledTaskJobCron,
12112 /// T1053.007
12113 ContainerOrchestrationJob,
12114 /// T1055
12115 ProcessInjection,
12116 /// T1056
12117 InputCapture,
12118 /// T1056.001
12119 InputCaptureKeylogging,
12120 /// T1057
12121 ProcessDiscovery,
12122 /// T1059
12123 CommandAndScriptingInterpreter,
12124 /// T1059.004
12125 UnixShell,
12126 /// T1059.006
12127 Python,
12128 /// T1068
12129 ExploitationForPrivilegeEscalation,
12130 /// T1069
12131 PermissionGroupsDiscovery,
12132 /// T1069.003
12133 CloudGroups,
12134 /// T1070
12135 IndicatorRemoval,
12136 /// T1070.002
12137 IndicatorRemovalClearLinuxOrMacSystemLogs,
12138 /// T1070.003
12139 IndicatorRemovalClearCommandHistory,
12140 /// T1070.004
12141 IndicatorRemovalFileDeletion,
12142 /// T1070.006
12143 IndicatorRemovalTimestomp,
12144 /// T1070.008
12145 IndicatorRemovalClearMailboxData,
12146 /// T1071
12147 ApplicationLayerProtocol,
12148 /// T1071.004
12149 Dns,
12150 /// T1072
12151 SoftwareDeploymentTools,
12152 /// T1078
12153 ValidAccounts,
12154 /// T1078.001
12155 DefaultAccounts,
12156 /// T1078.003
12157 LocalAccounts,
12158 /// T1078.004
12159 CloudAccounts,
12160 /// T1083
12161 FileAndDirectoryDiscovery,
12162 /// T1087.001
12163 AccountDiscoveryLocalAccount,
12164 /// T1090
12165 Proxy,
12166 /// T1090.002
12167 ExternalProxy,
12168 /// T1090.003
12169 MultiHopProxy,
12170 /// T1098
12171 AccountManipulation,
12172 /// T1098.001
12173 AdditionalCloudCredentials,
12174 /// T1098.003
12175 AdditionalCloudRoles,
12176 /// T1098.004
12177 SshAuthorizedKeys,
12178 /// T1098.006
12179 AdditionalContainerClusterRoles,
12180 /// T1104
12181 MultiStageChannels,
12182 /// T1105
12183 IngressToolTransfer,
12184 /// T1106
12185 NativeApi,
12186 /// T1110
12187 BruteForce,
12188 /// T1119
12189 AutomatedCollection,
12190 /// T1129
12191 SharedModules,
12192 /// T1132
12193 DataEncoding,
12194 /// T1132.001
12195 StandardEncoding,
12196 /// T1134
12197 AccessTokenManipulation,
12198 /// T1134.001
12199 TokenImpersonationOrTheft,
12200 /// T1136
12201 CreateAccount,
12202 /// T1136.001
12203 LocalAccount,
12204 /// T1140
12205 DeobfuscateDecodeFilesOrInfo,
12206 /// T1190
12207 ExploitPublicFacingApplication,
12208 /// T1195
12209 SupplyChainCompromise,
12210 /// T1195.001
12211 CompromiseSoftwareDependenciesAndDevelopmentTools,
12212 /// T1203
12213 ExploitationForClientExecution,
12214 /// T1204
12215 UserExecution,
12216 /// T1222.002
12217 LinuxAndMacFileAndDirectoryPermissionsModification,
12218 /// T1484
12219 DomainPolicyModification,
12220 /// T1485
12221 DataDestruction,
12222 /// T1486
12223 DataEncryptedForImpact,
12224 /// T1489
12225 ServiceStop,
12226 /// T1490
12227 InhibitSystemRecovery,
12228 /// T1495
12229 FirmwareCorruption,
12230 /// T1496
12231 ResourceHijacking,
12232 /// T1498
12233 NetworkDenialOfService,
12234 /// T1526
12235 CloudServiceDiscovery,
12236 /// T1528
12237 StealApplicationAccessToken,
12238 /// T1531
12239 AccountAccessRemoval,
12240 /// T1537
12241 TransferDataToCloudAccount,
12242 /// T1539
12243 StealWebSessionCookie,
12244 /// T1543
12245 CreateOrModifySystemProcess,
12246 /// T1546
12247 EventTriggeredExecution,
12248 /// T1547
12249 BootOrLogonAutostartExecution,
12250 /// T1547.006
12251 KernelModulesAndExtensions,
12252 /// T1547.009
12253 ShortcutModification,
12254 /// T1548
12255 AbuseElevationControlMechanism,
12256 /// T1548.001
12257 AbuseElevationControlMechanismSetuidAndSetgid,
12258 /// T1548.003
12259 AbuseElevationControlMechanismSudoAndSudoCaching,
12260 /// T1552
12261 UnsecuredCredentials,
12262 /// T1552.001
12263 CredentialsInFiles,
12264 /// T1552.003
12265 BashHistory,
12266 /// T1552.004
12267 PrivateKeys,
12268 /// T1553
12269 SubvertTrustControl,
12270 /// T1553.004
12271 InstallRootCertificate,
12272 /// T1554
12273 CompromiseHostSoftwareBinary,
12274 /// T1555
12275 CredentialsFromPasswordStores,
12276 /// T1556
12277 ModifyAuthenticationProcess,
12278 /// T1556.003
12279 PluggableAuthenticationModules,
12280 /// T1556.006
12281 MultiFactorAuthentication,
12282 /// T1562
12283 ImpairDefenses,
12284 /// T1562.001
12285 DisableOrModifyTools,
12286 /// T1562.006
12287 IndicatorBlocking,
12288 /// T1562.012
12289 DisableOrModifyLinuxAuditSystem,
12290 /// T1564
12291 HideArtifacts,
12292 /// T1564.001
12293 HiddenFilesAndDirectories,
12294 /// T1564.002
12295 HiddenUsers,
12296 /// T1567
12297 ExfiltrationOverWebService,
12298 /// T1567.002
12299 ExfiltrationToCloudStorage,
12300 /// T1568
12301 DynamicResolution,
12302 /// T1570
12303 LateralToolTransfer,
12304 /// T1574
12305 HijackExecutionFlow,
12306 /// T1574.006
12307 HijackExecutionFlowDynamicLinkerHijacking,
12308 /// T1578
12309 ModifyCloudComputeInfrastructure,
12310 /// T1578.001
12311 CreateSnapshot,
12312 /// T1580
12313 CloudInfrastructureDiscovery,
12314 /// T1587
12315 DevelopCapabilities,
12316 /// T1587.001
12317 DevelopCapabilitiesMalware,
12318 /// T1588
12319 ObtainCapabilities,
12320 /// T1588.001
12321 ObtainCapabilitiesMalware,
12322 /// T1588.006
12323 ObtainCapabilitiesVulnerabilities,
12324 /// T1595
12325 ActiveScanning,
12326 /// T1595.001
12327 ScanningIpBlocks,
12328 /// T1608
12329 StageCapabilities,
12330 /// T1608.001
12331 UploadMalware,
12332 /// T1609
12333 ContainerAdministrationCommand,
12334 /// T1610
12335 DeployContainer,
12336 /// T1611
12337 EscapeToHost,
12338 /// T1613
12339 ContainerAndResourceDiscovery,
12340 /// T1620
12341 ReflectiveCodeLoading,
12342 /// T1649
12343 StealOrForgeAuthenticationCertificates,
12344 /// T1657
12345 FinancialTheft,
12346 /// If set, the enum was initialized with an unknown value.
12347 ///
12348 /// Applications can examine the value using [Technique::value] or
12349 /// [Technique::name].
12350 UnknownValue(technique::UnknownValue),
12351 }
12352
12353 #[doc(hidden)]
12354 pub mod technique {
12355 #[allow(unused_imports)]
12356 use super::*;
12357 #[derive(Clone, Debug, PartialEq)]
12358 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12359 }
12360
12361 impl Technique {
12362 /// Gets the enum value.
12363 ///
12364 /// Returns `None` if the enum contains an unknown value deserialized from
12365 /// the string representation of enums.
12366 pub fn value(&self) -> std::option::Option<i32> {
12367 match self {
12368 Self::Unspecified => std::option::Option::Some(0),
12369 Self::DataObfuscation => std::option::Option::Some(70),
12370 Self::DataObfuscationSteganography => std::option::Option::Some(71),
12371 Self::OsCredentialDumping => std::option::Option::Some(114),
12372 Self::OsCredentialDumpingProcFilesystem => std::option::Option::Some(115),
12373 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => std::option::Option::Some(122),
12374 Self::DataFromLocalSystem => std::option::Option::Some(117),
12375 Self::AutomatedExfiltration => std::option::Option::Some(68),
12376 Self::ObfuscatedFilesOrInfo => std::option::Option::Some(72),
12377 Self::Steganography => std::option::Option::Some(73),
12378 Self::CompileAfterDelivery => std::option::Option::Some(74),
12379 Self::CommandObfuscation => std::option::Option::Some(75),
12380 Self::ScheduledTransfer => std::option::Option::Some(120),
12381 Self::SystemOwnerUserDiscovery => std::option::Option::Some(118),
12382 Self::Masquerading => std::option::Option::Some(49),
12383 Self::MatchLegitimateNameOrLocation => std::option::Option::Some(50),
12384 Self::BootOrLogonInitializationScripts => std::option::Option::Some(37),
12385 Self::StartupItems => std::option::Option::Some(38),
12386 Self::NetworkServiceDiscovery => std::option::Option::Some(32),
12387 Self::ScheduledTaskJob => std::option::Option::Some(89),
12388 Self::ScheduledTaskJobCron => std::option::Option::Some(119),
12389 Self::ContainerOrchestrationJob => std::option::Option::Some(90),
12390 Self::ProcessInjection => std::option::Option::Some(93),
12391 Self::InputCapture => std::option::Option::Some(103),
12392 Self::InputCaptureKeylogging => std::option::Option::Some(104),
12393 Self::ProcessDiscovery => std::option::Option::Some(56),
12394 Self::CommandAndScriptingInterpreter => std::option::Option::Some(6),
12395 Self::UnixShell => std::option::Option::Some(7),
12396 Self::Python => std::option::Option::Some(59),
12397 Self::ExploitationForPrivilegeEscalation => std::option::Option::Some(63),
12398 Self::PermissionGroupsDiscovery => std::option::Option::Some(18),
12399 Self::CloudGroups => std::option::Option::Some(19),
12400 Self::IndicatorRemoval => std::option::Option::Some(123),
12401 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => std::option::Option::Some(124),
12402 Self::IndicatorRemovalClearCommandHistory => std::option::Option::Some(125),
12403 Self::IndicatorRemovalFileDeletion => std::option::Option::Some(64),
12404 Self::IndicatorRemovalTimestomp => std::option::Option::Some(128),
12405 Self::IndicatorRemovalClearMailboxData => std::option::Option::Some(126),
12406 Self::ApplicationLayerProtocol => std::option::Option::Some(45),
12407 Self::Dns => std::option::Option::Some(46),
12408 Self::SoftwareDeploymentTools => std::option::Option::Some(47),
12409 Self::ValidAccounts => std::option::Option::Some(14),
12410 Self::DefaultAccounts => std::option::Option::Some(35),
12411 Self::LocalAccounts => std::option::Option::Some(15),
12412 Self::CloudAccounts => std::option::Option::Some(16),
12413 Self::FileAndDirectoryDiscovery => std::option::Option::Some(121),
12414 Self::AccountDiscoveryLocalAccount => std::option::Option::Some(116),
12415 Self::Proxy => std::option::Option::Some(9),
12416 Self::ExternalProxy => std::option::Option::Some(10),
12417 Self::MultiHopProxy => std::option::Option::Some(11),
12418 Self::AccountManipulation => std::option::Option::Some(22),
12419 Self::AdditionalCloudCredentials => std::option::Option::Some(40),
12420 Self::AdditionalCloudRoles => std::option::Option::Some(67),
12421 Self::SshAuthorizedKeys => std::option::Option::Some(23),
12422 Self::AdditionalContainerClusterRoles => std::option::Option::Some(58),
12423 Self::MultiStageChannels => std::option::Option::Some(76),
12424 Self::IngressToolTransfer => std::option::Option::Some(3),
12425 Self::NativeApi => std::option::Option::Some(4),
12426 Self::BruteForce => std::option::Option::Some(44),
12427 Self::AutomatedCollection => std::option::Option::Some(94),
12428 Self::SharedModules => std::option::Option::Some(5),
12429 Self::DataEncoding => std::option::Option::Some(77),
12430 Self::StandardEncoding => std::option::Option::Some(78),
12431 Self::AccessTokenManipulation => std::option::Option::Some(33),
12432 Self::TokenImpersonationOrTheft => std::option::Option::Some(39),
12433 Self::CreateAccount => std::option::Option::Some(79),
12434 Self::LocalAccount => std::option::Option::Some(80),
12435 Self::DeobfuscateDecodeFilesOrInfo => std::option::Option::Some(95),
12436 Self::ExploitPublicFacingApplication => std::option::Option::Some(27),
12437 Self::SupplyChainCompromise => std::option::Option::Some(129),
12438 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
12439 std::option::Option::Some(130)
12440 }
12441 Self::ExploitationForClientExecution => std::option::Option::Some(134),
12442 Self::UserExecution => std::option::Option::Some(69),
12443 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
12444 std::option::Option::Some(135)
12445 }
12446 Self::DomainPolicyModification => std::option::Option::Some(30),
12447 Self::DataDestruction => std::option::Option::Some(29),
12448 Self::DataEncryptedForImpact => std::option::Option::Some(132),
12449 Self::ServiceStop => std::option::Option::Some(52),
12450 Self::InhibitSystemRecovery => std::option::Option::Some(36),
12451 Self::FirmwareCorruption => std::option::Option::Some(81),
12452 Self::ResourceHijacking => std::option::Option::Some(8),
12453 Self::NetworkDenialOfService => std::option::Option::Some(17),
12454 Self::CloudServiceDiscovery => std::option::Option::Some(48),
12455 Self::StealApplicationAccessToken => std::option::Option::Some(42),
12456 Self::AccountAccessRemoval => std::option::Option::Some(51),
12457 Self::TransferDataToCloudAccount => std::option::Option::Some(91),
12458 Self::StealWebSessionCookie => std::option::Option::Some(25),
12459 Self::CreateOrModifySystemProcess => std::option::Option::Some(24),
12460 Self::EventTriggeredExecution => std::option::Option::Some(65),
12461 Self::BootOrLogonAutostartExecution => std::option::Option::Some(82),
12462 Self::KernelModulesAndExtensions => std::option::Option::Some(83),
12463 Self::ShortcutModification => std::option::Option::Some(127),
12464 Self::AbuseElevationControlMechanism => std::option::Option::Some(34),
12465 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
12466 std::option::Option::Some(136)
12467 }
12468 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
12469 std::option::Option::Some(109)
12470 }
12471 Self::UnsecuredCredentials => std::option::Option::Some(13),
12472 Self::CredentialsInFiles => std::option::Option::Some(105),
12473 Self::BashHistory => std::option::Option::Some(96),
12474 Self::PrivateKeys => std::option::Option::Some(97),
12475 Self::SubvertTrustControl => std::option::Option::Some(106),
12476 Self::InstallRootCertificate => std::option::Option::Some(107),
12477 Self::CompromiseHostSoftwareBinary => std::option::Option::Some(84),
12478 Self::CredentialsFromPasswordStores => std::option::Option::Some(98),
12479 Self::ModifyAuthenticationProcess => std::option::Option::Some(28),
12480 Self::PluggableAuthenticationModules => std::option::Option::Some(108),
12481 Self::MultiFactorAuthentication => std::option::Option::Some(137),
12482 Self::ImpairDefenses => std::option::Option::Some(31),
12483 Self::DisableOrModifyTools => std::option::Option::Some(55),
12484 Self::IndicatorBlocking => std::option::Option::Some(110),
12485 Self::DisableOrModifyLinuxAuditSystem => std::option::Option::Some(111),
12486 Self::HideArtifacts => std::option::Option::Some(85),
12487 Self::HiddenFilesAndDirectories => std::option::Option::Some(86),
12488 Self::HiddenUsers => std::option::Option::Some(87),
12489 Self::ExfiltrationOverWebService => std::option::Option::Some(20),
12490 Self::ExfiltrationToCloudStorage => std::option::Option::Some(21),
12491 Self::DynamicResolution => std::option::Option::Some(12),
12492 Self::LateralToolTransfer => std::option::Option::Some(41),
12493 Self::HijackExecutionFlow => std::option::Option::Some(112),
12494 Self::HijackExecutionFlowDynamicLinkerHijacking => std::option::Option::Some(113),
12495 Self::ModifyCloudComputeInfrastructure => std::option::Option::Some(26),
12496 Self::CreateSnapshot => std::option::Option::Some(54),
12497 Self::CloudInfrastructureDiscovery => std::option::Option::Some(53),
12498 Self::DevelopCapabilities => std::option::Option::Some(99),
12499 Self::DevelopCapabilitiesMalware => std::option::Option::Some(100),
12500 Self::ObtainCapabilities => std::option::Option::Some(43),
12501 Self::ObtainCapabilitiesMalware => std::option::Option::Some(101),
12502 Self::ObtainCapabilitiesVulnerabilities => std::option::Option::Some(133),
12503 Self::ActiveScanning => std::option::Option::Some(1),
12504 Self::ScanningIpBlocks => std::option::Option::Some(2),
12505 Self::StageCapabilities => std::option::Option::Some(88),
12506 Self::UploadMalware => std::option::Option::Some(102),
12507 Self::ContainerAdministrationCommand => std::option::Option::Some(60),
12508 Self::DeployContainer => std::option::Option::Some(66),
12509 Self::EscapeToHost => std::option::Option::Some(61),
12510 Self::ContainerAndResourceDiscovery => std::option::Option::Some(57),
12511 Self::ReflectiveCodeLoading => std::option::Option::Some(92),
12512 Self::StealOrForgeAuthenticationCertificates => std::option::Option::Some(62),
12513 Self::FinancialTheft => std::option::Option::Some(131),
12514 Self::UnknownValue(u) => u.0.value(),
12515 }
12516 }
12517
12518 /// Gets the enum value as a string.
12519 ///
12520 /// Returns `None` if the enum contains an unknown value deserialized from
12521 /// the integer representation of enums.
12522 pub fn name(&self) -> std::option::Option<&str> {
12523 match self {
12524 Self::Unspecified => std::option::Option::Some("TECHNIQUE_UNSPECIFIED"),
12525 Self::DataObfuscation => std::option::Option::Some("DATA_OBFUSCATION"),
12526 Self::DataObfuscationSteganography => {
12527 std::option::Option::Some("DATA_OBFUSCATION_STEGANOGRAPHY")
12528 }
12529 Self::OsCredentialDumping => std::option::Option::Some("OS_CREDENTIAL_DUMPING"),
12530 Self::OsCredentialDumpingProcFilesystem => {
12531 std::option::Option::Some("OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM")
12532 }
12533 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => {
12534 std::option::Option::Some("OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW")
12535 }
12536 Self::DataFromLocalSystem => std::option::Option::Some("DATA_FROM_LOCAL_SYSTEM"),
12537 Self::AutomatedExfiltration => std::option::Option::Some("AUTOMATED_EXFILTRATION"),
12538 Self::ObfuscatedFilesOrInfo => {
12539 std::option::Option::Some("OBFUSCATED_FILES_OR_INFO")
12540 }
12541 Self::Steganography => std::option::Option::Some("STEGANOGRAPHY"),
12542 Self::CompileAfterDelivery => std::option::Option::Some("COMPILE_AFTER_DELIVERY"),
12543 Self::CommandObfuscation => std::option::Option::Some("COMMAND_OBFUSCATION"),
12544 Self::ScheduledTransfer => std::option::Option::Some("SCHEDULED_TRANSFER"),
12545 Self::SystemOwnerUserDiscovery => {
12546 std::option::Option::Some("SYSTEM_OWNER_USER_DISCOVERY")
12547 }
12548 Self::Masquerading => std::option::Option::Some("MASQUERADING"),
12549 Self::MatchLegitimateNameOrLocation => {
12550 std::option::Option::Some("MATCH_LEGITIMATE_NAME_OR_LOCATION")
12551 }
12552 Self::BootOrLogonInitializationScripts => {
12553 std::option::Option::Some("BOOT_OR_LOGON_INITIALIZATION_SCRIPTS")
12554 }
12555 Self::StartupItems => std::option::Option::Some("STARTUP_ITEMS"),
12556 Self::NetworkServiceDiscovery => {
12557 std::option::Option::Some("NETWORK_SERVICE_DISCOVERY")
12558 }
12559 Self::ScheduledTaskJob => std::option::Option::Some("SCHEDULED_TASK_JOB"),
12560 Self::ScheduledTaskJobCron => std::option::Option::Some("SCHEDULED_TASK_JOB_CRON"),
12561 Self::ContainerOrchestrationJob => {
12562 std::option::Option::Some("CONTAINER_ORCHESTRATION_JOB")
12563 }
12564 Self::ProcessInjection => std::option::Option::Some("PROCESS_INJECTION"),
12565 Self::InputCapture => std::option::Option::Some("INPUT_CAPTURE"),
12566 Self::InputCaptureKeylogging => {
12567 std::option::Option::Some("INPUT_CAPTURE_KEYLOGGING")
12568 }
12569 Self::ProcessDiscovery => std::option::Option::Some("PROCESS_DISCOVERY"),
12570 Self::CommandAndScriptingInterpreter => {
12571 std::option::Option::Some("COMMAND_AND_SCRIPTING_INTERPRETER")
12572 }
12573 Self::UnixShell => std::option::Option::Some("UNIX_SHELL"),
12574 Self::Python => std::option::Option::Some("PYTHON"),
12575 Self::ExploitationForPrivilegeEscalation => {
12576 std::option::Option::Some("EXPLOITATION_FOR_PRIVILEGE_ESCALATION")
12577 }
12578 Self::PermissionGroupsDiscovery => {
12579 std::option::Option::Some("PERMISSION_GROUPS_DISCOVERY")
12580 }
12581 Self::CloudGroups => std::option::Option::Some("CLOUD_GROUPS"),
12582 Self::IndicatorRemoval => std::option::Option::Some("INDICATOR_REMOVAL"),
12583 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => {
12584 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS")
12585 }
12586 Self::IndicatorRemovalClearCommandHistory => {
12587 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY")
12588 }
12589 Self::IndicatorRemovalFileDeletion => {
12590 std::option::Option::Some("INDICATOR_REMOVAL_FILE_DELETION")
12591 }
12592 Self::IndicatorRemovalTimestomp => {
12593 std::option::Option::Some("INDICATOR_REMOVAL_TIMESTOMP")
12594 }
12595 Self::IndicatorRemovalClearMailboxData => {
12596 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA")
12597 }
12598 Self::ApplicationLayerProtocol => {
12599 std::option::Option::Some("APPLICATION_LAYER_PROTOCOL")
12600 }
12601 Self::Dns => std::option::Option::Some("DNS"),
12602 Self::SoftwareDeploymentTools => {
12603 std::option::Option::Some("SOFTWARE_DEPLOYMENT_TOOLS")
12604 }
12605 Self::ValidAccounts => std::option::Option::Some("VALID_ACCOUNTS"),
12606 Self::DefaultAccounts => std::option::Option::Some("DEFAULT_ACCOUNTS"),
12607 Self::LocalAccounts => std::option::Option::Some("LOCAL_ACCOUNTS"),
12608 Self::CloudAccounts => std::option::Option::Some("CLOUD_ACCOUNTS"),
12609 Self::FileAndDirectoryDiscovery => {
12610 std::option::Option::Some("FILE_AND_DIRECTORY_DISCOVERY")
12611 }
12612 Self::AccountDiscoveryLocalAccount => {
12613 std::option::Option::Some("ACCOUNT_DISCOVERY_LOCAL_ACCOUNT")
12614 }
12615 Self::Proxy => std::option::Option::Some("PROXY"),
12616 Self::ExternalProxy => std::option::Option::Some("EXTERNAL_PROXY"),
12617 Self::MultiHopProxy => std::option::Option::Some("MULTI_HOP_PROXY"),
12618 Self::AccountManipulation => std::option::Option::Some("ACCOUNT_MANIPULATION"),
12619 Self::AdditionalCloudCredentials => {
12620 std::option::Option::Some("ADDITIONAL_CLOUD_CREDENTIALS")
12621 }
12622 Self::AdditionalCloudRoles => std::option::Option::Some("ADDITIONAL_CLOUD_ROLES"),
12623 Self::SshAuthorizedKeys => std::option::Option::Some("SSH_AUTHORIZED_KEYS"),
12624 Self::AdditionalContainerClusterRoles => {
12625 std::option::Option::Some("ADDITIONAL_CONTAINER_CLUSTER_ROLES")
12626 }
12627 Self::MultiStageChannels => std::option::Option::Some("MULTI_STAGE_CHANNELS"),
12628 Self::IngressToolTransfer => std::option::Option::Some("INGRESS_TOOL_TRANSFER"),
12629 Self::NativeApi => std::option::Option::Some("NATIVE_API"),
12630 Self::BruteForce => std::option::Option::Some("BRUTE_FORCE"),
12631 Self::AutomatedCollection => std::option::Option::Some("AUTOMATED_COLLECTION"),
12632 Self::SharedModules => std::option::Option::Some("SHARED_MODULES"),
12633 Self::DataEncoding => std::option::Option::Some("DATA_ENCODING"),
12634 Self::StandardEncoding => std::option::Option::Some("STANDARD_ENCODING"),
12635 Self::AccessTokenManipulation => {
12636 std::option::Option::Some("ACCESS_TOKEN_MANIPULATION")
12637 }
12638 Self::TokenImpersonationOrTheft => {
12639 std::option::Option::Some("TOKEN_IMPERSONATION_OR_THEFT")
12640 }
12641 Self::CreateAccount => std::option::Option::Some("CREATE_ACCOUNT"),
12642 Self::LocalAccount => std::option::Option::Some("LOCAL_ACCOUNT"),
12643 Self::DeobfuscateDecodeFilesOrInfo => {
12644 std::option::Option::Some("DEOBFUSCATE_DECODE_FILES_OR_INFO")
12645 }
12646 Self::ExploitPublicFacingApplication => {
12647 std::option::Option::Some("EXPLOIT_PUBLIC_FACING_APPLICATION")
12648 }
12649 Self::SupplyChainCompromise => std::option::Option::Some("SUPPLY_CHAIN_COMPROMISE"),
12650 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
12651 std::option::Option::Some(
12652 "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS",
12653 )
12654 }
12655 Self::ExploitationForClientExecution => {
12656 std::option::Option::Some("EXPLOITATION_FOR_CLIENT_EXECUTION")
12657 }
12658 Self::UserExecution => std::option::Option::Some("USER_EXECUTION"),
12659 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
12660 std::option::Option::Some(
12661 "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION",
12662 )
12663 }
12664 Self::DomainPolicyModification => {
12665 std::option::Option::Some("DOMAIN_POLICY_MODIFICATION")
12666 }
12667 Self::DataDestruction => std::option::Option::Some("DATA_DESTRUCTION"),
12668 Self::DataEncryptedForImpact => {
12669 std::option::Option::Some("DATA_ENCRYPTED_FOR_IMPACT")
12670 }
12671 Self::ServiceStop => std::option::Option::Some("SERVICE_STOP"),
12672 Self::InhibitSystemRecovery => std::option::Option::Some("INHIBIT_SYSTEM_RECOVERY"),
12673 Self::FirmwareCorruption => std::option::Option::Some("FIRMWARE_CORRUPTION"),
12674 Self::ResourceHijacking => std::option::Option::Some("RESOURCE_HIJACKING"),
12675 Self::NetworkDenialOfService => {
12676 std::option::Option::Some("NETWORK_DENIAL_OF_SERVICE")
12677 }
12678 Self::CloudServiceDiscovery => std::option::Option::Some("CLOUD_SERVICE_DISCOVERY"),
12679 Self::StealApplicationAccessToken => {
12680 std::option::Option::Some("STEAL_APPLICATION_ACCESS_TOKEN")
12681 }
12682 Self::AccountAccessRemoval => std::option::Option::Some("ACCOUNT_ACCESS_REMOVAL"),
12683 Self::TransferDataToCloudAccount => {
12684 std::option::Option::Some("TRANSFER_DATA_TO_CLOUD_ACCOUNT")
12685 }
12686 Self::StealWebSessionCookie => {
12687 std::option::Option::Some("STEAL_WEB_SESSION_COOKIE")
12688 }
12689 Self::CreateOrModifySystemProcess => {
12690 std::option::Option::Some("CREATE_OR_MODIFY_SYSTEM_PROCESS")
12691 }
12692 Self::EventTriggeredExecution => {
12693 std::option::Option::Some("EVENT_TRIGGERED_EXECUTION")
12694 }
12695 Self::BootOrLogonAutostartExecution => {
12696 std::option::Option::Some("BOOT_OR_LOGON_AUTOSTART_EXECUTION")
12697 }
12698 Self::KernelModulesAndExtensions => {
12699 std::option::Option::Some("KERNEL_MODULES_AND_EXTENSIONS")
12700 }
12701 Self::ShortcutModification => std::option::Option::Some("SHORTCUT_MODIFICATION"),
12702 Self::AbuseElevationControlMechanism => {
12703 std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM")
12704 }
12705 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
12706 std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID")
12707 }
12708 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
12709 std::option::Option::Some(
12710 "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING",
12711 )
12712 }
12713 Self::UnsecuredCredentials => std::option::Option::Some("UNSECURED_CREDENTIALS"),
12714 Self::CredentialsInFiles => std::option::Option::Some("CREDENTIALS_IN_FILES"),
12715 Self::BashHistory => std::option::Option::Some("BASH_HISTORY"),
12716 Self::PrivateKeys => std::option::Option::Some("PRIVATE_KEYS"),
12717 Self::SubvertTrustControl => std::option::Option::Some("SUBVERT_TRUST_CONTROL"),
12718 Self::InstallRootCertificate => {
12719 std::option::Option::Some("INSTALL_ROOT_CERTIFICATE")
12720 }
12721 Self::CompromiseHostSoftwareBinary => {
12722 std::option::Option::Some("COMPROMISE_HOST_SOFTWARE_BINARY")
12723 }
12724 Self::CredentialsFromPasswordStores => {
12725 std::option::Option::Some("CREDENTIALS_FROM_PASSWORD_STORES")
12726 }
12727 Self::ModifyAuthenticationProcess => {
12728 std::option::Option::Some("MODIFY_AUTHENTICATION_PROCESS")
12729 }
12730 Self::PluggableAuthenticationModules => {
12731 std::option::Option::Some("PLUGGABLE_AUTHENTICATION_MODULES")
12732 }
12733 Self::MultiFactorAuthentication => {
12734 std::option::Option::Some("MULTI_FACTOR_AUTHENTICATION")
12735 }
12736 Self::ImpairDefenses => std::option::Option::Some("IMPAIR_DEFENSES"),
12737 Self::DisableOrModifyTools => std::option::Option::Some("DISABLE_OR_MODIFY_TOOLS"),
12738 Self::IndicatorBlocking => std::option::Option::Some("INDICATOR_BLOCKING"),
12739 Self::DisableOrModifyLinuxAuditSystem => {
12740 std::option::Option::Some("DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM")
12741 }
12742 Self::HideArtifacts => std::option::Option::Some("HIDE_ARTIFACTS"),
12743 Self::HiddenFilesAndDirectories => {
12744 std::option::Option::Some("HIDDEN_FILES_AND_DIRECTORIES")
12745 }
12746 Self::HiddenUsers => std::option::Option::Some("HIDDEN_USERS"),
12747 Self::ExfiltrationOverWebService => {
12748 std::option::Option::Some("EXFILTRATION_OVER_WEB_SERVICE")
12749 }
12750 Self::ExfiltrationToCloudStorage => {
12751 std::option::Option::Some("EXFILTRATION_TO_CLOUD_STORAGE")
12752 }
12753 Self::DynamicResolution => std::option::Option::Some("DYNAMIC_RESOLUTION"),
12754 Self::LateralToolTransfer => std::option::Option::Some("LATERAL_TOOL_TRANSFER"),
12755 Self::HijackExecutionFlow => std::option::Option::Some("HIJACK_EXECUTION_FLOW"),
12756 Self::HijackExecutionFlowDynamicLinkerHijacking => {
12757 std::option::Option::Some("HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING")
12758 }
12759 Self::ModifyCloudComputeInfrastructure => {
12760 std::option::Option::Some("MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE")
12761 }
12762 Self::CreateSnapshot => std::option::Option::Some("CREATE_SNAPSHOT"),
12763 Self::CloudInfrastructureDiscovery => {
12764 std::option::Option::Some("CLOUD_INFRASTRUCTURE_DISCOVERY")
12765 }
12766 Self::DevelopCapabilities => std::option::Option::Some("DEVELOP_CAPABILITIES"),
12767 Self::DevelopCapabilitiesMalware => {
12768 std::option::Option::Some("DEVELOP_CAPABILITIES_MALWARE")
12769 }
12770 Self::ObtainCapabilities => std::option::Option::Some("OBTAIN_CAPABILITIES"),
12771 Self::ObtainCapabilitiesMalware => {
12772 std::option::Option::Some("OBTAIN_CAPABILITIES_MALWARE")
12773 }
12774 Self::ObtainCapabilitiesVulnerabilities => {
12775 std::option::Option::Some("OBTAIN_CAPABILITIES_VULNERABILITIES")
12776 }
12777 Self::ActiveScanning => std::option::Option::Some("ACTIVE_SCANNING"),
12778 Self::ScanningIpBlocks => std::option::Option::Some("SCANNING_IP_BLOCKS"),
12779 Self::StageCapabilities => std::option::Option::Some("STAGE_CAPABILITIES"),
12780 Self::UploadMalware => std::option::Option::Some("UPLOAD_MALWARE"),
12781 Self::ContainerAdministrationCommand => {
12782 std::option::Option::Some("CONTAINER_ADMINISTRATION_COMMAND")
12783 }
12784 Self::DeployContainer => std::option::Option::Some("DEPLOY_CONTAINER"),
12785 Self::EscapeToHost => std::option::Option::Some("ESCAPE_TO_HOST"),
12786 Self::ContainerAndResourceDiscovery => {
12787 std::option::Option::Some("CONTAINER_AND_RESOURCE_DISCOVERY")
12788 }
12789 Self::ReflectiveCodeLoading => std::option::Option::Some("REFLECTIVE_CODE_LOADING"),
12790 Self::StealOrForgeAuthenticationCertificates => {
12791 std::option::Option::Some("STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES")
12792 }
12793 Self::FinancialTheft => std::option::Option::Some("FINANCIAL_THEFT"),
12794 Self::UnknownValue(u) => u.0.name(),
12795 }
12796 }
12797 }
12798
12799 impl std::default::Default for Technique {
12800 fn default() -> Self {
12801 use std::convert::From;
12802 Self::from(0)
12803 }
12804 }
12805
12806 impl std::fmt::Display for Technique {
12807 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12808 wkt::internal::display_enum(f, self.name(), self.value())
12809 }
12810 }
12811
12812 impl std::convert::From<i32> for Technique {
12813 fn from(value: i32) -> Self {
12814 match value {
12815 0 => Self::Unspecified,
12816 1 => Self::ActiveScanning,
12817 2 => Self::ScanningIpBlocks,
12818 3 => Self::IngressToolTransfer,
12819 4 => Self::NativeApi,
12820 5 => Self::SharedModules,
12821 6 => Self::CommandAndScriptingInterpreter,
12822 7 => Self::UnixShell,
12823 8 => Self::ResourceHijacking,
12824 9 => Self::Proxy,
12825 10 => Self::ExternalProxy,
12826 11 => Self::MultiHopProxy,
12827 12 => Self::DynamicResolution,
12828 13 => Self::UnsecuredCredentials,
12829 14 => Self::ValidAccounts,
12830 15 => Self::LocalAccounts,
12831 16 => Self::CloudAccounts,
12832 17 => Self::NetworkDenialOfService,
12833 18 => Self::PermissionGroupsDiscovery,
12834 19 => Self::CloudGroups,
12835 20 => Self::ExfiltrationOverWebService,
12836 21 => Self::ExfiltrationToCloudStorage,
12837 22 => Self::AccountManipulation,
12838 23 => Self::SshAuthorizedKeys,
12839 24 => Self::CreateOrModifySystemProcess,
12840 25 => Self::StealWebSessionCookie,
12841 26 => Self::ModifyCloudComputeInfrastructure,
12842 27 => Self::ExploitPublicFacingApplication,
12843 28 => Self::ModifyAuthenticationProcess,
12844 29 => Self::DataDestruction,
12845 30 => Self::DomainPolicyModification,
12846 31 => Self::ImpairDefenses,
12847 32 => Self::NetworkServiceDiscovery,
12848 33 => Self::AccessTokenManipulation,
12849 34 => Self::AbuseElevationControlMechanism,
12850 35 => Self::DefaultAccounts,
12851 36 => Self::InhibitSystemRecovery,
12852 37 => Self::BootOrLogonInitializationScripts,
12853 38 => Self::StartupItems,
12854 39 => Self::TokenImpersonationOrTheft,
12855 40 => Self::AdditionalCloudCredentials,
12856 41 => Self::LateralToolTransfer,
12857 42 => Self::StealApplicationAccessToken,
12858 43 => Self::ObtainCapabilities,
12859 44 => Self::BruteForce,
12860 45 => Self::ApplicationLayerProtocol,
12861 46 => Self::Dns,
12862 47 => Self::SoftwareDeploymentTools,
12863 48 => Self::CloudServiceDiscovery,
12864 49 => Self::Masquerading,
12865 50 => Self::MatchLegitimateNameOrLocation,
12866 51 => Self::AccountAccessRemoval,
12867 52 => Self::ServiceStop,
12868 53 => Self::CloudInfrastructureDiscovery,
12869 54 => Self::CreateSnapshot,
12870 55 => Self::DisableOrModifyTools,
12871 56 => Self::ProcessDiscovery,
12872 57 => Self::ContainerAndResourceDiscovery,
12873 58 => Self::AdditionalContainerClusterRoles,
12874 59 => Self::Python,
12875 60 => Self::ContainerAdministrationCommand,
12876 61 => Self::EscapeToHost,
12877 62 => Self::StealOrForgeAuthenticationCertificates,
12878 63 => Self::ExploitationForPrivilegeEscalation,
12879 64 => Self::IndicatorRemovalFileDeletion,
12880 65 => Self::EventTriggeredExecution,
12881 66 => Self::DeployContainer,
12882 67 => Self::AdditionalCloudRoles,
12883 68 => Self::AutomatedExfiltration,
12884 69 => Self::UserExecution,
12885 70 => Self::DataObfuscation,
12886 71 => Self::DataObfuscationSteganography,
12887 72 => Self::ObfuscatedFilesOrInfo,
12888 73 => Self::Steganography,
12889 74 => Self::CompileAfterDelivery,
12890 75 => Self::CommandObfuscation,
12891 76 => Self::MultiStageChannels,
12892 77 => Self::DataEncoding,
12893 78 => Self::StandardEncoding,
12894 79 => Self::CreateAccount,
12895 80 => Self::LocalAccount,
12896 81 => Self::FirmwareCorruption,
12897 82 => Self::BootOrLogonAutostartExecution,
12898 83 => Self::KernelModulesAndExtensions,
12899 84 => Self::CompromiseHostSoftwareBinary,
12900 85 => Self::HideArtifacts,
12901 86 => Self::HiddenFilesAndDirectories,
12902 87 => Self::HiddenUsers,
12903 88 => Self::StageCapabilities,
12904 89 => Self::ScheduledTaskJob,
12905 90 => Self::ContainerOrchestrationJob,
12906 91 => Self::TransferDataToCloudAccount,
12907 92 => Self::ReflectiveCodeLoading,
12908 93 => Self::ProcessInjection,
12909 94 => Self::AutomatedCollection,
12910 95 => Self::DeobfuscateDecodeFilesOrInfo,
12911 96 => Self::BashHistory,
12912 97 => Self::PrivateKeys,
12913 98 => Self::CredentialsFromPasswordStores,
12914 99 => Self::DevelopCapabilities,
12915 100 => Self::DevelopCapabilitiesMalware,
12916 101 => Self::ObtainCapabilitiesMalware,
12917 102 => Self::UploadMalware,
12918 103 => Self::InputCapture,
12919 104 => Self::InputCaptureKeylogging,
12920 105 => Self::CredentialsInFiles,
12921 106 => Self::SubvertTrustControl,
12922 107 => Self::InstallRootCertificate,
12923 108 => Self::PluggableAuthenticationModules,
12924 109 => Self::AbuseElevationControlMechanismSudoAndSudoCaching,
12925 110 => Self::IndicatorBlocking,
12926 111 => Self::DisableOrModifyLinuxAuditSystem,
12927 112 => Self::HijackExecutionFlow,
12928 113 => Self::HijackExecutionFlowDynamicLinkerHijacking,
12929 114 => Self::OsCredentialDumping,
12930 115 => Self::OsCredentialDumpingProcFilesystem,
12931 116 => Self::AccountDiscoveryLocalAccount,
12932 117 => Self::DataFromLocalSystem,
12933 118 => Self::SystemOwnerUserDiscovery,
12934 119 => Self::ScheduledTaskJobCron,
12935 120 => Self::ScheduledTransfer,
12936 121 => Self::FileAndDirectoryDiscovery,
12937 122 => Self::OsCredentialDumpingEtcPasswordAndEtcShadow,
12938 123 => Self::IndicatorRemoval,
12939 124 => Self::IndicatorRemovalClearLinuxOrMacSystemLogs,
12940 125 => Self::IndicatorRemovalClearCommandHistory,
12941 126 => Self::IndicatorRemovalClearMailboxData,
12942 127 => Self::ShortcutModification,
12943 128 => Self::IndicatorRemovalTimestomp,
12944 129 => Self::SupplyChainCompromise,
12945 130 => Self::CompromiseSoftwareDependenciesAndDevelopmentTools,
12946 131 => Self::FinancialTheft,
12947 132 => Self::DataEncryptedForImpact,
12948 133 => Self::ObtainCapabilitiesVulnerabilities,
12949 134 => Self::ExploitationForClientExecution,
12950 135 => Self::LinuxAndMacFileAndDirectoryPermissionsModification,
12951 136 => Self::AbuseElevationControlMechanismSetuidAndSetgid,
12952 137 => Self::MultiFactorAuthentication,
12953 _ => Self::UnknownValue(technique::UnknownValue(
12954 wkt::internal::UnknownEnumValue::Integer(value),
12955 )),
12956 }
12957 }
12958 }
12959
12960 impl std::convert::From<&str> for Technique {
12961 fn from(value: &str) -> Self {
12962 use std::string::ToString;
12963 match value {
12964 "TECHNIQUE_UNSPECIFIED" => Self::Unspecified,
12965 "DATA_OBFUSCATION" => Self::DataObfuscation,
12966 "DATA_OBFUSCATION_STEGANOGRAPHY" => Self::DataObfuscationSteganography,
12967 "OS_CREDENTIAL_DUMPING" => Self::OsCredentialDumping,
12968 "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM" => Self::OsCredentialDumpingProcFilesystem,
12969 "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW" => {
12970 Self::OsCredentialDumpingEtcPasswordAndEtcShadow
12971 }
12972 "DATA_FROM_LOCAL_SYSTEM" => Self::DataFromLocalSystem,
12973 "AUTOMATED_EXFILTRATION" => Self::AutomatedExfiltration,
12974 "OBFUSCATED_FILES_OR_INFO" => Self::ObfuscatedFilesOrInfo,
12975 "STEGANOGRAPHY" => Self::Steganography,
12976 "COMPILE_AFTER_DELIVERY" => Self::CompileAfterDelivery,
12977 "COMMAND_OBFUSCATION" => Self::CommandObfuscation,
12978 "SCHEDULED_TRANSFER" => Self::ScheduledTransfer,
12979 "SYSTEM_OWNER_USER_DISCOVERY" => Self::SystemOwnerUserDiscovery,
12980 "MASQUERADING" => Self::Masquerading,
12981 "MATCH_LEGITIMATE_NAME_OR_LOCATION" => Self::MatchLegitimateNameOrLocation,
12982 "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS" => Self::BootOrLogonInitializationScripts,
12983 "STARTUP_ITEMS" => Self::StartupItems,
12984 "NETWORK_SERVICE_DISCOVERY" => Self::NetworkServiceDiscovery,
12985 "SCHEDULED_TASK_JOB" => Self::ScheduledTaskJob,
12986 "SCHEDULED_TASK_JOB_CRON" => Self::ScheduledTaskJobCron,
12987 "CONTAINER_ORCHESTRATION_JOB" => Self::ContainerOrchestrationJob,
12988 "PROCESS_INJECTION" => Self::ProcessInjection,
12989 "INPUT_CAPTURE" => Self::InputCapture,
12990 "INPUT_CAPTURE_KEYLOGGING" => Self::InputCaptureKeylogging,
12991 "PROCESS_DISCOVERY" => Self::ProcessDiscovery,
12992 "COMMAND_AND_SCRIPTING_INTERPRETER" => Self::CommandAndScriptingInterpreter,
12993 "UNIX_SHELL" => Self::UnixShell,
12994 "PYTHON" => Self::Python,
12995 "EXPLOITATION_FOR_PRIVILEGE_ESCALATION" => Self::ExploitationForPrivilegeEscalation,
12996 "PERMISSION_GROUPS_DISCOVERY" => Self::PermissionGroupsDiscovery,
12997 "CLOUD_GROUPS" => Self::CloudGroups,
12998 "INDICATOR_REMOVAL" => Self::IndicatorRemoval,
12999 "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS" => {
13000 Self::IndicatorRemovalClearLinuxOrMacSystemLogs
13001 }
13002 "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY" => {
13003 Self::IndicatorRemovalClearCommandHistory
13004 }
13005 "INDICATOR_REMOVAL_FILE_DELETION" => Self::IndicatorRemovalFileDeletion,
13006 "INDICATOR_REMOVAL_TIMESTOMP" => Self::IndicatorRemovalTimestomp,
13007 "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA" => Self::IndicatorRemovalClearMailboxData,
13008 "APPLICATION_LAYER_PROTOCOL" => Self::ApplicationLayerProtocol,
13009 "DNS" => Self::Dns,
13010 "SOFTWARE_DEPLOYMENT_TOOLS" => Self::SoftwareDeploymentTools,
13011 "VALID_ACCOUNTS" => Self::ValidAccounts,
13012 "DEFAULT_ACCOUNTS" => Self::DefaultAccounts,
13013 "LOCAL_ACCOUNTS" => Self::LocalAccounts,
13014 "CLOUD_ACCOUNTS" => Self::CloudAccounts,
13015 "FILE_AND_DIRECTORY_DISCOVERY" => Self::FileAndDirectoryDiscovery,
13016 "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT" => Self::AccountDiscoveryLocalAccount,
13017 "PROXY" => Self::Proxy,
13018 "EXTERNAL_PROXY" => Self::ExternalProxy,
13019 "MULTI_HOP_PROXY" => Self::MultiHopProxy,
13020 "ACCOUNT_MANIPULATION" => Self::AccountManipulation,
13021 "ADDITIONAL_CLOUD_CREDENTIALS" => Self::AdditionalCloudCredentials,
13022 "ADDITIONAL_CLOUD_ROLES" => Self::AdditionalCloudRoles,
13023 "SSH_AUTHORIZED_KEYS" => Self::SshAuthorizedKeys,
13024 "ADDITIONAL_CONTAINER_CLUSTER_ROLES" => Self::AdditionalContainerClusterRoles,
13025 "MULTI_STAGE_CHANNELS" => Self::MultiStageChannels,
13026 "INGRESS_TOOL_TRANSFER" => Self::IngressToolTransfer,
13027 "NATIVE_API" => Self::NativeApi,
13028 "BRUTE_FORCE" => Self::BruteForce,
13029 "AUTOMATED_COLLECTION" => Self::AutomatedCollection,
13030 "SHARED_MODULES" => Self::SharedModules,
13031 "DATA_ENCODING" => Self::DataEncoding,
13032 "STANDARD_ENCODING" => Self::StandardEncoding,
13033 "ACCESS_TOKEN_MANIPULATION" => Self::AccessTokenManipulation,
13034 "TOKEN_IMPERSONATION_OR_THEFT" => Self::TokenImpersonationOrTheft,
13035 "CREATE_ACCOUNT" => Self::CreateAccount,
13036 "LOCAL_ACCOUNT" => Self::LocalAccount,
13037 "DEOBFUSCATE_DECODE_FILES_OR_INFO" => Self::DeobfuscateDecodeFilesOrInfo,
13038 "EXPLOIT_PUBLIC_FACING_APPLICATION" => Self::ExploitPublicFacingApplication,
13039 "SUPPLY_CHAIN_COMPROMISE" => Self::SupplyChainCompromise,
13040 "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS" => {
13041 Self::CompromiseSoftwareDependenciesAndDevelopmentTools
13042 }
13043 "EXPLOITATION_FOR_CLIENT_EXECUTION" => Self::ExploitationForClientExecution,
13044 "USER_EXECUTION" => Self::UserExecution,
13045 "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION" => {
13046 Self::LinuxAndMacFileAndDirectoryPermissionsModification
13047 }
13048 "DOMAIN_POLICY_MODIFICATION" => Self::DomainPolicyModification,
13049 "DATA_DESTRUCTION" => Self::DataDestruction,
13050 "DATA_ENCRYPTED_FOR_IMPACT" => Self::DataEncryptedForImpact,
13051 "SERVICE_STOP" => Self::ServiceStop,
13052 "INHIBIT_SYSTEM_RECOVERY" => Self::InhibitSystemRecovery,
13053 "FIRMWARE_CORRUPTION" => Self::FirmwareCorruption,
13054 "RESOURCE_HIJACKING" => Self::ResourceHijacking,
13055 "NETWORK_DENIAL_OF_SERVICE" => Self::NetworkDenialOfService,
13056 "CLOUD_SERVICE_DISCOVERY" => Self::CloudServiceDiscovery,
13057 "STEAL_APPLICATION_ACCESS_TOKEN" => Self::StealApplicationAccessToken,
13058 "ACCOUNT_ACCESS_REMOVAL" => Self::AccountAccessRemoval,
13059 "TRANSFER_DATA_TO_CLOUD_ACCOUNT" => Self::TransferDataToCloudAccount,
13060 "STEAL_WEB_SESSION_COOKIE" => Self::StealWebSessionCookie,
13061 "CREATE_OR_MODIFY_SYSTEM_PROCESS" => Self::CreateOrModifySystemProcess,
13062 "EVENT_TRIGGERED_EXECUTION" => Self::EventTriggeredExecution,
13063 "BOOT_OR_LOGON_AUTOSTART_EXECUTION" => Self::BootOrLogonAutostartExecution,
13064 "KERNEL_MODULES_AND_EXTENSIONS" => Self::KernelModulesAndExtensions,
13065 "SHORTCUT_MODIFICATION" => Self::ShortcutModification,
13066 "ABUSE_ELEVATION_CONTROL_MECHANISM" => Self::AbuseElevationControlMechanism,
13067 "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID" => {
13068 Self::AbuseElevationControlMechanismSetuidAndSetgid
13069 }
13070 "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING" => {
13071 Self::AbuseElevationControlMechanismSudoAndSudoCaching
13072 }
13073 "UNSECURED_CREDENTIALS" => Self::UnsecuredCredentials,
13074 "CREDENTIALS_IN_FILES" => Self::CredentialsInFiles,
13075 "BASH_HISTORY" => Self::BashHistory,
13076 "PRIVATE_KEYS" => Self::PrivateKeys,
13077 "SUBVERT_TRUST_CONTROL" => Self::SubvertTrustControl,
13078 "INSTALL_ROOT_CERTIFICATE" => Self::InstallRootCertificate,
13079 "COMPROMISE_HOST_SOFTWARE_BINARY" => Self::CompromiseHostSoftwareBinary,
13080 "CREDENTIALS_FROM_PASSWORD_STORES" => Self::CredentialsFromPasswordStores,
13081 "MODIFY_AUTHENTICATION_PROCESS" => Self::ModifyAuthenticationProcess,
13082 "PLUGGABLE_AUTHENTICATION_MODULES" => Self::PluggableAuthenticationModules,
13083 "MULTI_FACTOR_AUTHENTICATION" => Self::MultiFactorAuthentication,
13084 "IMPAIR_DEFENSES" => Self::ImpairDefenses,
13085 "DISABLE_OR_MODIFY_TOOLS" => Self::DisableOrModifyTools,
13086 "INDICATOR_BLOCKING" => Self::IndicatorBlocking,
13087 "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM" => Self::DisableOrModifyLinuxAuditSystem,
13088 "HIDE_ARTIFACTS" => Self::HideArtifacts,
13089 "HIDDEN_FILES_AND_DIRECTORIES" => Self::HiddenFilesAndDirectories,
13090 "HIDDEN_USERS" => Self::HiddenUsers,
13091 "EXFILTRATION_OVER_WEB_SERVICE" => Self::ExfiltrationOverWebService,
13092 "EXFILTRATION_TO_CLOUD_STORAGE" => Self::ExfiltrationToCloudStorage,
13093 "DYNAMIC_RESOLUTION" => Self::DynamicResolution,
13094 "LATERAL_TOOL_TRANSFER" => Self::LateralToolTransfer,
13095 "HIJACK_EXECUTION_FLOW" => Self::HijackExecutionFlow,
13096 "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING" => {
13097 Self::HijackExecutionFlowDynamicLinkerHijacking
13098 }
13099 "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE" => Self::ModifyCloudComputeInfrastructure,
13100 "CREATE_SNAPSHOT" => Self::CreateSnapshot,
13101 "CLOUD_INFRASTRUCTURE_DISCOVERY" => Self::CloudInfrastructureDiscovery,
13102 "DEVELOP_CAPABILITIES" => Self::DevelopCapabilities,
13103 "DEVELOP_CAPABILITIES_MALWARE" => Self::DevelopCapabilitiesMalware,
13104 "OBTAIN_CAPABILITIES" => Self::ObtainCapabilities,
13105 "OBTAIN_CAPABILITIES_MALWARE" => Self::ObtainCapabilitiesMalware,
13106 "OBTAIN_CAPABILITIES_VULNERABILITIES" => Self::ObtainCapabilitiesVulnerabilities,
13107 "ACTIVE_SCANNING" => Self::ActiveScanning,
13108 "SCANNING_IP_BLOCKS" => Self::ScanningIpBlocks,
13109 "STAGE_CAPABILITIES" => Self::StageCapabilities,
13110 "UPLOAD_MALWARE" => Self::UploadMalware,
13111 "CONTAINER_ADMINISTRATION_COMMAND" => Self::ContainerAdministrationCommand,
13112 "DEPLOY_CONTAINER" => Self::DeployContainer,
13113 "ESCAPE_TO_HOST" => Self::EscapeToHost,
13114 "CONTAINER_AND_RESOURCE_DISCOVERY" => Self::ContainerAndResourceDiscovery,
13115 "REFLECTIVE_CODE_LOADING" => Self::ReflectiveCodeLoading,
13116 "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES" => {
13117 Self::StealOrForgeAuthenticationCertificates
13118 }
13119 "FINANCIAL_THEFT" => Self::FinancialTheft,
13120 _ => Self::UnknownValue(technique::UnknownValue(
13121 wkt::internal::UnknownEnumValue::String(value.to_string()),
13122 )),
13123 }
13124 }
13125 }
13126
13127 impl serde::ser::Serialize for Technique {
13128 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13129 where
13130 S: serde::Serializer,
13131 {
13132 match self {
13133 Self::Unspecified => serializer.serialize_i32(0),
13134 Self::DataObfuscation => serializer.serialize_i32(70),
13135 Self::DataObfuscationSteganography => serializer.serialize_i32(71),
13136 Self::OsCredentialDumping => serializer.serialize_i32(114),
13137 Self::OsCredentialDumpingProcFilesystem => serializer.serialize_i32(115),
13138 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => serializer.serialize_i32(122),
13139 Self::DataFromLocalSystem => serializer.serialize_i32(117),
13140 Self::AutomatedExfiltration => serializer.serialize_i32(68),
13141 Self::ObfuscatedFilesOrInfo => serializer.serialize_i32(72),
13142 Self::Steganography => serializer.serialize_i32(73),
13143 Self::CompileAfterDelivery => serializer.serialize_i32(74),
13144 Self::CommandObfuscation => serializer.serialize_i32(75),
13145 Self::ScheduledTransfer => serializer.serialize_i32(120),
13146 Self::SystemOwnerUserDiscovery => serializer.serialize_i32(118),
13147 Self::Masquerading => serializer.serialize_i32(49),
13148 Self::MatchLegitimateNameOrLocation => serializer.serialize_i32(50),
13149 Self::BootOrLogonInitializationScripts => serializer.serialize_i32(37),
13150 Self::StartupItems => serializer.serialize_i32(38),
13151 Self::NetworkServiceDiscovery => serializer.serialize_i32(32),
13152 Self::ScheduledTaskJob => serializer.serialize_i32(89),
13153 Self::ScheduledTaskJobCron => serializer.serialize_i32(119),
13154 Self::ContainerOrchestrationJob => serializer.serialize_i32(90),
13155 Self::ProcessInjection => serializer.serialize_i32(93),
13156 Self::InputCapture => serializer.serialize_i32(103),
13157 Self::InputCaptureKeylogging => serializer.serialize_i32(104),
13158 Self::ProcessDiscovery => serializer.serialize_i32(56),
13159 Self::CommandAndScriptingInterpreter => serializer.serialize_i32(6),
13160 Self::UnixShell => serializer.serialize_i32(7),
13161 Self::Python => serializer.serialize_i32(59),
13162 Self::ExploitationForPrivilegeEscalation => serializer.serialize_i32(63),
13163 Self::PermissionGroupsDiscovery => serializer.serialize_i32(18),
13164 Self::CloudGroups => serializer.serialize_i32(19),
13165 Self::IndicatorRemoval => serializer.serialize_i32(123),
13166 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => serializer.serialize_i32(124),
13167 Self::IndicatorRemovalClearCommandHistory => serializer.serialize_i32(125),
13168 Self::IndicatorRemovalFileDeletion => serializer.serialize_i32(64),
13169 Self::IndicatorRemovalTimestomp => serializer.serialize_i32(128),
13170 Self::IndicatorRemovalClearMailboxData => serializer.serialize_i32(126),
13171 Self::ApplicationLayerProtocol => serializer.serialize_i32(45),
13172 Self::Dns => serializer.serialize_i32(46),
13173 Self::SoftwareDeploymentTools => serializer.serialize_i32(47),
13174 Self::ValidAccounts => serializer.serialize_i32(14),
13175 Self::DefaultAccounts => serializer.serialize_i32(35),
13176 Self::LocalAccounts => serializer.serialize_i32(15),
13177 Self::CloudAccounts => serializer.serialize_i32(16),
13178 Self::FileAndDirectoryDiscovery => serializer.serialize_i32(121),
13179 Self::AccountDiscoveryLocalAccount => serializer.serialize_i32(116),
13180 Self::Proxy => serializer.serialize_i32(9),
13181 Self::ExternalProxy => serializer.serialize_i32(10),
13182 Self::MultiHopProxy => serializer.serialize_i32(11),
13183 Self::AccountManipulation => serializer.serialize_i32(22),
13184 Self::AdditionalCloudCredentials => serializer.serialize_i32(40),
13185 Self::AdditionalCloudRoles => serializer.serialize_i32(67),
13186 Self::SshAuthorizedKeys => serializer.serialize_i32(23),
13187 Self::AdditionalContainerClusterRoles => serializer.serialize_i32(58),
13188 Self::MultiStageChannels => serializer.serialize_i32(76),
13189 Self::IngressToolTransfer => serializer.serialize_i32(3),
13190 Self::NativeApi => serializer.serialize_i32(4),
13191 Self::BruteForce => serializer.serialize_i32(44),
13192 Self::AutomatedCollection => serializer.serialize_i32(94),
13193 Self::SharedModules => serializer.serialize_i32(5),
13194 Self::DataEncoding => serializer.serialize_i32(77),
13195 Self::StandardEncoding => serializer.serialize_i32(78),
13196 Self::AccessTokenManipulation => serializer.serialize_i32(33),
13197 Self::TokenImpersonationOrTheft => serializer.serialize_i32(39),
13198 Self::CreateAccount => serializer.serialize_i32(79),
13199 Self::LocalAccount => serializer.serialize_i32(80),
13200 Self::DeobfuscateDecodeFilesOrInfo => serializer.serialize_i32(95),
13201 Self::ExploitPublicFacingApplication => serializer.serialize_i32(27),
13202 Self::SupplyChainCompromise => serializer.serialize_i32(129),
13203 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
13204 serializer.serialize_i32(130)
13205 }
13206 Self::ExploitationForClientExecution => serializer.serialize_i32(134),
13207 Self::UserExecution => serializer.serialize_i32(69),
13208 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
13209 serializer.serialize_i32(135)
13210 }
13211 Self::DomainPolicyModification => serializer.serialize_i32(30),
13212 Self::DataDestruction => serializer.serialize_i32(29),
13213 Self::DataEncryptedForImpact => serializer.serialize_i32(132),
13214 Self::ServiceStop => serializer.serialize_i32(52),
13215 Self::InhibitSystemRecovery => serializer.serialize_i32(36),
13216 Self::FirmwareCorruption => serializer.serialize_i32(81),
13217 Self::ResourceHijacking => serializer.serialize_i32(8),
13218 Self::NetworkDenialOfService => serializer.serialize_i32(17),
13219 Self::CloudServiceDiscovery => serializer.serialize_i32(48),
13220 Self::StealApplicationAccessToken => serializer.serialize_i32(42),
13221 Self::AccountAccessRemoval => serializer.serialize_i32(51),
13222 Self::TransferDataToCloudAccount => serializer.serialize_i32(91),
13223 Self::StealWebSessionCookie => serializer.serialize_i32(25),
13224 Self::CreateOrModifySystemProcess => serializer.serialize_i32(24),
13225 Self::EventTriggeredExecution => serializer.serialize_i32(65),
13226 Self::BootOrLogonAutostartExecution => serializer.serialize_i32(82),
13227 Self::KernelModulesAndExtensions => serializer.serialize_i32(83),
13228 Self::ShortcutModification => serializer.serialize_i32(127),
13229 Self::AbuseElevationControlMechanism => serializer.serialize_i32(34),
13230 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
13231 serializer.serialize_i32(136)
13232 }
13233 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
13234 serializer.serialize_i32(109)
13235 }
13236 Self::UnsecuredCredentials => serializer.serialize_i32(13),
13237 Self::CredentialsInFiles => serializer.serialize_i32(105),
13238 Self::BashHistory => serializer.serialize_i32(96),
13239 Self::PrivateKeys => serializer.serialize_i32(97),
13240 Self::SubvertTrustControl => serializer.serialize_i32(106),
13241 Self::InstallRootCertificate => serializer.serialize_i32(107),
13242 Self::CompromiseHostSoftwareBinary => serializer.serialize_i32(84),
13243 Self::CredentialsFromPasswordStores => serializer.serialize_i32(98),
13244 Self::ModifyAuthenticationProcess => serializer.serialize_i32(28),
13245 Self::PluggableAuthenticationModules => serializer.serialize_i32(108),
13246 Self::MultiFactorAuthentication => serializer.serialize_i32(137),
13247 Self::ImpairDefenses => serializer.serialize_i32(31),
13248 Self::DisableOrModifyTools => serializer.serialize_i32(55),
13249 Self::IndicatorBlocking => serializer.serialize_i32(110),
13250 Self::DisableOrModifyLinuxAuditSystem => serializer.serialize_i32(111),
13251 Self::HideArtifacts => serializer.serialize_i32(85),
13252 Self::HiddenFilesAndDirectories => serializer.serialize_i32(86),
13253 Self::HiddenUsers => serializer.serialize_i32(87),
13254 Self::ExfiltrationOverWebService => serializer.serialize_i32(20),
13255 Self::ExfiltrationToCloudStorage => serializer.serialize_i32(21),
13256 Self::DynamicResolution => serializer.serialize_i32(12),
13257 Self::LateralToolTransfer => serializer.serialize_i32(41),
13258 Self::HijackExecutionFlow => serializer.serialize_i32(112),
13259 Self::HijackExecutionFlowDynamicLinkerHijacking => serializer.serialize_i32(113),
13260 Self::ModifyCloudComputeInfrastructure => serializer.serialize_i32(26),
13261 Self::CreateSnapshot => serializer.serialize_i32(54),
13262 Self::CloudInfrastructureDiscovery => serializer.serialize_i32(53),
13263 Self::DevelopCapabilities => serializer.serialize_i32(99),
13264 Self::DevelopCapabilitiesMalware => serializer.serialize_i32(100),
13265 Self::ObtainCapabilities => serializer.serialize_i32(43),
13266 Self::ObtainCapabilitiesMalware => serializer.serialize_i32(101),
13267 Self::ObtainCapabilitiesVulnerabilities => serializer.serialize_i32(133),
13268 Self::ActiveScanning => serializer.serialize_i32(1),
13269 Self::ScanningIpBlocks => serializer.serialize_i32(2),
13270 Self::StageCapabilities => serializer.serialize_i32(88),
13271 Self::UploadMalware => serializer.serialize_i32(102),
13272 Self::ContainerAdministrationCommand => serializer.serialize_i32(60),
13273 Self::DeployContainer => serializer.serialize_i32(66),
13274 Self::EscapeToHost => serializer.serialize_i32(61),
13275 Self::ContainerAndResourceDiscovery => serializer.serialize_i32(57),
13276 Self::ReflectiveCodeLoading => serializer.serialize_i32(92),
13277 Self::StealOrForgeAuthenticationCertificates => serializer.serialize_i32(62),
13278 Self::FinancialTheft => serializer.serialize_i32(131),
13279 Self::UnknownValue(u) => u.0.serialize(serializer),
13280 }
13281 }
13282 }
13283
13284 impl<'de> serde::de::Deserialize<'de> for Technique {
13285 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13286 where
13287 D: serde::Deserializer<'de>,
13288 {
13289 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Technique>::new(
13290 ".google.cloud.securitycenter.v2.MitreAttack.Technique",
13291 ))
13292 }
13293 }
13294}
13295
13296/// A mute config is a Cloud SCC resource that contains the configuration
13297/// to mute create/update events of findings.
13298#[derive(Clone, Default, PartialEq)]
13299#[non_exhaustive]
13300pub struct MuteConfig {
13301 /// Identifier. This field will be ignored if provided on config creation. The
13302 /// following list shows some examples of the format:
13303 ///
13304 /// + `organizations/{organization}/muteConfigs/{mute_config}`
13305 ///
13306 /// `organizations/{organization}locations/{location}//muteConfigs/{mute_config}`
13307 ///
13308 /// + `folders/{folder}/muteConfigs/{mute_config}`
13309 /// + `folders/{folder}/locations/{location}/muteConfigs/{mute_config}`
13310 /// + `projects/{project}/muteConfigs/{mute_config}`
13311 /// + `projects/{project}/locations/{location}/muteConfigs/{mute_config}`
13312 pub name: std::string::String,
13313
13314 /// A description of the mute config.
13315 pub description: std::string::String,
13316
13317 /// Required. An expression that defines the filter to apply across
13318 /// create/update events of findings. While creating a filter string, be
13319 /// mindful of the scope in which the mute configuration is being created.
13320 /// E.g., If a filter contains project = X but is created under the project = Y
13321 /// scope, it might not match any findings.
13322 ///
13323 /// The following field and operator combinations are supported:
13324 ///
13325 /// * severity: `=`, `:`
13326 /// * category: `=`, `:`
13327 /// * resource.name: `=`, `:`
13328 /// * resource.project_name: `=`, `:`
13329 /// * resource.project_display_name: `=`, `:`
13330 /// * resource.folders.resource_folder: `=`, `:`
13331 /// * resource.parent_name: `=`, `:`
13332 /// * resource.parent_display_name: `=`, `:`
13333 /// * resource.type: `=`, `:`
13334 /// * finding_class: `=`, `:`
13335 /// * indicator.ip_addresses: `=`, `:`
13336 /// * indicator.domains: `=`, `:`
13337 pub filter: std::string::String,
13338
13339 /// Output only. The time at which the mute config was created.
13340 /// This field is set by the server and will be ignored if provided on config
13341 /// creation.
13342 pub create_time: std::option::Option<wkt::Timestamp>,
13343
13344 /// Output only. The most recent time at which the mute config was updated.
13345 /// This field is set by the server and will be ignored if provided on config
13346 /// creation or update.
13347 pub update_time: std::option::Option<wkt::Timestamp>,
13348
13349 /// Output only. Email address of the user who last edited the mute config.
13350 /// This field is set by the server and will be ignored if provided on config
13351 /// creation or update.
13352 pub most_recent_editor: std::string::String,
13353
13354 /// Required. The type of the mute config, which determines what type of mute
13355 /// state the config affects. Immutable after creation.
13356 pub r#type: crate::model::mute_config::MuteConfigType,
13357
13358 /// Optional. The expiry of the mute config. Only applicable for dynamic
13359 /// configs. If the expiry is set, when the config expires, it is removed from
13360 /// all findings.
13361 pub expiry_time: std::option::Option<wkt::Timestamp>,
13362
13363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13364}
13365
13366impl MuteConfig {
13367 /// Creates a new default instance.
13368 pub fn new() -> Self {
13369 std::default::Default::default()
13370 }
13371
13372 /// Sets the value of [name][crate::model::MuteConfig::name].
13373 ///
13374 /// # Example
13375 /// ```ignore,no_run
13376 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13377 /// # let organization_id = "organization_id";
13378 /// # let mute_config_id = "mute_config_id";
13379 /// let x = MuteConfig::new().set_name(format!("organizations/{organization_id}/muteConfigs/{mute_config_id}"));
13380 /// ```
13381 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13382 self.name = v.into();
13383 self
13384 }
13385
13386 /// Sets the value of [description][crate::model::MuteConfig::description].
13387 ///
13388 /// # Example
13389 /// ```ignore,no_run
13390 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13391 /// let x = MuteConfig::new().set_description("example");
13392 /// ```
13393 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13394 self.description = v.into();
13395 self
13396 }
13397
13398 /// Sets the value of [filter][crate::model::MuteConfig::filter].
13399 ///
13400 /// # Example
13401 /// ```ignore,no_run
13402 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13403 /// let x = MuteConfig::new().set_filter("example");
13404 /// ```
13405 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13406 self.filter = v.into();
13407 self
13408 }
13409
13410 /// Sets 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_create_time(Timestamp::default()/* use setters */);
13417 /// ```
13418 pub fn set_create_time<T>(mut self, v: T) -> Self
13419 where
13420 T: std::convert::Into<wkt::Timestamp>,
13421 {
13422 self.create_time = std::option::Option::Some(v.into());
13423 self
13424 }
13425
13426 /// Sets or clears the value of [create_time][crate::model::MuteConfig::create_time].
13427 ///
13428 /// # Example
13429 /// ```ignore,no_run
13430 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13431 /// use wkt::Timestamp;
13432 /// let x = MuteConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13433 /// let x = MuteConfig::new().set_or_clear_create_time(None::<Timestamp>);
13434 /// ```
13435 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13436 where
13437 T: std::convert::Into<wkt::Timestamp>,
13438 {
13439 self.create_time = v.map(|x| x.into());
13440 self
13441 }
13442
13443 /// Sets 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_update_time(Timestamp::default()/* use setters */);
13450 /// ```
13451 pub fn set_update_time<T>(mut self, v: T) -> Self
13452 where
13453 T: std::convert::Into<wkt::Timestamp>,
13454 {
13455 self.update_time = std::option::Option::Some(v.into());
13456 self
13457 }
13458
13459 /// Sets or clears the value of [update_time][crate::model::MuteConfig::update_time].
13460 ///
13461 /// # Example
13462 /// ```ignore,no_run
13463 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13464 /// use wkt::Timestamp;
13465 /// let x = MuteConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13466 /// let x = MuteConfig::new().set_or_clear_update_time(None::<Timestamp>);
13467 /// ```
13468 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13469 where
13470 T: std::convert::Into<wkt::Timestamp>,
13471 {
13472 self.update_time = v.map(|x| x.into());
13473 self
13474 }
13475
13476 /// Sets the value of [most_recent_editor][crate::model::MuteConfig::most_recent_editor].
13477 ///
13478 /// # Example
13479 /// ```ignore,no_run
13480 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13481 /// let x = MuteConfig::new().set_most_recent_editor("example");
13482 /// ```
13483 pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
13484 mut self,
13485 v: T,
13486 ) -> Self {
13487 self.most_recent_editor = v.into();
13488 self
13489 }
13490
13491 /// Sets the value of [r#type][crate::model::MuteConfig::type].
13492 ///
13493 /// # Example
13494 /// ```ignore,no_run
13495 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13496 /// use google_cloud_securitycenter_v2::model::mute_config::MuteConfigType;
13497 /// let x0 = MuteConfig::new().set_type(MuteConfigType::Static);
13498 /// let x1 = MuteConfig::new().set_type(MuteConfigType::Dynamic);
13499 /// ```
13500 pub fn set_type<T: std::convert::Into<crate::model::mute_config::MuteConfigType>>(
13501 mut self,
13502 v: T,
13503 ) -> Self {
13504 self.r#type = v.into();
13505 self
13506 }
13507
13508 /// Sets 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_expiry_time(Timestamp::default()/* use setters */);
13515 /// ```
13516 pub fn set_expiry_time<T>(mut self, v: T) -> Self
13517 where
13518 T: std::convert::Into<wkt::Timestamp>,
13519 {
13520 self.expiry_time = std::option::Option::Some(v.into());
13521 self
13522 }
13523
13524 /// Sets or clears the value of [expiry_time][crate::model::MuteConfig::expiry_time].
13525 ///
13526 /// # Example
13527 /// ```ignore,no_run
13528 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13529 /// use wkt::Timestamp;
13530 /// let x = MuteConfig::new().set_or_clear_expiry_time(Some(Timestamp::default()/* use setters */));
13531 /// let x = MuteConfig::new().set_or_clear_expiry_time(None::<Timestamp>);
13532 /// ```
13533 pub fn set_or_clear_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
13534 where
13535 T: std::convert::Into<wkt::Timestamp>,
13536 {
13537 self.expiry_time = v.map(|x| x.into());
13538 self
13539 }
13540}
13541
13542impl wkt::message::Message for MuteConfig {
13543 fn typename() -> &'static str {
13544 "type.googleapis.com/google.cloud.securitycenter.v2.MuteConfig"
13545 }
13546}
13547
13548/// Defines additional types related to [MuteConfig].
13549pub mod mute_config {
13550 #[allow(unused_imports)]
13551 use super::*;
13552
13553 /// The type of MuteConfig.
13554 ///
13555 /// # Working with unknown values
13556 ///
13557 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13558 /// additional enum variants at any time. Adding new variants is not considered
13559 /// a breaking change. Applications should write their code in anticipation of:
13560 ///
13561 /// - New values appearing in future releases of the client library, **and**
13562 /// - New values received dynamically, without application changes.
13563 ///
13564 /// Please consult the [Working with enums] section in the user guide for some
13565 /// guidelines.
13566 ///
13567 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13568 #[derive(Clone, Debug, PartialEq)]
13569 #[non_exhaustive]
13570 pub enum MuteConfigType {
13571 /// Unused.
13572 Unspecified,
13573 /// A static mute config, which sets the static mute state of future matching
13574 /// findings to muted. Once the static mute state has been set, finding or
13575 /// config modifications will not affect the state.
13576 Static,
13577 /// A dynamic mute config, which is applied to existing and future matching
13578 /// findings, setting their dynamic mute state to "muted". If the config is
13579 /// updated or deleted, or a matching finding is updated, such that the
13580 /// finding doesn't match the config, the config will be removed from the
13581 /// finding, and the finding's dynamic mute state may become "unmuted"
13582 /// (unless other configs still match).
13583 Dynamic,
13584 /// If set, the enum was initialized with an unknown value.
13585 ///
13586 /// Applications can examine the value using [MuteConfigType::value] or
13587 /// [MuteConfigType::name].
13588 UnknownValue(mute_config_type::UnknownValue),
13589 }
13590
13591 #[doc(hidden)]
13592 pub mod mute_config_type {
13593 #[allow(unused_imports)]
13594 use super::*;
13595 #[derive(Clone, Debug, PartialEq)]
13596 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13597 }
13598
13599 impl MuteConfigType {
13600 /// Gets the enum value.
13601 ///
13602 /// Returns `None` if the enum contains an unknown value deserialized from
13603 /// the string representation of enums.
13604 pub fn value(&self) -> std::option::Option<i32> {
13605 match self {
13606 Self::Unspecified => std::option::Option::Some(0),
13607 Self::Static => std::option::Option::Some(1),
13608 Self::Dynamic => std::option::Option::Some(2),
13609 Self::UnknownValue(u) => u.0.value(),
13610 }
13611 }
13612
13613 /// Gets the enum value as a string.
13614 ///
13615 /// Returns `None` if the enum contains an unknown value deserialized from
13616 /// the integer representation of enums.
13617 pub fn name(&self) -> std::option::Option<&str> {
13618 match self {
13619 Self::Unspecified => std::option::Option::Some("MUTE_CONFIG_TYPE_UNSPECIFIED"),
13620 Self::Static => std::option::Option::Some("STATIC"),
13621 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
13622 Self::UnknownValue(u) => u.0.name(),
13623 }
13624 }
13625 }
13626
13627 impl std::default::Default for MuteConfigType {
13628 fn default() -> Self {
13629 use std::convert::From;
13630 Self::from(0)
13631 }
13632 }
13633
13634 impl std::fmt::Display for MuteConfigType {
13635 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13636 wkt::internal::display_enum(f, self.name(), self.value())
13637 }
13638 }
13639
13640 impl std::convert::From<i32> for MuteConfigType {
13641 fn from(value: i32) -> Self {
13642 match value {
13643 0 => Self::Unspecified,
13644 1 => Self::Static,
13645 2 => Self::Dynamic,
13646 _ => Self::UnknownValue(mute_config_type::UnknownValue(
13647 wkt::internal::UnknownEnumValue::Integer(value),
13648 )),
13649 }
13650 }
13651 }
13652
13653 impl std::convert::From<&str> for MuteConfigType {
13654 fn from(value: &str) -> Self {
13655 use std::string::ToString;
13656 match value {
13657 "MUTE_CONFIG_TYPE_UNSPECIFIED" => Self::Unspecified,
13658 "STATIC" => Self::Static,
13659 "DYNAMIC" => Self::Dynamic,
13660 _ => Self::UnknownValue(mute_config_type::UnknownValue(
13661 wkt::internal::UnknownEnumValue::String(value.to_string()),
13662 )),
13663 }
13664 }
13665 }
13666
13667 impl serde::ser::Serialize for MuteConfigType {
13668 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13669 where
13670 S: serde::Serializer,
13671 {
13672 match self {
13673 Self::Unspecified => serializer.serialize_i32(0),
13674 Self::Static => serializer.serialize_i32(1),
13675 Self::Dynamic => serializer.serialize_i32(2),
13676 Self::UnknownValue(u) => u.0.serialize(serializer),
13677 }
13678 }
13679 }
13680
13681 impl<'de> serde::de::Deserialize<'de> for MuteConfigType {
13682 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13683 where
13684 D: serde::Deserializer<'de>,
13685 {
13686 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteConfigType>::new(
13687 ".google.cloud.securitycenter.v2.MuteConfig.MuteConfigType",
13688 ))
13689 }
13690 }
13691}
13692
13693/// Contains information about a VPC network associated with the finding.
13694#[derive(Clone, Default, PartialEq)]
13695#[non_exhaustive]
13696pub struct Network {
13697 /// The name of the VPC network resource, for example,
13698 /// `//compute.googleapis.com/projects/my-project/global/networks/my-network`.
13699 pub name: std::string::String,
13700
13701 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13702}
13703
13704impl Network {
13705 /// Creates a new default instance.
13706 pub fn new() -> Self {
13707 std::default::Default::default()
13708 }
13709
13710 /// Sets the value of [name][crate::model::Network::name].
13711 ///
13712 /// # Example
13713 /// ```ignore,no_run
13714 /// # use google_cloud_securitycenter_v2::model::Network;
13715 /// let x = Network::new().set_name("example");
13716 /// ```
13717 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13718 self.name = v.into();
13719 self
13720 }
13721}
13722
13723impl wkt::message::Message for Network {
13724 fn typename() -> &'static str {
13725 "type.googleapis.com/google.cloud.securitycenter.v2.Network"
13726 }
13727}
13728
13729/// Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise
13730/// notebook](https://cloud.google.com/colab/docs/introduction) file, that is
13731/// associated with a finding.
13732#[derive(Clone, Default, PartialEq)]
13733#[non_exhaustive]
13734pub struct Notebook {
13735 /// The name of the notebook.
13736 pub name: std::string::String,
13737
13738 /// The source notebook service, for example, "Colab Enterprise".
13739 pub service: std::string::String,
13740
13741 /// The user ID of the latest author to modify the notebook.
13742 pub last_author: std::string::String,
13743
13744 /// The most recent time the notebook was updated.
13745 pub notebook_update_time: std::option::Option<wkt::Timestamp>,
13746
13747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13748}
13749
13750impl Notebook {
13751 /// Creates a new default instance.
13752 pub fn new() -> Self {
13753 std::default::Default::default()
13754 }
13755
13756 /// Sets the value of [name][crate::model::Notebook::name].
13757 ///
13758 /// # Example
13759 /// ```ignore,no_run
13760 /// # use google_cloud_securitycenter_v2::model::Notebook;
13761 /// let x = Notebook::new().set_name("example");
13762 /// ```
13763 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13764 self.name = v.into();
13765 self
13766 }
13767
13768 /// Sets the value of [service][crate::model::Notebook::service].
13769 ///
13770 /// # Example
13771 /// ```ignore,no_run
13772 /// # use google_cloud_securitycenter_v2::model::Notebook;
13773 /// let x = Notebook::new().set_service("example");
13774 /// ```
13775 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13776 self.service = v.into();
13777 self
13778 }
13779
13780 /// Sets the value of [last_author][crate::model::Notebook::last_author].
13781 ///
13782 /// # Example
13783 /// ```ignore,no_run
13784 /// # use google_cloud_securitycenter_v2::model::Notebook;
13785 /// let x = Notebook::new().set_last_author("example");
13786 /// ```
13787 pub fn set_last_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13788 self.last_author = v.into();
13789 self
13790 }
13791
13792 /// Sets 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_notebook_update_time(Timestamp::default()/* use setters */);
13799 /// ```
13800 pub fn set_notebook_update_time<T>(mut self, v: T) -> Self
13801 where
13802 T: std::convert::Into<wkt::Timestamp>,
13803 {
13804 self.notebook_update_time = std::option::Option::Some(v.into());
13805 self
13806 }
13807
13808 /// Sets or clears the value of [notebook_update_time][crate::model::Notebook::notebook_update_time].
13809 ///
13810 /// # Example
13811 /// ```ignore,no_run
13812 /// # use google_cloud_securitycenter_v2::model::Notebook;
13813 /// use wkt::Timestamp;
13814 /// let x = Notebook::new().set_or_clear_notebook_update_time(Some(Timestamp::default()/* use setters */));
13815 /// let x = Notebook::new().set_or_clear_notebook_update_time(None::<Timestamp>);
13816 /// ```
13817 pub fn set_or_clear_notebook_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13818 where
13819 T: std::convert::Into<wkt::Timestamp>,
13820 {
13821 self.notebook_update_time = v.map(|x| x.into());
13822 self
13823 }
13824}
13825
13826impl wkt::message::Message for Notebook {
13827 fn typename() -> &'static str {
13828 "type.googleapis.com/google.cloud.securitycenter.v2.Notebook"
13829 }
13830}
13831
13832/// Cloud Security Command Center (Cloud SCC) notification configs.
13833///
13834/// A notification config is a Cloud SCC resource that contains the configuration
13835/// to send notifications for create/update events of findings, assets and etc.
13836#[derive(Clone, Default, PartialEq)]
13837#[non_exhaustive]
13838pub struct NotificationConfig {
13839 /// Identifier. The relative resource name of this notification config. See:
13840 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
13841 /// The following list shows some examples:
13842 /// +
13843 /// `organizations/{organization_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13844 /// +
13845 /// `folders/{folder_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13846 /// +
13847 /// `projects/{project_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13848 pub name: std::string::String,
13849
13850 /// The description of the notification config (max of 1024 characters).
13851 pub description: std::string::String,
13852
13853 /// The Pub/Sub topic to send notifications to. Its format is
13854 /// "projects/[project_id]/topics/[topic]".
13855 pub pubsub_topic: std::string::String,
13856
13857 /// Output only. The service account that needs "pubsub.topics.publish"
13858 /// permission to publish to the Pub/Sub topic.
13859 pub service_account: std::string::String,
13860
13861 /// Output only. The timestamp of when the notification config was last
13862 /// updated.
13863 pub update_time: std::option::Option<wkt::Timestamp>,
13864
13865 /// The config for triggering notifications.
13866 pub notify_config: std::option::Option<crate::model::notification_config::NotifyConfig>,
13867
13868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13869}
13870
13871impl NotificationConfig {
13872 /// Creates a new default instance.
13873 pub fn new() -> Self {
13874 std::default::Default::default()
13875 }
13876
13877 /// Sets the value of [name][crate::model::NotificationConfig::name].
13878 ///
13879 /// # Example
13880 /// ```ignore,no_run
13881 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13882 /// # let organization_id = "organization_id";
13883 /// # let location_id = "location_id";
13884 /// # let notification_config_id = "notification_config_id";
13885 /// let x = NotificationConfig::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/notificationConfigs/{notification_config_id}"));
13886 /// ```
13887 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13888 self.name = v.into();
13889 self
13890 }
13891
13892 /// Sets the value of [description][crate::model::NotificationConfig::description].
13893 ///
13894 /// # Example
13895 /// ```ignore,no_run
13896 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13897 /// let x = NotificationConfig::new().set_description("example");
13898 /// ```
13899 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13900 self.description = v.into();
13901 self
13902 }
13903
13904 /// Sets the value of [pubsub_topic][crate::model::NotificationConfig::pubsub_topic].
13905 ///
13906 /// # Example
13907 /// ```ignore,no_run
13908 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13909 /// let x = NotificationConfig::new().set_pubsub_topic("example");
13910 /// ```
13911 pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13912 self.pubsub_topic = v.into();
13913 self
13914 }
13915
13916 /// Sets the value of [service_account][crate::model::NotificationConfig::service_account].
13917 ///
13918 /// # Example
13919 /// ```ignore,no_run
13920 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13921 /// let x = NotificationConfig::new().set_service_account("example");
13922 /// ```
13923 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13924 self.service_account = v.into();
13925 self
13926 }
13927
13928 /// Sets the value of [update_time][crate::model::NotificationConfig::update_time].
13929 ///
13930 /// # Example
13931 /// ```ignore,no_run
13932 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13933 /// use wkt::Timestamp;
13934 /// let x = NotificationConfig::new().set_update_time(Timestamp::default()/* use setters */);
13935 /// ```
13936 pub fn set_update_time<T>(mut self, v: T) -> Self
13937 where
13938 T: std::convert::Into<wkt::Timestamp>,
13939 {
13940 self.update_time = std::option::Option::Some(v.into());
13941 self
13942 }
13943
13944 /// Sets or clears the value of [update_time][crate::model::NotificationConfig::update_time].
13945 ///
13946 /// # Example
13947 /// ```ignore,no_run
13948 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13949 /// use wkt::Timestamp;
13950 /// let x = NotificationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13951 /// let x = NotificationConfig::new().set_or_clear_update_time(None::<Timestamp>);
13952 /// ```
13953 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13954 where
13955 T: std::convert::Into<wkt::Timestamp>,
13956 {
13957 self.update_time = v.map(|x| x.into());
13958 self
13959 }
13960
13961 /// Sets the value of [notify_config][crate::model::NotificationConfig::notify_config].
13962 ///
13963 /// Note that all the setters affecting `notify_config` are mutually
13964 /// exclusive.
13965 ///
13966 /// # Example
13967 /// ```ignore,no_run
13968 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13969 /// use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
13970 /// let x = NotificationConfig::new().set_notify_config(Some(
13971 /// google_cloud_securitycenter_v2::model::notification_config::NotifyConfig::StreamingConfig(StreamingConfig::default().into())));
13972 /// ```
13973 pub fn set_notify_config<
13974 T: std::convert::Into<std::option::Option<crate::model::notification_config::NotifyConfig>>,
13975 >(
13976 mut self,
13977 v: T,
13978 ) -> Self {
13979 self.notify_config = v.into();
13980 self
13981 }
13982
13983 /// The value of [notify_config][crate::model::NotificationConfig::notify_config]
13984 /// if it holds a `StreamingConfig`, `None` if the field is not set or
13985 /// holds a different branch.
13986 pub fn streaming_config(
13987 &self,
13988 ) -> std::option::Option<&std::boxed::Box<crate::model::notification_config::StreamingConfig>>
13989 {
13990 #[allow(unreachable_patterns)]
13991 self.notify_config.as_ref().and_then(|v| match v {
13992 crate::model::notification_config::NotifyConfig::StreamingConfig(v) => {
13993 std::option::Option::Some(v)
13994 }
13995 _ => std::option::Option::None,
13996 })
13997 }
13998
13999 /// Sets the value of [notify_config][crate::model::NotificationConfig::notify_config]
14000 /// to hold a `StreamingConfig`.
14001 ///
14002 /// Note that all the setters affecting `notify_config` are
14003 /// mutually exclusive.
14004 ///
14005 /// # Example
14006 /// ```ignore,no_run
14007 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
14008 /// use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
14009 /// let x = NotificationConfig::new().set_streaming_config(StreamingConfig::default()/* use setters */);
14010 /// assert!(x.streaming_config().is_some());
14011 /// ```
14012 pub fn set_streaming_config<
14013 T: std::convert::Into<std::boxed::Box<crate::model::notification_config::StreamingConfig>>,
14014 >(
14015 mut self,
14016 v: T,
14017 ) -> Self {
14018 self.notify_config = std::option::Option::Some(
14019 crate::model::notification_config::NotifyConfig::StreamingConfig(v.into()),
14020 );
14021 self
14022 }
14023}
14024
14025impl wkt::message::Message for NotificationConfig {
14026 fn typename() -> &'static str {
14027 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig"
14028 }
14029}
14030
14031/// Defines additional types related to [NotificationConfig].
14032pub mod notification_config {
14033 #[allow(unused_imports)]
14034 use super::*;
14035
14036 /// The config for streaming-based notifications, which send each event as soon
14037 /// as it is detected.
14038 #[derive(Clone, Default, PartialEq)]
14039 #[non_exhaustive]
14040 pub struct StreamingConfig {
14041 /// Expression that defines the filter to apply across create/update events
14042 /// of assets or findings as specified by the event type. The expression is a
14043 /// list of zero or more restrictions combined via logical operators `AND`
14044 /// and `OR`. Parentheses are supported, and `OR` has higher precedence than
14045 /// `AND`.
14046 ///
14047 /// Restrictions have the form `<field> <operator> <value>` and may have a
14048 /// `-` character in front of them to indicate negation. The fields map to
14049 /// those defined in the corresponding resource.
14050 ///
14051 /// The supported operators are:
14052 ///
14053 /// * `=` for all value types.
14054 /// * `>`, `<`, `>=`, `<=` for integer values.
14055 /// * `:`, meaning substring matching, for strings.
14056 ///
14057 /// The supported value types are:
14058 ///
14059 /// * string literals in quotes.
14060 /// * integer literals without quotes.
14061 /// * boolean literals `true` and `false` without quotes.
14062 pub filter: std::string::String,
14063
14064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14065 }
14066
14067 impl StreamingConfig {
14068 /// Creates a new default instance.
14069 pub fn new() -> Self {
14070 std::default::Default::default()
14071 }
14072
14073 /// Sets the value of [filter][crate::model::notification_config::StreamingConfig::filter].
14074 ///
14075 /// # Example
14076 /// ```ignore,no_run
14077 /// # use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
14078 /// let x = StreamingConfig::new().set_filter("example");
14079 /// ```
14080 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14081 self.filter = v.into();
14082 self
14083 }
14084 }
14085
14086 impl wkt::message::Message for StreamingConfig {
14087 fn typename() -> &'static str {
14088 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig"
14089 }
14090 }
14091
14092 /// The config for triggering notifications.
14093 #[derive(Clone, Debug, PartialEq)]
14094 #[non_exhaustive]
14095 pub enum NotifyConfig {
14096 /// The config for triggering streaming-based notifications.
14097 StreamingConfig(std::boxed::Box<crate::model::notification_config::StreamingConfig>),
14098 }
14099}
14100
14101/// Cloud SCC's Notification
14102#[derive(Clone, Default, PartialEq)]
14103#[non_exhaustive]
14104pub struct NotificationMessage {
14105 /// Name of the notification config that generated current notification.
14106 pub notification_config_name: std::string::String,
14107
14108 /// The Cloud resource tied to this notification's Finding.
14109 pub resource: std::option::Option<crate::model::Resource>,
14110
14111 /// Notification Event.
14112 pub event: std::option::Option<crate::model::notification_message::Event>,
14113
14114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14115}
14116
14117impl NotificationMessage {
14118 /// Creates a new default instance.
14119 pub fn new() -> Self {
14120 std::default::Default::default()
14121 }
14122
14123 /// Sets the value of [notification_config_name][crate::model::NotificationMessage::notification_config_name].
14124 ///
14125 /// # Example
14126 /// ```ignore,no_run
14127 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14128 /// let x = NotificationMessage::new().set_notification_config_name("example");
14129 /// ```
14130 pub fn set_notification_config_name<T: std::convert::Into<std::string::String>>(
14131 mut self,
14132 v: T,
14133 ) -> Self {
14134 self.notification_config_name = v.into();
14135 self
14136 }
14137
14138 /// Sets the value of [resource][crate::model::NotificationMessage::resource].
14139 ///
14140 /// # Example
14141 /// ```ignore,no_run
14142 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14143 /// use google_cloud_securitycenter_v2::model::Resource;
14144 /// let x = NotificationMessage::new().set_resource(Resource::default()/* use setters */);
14145 /// ```
14146 pub fn set_resource<T>(mut self, v: T) -> Self
14147 where
14148 T: std::convert::Into<crate::model::Resource>,
14149 {
14150 self.resource = std::option::Option::Some(v.into());
14151 self
14152 }
14153
14154 /// Sets or clears the value of [resource][crate::model::NotificationMessage::resource].
14155 ///
14156 /// # Example
14157 /// ```ignore,no_run
14158 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14159 /// use google_cloud_securitycenter_v2::model::Resource;
14160 /// let x = NotificationMessage::new().set_or_clear_resource(Some(Resource::default()/* use setters */));
14161 /// let x = NotificationMessage::new().set_or_clear_resource(None::<Resource>);
14162 /// ```
14163 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
14164 where
14165 T: std::convert::Into<crate::model::Resource>,
14166 {
14167 self.resource = v.map(|x| x.into());
14168 self
14169 }
14170
14171 /// Sets the value of [event][crate::model::NotificationMessage::event].
14172 ///
14173 /// Note that all the setters affecting `event` are mutually
14174 /// exclusive.
14175 ///
14176 /// # Example
14177 /// ```ignore,no_run
14178 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14179 /// use google_cloud_securitycenter_v2::model::Finding;
14180 /// let x = NotificationMessage::new().set_event(Some(
14181 /// google_cloud_securitycenter_v2::model::notification_message::Event::Finding(Finding::default().into())));
14182 /// ```
14183 pub fn set_event<
14184 T: std::convert::Into<std::option::Option<crate::model::notification_message::Event>>,
14185 >(
14186 mut self,
14187 v: T,
14188 ) -> Self {
14189 self.event = v.into();
14190 self
14191 }
14192
14193 /// The value of [event][crate::model::NotificationMessage::event]
14194 /// if it holds a `Finding`, `None` if the field is not set or
14195 /// holds a different branch.
14196 pub fn finding(&self) -> std::option::Option<&std::boxed::Box<crate::model::Finding>> {
14197 #[allow(unreachable_patterns)]
14198 self.event.as_ref().and_then(|v| match v {
14199 crate::model::notification_message::Event::Finding(v) => std::option::Option::Some(v),
14200 _ => std::option::Option::None,
14201 })
14202 }
14203
14204 /// Sets the value of [event][crate::model::NotificationMessage::event]
14205 /// to hold a `Finding`.
14206 ///
14207 /// Note that all the setters affecting `event` are
14208 /// mutually exclusive.
14209 ///
14210 /// # Example
14211 /// ```ignore,no_run
14212 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14213 /// use google_cloud_securitycenter_v2::model::Finding;
14214 /// let x = NotificationMessage::new().set_finding(Finding::default()/* use setters */);
14215 /// assert!(x.finding().is_some());
14216 /// ```
14217 pub fn set_finding<T: std::convert::Into<std::boxed::Box<crate::model::Finding>>>(
14218 mut self,
14219 v: T,
14220 ) -> Self {
14221 self.event =
14222 std::option::Option::Some(crate::model::notification_message::Event::Finding(v.into()));
14223 self
14224 }
14225}
14226
14227impl wkt::message::Message for NotificationMessage {
14228 fn typename() -> &'static str {
14229 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationMessage"
14230 }
14231}
14232
14233/// Defines additional types related to [NotificationMessage].
14234pub mod notification_message {
14235 #[allow(unused_imports)]
14236 use super::*;
14237
14238 /// Notification Event.
14239 #[derive(Clone, Debug, PartialEq)]
14240 #[non_exhaustive]
14241 pub enum Event {
14242 /// If it's a Finding based notification config, this field will be
14243 /// populated.
14244 Finding(std::boxed::Box<crate::model::Finding>),
14245 }
14246}
14247
14248/// Contains information about the org policies associated with the finding.
14249#[derive(Clone, Default, PartialEq)]
14250#[non_exhaustive]
14251pub struct OrgPolicy {
14252 /// Identifier. The resource name of the org policy.
14253 /// Example:
14254 /// "organizations/{organization_id}/policies/{constraint_name}"
14255 pub name: std::string::String,
14256
14257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14258}
14259
14260impl OrgPolicy {
14261 /// Creates a new default instance.
14262 pub fn new() -> Self {
14263 std::default::Default::default()
14264 }
14265
14266 /// Sets the value of [name][crate::model::OrgPolicy::name].
14267 ///
14268 /// # Example
14269 /// ```ignore,no_run
14270 /// # use google_cloud_securitycenter_v2::model::OrgPolicy;
14271 /// # let organization_id = "organization_id";
14272 /// # let constraint_name = "constraint_name";
14273 /// let x = OrgPolicy::new().set_name(format!("organizations/{organization_id}/policies/{constraint_name}"));
14274 /// ```
14275 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14276 self.name = v.into();
14277 self
14278 }
14279}
14280
14281impl wkt::message::Message for OrgPolicy {
14282 fn typename() -> &'static str {
14283 "type.googleapis.com/google.cloud.securitycenter.v2.OrgPolicy"
14284 }
14285}
14286
14287/// Represents an operating system process.
14288#[derive(Clone, Default, PartialEq)]
14289#[non_exhaustive]
14290pub struct Process {
14291 /// The process name, as displayed in utilities like `top` and `ps`. This name
14292 /// can be accessed through `/proc/[pid]/comm` and changed with
14293 /// `prctl(PR_SET_NAME)`.
14294 pub name: std::string::String,
14295
14296 /// File information for the process executable.
14297 pub binary: std::option::Option<crate::model::File>,
14298
14299 /// File information for libraries loaded by the process.
14300 pub libraries: std::vec::Vec<crate::model::File>,
14301
14302 /// When the process represents the invocation of a script, `binary` provides
14303 /// information about the interpreter, while `script` provides information
14304 /// about the script file provided to the interpreter.
14305 pub script: std::option::Option<crate::model::File>,
14306
14307 /// Process arguments as JSON encoded strings.
14308 pub args: std::vec::Vec<std::string::String>,
14309
14310 /// True if `args` is incomplete.
14311 pub arguments_truncated: bool,
14312
14313 /// Process environment variables.
14314 pub env_variables: std::vec::Vec<crate::model::EnvironmentVariable>,
14315
14316 /// True if `env_variables` is incomplete.
14317 pub env_variables_truncated: bool,
14318
14319 /// The process ID.
14320 pub pid: i64,
14321
14322 /// The parent process ID.
14323 pub parent_pid: i64,
14324
14325 /// The ID of the user that executed the process. E.g. If this is the root user
14326 /// this will always be 0.
14327 pub user_id: i64,
14328
14329 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14330}
14331
14332impl Process {
14333 /// Creates a new default instance.
14334 pub fn new() -> Self {
14335 std::default::Default::default()
14336 }
14337
14338 /// Sets the value of [name][crate::model::Process::name].
14339 ///
14340 /// # Example
14341 /// ```ignore,no_run
14342 /// # use google_cloud_securitycenter_v2::model::Process;
14343 /// let x = Process::new().set_name("example");
14344 /// ```
14345 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14346 self.name = v.into();
14347 self
14348 }
14349
14350 /// Sets the value of [binary][crate::model::Process::binary].
14351 ///
14352 /// # Example
14353 /// ```ignore,no_run
14354 /// # use google_cloud_securitycenter_v2::model::Process;
14355 /// use google_cloud_securitycenter_v2::model::File;
14356 /// let x = Process::new().set_binary(File::default()/* use setters */);
14357 /// ```
14358 pub fn set_binary<T>(mut self, v: T) -> Self
14359 where
14360 T: std::convert::Into<crate::model::File>,
14361 {
14362 self.binary = std::option::Option::Some(v.into());
14363 self
14364 }
14365
14366 /// Sets or clears the value of [binary][crate::model::Process::binary].
14367 ///
14368 /// # Example
14369 /// ```ignore,no_run
14370 /// # use google_cloud_securitycenter_v2::model::Process;
14371 /// use google_cloud_securitycenter_v2::model::File;
14372 /// let x = Process::new().set_or_clear_binary(Some(File::default()/* use setters */));
14373 /// let x = Process::new().set_or_clear_binary(None::<File>);
14374 /// ```
14375 pub fn set_or_clear_binary<T>(mut self, v: std::option::Option<T>) -> Self
14376 where
14377 T: std::convert::Into<crate::model::File>,
14378 {
14379 self.binary = v.map(|x| x.into());
14380 self
14381 }
14382
14383 /// Sets the value of [libraries][crate::model::Process::libraries].
14384 ///
14385 /// # Example
14386 /// ```ignore,no_run
14387 /// # use google_cloud_securitycenter_v2::model::Process;
14388 /// use google_cloud_securitycenter_v2::model::File;
14389 /// let x = Process::new()
14390 /// .set_libraries([
14391 /// File::default()/* use setters */,
14392 /// File::default()/* use (different) setters */,
14393 /// ]);
14394 /// ```
14395 pub fn set_libraries<T, V>(mut self, v: T) -> Self
14396 where
14397 T: std::iter::IntoIterator<Item = V>,
14398 V: std::convert::Into<crate::model::File>,
14399 {
14400 use std::iter::Iterator;
14401 self.libraries = v.into_iter().map(|i| i.into()).collect();
14402 self
14403 }
14404
14405 /// Sets the value of [script][crate::model::Process::script].
14406 ///
14407 /// # Example
14408 /// ```ignore,no_run
14409 /// # use google_cloud_securitycenter_v2::model::Process;
14410 /// use google_cloud_securitycenter_v2::model::File;
14411 /// let x = Process::new().set_script(File::default()/* use setters */);
14412 /// ```
14413 pub fn set_script<T>(mut self, v: T) -> Self
14414 where
14415 T: std::convert::Into<crate::model::File>,
14416 {
14417 self.script = std::option::Option::Some(v.into());
14418 self
14419 }
14420
14421 /// Sets or clears the value of [script][crate::model::Process::script].
14422 ///
14423 /// # Example
14424 /// ```ignore,no_run
14425 /// # use google_cloud_securitycenter_v2::model::Process;
14426 /// use google_cloud_securitycenter_v2::model::File;
14427 /// let x = Process::new().set_or_clear_script(Some(File::default()/* use setters */));
14428 /// let x = Process::new().set_or_clear_script(None::<File>);
14429 /// ```
14430 pub fn set_or_clear_script<T>(mut self, v: std::option::Option<T>) -> Self
14431 where
14432 T: std::convert::Into<crate::model::File>,
14433 {
14434 self.script = v.map(|x| x.into());
14435 self
14436 }
14437
14438 /// Sets the value of [args][crate::model::Process::args].
14439 ///
14440 /// # Example
14441 /// ```ignore,no_run
14442 /// # use google_cloud_securitycenter_v2::model::Process;
14443 /// let x = Process::new().set_args(["a", "b", "c"]);
14444 /// ```
14445 pub fn set_args<T, V>(mut self, v: T) -> Self
14446 where
14447 T: std::iter::IntoIterator<Item = V>,
14448 V: std::convert::Into<std::string::String>,
14449 {
14450 use std::iter::Iterator;
14451 self.args = v.into_iter().map(|i| i.into()).collect();
14452 self
14453 }
14454
14455 /// Sets the value of [arguments_truncated][crate::model::Process::arguments_truncated].
14456 ///
14457 /// # Example
14458 /// ```ignore,no_run
14459 /// # use google_cloud_securitycenter_v2::model::Process;
14460 /// let x = Process::new().set_arguments_truncated(true);
14461 /// ```
14462 pub fn set_arguments_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14463 self.arguments_truncated = v.into();
14464 self
14465 }
14466
14467 /// Sets the value of [env_variables][crate::model::Process::env_variables].
14468 ///
14469 /// # Example
14470 /// ```ignore,no_run
14471 /// # use google_cloud_securitycenter_v2::model::Process;
14472 /// use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14473 /// let x = Process::new()
14474 /// .set_env_variables([
14475 /// EnvironmentVariable::default()/* use setters */,
14476 /// EnvironmentVariable::default()/* use (different) setters */,
14477 /// ]);
14478 /// ```
14479 pub fn set_env_variables<T, V>(mut self, v: T) -> Self
14480 where
14481 T: std::iter::IntoIterator<Item = V>,
14482 V: std::convert::Into<crate::model::EnvironmentVariable>,
14483 {
14484 use std::iter::Iterator;
14485 self.env_variables = v.into_iter().map(|i| i.into()).collect();
14486 self
14487 }
14488
14489 /// Sets the value of [env_variables_truncated][crate::model::Process::env_variables_truncated].
14490 ///
14491 /// # Example
14492 /// ```ignore,no_run
14493 /// # use google_cloud_securitycenter_v2::model::Process;
14494 /// let x = Process::new().set_env_variables_truncated(true);
14495 /// ```
14496 pub fn set_env_variables_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14497 self.env_variables_truncated = v.into();
14498 self
14499 }
14500
14501 /// Sets the value of [pid][crate::model::Process::pid].
14502 ///
14503 /// # Example
14504 /// ```ignore,no_run
14505 /// # use google_cloud_securitycenter_v2::model::Process;
14506 /// let x = Process::new().set_pid(42);
14507 /// ```
14508 pub fn set_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14509 self.pid = v.into();
14510 self
14511 }
14512
14513 /// Sets the value of [parent_pid][crate::model::Process::parent_pid].
14514 ///
14515 /// # Example
14516 /// ```ignore,no_run
14517 /// # use google_cloud_securitycenter_v2::model::Process;
14518 /// let x = Process::new().set_parent_pid(42);
14519 /// ```
14520 pub fn set_parent_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14521 self.parent_pid = v.into();
14522 self
14523 }
14524
14525 /// Sets the value of [user_id][crate::model::Process::user_id].
14526 ///
14527 /// # Example
14528 /// ```ignore,no_run
14529 /// # use google_cloud_securitycenter_v2::model::Process;
14530 /// let x = Process::new().set_user_id(42);
14531 /// ```
14532 pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14533 self.user_id = v.into();
14534 self
14535 }
14536}
14537
14538impl wkt::message::Message for Process {
14539 fn typename() -> &'static str {
14540 "type.googleapis.com/google.cloud.securitycenter.v2.Process"
14541 }
14542}
14543
14544/// A name-value pair representing an environment variable used in an operating
14545/// system process.
14546#[derive(Clone, Default, PartialEq)]
14547#[non_exhaustive]
14548pub struct EnvironmentVariable {
14549 /// Environment variable name as a JSON encoded string.
14550 pub name: std::string::String,
14551
14552 /// Environment variable value as a JSON encoded string.
14553 pub val: std::string::String,
14554
14555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14556}
14557
14558impl EnvironmentVariable {
14559 /// Creates a new default instance.
14560 pub fn new() -> Self {
14561 std::default::Default::default()
14562 }
14563
14564 /// Sets the value of [name][crate::model::EnvironmentVariable::name].
14565 ///
14566 /// # Example
14567 /// ```ignore,no_run
14568 /// # use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14569 /// let x = EnvironmentVariable::new().set_name("example");
14570 /// ```
14571 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14572 self.name = v.into();
14573 self
14574 }
14575
14576 /// Sets the value of [val][crate::model::EnvironmentVariable::val].
14577 ///
14578 /// # Example
14579 /// ```ignore,no_run
14580 /// # use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14581 /// let x = EnvironmentVariable::new().set_val("example");
14582 /// ```
14583 pub fn set_val<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14584 self.val = v.into();
14585 self
14586 }
14587}
14588
14589impl wkt::message::Message for EnvironmentVariable {
14590 fn typename() -> &'static str {
14591 "type.googleapis.com/google.cloud.securitycenter.v2.EnvironmentVariable"
14592 }
14593}
14594
14595/// Information related to the Google Cloud resource.
14596#[derive(Clone, Default, PartialEq)]
14597#[non_exhaustive]
14598pub struct Resource {
14599 /// The full resource name of the resource. See:
14600 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
14601 pub name: std::string::String,
14602
14603 /// The human readable name of the resource.
14604 pub display_name: std::string::String,
14605
14606 /// The full resource type of the resource.
14607 pub r#type: std::string::String,
14608
14609 /// Indicates which cloud provider the finding is from.
14610 pub cloud_provider: crate::model::CloudProvider,
14611
14612 /// The service or resource provider associated with the resource.
14613 pub service: std::string::String,
14614
14615 /// The region or location of the service (if applicable).
14616 pub location: std::string::String,
14617
14618 /// Provides the path to the resource within the resource hierarchy.
14619 pub resource_path: std::option::Option<crate::model::ResourcePath>,
14620
14621 /// A string representation of the resource path.
14622 /// For Google Cloud, it has the format of
14623 /// `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}`
14624 /// where there can be any number of folders.
14625 /// For AWS, it has the format of
14626 /// `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}`
14627 /// where there can be any number of organizational units.
14628 /// For Azure, it has the format of
14629 /// `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}`
14630 /// where there can be any number of management groups.
14631 pub resource_path_string: std::string::String,
14632
14633 /// The metadata associated with the cloud provider.
14634 pub cloud_provider_metadata: std::option::Option<crate::model::resource::CloudProviderMetadata>,
14635
14636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14637}
14638
14639impl Resource {
14640 /// Creates a new default instance.
14641 pub fn new() -> Self {
14642 std::default::Default::default()
14643 }
14644
14645 /// Sets the value of [name][crate::model::Resource::name].
14646 ///
14647 /// # Example
14648 /// ```ignore,no_run
14649 /// # use google_cloud_securitycenter_v2::model::Resource;
14650 /// let x = Resource::new().set_name("example");
14651 /// ```
14652 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14653 self.name = v.into();
14654 self
14655 }
14656
14657 /// Sets the value of [display_name][crate::model::Resource::display_name].
14658 ///
14659 /// # Example
14660 /// ```ignore,no_run
14661 /// # use google_cloud_securitycenter_v2::model::Resource;
14662 /// let x = Resource::new().set_display_name("example");
14663 /// ```
14664 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14665 self.display_name = v.into();
14666 self
14667 }
14668
14669 /// Sets the value of [r#type][crate::model::Resource::type].
14670 ///
14671 /// # Example
14672 /// ```ignore,no_run
14673 /// # use google_cloud_securitycenter_v2::model::Resource;
14674 /// let x = Resource::new().set_type("example");
14675 /// ```
14676 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14677 self.r#type = v.into();
14678 self
14679 }
14680
14681 /// Sets the value of [cloud_provider][crate::model::Resource::cloud_provider].
14682 ///
14683 /// # Example
14684 /// ```ignore,no_run
14685 /// # use google_cloud_securitycenter_v2::model::Resource;
14686 /// use google_cloud_securitycenter_v2::model::CloudProvider;
14687 /// let x0 = Resource::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
14688 /// let x1 = Resource::new().set_cloud_provider(CloudProvider::AmazonWebServices);
14689 /// let x2 = Resource::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
14690 /// ```
14691 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
14692 mut self,
14693 v: T,
14694 ) -> Self {
14695 self.cloud_provider = v.into();
14696 self
14697 }
14698
14699 /// Sets the value of [service][crate::model::Resource::service].
14700 ///
14701 /// # Example
14702 /// ```ignore,no_run
14703 /// # use google_cloud_securitycenter_v2::model::Resource;
14704 /// let x = Resource::new().set_service("example");
14705 /// ```
14706 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14707 self.service = v.into();
14708 self
14709 }
14710
14711 /// Sets the value of [location][crate::model::Resource::location].
14712 ///
14713 /// # Example
14714 /// ```ignore,no_run
14715 /// # use google_cloud_securitycenter_v2::model::Resource;
14716 /// let x = Resource::new().set_location("example");
14717 /// ```
14718 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14719 self.location = v.into();
14720 self
14721 }
14722
14723 /// Sets the value of [resource_path][crate::model::Resource::resource_path].
14724 ///
14725 /// # Example
14726 /// ```ignore,no_run
14727 /// # use google_cloud_securitycenter_v2::model::Resource;
14728 /// use google_cloud_securitycenter_v2::model::ResourcePath;
14729 /// let x = Resource::new().set_resource_path(ResourcePath::default()/* use setters */);
14730 /// ```
14731 pub fn set_resource_path<T>(mut self, v: T) -> Self
14732 where
14733 T: std::convert::Into<crate::model::ResourcePath>,
14734 {
14735 self.resource_path = std::option::Option::Some(v.into());
14736 self
14737 }
14738
14739 /// Sets or clears the value of [resource_path][crate::model::Resource::resource_path].
14740 ///
14741 /// # Example
14742 /// ```ignore,no_run
14743 /// # use google_cloud_securitycenter_v2::model::Resource;
14744 /// use google_cloud_securitycenter_v2::model::ResourcePath;
14745 /// let x = Resource::new().set_or_clear_resource_path(Some(ResourcePath::default()/* use setters */));
14746 /// let x = Resource::new().set_or_clear_resource_path(None::<ResourcePath>);
14747 /// ```
14748 pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
14749 where
14750 T: std::convert::Into<crate::model::ResourcePath>,
14751 {
14752 self.resource_path = v.map(|x| x.into());
14753 self
14754 }
14755
14756 /// Sets the value of [resource_path_string][crate::model::Resource::resource_path_string].
14757 ///
14758 /// # Example
14759 /// ```ignore,no_run
14760 /// # use google_cloud_securitycenter_v2::model::Resource;
14761 /// let x = Resource::new().set_resource_path_string("example");
14762 /// ```
14763 pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
14764 mut self,
14765 v: T,
14766 ) -> Self {
14767 self.resource_path_string = v.into();
14768 self
14769 }
14770
14771 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata].
14772 ///
14773 /// Note that all the setters affecting `cloud_provider_metadata` are mutually
14774 /// exclusive.
14775 ///
14776 /// # Example
14777 /// ```ignore,no_run
14778 /// # use google_cloud_securitycenter_v2::model::Resource;
14779 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
14780 /// let x = Resource::new().set_cloud_provider_metadata(Some(
14781 /// google_cloud_securitycenter_v2::model::resource::CloudProviderMetadata::GcpMetadata(GcpMetadata::default().into())));
14782 /// ```
14783 pub fn set_cloud_provider_metadata<
14784 T: std::convert::Into<std::option::Option<crate::model::resource::CloudProviderMetadata>>,
14785 >(
14786 mut self,
14787 v: T,
14788 ) -> Self {
14789 self.cloud_provider_metadata = v.into();
14790 self
14791 }
14792
14793 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14794 /// if it holds a `GcpMetadata`, `None` if the field is not set or
14795 /// holds a different branch.
14796 pub fn gcp_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
14797 #[allow(unreachable_patterns)]
14798 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14799 crate::model::resource::CloudProviderMetadata::GcpMetadata(v) => {
14800 std::option::Option::Some(v)
14801 }
14802 _ => std::option::Option::None,
14803 })
14804 }
14805
14806 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14807 /// to hold a `GcpMetadata`.
14808 ///
14809 /// Note that all the setters affecting `cloud_provider_metadata` are
14810 /// mutually exclusive.
14811 ///
14812 /// # Example
14813 /// ```ignore,no_run
14814 /// # use google_cloud_securitycenter_v2::model::Resource;
14815 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
14816 /// let x = Resource::new().set_gcp_metadata(GcpMetadata::default()/* use setters */);
14817 /// assert!(x.gcp_metadata().is_some());
14818 /// assert!(x.aws_metadata().is_none());
14819 /// assert!(x.azure_metadata().is_none());
14820 /// ```
14821 pub fn set_gcp_metadata<T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>>(
14822 mut self,
14823 v: T,
14824 ) -> Self {
14825 self.cloud_provider_metadata = std::option::Option::Some(
14826 crate::model::resource::CloudProviderMetadata::GcpMetadata(v.into()),
14827 );
14828 self
14829 }
14830
14831 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14832 /// if it holds a `AwsMetadata`, `None` if the field is not set or
14833 /// holds a different branch.
14834 pub fn aws_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
14835 #[allow(unreachable_patterns)]
14836 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14837 crate::model::resource::CloudProviderMetadata::AwsMetadata(v) => {
14838 std::option::Option::Some(v)
14839 }
14840 _ => std::option::Option::None,
14841 })
14842 }
14843
14844 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14845 /// to hold a `AwsMetadata`.
14846 ///
14847 /// Note that all the setters affecting `cloud_provider_metadata` are
14848 /// mutually exclusive.
14849 ///
14850 /// # Example
14851 /// ```ignore,no_run
14852 /// # use google_cloud_securitycenter_v2::model::Resource;
14853 /// use google_cloud_securitycenter_v2::model::AwsMetadata;
14854 /// let x = Resource::new().set_aws_metadata(AwsMetadata::default()/* use setters */);
14855 /// assert!(x.aws_metadata().is_some());
14856 /// assert!(x.gcp_metadata().is_none());
14857 /// assert!(x.azure_metadata().is_none());
14858 /// ```
14859 pub fn set_aws_metadata<T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>>(
14860 mut self,
14861 v: T,
14862 ) -> Self {
14863 self.cloud_provider_metadata = std::option::Option::Some(
14864 crate::model::resource::CloudProviderMetadata::AwsMetadata(v.into()),
14865 );
14866 self
14867 }
14868
14869 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14870 /// if it holds a `AzureMetadata`, `None` if the field is not set or
14871 /// holds a different branch.
14872 pub fn azure_metadata(
14873 &self,
14874 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
14875 #[allow(unreachable_patterns)]
14876 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14877 crate::model::resource::CloudProviderMetadata::AzureMetadata(v) => {
14878 std::option::Option::Some(v)
14879 }
14880 _ => std::option::Option::None,
14881 })
14882 }
14883
14884 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14885 /// to hold a `AzureMetadata`.
14886 ///
14887 /// Note that all the setters affecting `cloud_provider_metadata` are
14888 /// mutually exclusive.
14889 ///
14890 /// # Example
14891 /// ```ignore,no_run
14892 /// # use google_cloud_securitycenter_v2::model::Resource;
14893 /// use google_cloud_securitycenter_v2::model::AzureMetadata;
14894 /// let x = Resource::new().set_azure_metadata(AzureMetadata::default()/* use setters */);
14895 /// assert!(x.azure_metadata().is_some());
14896 /// assert!(x.gcp_metadata().is_none());
14897 /// assert!(x.aws_metadata().is_none());
14898 /// ```
14899 pub fn set_azure_metadata<
14900 T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
14901 >(
14902 mut self,
14903 v: T,
14904 ) -> Self {
14905 self.cloud_provider_metadata = std::option::Option::Some(
14906 crate::model::resource::CloudProviderMetadata::AzureMetadata(v.into()),
14907 );
14908 self
14909 }
14910}
14911
14912impl wkt::message::Message for Resource {
14913 fn typename() -> &'static str {
14914 "type.googleapis.com/google.cloud.securitycenter.v2.Resource"
14915 }
14916}
14917
14918/// Defines additional types related to [Resource].
14919pub mod resource {
14920 #[allow(unused_imports)]
14921 use super::*;
14922
14923 /// The metadata associated with the cloud provider.
14924 #[derive(Clone, Debug, PartialEq)]
14925 #[non_exhaustive]
14926 pub enum CloudProviderMetadata {
14927 /// The GCP metadata associated with the finding.
14928 GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
14929 /// The AWS metadata associated with the finding.
14930 AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
14931 /// The Azure metadata associated with the finding.
14932 AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
14933 }
14934}
14935
14936/// Google Cloud metadata associated with the resource. Only applicable if the
14937/// finding's cloud provider is Google Cloud.
14938#[derive(Clone, Default, PartialEq)]
14939#[non_exhaustive]
14940pub struct GcpMetadata {
14941 /// The full resource name of project that the resource belongs to.
14942 pub project: std::string::String,
14943
14944 /// The project ID that the resource belongs to.
14945 pub project_display_name: std::string::String,
14946
14947 /// The full resource name of resource's parent.
14948 pub parent: std::string::String,
14949
14950 /// The human readable name of resource's parent.
14951 pub parent_display_name: std::string::String,
14952
14953 /// Output only. Contains a Folder message for each folder in the assets
14954 /// ancestry. The first folder is the deepest nested folder, and the last
14955 /// folder is the folder directly under the Organization.
14956 pub folders: std::vec::Vec<crate::model::Folder>,
14957
14958 /// The name of the organization that the resource belongs to.
14959 pub organization: std::string::String,
14960
14961 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14962}
14963
14964impl GcpMetadata {
14965 /// Creates a new default instance.
14966 pub fn new() -> Self {
14967 std::default::Default::default()
14968 }
14969
14970 /// Sets the value of [project][crate::model::GcpMetadata::project].
14971 ///
14972 /// # Example
14973 /// ```ignore,no_run
14974 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14975 /// let x = GcpMetadata::new().set_project("example");
14976 /// ```
14977 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14978 self.project = v.into();
14979 self
14980 }
14981
14982 /// Sets the value of [project_display_name][crate::model::GcpMetadata::project_display_name].
14983 ///
14984 /// # Example
14985 /// ```ignore,no_run
14986 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14987 /// let x = GcpMetadata::new().set_project_display_name("example");
14988 /// ```
14989 pub fn set_project_display_name<T: std::convert::Into<std::string::String>>(
14990 mut self,
14991 v: T,
14992 ) -> Self {
14993 self.project_display_name = v.into();
14994 self
14995 }
14996
14997 /// Sets the value of [parent][crate::model::GcpMetadata::parent].
14998 ///
14999 /// # Example
15000 /// ```ignore,no_run
15001 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
15002 /// let x = GcpMetadata::new().set_parent("example");
15003 /// ```
15004 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15005 self.parent = v.into();
15006 self
15007 }
15008
15009 /// Sets the value of [parent_display_name][crate::model::GcpMetadata::parent_display_name].
15010 ///
15011 /// # Example
15012 /// ```ignore,no_run
15013 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
15014 /// let x = GcpMetadata::new().set_parent_display_name("example");
15015 /// ```
15016 pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
15017 mut self,
15018 v: T,
15019 ) -> Self {
15020 self.parent_display_name = v.into();
15021 self
15022 }
15023
15024 /// Sets the value of [folders][crate::model::GcpMetadata::folders].
15025 ///
15026 /// # Example
15027 /// ```ignore,no_run
15028 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
15029 /// use google_cloud_securitycenter_v2::model::Folder;
15030 /// let x = GcpMetadata::new()
15031 /// .set_folders([
15032 /// Folder::default()/* use setters */,
15033 /// Folder::default()/* use (different) setters */,
15034 /// ]);
15035 /// ```
15036 pub fn set_folders<T, V>(mut self, v: T) -> Self
15037 where
15038 T: std::iter::IntoIterator<Item = V>,
15039 V: std::convert::Into<crate::model::Folder>,
15040 {
15041 use std::iter::Iterator;
15042 self.folders = v.into_iter().map(|i| i.into()).collect();
15043 self
15044 }
15045
15046 /// Sets the value of [organization][crate::model::GcpMetadata::organization].
15047 ///
15048 /// # Example
15049 /// ```ignore,no_run
15050 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
15051 /// let x = GcpMetadata::new().set_organization("example");
15052 /// ```
15053 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15054 self.organization = v.into();
15055 self
15056 }
15057}
15058
15059impl wkt::message::Message for GcpMetadata {
15060 fn typename() -> &'static str {
15061 "type.googleapis.com/google.cloud.securitycenter.v2.GcpMetadata"
15062 }
15063}
15064
15065/// AWS metadata associated with the resource, only applicable if the finding's
15066/// cloud provider is Amazon Web Services.
15067#[derive(Clone, Default, PartialEq)]
15068#[non_exhaustive]
15069pub struct AwsMetadata {
15070 /// The AWS organization associated with the resource.
15071 pub organization: std::option::Option<crate::model::aws_metadata::AwsOrganization>,
15072
15073 /// A list of AWS organizational units associated with the resource, ordered
15074 /// from lowest level (closest to the account) to highest level.
15075 pub organizational_units: std::vec::Vec<crate::model::aws_metadata::AwsOrganizationalUnit>,
15076
15077 /// The AWS account associated with the resource.
15078 pub account: std::option::Option<crate::model::aws_metadata::AwsAccount>,
15079
15080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15081}
15082
15083impl AwsMetadata {
15084 /// Creates a new default instance.
15085 pub fn new() -> Self {
15086 std::default::Default::default()
15087 }
15088
15089 /// Sets the value of [organization][crate::model::AwsMetadata::organization].
15090 ///
15091 /// # Example
15092 /// ```ignore,no_run
15093 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15094 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15095 /// let x = AwsMetadata::new().set_organization(AwsOrganization::default()/* use setters */);
15096 /// ```
15097 pub fn set_organization<T>(mut self, v: T) -> Self
15098 where
15099 T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
15100 {
15101 self.organization = std::option::Option::Some(v.into());
15102 self
15103 }
15104
15105 /// Sets or clears the value of [organization][crate::model::AwsMetadata::organization].
15106 ///
15107 /// # Example
15108 /// ```ignore,no_run
15109 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15110 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15111 /// let x = AwsMetadata::new().set_or_clear_organization(Some(AwsOrganization::default()/* use setters */));
15112 /// let x = AwsMetadata::new().set_or_clear_organization(None::<AwsOrganization>);
15113 /// ```
15114 pub fn set_or_clear_organization<T>(mut self, v: std::option::Option<T>) -> Self
15115 where
15116 T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
15117 {
15118 self.organization = v.map(|x| x.into());
15119 self
15120 }
15121
15122 /// Sets the value of [organizational_units][crate::model::AwsMetadata::organizational_units].
15123 ///
15124 /// # Example
15125 /// ```ignore,no_run
15126 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15127 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15128 /// let x = AwsMetadata::new()
15129 /// .set_organizational_units([
15130 /// AwsOrganizationalUnit::default()/* use setters */,
15131 /// AwsOrganizationalUnit::default()/* use (different) setters */,
15132 /// ]);
15133 /// ```
15134 pub fn set_organizational_units<T, V>(mut self, v: T) -> Self
15135 where
15136 T: std::iter::IntoIterator<Item = V>,
15137 V: std::convert::Into<crate::model::aws_metadata::AwsOrganizationalUnit>,
15138 {
15139 use std::iter::Iterator;
15140 self.organizational_units = v.into_iter().map(|i| i.into()).collect();
15141 self
15142 }
15143
15144 /// Sets the value of [account][crate::model::AwsMetadata::account].
15145 ///
15146 /// # Example
15147 /// ```ignore,no_run
15148 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15149 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15150 /// let x = AwsMetadata::new().set_account(AwsAccount::default()/* use setters */);
15151 /// ```
15152 pub fn set_account<T>(mut self, v: T) -> Self
15153 where
15154 T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
15155 {
15156 self.account = std::option::Option::Some(v.into());
15157 self
15158 }
15159
15160 /// Sets or clears the value of [account][crate::model::AwsMetadata::account].
15161 ///
15162 /// # Example
15163 /// ```ignore,no_run
15164 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15165 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15166 /// let x = AwsMetadata::new().set_or_clear_account(Some(AwsAccount::default()/* use setters */));
15167 /// let x = AwsMetadata::new().set_or_clear_account(None::<AwsAccount>);
15168 /// ```
15169 pub fn set_or_clear_account<T>(mut self, v: std::option::Option<T>) -> Self
15170 where
15171 T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
15172 {
15173 self.account = v.map(|x| x.into());
15174 self
15175 }
15176}
15177
15178impl wkt::message::Message for AwsMetadata {
15179 fn typename() -> &'static str {
15180 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata"
15181 }
15182}
15183
15184/// Defines additional types related to [AwsMetadata].
15185pub mod aws_metadata {
15186 #[allow(unused_imports)]
15187 use super::*;
15188
15189 /// An organization is a collection of accounts that are centrally managed
15190 /// together using consolidated billing, organized hierarchically with
15191 /// organizational units (OUs), and controlled with policies.
15192 #[derive(Clone, Default, PartialEq)]
15193 #[non_exhaustive]
15194 pub struct AwsOrganization {
15195 /// The unique identifier (ID) for the organization. The regex pattern for an
15196 /// organization ID string requires "o-" followed by from 10 to 32 lowercase
15197 /// letters or digits.
15198 pub id: std::string::String,
15199
15200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15201 }
15202
15203 impl AwsOrganization {
15204 /// Creates a new default instance.
15205 pub fn new() -> Self {
15206 std::default::Default::default()
15207 }
15208
15209 /// Sets the value of [id][crate::model::aws_metadata::AwsOrganization::id].
15210 ///
15211 /// # Example
15212 /// ```ignore,no_run
15213 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15214 /// let x = AwsOrganization::new().set_id("example");
15215 /// ```
15216 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15217 self.id = v.into();
15218 self
15219 }
15220 }
15221
15222 impl wkt::message::Message for AwsOrganization {
15223 fn typename() -> &'static str {
15224 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization"
15225 }
15226 }
15227
15228 /// An Organizational Unit (OU) is a container of AWS accounts within a root of
15229 /// an organization. Policies that are attached to an OU apply to all accounts
15230 /// contained in that OU and in any child OUs.
15231 #[derive(Clone, Default, PartialEq)]
15232 #[non_exhaustive]
15233 pub struct AwsOrganizationalUnit {
15234 /// The unique identifier (ID) associated with this OU. The regex pattern for
15235 /// an organizational unit ID string requires "ou-" followed by from 4 to 32
15236 /// lowercase letters or digits (the ID of the root that contains the OU).
15237 /// This string is followed by a second "-" dash and from 8 to 32 additional
15238 /// lowercase letters or digits. For example, "ou-ab12-cd34ef56".
15239 pub id: std::string::String,
15240
15241 /// The friendly name of the OU.
15242 pub name: std::string::String,
15243
15244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15245 }
15246
15247 impl AwsOrganizationalUnit {
15248 /// Creates a new default instance.
15249 pub fn new() -> Self {
15250 std::default::Default::default()
15251 }
15252
15253 /// Sets the value of [id][crate::model::aws_metadata::AwsOrganizationalUnit::id].
15254 ///
15255 /// # Example
15256 /// ```ignore,no_run
15257 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15258 /// let x = AwsOrganizationalUnit::new().set_id("example");
15259 /// ```
15260 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15261 self.id = v.into();
15262 self
15263 }
15264
15265 /// Sets the value of [name][crate::model::aws_metadata::AwsOrganizationalUnit::name].
15266 ///
15267 /// # Example
15268 /// ```ignore,no_run
15269 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15270 /// let x = AwsOrganizationalUnit::new().set_name("example");
15271 /// ```
15272 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15273 self.name = v.into();
15274 self
15275 }
15276 }
15277
15278 impl wkt::message::Message for AwsOrganizationalUnit {
15279 fn typename() -> &'static str {
15280 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit"
15281 }
15282 }
15283
15284 /// An AWS account that is a member of an organization.
15285 #[derive(Clone, Default, PartialEq)]
15286 #[non_exhaustive]
15287 pub struct AwsAccount {
15288 /// The unique identifier (ID) of the account, containing exactly 12 digits.
15289 pub id: std::string::String,
15290
15291 /// The friendly name of this account.
15292 pub name: std::string::String,
15293
15294 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15295 }
15296
15297 impl AwsAccount {
15298 /// Creates a new default instance.
15299 pub fn new() -> Self {
15300 std::default::Default::default()
15301 }
15302
15303 /// Sets the value of [id][crate::model::aws_metadata::AwsAccount::id].
15304 ///
15305 /// # Example
15306 /// ```ignore,no_run
15307 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15308 /// let x = AwsAccount::new().set_id("example");
15309 /// ```
15310 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15311 self.id = v.into();
15312 self
15313 }
15314
15315 /// Sets the value of [name][crate::model::aws_metadata::AwsAccount::name].
15316 ///
15317 /// # Example
15318 /// ```ignore,no_run
15319 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15320 /// let x = AwsAccount::new().set_name("example");
15321 /// ```
15322 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15323 self.name = v.into();
15324 self
15325 }
15326 }
15327
15328 impl wkt::message::Message for AwsAccount {
15329 fn typename() -> &'static str {
15330 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsAccount"
15331 }
15332 }
15333}
15334
15335/// Azure metadata associated with the resource, only applicable if the finding's
15336/// cloud provider is Microsoft Azure.
15337#[derive(Clone, Default, PartialEq)]
15338#[non_exhaustive]
15339pub struct AzureMetadata {
15340 /// A list of Azure management groups associated with the resource, ordered
15341 /// from lowest level (closest to the subscription) to highest level.
15342 pub management_groups: std::vec::Vec<crate::model::azure_metadata::AzureManagementGroup>,
15343
15344 /// The Azure subscription associated with the resource.
15345 pub subscription: std::option::Option<crate::model::azure_metadata::AzureSubscription>,
15346
15347 /// The Azure resource group associated with the resource.
15348 pub resource_group: std::option::Option<crate::model::azure_metadata::AzureResourceGroup>,
15349
15350 /// The Azure Entra tenant associated with the resource.
15351 pub tenant: std::option::Option<crate::model::azure_metadata::AzureTenant>,
15352
15353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15354}
15355
15356impl AzureMetadata {
15357 /// Creates a new default instance.
15358 pub fn new() -> Self {
15359 std::default::Default::default()
15360 }
15361
15362 /// Sets the value of [management_groups][crate::model::AzureMetadata::management_groups].
15363 ///
15364 /// # Example
15365 /// ```ignore,no_run
15366 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15367 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15368 /// let x = AzureMetadata::new()
15369 /// .set_management_groups([
15370 /// AzureManagementGroup::default()/* use setters */,
15371 /// AzureManagementGroup::default()/* use (different) setters */,
15372 /// ]);
15373 /// ```
15374 pub fn set_management_groups<T, V>(mut self, v: T) -> Self
15375 where
15376 T: std::iter::IntoIterator<Item = V>,
15377 V: std::convert::Into<crate::model::azure_metadata::AzureManagementGroup>,
15378 {
15379 use std::iter::Iterator;
15380 self.management_groups = v.into_iter().map(|i| i.into()).collect();
15381 self
15382 }
15383
15384 /// Sets the value of [subscription][crate::model::AzureMetadata::subscription].
15385 ///
15386 /// # Example
15387 /// ```ignore,no_run
15388 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15389 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15390 /// let x = AzureMetadata::new().set_subscription(AzureSubscription::default()/* use setters */);
15391 /// ```
15392 pub fn set_subscription<T>(mut self, v: T) -> Self
15393 where
15394 T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
15395 {
15396 self.subscription = std::option::Option::Some(v.into());
15397 self
15398 }
15399
15400 /// Sets or clears the value of [subscription][crate::model::AzureMetadata::subscription].
15401 ///
15402 /// # Example
15403 /// ```ignore,no_run
15404 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15405 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15406 /// let x = AzureMetadata::new().set_or_clear_subscription(Some(AzureSubscription::default()/* use setters */));
15407 /// let x = AzureMetadata::new().set_or_clear_subscription(None::<AzureSubscription>);
15408 /// ```
15409 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
15410 where
15411 T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
15412 {
15413 self.subscription = v.map(|x| x.into());
15414 self
15415 }
15416
15417 /// Sets the value of [resource_group][crate::model::AzureMetadata::resource_group].
15418 ///
15419 /// # Example
15420 /// ```ignore,no_run
15421 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15422 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15423 /// let x = AzureMetadata::new().set_resource_group(AzureResourceGroup::default()/* use setters */);
15424 /// ```
15425 pub fn set_resource_group<T>(mut self, v: T) -> Self
15426 where
15427 T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
15428 {
15429 self.resource_group = std::option::Option::Some(v.into());
15430 self
15431 }
15432
15433 /// Sets or clears the value of [resource_group][crate::model::AzureMetadata::resource_group].
15434 ///
15435 /// # Example
15436 /// ```ignore,no_run
15437 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15438 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15439 /// let x = AzureMetadata::new().set_or_clear_resource_group(Some(AzureResourceGroup::default()/* use setters */));
15440 /// let x = AzureMetadata::new().set_or_clear_resource_group(None::<AzureResourceGroup>);
15441 /// ```
15442 pub fn set_or_clear_resource_group<T>(mut self, v: std::option::Option<T>) -> Self
15443 where
15444 T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
15445 {
15446 self.resource_group = v.map(|x| x.into());
15447 self
15448 }
15449
15450 /// Sets the value of [tenant][crate::model::AzureMetadata::tenant].
15451 ///
15452 /// # Example
15453 /// ```ignore,no_run
15454 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15455 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15456 /// let x = AzureMetadata::new().set_tenant(AzureTenant::default()/* use setters */);
15457 /// ```
15458 pub fn set_tenant<T>(mut self, v: T) -> Self
15459 where
15460 T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
15461 {
15462 self.tenant = std::option::Option::Some(v.into());
15463 self
15464 }
15465
15466 /// Sets or clears the value of [tenant][crate::model::AzureMetadata::tenant].
15467 ///
15468 /// # Example
15469 /// ```ignore,no_run
15470 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15471 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15472 /// let x = AzureMetadata::new().set_or_clear_tenant(Some(AzureTenant::default()/* use setters */));
15473 /// let x = AzureMetadata::new().set_or_clear_tenant(None::<AzureTenant>);
15474 /// ```
15475 pub fn set_or_clear_tenant<T>(mut self, v: std::option::Option<T>) -> Self
15476 where
15477 T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
15478 {
15479 self.tenant = v.map(|x| x.into());
15480 self
15481 }
15482}
15483
15484impl wkt::message::Message for AzureMetadata {
15485 fn typename() -> &'static str {
15486 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata"
15487 }
15488}
15489
15490/// Defines additional types related to [AzureMetadata].
15491pub mod azure_metadata {
15492 #[allow(unused_imports)]
15493 use super::*;
15494
15495 /// Represents an Azure management group.
15496 #[derive(Clone, Default, PartialEq)]
15497 #[non_exhaustive]
15498 pub struct AzureManagementGroup {
15499 /// The UUID of the Azure management group, for example,
15500 /// `20000000-0001-0000-0000-000000000000`.
15501 pub id: std::string::String,
15502
15503 /// The display name of the Azure management group.
15504 pub display_name: std::string::String,
15505
15506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15507 }
15508
15509 impl AzureManagementGroup {
15510 /// Creates a new default instance.
15511 pub fn new() -> Self {
15512 std::default::Default::default()
15513 }
15514
15515 /// Sets the value of [id][crate::model::azure_metadata::AzureManagementGroup::id].
15516 ///
15517 /// # Example
15518 /// ```ignore,no_run
15519 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15520 /// let x = AzureManagementGroup::new().set_id("example");
15521 /// ```
15522 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15523 self.id = v.into();
15524 self
15525 }
15526
15527 /// Sets the value of [display_name][crate::model::azure_metadata::AzureManagementGroup::display_name].
15528 ///
15529 /// # Example
15530 /// ```ignore,no_run
15531 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15532 /// let x = AzureManagementGroup::new().set_display_name("example");
15533 /// ```
15534 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15535 mut self,
15536 v: T,
15537 ) -> Self {
15538 self.display_name = v.into();
15539 self
15540 }
15541 }
15542
15543 impl wkt::message::Message for AzureManagementGroup {
15544 fn typename() -> &'static str {
15545 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup"
15546 }
15547 }
15548
15549 /// Represents an Azure subscription.
15550 #[derive(Clone, Default, PartialEq)]
15551 #[non_exhaustive]
15552 pub struct AzureSubscription {
15553 /// The UUID of the Azure subscription, for example,
15554 /// `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`.
15555 pub id: std::string::String,
15556
15557 /// The display name of the Azure subscription.
15558 pub display_name: std::string::String,
15559
15560 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15561 }
15562
15563 impl AzureSubscription {
15564 /// Creates a new default instance.
15565 pub fn new() -> Self {
15566 std::default::Default::default()
15567 }
15568
15569 /// Sets the value of [id][crate::model::azure_metadata::AzureSubscription::id].
15570 ///
15571 /// # Example
15572 /// ```ignore,no_run
15573 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15574 /// let x = AzureSubscription::new().set_id("example");
15575 /// ```
15576 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15577 self.id = v.into();
15578 self
15579 }
15580
15581 /// Sets the value of [display_name][crate::model::azure_metadata::AzureSubscription::display_name].
15582 ///
15583 /// # Example
15584 /// ```ignore,no_run
15585 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15586 /// let x = AzureSubscription::new().set_display_name("example");
15587 /// ```
15588 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15589 mut self,
15590 v: T,
15591 ) -> Self {
15592 self.display_name = v.into();
15593 self
15594 }
15595 }
15596
15597 impl wkt::message::Message for AzureSubscription {
15598 fn typename() -> &'static str {
15599 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription"
15600 }
15601 }
15602
15603 /// Represents an Azure resource group.
15604 #[derive(Clone, Default, PartialEq)]
15605 #[non_exhaustive]
15606 pub struct AzureResourceGroup {
15607 /// The ID of the Azure resource group.
15608 pub id: std::string::String,
15609
15610 /// The name of the Azure resource group. This is not a UUID.
15611 pub name: std::string::String,
15612
15613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15614 }
15615
15616 impl AzureResourceGroup {
15617 /// Creates a new default instance.
15618 pub fn new() -> Self {
15619 std::default::Default::default()
15620 }
15621
15622 /// Sets the value of [id][crate::model::azure_metadata::AzureResourceGroup::id].
15623 ///
15624 /// # Example
15625 /// ```ignore,no_run
15626 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15627 /// let x = AzureResourceGroup::new().set_id("example");
15628 /// ```
15629 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15630 self.id = v.into();
15631 self
15632 }
15633
15634 /// Sets the value of [name][crate::model::azure_metadata::AzureResourceGroup::name].
15635 ///
15636 /// # Example
15637 /// ```ignore,no_run
15638 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15639 /// let x = AzureResourceGroup::new().set_name("example");
15640 /// ```
15641 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15642 self.name = v.into();
15643 self
15644 }
15645 }
15646
15647 impl wkt::message::Message for AzureResourceGroup {
15648 fn typename() -> &'static str {
15649 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup"
15650 }
15651 }
15652
15653 /// Represents a Microsoft Entra tenant.
15654 #[derive(Clone, Default, PartialEq)]
15655 #[non_exhaustive]
15656 pub struct AzureTenant {
15657 /// The ID of the Microsoft Entra tenant, for example,
15658 /// "a11aaa11-aa11-1aa1-11aa-1aaa11a".
15659 pub id: std::string::String,
15660
15661 /// The display name of the Azure tenant.
15662 pub display_name: std::string::String,
15663
15664 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15665 }
15666
15667 impl AzureTenant {
15668 /// Creates a new default instance.
15669 pub fn new() -> Self {
15670 std::default::Default::default()
15671 }
15672
15673 /// Sets the value of [id][crate::model::azure_metadata::AzureTenant::id].
15674 ///
15675 /// # Example
15676 /// ```ignore,no_run
15677 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15678 /// let x = AzureTenant::new().set_id("example");
15679 /// ```
15680 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15681 self.id = v.into();
15682 self
15683 }
15684
15685 /// Sets the value of [display_name][crate::model::azure_metadata::AzureTenant::display_name].
15686 ///
15687 /// # Example
15688 /// ```ignore,no_run
15689 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15690 /// let x = AzureTenant::new().set_display_name("example");
15691 /// ```
15692 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15693 mut self,
15694 v: T,
15695 ) -> Self {
15696 self.display_name = v.into();
15697 self
15698 }
15699 }
15700
15701 impl wkt::message::Message for AzureTenant {
15702 fn typename() -> &'static str {
15703 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureTenant"
15704 }
15705 }
15706}
15707
15708/// Represents the path of resources leading up to the resource this finding is
15709/// about.
15710#[derive(Clone, Default, PartialEq)]
15711#[non_exhaustive]
15712pub struct ResourcePath {
15713 /// The list of nodes that make the up resource path, ordered from lowest
15714 /// level to highest level.
15715 pub nodes: std::vec::Vec<crate::model::resource_path::ResourcePathNode>,
15716
15717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15718}
15719
15720impl ResourcePath {
15721 /// Creates a new default instance.
15722 pub fn new() -> Self {
15723 std::default::Default::default()
15724 }
15725
15726 /// Sets the value of [nodes][crate::model::ResourcePath::nodes].
15727 ///
15728 /// # Example
15729 /// ```ignore,no_run
15730 /// # use google_cloud_securitycenter_v2::model::ResourcePath;
15731 /// use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15732 /// let x = ResourcePath::new()
15733 /// .set_nodes([
15734 /// ResourcePathNode::default()/* use setters */,
15735 /// ResourcePathNode::default()/* use (different) setters */,
15736 /// ]);
15737 /// ```
15738 pub fn set_nodes<T, V>(mut self, v: T) -> Self
15739 where
15740 T: std::iter::IntoIterator<Item = V>,
15741 V: std::convert::Into<crate::model::resource_path::ResourcePathNode>,
15742 {
15743 use std::iter::Iterator;
15744 self.nodes = v.into_iter().map(|i| i.into()).collect();
15745 self
15746 }
15747}
15748
15749impl wkt::message::Message for ResourcePath {
15750 fn typename() -> &'static str {
15751 "type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath"
15752 }
15753}
15754
15755/// Defines additional types related to [ResourcePath].
15756pub mod resource_path {
15757 #[allow(unused_imports)]
15758 use super::*;
15759
15760 /// A node within the resource path. Each node represents a resource within the
15761 /// resource hierarchy.
15762 #[derive(Clone, Default, PartialEq)]
15763 #[non_exhaustive]
15764 pub struct ResourcePathNode {
15765 /// The type of resource this node represents.
15766 pub node_type: crate::model::resource_path::ResourcePathNodeType,
15767
15768 /// The ID of the resource this node represents.
15769 pub id: std::string::String,
15770
15771 /// The display name of the resource this node represents.
15772 pub display_name: std::string::String,
15773
15774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15775 }
15776
15777 impl ResourcePathNode {
15778 /// Creates a new default instance.
15779 pub fn new() -> Self {
15780 std::default::Default::default()
15781 }
15782
15783 /// Sets the value of [node_type][crate::model::resource_path::ResourcePathNode::node_type].
15784 ///
15785 /// # Example
15786 /// ```ignore,no_run
15787 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15788 /// use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNodeType;
15789 /// let x0 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpOrganization);
15790 /// let x1 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpFolder);
15791 /// let x2 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpProject);
15792 /// ```
15793 pub fn set_node_type<
15794 T: std::convert::Into<crate::model::resource_path::ResourcePathNodeType>,
15795 >(
15796 mut self,
15797 v: T,
15798 ) -> Self {
15799 self.node_type = v.into();
15800 self
15801 }
15802
15803 /// Sets the value of [id][crate::model::resource_path::ResourcePathNode::id].
15804 ///
15805 /// # Example
15806 /// ```ignore,no_run
15807 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15808 /// let x = ResourcePathNode::new().set_id("example");
15809 /// ```
15810 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15811 self.id = v.into();
15812 self
15813 }
15814
15815 /// Sets the value of [display_name][crate::model::resource_path::ResourcePathNode::display_name].
15816 ///
15817 /// # Example
15818 /// ```ignore,no_run
15819 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15820 /// let x = ResourcePathNode::new().set_display_name("example");
15821 /// ```
15822 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15823 mut self,
15824 v: T,
15825 ) -> Self {
15826 self.display_name = v.into();
15827 self
15828 }
15829 }
15830
15831 impl wkt::message::Message for ResourcePathNode {
15832 fn typename() -> &'static str {
15833 "type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode"
15834 }
15835 }
15836
15837 /// The type of resource the node represents.
15838 ///
15839 /// # Working with unknown values
15840 ///
15841 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15842 /// additional enum variants at any time. Adding new variants is not considered
15843 /// a breaking change. Applications should write their code in anticipation of:
15844 ///
15845 /// - New values appearing in future releases of the client library, **and**
15846 /// - New values received dynamically, without application changes.
15847 ///
15848 /// Please consult the [Working with enums] section in the user guide for some
15849 /// guidelines.
15850 ///
15851 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15852 #[derive(Clone, Debug, PartialEq)]
15853 #[non_exhaustive]
15854 pub enum ResourcePathNodeType {
15855 /// Node type is unspecified.
15856 Unspecified,
15857 /// The node represents a Google Cloud organization.
15858 GcpOrganization,
15859 /// The node represents a Google Cloud folder.
15860 GcpFolder,
15861 /// The node represents a Google Cloud project.
15862 GcpProject,
15863 /// The node represents an AWS organization.
15864 AwsOrganization,
15865 /// The node represents an AWS organizational unit.
15866 AwsOrganizationalUnit,
15867 /// The node represents an AWS account.
15868 AwsAccount,
15869 /// The node represents an Azure management group.
15870 AzureManagementGroup,
15871 /// The node represents an Azure subscription.
15872 AzureSubscription,
15873 /// The node represents an Azure resource group.
15874 AzureResourceGroup,
15875 /// If set, the enum was initialized with an unknown value.
15876 ///
15877 /// Applications can examine the value using [ResourcePathNodeType::value] or
15878 /// [ResourcePathNodeType::name].
15879 UnknownValue(resource_path_node_type::UnknownValue),
15880 }
15881
15882 #[doc(hidden)]
15883 pub mod resource_path_node_type {
15884 #[allow(unused_imports)]
15885 use super::*;
15886 #[derive(Clone, Debug, PartialEq)]
15887 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15888 }
15889
15890 impl ResourcePathNodeType {
15891 /// Gets the enum value.
15892 ///
15893 /// Returns `None` if the enum contains an unknown value deserialized from
15894 /// the string representation of enums.
15895 pub fn value(&self) -> std::option::Option<i32> {
15896 match self {
15897 Self::Unspecified => std::option::Option::Some(0),
15898 Self::GcpOrganization => std::option::Option::Some(1),
15899 Self::GcpFolder => std::option::Option::Some(2),
15900 Self::GcpProject => std::option::Option::Some(3),
15901 Self::AwsOrganization => std::option::Option::Some(4),
15902 Self::AwsOrganizationalUnit => std::option::Option::Some(5),
15903 Self::AwsAccount => std::option::Option::Some(6),
15904 Self::AzureManagementGroup => std::option::Option::Some(7),
15905 Self::AzureSubscription => std::option::Option::Some(8),
15906 Self::AzureResourceGroup => std::option::Option::Some(9),
15907 Self::UnknownValue(u) => u.0.value(),
15908 }
15909 }
15910
15911 /// Gets the enum value as a string.
15912 ///
15913 /// Returns `None` if the enum contains an unknown value deserialized from
15914 /// the integer representation of enums.
15915 pub fn name(&self) -> std::option::Option<&str> {
15916 match self {
15917 Self::Unspecified => {
15918 std::option::Option::Some("RESOURCE_PATH_NODE_TYPE_UNSPECIFIED")
15919 }
15920 Self::GcpOrganization => std::option::Option::Some("GCP_ORGANIZATION"),
15921 Self::GcpFolder => std::option::Option::Some("GCP_FOLDER"),
15922 Self::GcpProject => std::option::Option::Some("GCP_PROJECT"),
15923 Self::AwsOrganization => std::option::Option::Some("AWS_ORGANIZATION"),
15924 Self::AwsOrganizationalUnit => std::option::Option::Some("AWS_ORGANIZATIONAL_UNIT"),
15925 Self::AwsAccount => std::option::Option::Some("AWS_ACCOUNT"),
15926 Self::AzureManagementGroup => std::option::Option::Some("AZURE_MANAGEMENT_GROUP"),
15927 Self::AzureSubscription => std::option::Option::Some("AZURE_SUBSCRIPTION"),
15928 Self::AzureResourceGroup => std::option::Option::Some("AZURE_RESOURCE_GROUP"),
15929 Self::UnknownValue(u) => u.0.name(),
15930 }
15931 }
15932 }
15933
15934 impl std::default::Default for ResourcePathNodeType {
15935 fn default() -> Self {
15936 use std::convert::From;
15937 Self::from(0)
15938 }
15939 }
15940
15941 impl std::fmt::Display for ResourcePathNodeType {
15942 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15943 wkt::internal::display_enum(f, self.name(), self.value())
15944 }
15945 }
15946
15947 impl std::convert::From<i32> for ResourcePathNodeType {
15948 fn from(value: i32) -> Self {
15949 match value {
15950 0 => Self::Unspecified,
15951 1 => Self::GcpOrganization,
15952 2 => Self::GcpFolder,
15953 3 => Self::GcpProject,
15954 4 => Self::AwsOrganization,
15955 5 => Self::AwsOrganizationalUnit,
15956 6 => Self::AwsAccount,
15957 7 => Self::AzureManagementGroup,
15958 8 => Self::AzureSubscription,
15959 9 => Self::AzureResourceGroup,
15960 _ => Self::UnknownValue(resource_path_node_type::UnknownValue(
15961 wkt::internal::UnknownEnumValue::Integer(value),
15962 )),
15963 }
15964 }
15965 }
15966
15967 impl std::convert::From<&str> for ResourcePathNodeType {
15968 fn from(value: &str) -> Self {
15969 use std::string::ToString;
15970 match value {
15971 "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
15972 "GCP_ORGANIZATION" => Self::GcpOrganization,
15973 "GCP_FOLDER" => Self::GcpFolder,
15974 "GCP_PROJECT" => Self::GcpProject,
15975 "AWS_ORGANIZATION" => Self::AwsOrganization,
15976 "AWS_ORGANIZATIONAL_UNIT" => Self::AwsOrganizationalUnit,
15977 "AWS_ACCOUNT" => Self::AwsAccount,
15978 "AZURE_MANAGEMENT_GROUP" => Self::AzureManagementGroup,
15979 "AZURE_SUBSCRIPTION" => Self::AzureSubscription,
15980 "AZURE_RESOURCE_GROUP" => Self::AzureResourceGroup,
15981 _ => Self::UnknownValue(resource_path_node_type::UnknownValue(
15982 wkt::internal::UnknownEnumValue::String(value.to_string()),
15983 )),
15984 }
15985 }
15986 }
15987
15988 impl serde::ser::Serialize for ResourcePathNodeType {
15989 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15990 where
15991 S: serde::Serializer,
15992 {
15993 match self {
15994 Self::Unspecified => serializer.serialize_i32(0),
15995 Self::GcpOrganization => serializer.serialize_i32(1),
15996 Self::GcpFolder => serializer.serialize_i32(2),
15997 Self::GcpProject => serializer.serialize_i32(3),
15998 Self::AwsOrganization => serializer.serialize_i32(4),
15999 Self::AwsOrganizationalUnit => serializer.serialize_i32(5),
16000 Self::AwsAccount => serializer.serialize_i32(6),
16001 Self::AzureManagementGroup => serializer.serialize_i32(7),
16002 Self::AzureSubscription => serializer.serialize_i32(8),
16003 Self::AzureResourceGroup => serializer.serialize_i32(9),
16004 Self::UnknownValue(u) => u.0.serialize(serializer),
16005 }
16006 }
16007 }
16008
16009 impl<'de> serde::de::Deserialize<'de> for ResourcePathNodeType {
16010 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16011 where
16012 D: serde::Deserializer<'de>,
16013 {
16014 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourcePathNodeType>::new(
16015 ".google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType",
16016 ))
16017 }
16018 }
16019}
16020
16021/// A resource value configuration (RVC) is a mapping configuration of user's
16022/// resources to resource values. Used in Attack path simulations.
16023#[derive(Clone, Default, PartialEq)]
16024#[non_exhaustive]
16025pub struct ResourceValueConfig {
16026 /// Identifier. Name for the resource value configuration
16027 pub name: std::string::String,
16028
16029 /// Resource value level this expression represents
16030 /// Only required when there is no Sensitive Data Protection mapping in the
16031 /// request
16032 pub resource_value: crate::model::ResourceValue,
16033
16034 /// Tag values combined with `AND` to check against.
16035 /// For Google Cloud resources, they are tag value IDs in the form of
16036 /// "tagValues/123". Example: `[ "tagValues/123", "tagValues/456",
16037 /// "tagValues/789" ]`
16038 /// <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing>
16039 pub tag_values: std::vec::Vec<std::string::String>,
16040
16041 /// Apply resource_value only to resources that match resource_type.
16042 /// resource_type will be checked with `AND` of other resources.
16043 /// For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
16044 /// will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
16045 pub resource_type: std::string::String,
16046
16047 /// Project or folder to scope this configuration to.
16048 /// For example, "project/456" would apply this configuration only to resources
16049 /// in "project/456" scope and will be checked with `AND` of other resources.
16050 pub scope: std::string::String,
16051
16052 /// List of resource labels to search for, evaluated with `AND`.
16053 /// For example, "resource_labels_selector": {"key": "value", "env": "prod"}
16054 /// will match resources with labels "key": "value" `AND` "env":
16055 /// "prod"
16056 /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
16057 pub resource_labels_selector:
16058 std::collections::HashMap<std::string::String, std::string::String>,
16059
16060 /// Description of the resource value configuration.
16061 pub description: std::string::String,
16062
16063 /// Output only. Timestamp this resource value configuration was created.
16064 pub create_time: std::option::Option<wkt::Timestamp>,
16065
16066 /// Output only. Timestamp this resource value configuration was last updated.
16067 pub update_time: std::option::Option<wkt::Timestamp>,
16068
16069 /// Cloud provider this configuration applies to
16070 pub cloud_provider: crate::model::CloudProvider,
16071
16072 /// A mapping of the sensitivity on Sensitive Data Protection finding to
16073 /// resource values. This mapping can only be used in combination with a
16074 /// resource_type that is related to BigQuery, e.g.
16075 /// "bigquery.googleapis.com/Dataset".
16076 pub sensitive_data_protection_mapping:
16077 std::option::Option<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16078
16079 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16080}
16081
16082impl ResourceValueConfig {
16083 /// Creates a new default instance.
16084 pub fn new() -> Self {
16085 std::default::Default::default()
16086 }
16087
16088 /// Sets the value of [name][crate::model::ResourceValueConfig::name].
16089 ///
16090 /// # Example
16091 /// ```ignore,no_run
16092 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16093 /// # let organization_id = "organization_id";
16094 /// # let resource_value_config_id = "resource_value_config_id";
16095 /// let x = ResourceValueConfig::new().set_name(format!("organizations/{organization_id}/resourceValueConfigs/{resource_value_config_id}"));
16096 /// ```
16097 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16098 self.name = v.into();
16099 self
16100 }
16101
16102 /// Sets the value of [resource_value][crate::model::ResourceValueConfig::resource_value].
16103 ///
16104 /// # Example
16105 /// ```ignore,no_run
16106 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16107 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16108 /// let x0 = ResourceValueConfig::new().set_resource_value(ResourceValue::High);
16109 /// let x1 = ResourceValueConfig::new().set_resource_value(ResourceValue::Medium);
16110 /// let x2 = ResourceValueConfig::new().set_resource_value(ResourceValue::Low);
16111 /// ```
16112 pub fn set_resource_value<T: std::convert::Into<crate::model::ResourceValue>>(
16113 mut self,
16114 v: T,
16115 ) -> Self {
16116 self.resource_value = v.into();
16117 self
16118 }
16119
16120 /// Sets the value of [tag_values][crate::model::ResourceValueConfig::tag_values].
16121 ///
16122 /// # Example
16123 /// ```ignore,no_run
16124 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16125 /// let x = ResourceValueConfig::new().set_tag_values(["a", "b", "c"]);
16126 /// ```
16127 pub fn set_tag_values<T, V>(mut self, v: T) -> Self
16128 where
16129 T: std::iter::IntoIterator<Item = V>,
16130 V: std::convert::Into<std::string::String>,
16131 {
16132 use std::iter::Iterator;
16133 self.tag_values = v.into_iter().map(|i| i.into()).collect();
16134 self
16135 }
16136
16137 /// Sets the value of [resource_type][crate::model::ResourceValueConfig::resource_type].
16138 ///
16139 /// # Example
16140 /// ```ignore,no_run
16141 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16142 /// let x = ResourceValueConfig::new().set_resource_type("example");
16143 /// ```
16144 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16145 self.resource_type = v.into();
16146 self
16147 }
16148
16149 /// Sets the value of [scope][crate::model::ResourceValueConfig::scope].
16150 ///
16151 /// # Example
16152 /// ```ignore,no_run
16153 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16154 /// let x = ResourceValueConfig::new().set_scope("example");
16155 /// ```
16156 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16157 self.scope = v.into();
16158 self
16159 }
16160
16161 /// Sets the value of [resource_labels_selector][crate::model::ResourceValueConfig::resource_labels_selector].
16162 ///
16163 /// # Example
16164 /// ```ignore,no_run
16165 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16166 /// let x = ResourceValueConfig::new().set_resource_labels_selector([
16167 /// ("key0", "abc"),
16168 /// ("key1", "xyz"),
16169 /// ]);
16170 /// ```
16171 pub fn set_resource_labels_selector<T, K, V>(mut self, v: T) -> Self
16172 where
16173 T: std::iter::IntoIterator<Item = (K, V)>,
16174 K: std::convert::Into<std::string::String>,
16175 V: std::convert::Into<std::string::String>,
16176 {
16177 use std::iter::Iterator;
16178 self.resource_labels_selector = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16179 self
16180 }
16181
16182 /// Sets the value of [description][crate::model::ResourceValueConfig::description].
16183 ///
16184 /// # Example
16185 /// ```ignore,no_run
16186 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16187 /// let x = ResourceValueConfig::new().set_description("example");
16188 /// ```
16189 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16190 self.description = v.into();
16191 self
16192 }
16193
16194 /// Sets the value of [create_time][crate::model::ResourceValueConfig::create_time].
16195 ///
16196 /// # Example
16197 /// ```ignore,no_run
16198 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16199 /// use wkt::Timestamp;
16200 /// let x = ResourceValueConfig::new().set_create_time(Timestamp::default()/* use setters */);
16201 /// ```
16202 pub fn set_create_time<T>(mut self, v: T) -> Self
16203 where
16204 T: std::convert::Into<wkt::Timestamp>,
16205 {
16206 self.create_time = std::option::Option::Some(v.into());
16207 self
16208 }
16209
16210 /// Sets or clears the value of [create_time][crate::model::ResourceValueConfig::create_time].
16211 ///
16212 /// # Example
16213 /// ```ignore,no_run
16214 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16215 /// use wkt::Timestamp;
16216 /// let x = ResourceValueConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16217 /// let x = ResourceValueConfig::new().set_or_clear_create_time(None::<Timestamp>);
16218 /// ```
16219 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16220 where
16221 T: std::convert::Into<wkt::Timestamp>,
16222 {
16223 self.create_time = v.map(|x| x.into());
16224 self
16225 }
16226
16227 /// Sets the value of [update_time][crate::model::ResourceValueConfig::update_time].
16228 ///
16229 /// # Example
16230 /// ```ignore,no_run
16231 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16232 /// use wkt::Timestamp;
16233 /// let x = ResourceValueConfig::new().set_update_time(Timestamp::default()/* use setters */);
16234 /// ```
16235 pub fn set_update_time<T>(mut self, v: T) -> Self
16236 where
16237 T: std::convert::Into<wkt::Timestamp>,
16238 {
16239 self.update_time = std::option::Option::Some(v.into());
16240 self
16241 }
16242
16243 /// Sets or clears the value of [update_time][crate::model::ResourceValueConfig::update_time].
16244 ///
16245 /// # Example
16246 /// ```ignore,no_run
16247 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16248 /// use wkt::Timestamp;
16249 /// let x = ResourceValueConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16250 /// let x = ResourceValueConfig::new().set_or_clear_update_time(None::<Timestamp>);
16251 /// ```
16252 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16253 where
16254 T: std::convert::Into<wkt::Timestamp>,
16255 {
16256 self.update_time = v.map(|x| x.into());
16257 self
16258 }
16259
16260 /// Sets the value of [cloud_provider][crate::model::ResourceValueConfig::cloud_provider].
16261 ///
16262 /// # Example
16263 /// ```ignore,no_run
16264 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16265 /// use google_cloud_securitycenter_v2::model::CloudProvider;
16266 /// let x0 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
16267 /// let x1 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::AmazonWebServices);
16268 /// let x2 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
16269 /// ```
16270 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
16271 mut self,
16272 v: T,
16273 ) -> Self {
16274 self.cloud_provider = v.into();
16275 self
16276 }
16277
16278 /// Sets the value of [sensitive_data_protection_mapping][crate::model::ResourceValueConfig::sensitive_data_protection_mapping].
16279 ///
16280 /// # Example
16281 /// ```ignore,no_run
16282 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16283 /// use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16284 /// let x = ResourceValueConfig::new().set_sensitive_data_protection_mapping(SensitiveDataProtectionMapping::default()/* use setters */);
16285 /// ```
16286 pub fn set_sensitive_data_protection_mapping<T>(mut self, v: T) -> Self
16287 where
16288 T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16289 {
16290 self.sensitive_data_protection_mapping = std::option::Option::Some(v.into());
16291 self
16292 }
16293
16294 /// Sets or clears the value of [sensitive_data_protection_mapping][crate::model::ResourceValueConfig::sensitive_data_protection_mapping].
16295 ///
16296 /// # Example
16297 /// ```ignore,no_run
16298 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16299 /// use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16300 /// let x = ResourceValueConfig::new().set_or_clear_sensitive_data_protection_mapping(Some(SensitiveDataProtectionMapping::default()/* use setters */));
16301 /// let x = ResourceValueConfig::new().set_or_clear_sensitive_data_protection_mapping(None::<SensitiveDataProtectionMapping>);
16302 /// ```
16303 pub fn set_or_clear_sensitive_data_protection_mapping<T>(
16304 mut self,
16305 v: std::option::Option<T>,
16306 ) -> Self
16307 where
16308 T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16309 {
16310 self.sensitive_data_protection_mapping = v.map(|x| x.into());
16311 self
16312 }
16313}
16314
16315impl wkt::message::Message for ResourceValueConfig {
16316 fn typename() -> &'static str {
16317 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig"
16318 }
16319}
16320
16321/// Defines additional types related to [ResourceValueConfig].
16322pub mod resource_value_config {
16323 #[allow(unused_imports)]
16324 use super::*;
16325
16326 /// Resource value mapping for Sensitive Data Protection findings
16327 /// If any of these mappings have a resource value that is not unspecified,
16328 /// the resource_value field will be ignored when reading this configuration.
16329 #[derive(Clone, Default, PartialEq)]
16330 #[non_exhaustive]
16331 pub struct SensitiveDataProtectionMapping {
16332 /// Resource value mapping for high-sensitivity Sensitive Data Protection
16333 /// findings
16334 pub high_sensitivity_mapping: crate::model::ResourceValue,
16335
16336 /// Resource value mapping for medium-sensitivity Sensitive Data Protection
16337 /// findings
16338 pub medium_sensitivity_mapping: crate::model::ResourceValue,
16339
16340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16341 }
16342
16343 impl SensitiveDataProtectionMapping {
16344 /// Creates a new default instance.
16345 pub fn new() -> Self {
16346 std::default::Default::default()
16347 }
16348
16349 /// Sets the value of [high_sensitivity_mapping][crate::model::resource_value_config::SensitiveDataProtectionMapping::high_sensitivity_mapping].
16350 ///
16351 /// # Example
16352 /// ```ignore,no_run
16353 /// # use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16354 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16355 /// let x0 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::High);
16356 /// let x1 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::Medium);
16357 /// let x2 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::Low);
16358 /// ```
16359 pub fn set_high_sensitivity_mapping<T: std::convert::Into<crate::model::ResourceValue>>(
16360 mut self,
16361 v: T,
16362 ) -> Self {
16363 self.high_sensitivity_mapping = v.into();
16364 self
16365 }
16366
16367 /// Sets the value of [medium_sensitivity_mapping][crate::model::resource_value_config::SensitiveDataProtectionMapping::medium_sensitivity_mapping].
16368 ///
16369 /// # Example
16370 /// ```ignore,no_run
16371 /// # use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16372 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16373 /// let x0 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::High);
16374 /// let x1 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::Medium);
16375 /// let x2 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::Low);
16376 /// ```
16377 pub fn set_medium_sensitivity_mapping<
16378 T: std::convert::Into<crate::model::ResourceValue>,
16379 >(
16380 mut self,
16381 v: T,
16382 ) -> Self {
16383 self.medium_sensitivity_mapping = v.into();
16384 self
16385 }
16386 }
16387
16388 impl wkt::message::Message for SensitiveDataProtectionMapping {
16389 fn typename() -> &'static str {
16390 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping"
16391 }
16392 }
16393}
16394
16395/// User specified security marks that are attached to the parent Security
16396/// Command Center resource. Security marks are scoped within a Security Command
16397/// Center organization -- they can be modified and viewed by all users who have
16398/// proper permissions on the organization.
16399#[derive(Clone, Default, PartialEq)]
16400#[non_exhaustive]
16401pub struct SecurityMarks {
16402 /// The relative resource name of the SecurityMarks. See:
16403 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
16404 /// The following list shows some examples:
16405 ///
16406 /// + `organizations/{organization_id}/assets/{asset_id}/securityMarks`
16407 ///
16408 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16409 /// +
16410 /// `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16411 pub name: std::string::String,
16412
16413 /// Mutable user specified security marks belonging to the parent resource.
16414 /// Constraints are as follows:
16415 ///
16416 /// * Keys and values are treated as case insensitive
16417 /// * Keys must be between 1 - 256 characters (inclusive)
16418 /// * Keys must be letters, numbers, underscores, or dashes
16419 /// * Values have leading and trailing whitespace trimmed, remaining
16420 /// characters must be between 1 - 4096 characters (inclusive)
16421 pub marks: std::collections::HashMap<std::string::String, std::string::String>,
16422
16423 /// The canonical name of the marks. The following list shows some examples:
16424 ///
16425 /// + `organizations/{organization_id}/assets/{asset_id}/securityMarks`
16426 ///
16427 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16428 /// +
16429 /// `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16430 ///
16431 /// + `folders/{folder_id}/assets/{asset_id}/securityMarks`
16432 ///
16433 /// `folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16434 /// +
16435 /// `folders/{folder_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16436 ///
16437 /// + `projects/{project_number}/assets/{asset_id}/securityMarks`
16438 ///
16439 /// `projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks`
16440 /// +
16441 /// `projects/{project_number}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16442 pub canonical_name: std::string::String,
16443
16444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16445}
16446
16447impl SecurityMarks {
16448 /// Creates a new default instance.
16449 pub fn new() -> Self {
16450 std::default::Default::default()
16451 }
16452
16453 /// Sets the value of [name][crate::model::SecurityMarks::name].
16454 ///
16455 /// # Example
16456 /// ```ignore,no_run
16457 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16458 /// # let organization_id = "organization_id";
16459 /// # let asset_id = "asset_id";
16460 /// let x = SecurityMarks::new().set_name(format!("organizations/{organization_id}/assets/{asset_id}/securityMarks"));
16461 /// ```
16462 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16463 self.name = v.into();
16464 self
16465 }
16466
16467 /// Sets the value of [marks][crate::model::SecurityMarks::marks].
16468 ///
16469 /// # Example
16470 /// ```ignore,no_run
16471 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16472 /// let x = SecurityMarks::new().set_marks([
16473 /// ("key0", "abc"),
16474 /// ("key1", "xyz"),
16475 /// ]);
16476 /// ```
16477 pub fn set_marks<T, K, V>(mut self, v: T) -> Self
16478 where
16479 T: std::iter::IntoIterator<Item = (K, V)>,
16480 K: std::convert::Into<std::string::String>,
16481 V: std::convert::Into<std::string::String>,
16482 {
16483 use std::iter::Iterator;
16484 self.marks = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16485 self
16486 }
16487
16488 /// Sets the value of [canonical_name][crate::model::SecurityMarks::canonical_name].
16489 ///
16490 /// # Example
16491 /// ```ignore,no_run
16492 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16493 /// let x = SecurityMarks::new().set_canonical_name("example");
16494 /// ```
16495 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16496 self.canonical_name = v.into();
16497 self
16498 }
16499}
16500
16501impl wkt::message::Message for SecurityMarks {
16502 fn typename() -> &'static str {
16503 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityMarks"
16504 }
16505}
16506
16507/// Represents a posture that is deployed on Google Cloud by the
16508/// Security Command Center Posture Management service.
16509/// A posture contains one or more policy sets. A policy set is a
16510/// group of policies that enforce a set of security rules on Google
16511/// Cloud.
16512#[derive(Clone, Default, PartialEq)]
16513#[non_exhaustive]
16514pub struct SecurityPosture {
16515 /// Name of the posture, for example, `CIS-Posture`.
16516 pub name: std::string::String,
16517
16518 /// The version of the posture, for example, `c7cfa2a8`.
16519 pub revision_id: std::string::String,
16520
16521 /// The project, folder, or organization on which the posture is deployed,
16522 /// for example, `projects/{project_number}`.
16523 pub posture_deployment_resource: std::string::String,
16524
16525 /// The name of the posture deployment, for example,
16526 /// `organizations/{org_id}/posturedeployments/{posture_deployment_id}`.
16527 pub posture_deployment: std::string::String,
16528
16529 /// The name of the updated policy, for example,
16530 /// `projects/{project_id}/policies/{constraint_name}`.
16531 pub changed_policy: std::string::String,
16532
16533 /// The name of the updated policy set, for example, `cis-policyset`.
16534 pub policy_set: std::string::String,
16535
16536 /// The ID of the updated policy, for example, `compute-policy-1`.
16537 pub policy: std::string::String,
16538
16539 /// The details about a change in an updated policy that violates the deployed
16540 /// posture.
16541 pub policy_drift_details: std::vec::Vec<crate::model::security_posture::PolicyDriftDetails>,
16542
16543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16544}
16545
16546impl SecurityPosture {
16547 /// Creates a new default instance.
16548 pub fn new() -> Self {
16549 std::default::Default::default()
16550 }
16551
16552 /// Sets the value of [name][crate::model::SecurityPosture::name].
16553 ///
16554 /// # Example
16555 /// ```ignore,no_run
16556 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16557 /// let x = SecurityPosture::new().set_name("example");
16558 /// ```
16559 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16560 self.name = v.into();
16561 self
16562 }
16563
16564 /// Sets the value of [revision_id][crate::model::SecurityPosture::revision_id].
16565 ///
16566 /// # Example
16567 /// ```ignore,no_run
16568 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16569 /// let x = SecurityPosture::new().set_revision_id("example");
16570 /// ```
16571 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16572 self.revision_id = v.into();
16573 self
16574 }
16575
16576 /// Sets the value of [posture_deployment_resource][crate::model::SecurityPosture::posture_deployment_resource].
16577 ///
16578 /// # Example
16579 /// ```ignore,no_run
16580 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16581 /// let x = SecurityPosture::new().set_posture_deployment_resource("example");
16582 /// ```
16583 pub fn set_posture_deployment_resource<T: std::convert::Into<std::string::String>>(
16584 mut self,
16585 v: T,
16586 ) -> Self {
16587 self.posture_deployment_resource = v.into();
16588 self
16589 }
16590
16591 /// Sets the value of [posture_deployment][crate::model::SecurityPosture::posture_deployment].
16592 ///
16593 /// # Example
16594 /// ```ignore,no_run
16595 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16596 /// let x = SecurityPosture::new().set_posture_deployment("example");
16597 /// ```
16598 pub fn set_posture_deployment<T: std::convert::Into<std::string::String>>(
16599 mut self,
16600 v: T,
16601 ) -> Self {
16602 self.posture_deployment = v.into();
16603 self
16604 }
16605
16606 /// Sets the value of [changed_policy][crate::model::SecurityPosture::changed_policy].
16607 ///
16608 /// # Example
16609 /// ```ignore,no_run
16610 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16611 /// let x = SecurityPosture::new().set_changed_policy("example");
16612 /// ```
16613 pub fn set_changed_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16614 self.changed_policy = v.into();
16615 self
16616 }
16617
16618 /// Sets the value of [policy_set][crate::model::SecurityPosture::policy_set].
16619 ///
16620 /// # Example
16621 /// ```ignore,no_run
16622 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16623 /// let x = SecurityPosture::new().set_policy_set("example");
16624 /// ```
16625 pub fn set_policy_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16626 self.policy_set = v.into();
16627 self
16628 }
16629
16630 /// Sets the value of [policy][crate::model::SecurityPosture::policy].
16631 ///
16632 /// # Example
16633 /// ```ignore,no_run
16634 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16635 /// let x = SecurityPosture::new().set_policy("example");
16636 /// ```
16637 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16638 self.policy = v.into();
16639 self
16640 }
16641
16642 /// Sets the value of [policy_drift_details][crate::model::SecurityPosture::policy_drift_details].
16643 ///
16644 /// # Example
16645 /// ```ignore,no_run
16646 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16647 /// use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16648 /// let x = SecurityPosture::new()
16649 /// .set_policy_drift_details([
16650 /// PolicyDriftDetails::default()/* use setters */,
16651 /// PolicyDriftDetails::default()/* use (different) setters */,
16652 /// ]);
16653 /// ```
16654 pub fn set_policy_drift_details<T, V>(mut self, v: T) -> Self
16655 where
16656 T: std::iter::IntoIterator<Item = V>,
16657 V: std::convert::Into<crate::model::security_posture::PolicyDriftDetails>,
16658 {
16659 use std::iter::Iterator;
16660 self.policy_drift_details = v.into_iter().map(|i| i.into()).collect();
16661 self
16662 }
16663}
16664
16665impl wkt::message::Message for SecurityPosture {
16666 fn typename() -> &'static str {
16667 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture"
16668 }
16669}
16670
16671/// Defines additional types related to [SecurityPosture].
16672pub mod security_posture {
16673 #[allow(unused_imports)]
16674 use super::*;
16675
16676 /// The policy field that violates the deployed posture and its expected and
16677 /// detected values.
16678 #[derive(Clone, Default, PartialEq)]
16679 #[non_exhaustive]
16680 pub struct PolicyDriftDetails {
16681 /// The name of the updated field, for example
16682 /// constraint.implementation.policy_rules[0].enforce
16683 pub field: std::string::String,
16684
16685 /// The value of this field that was configured in a posture, for example,
16686 /// `true` or `allowed_values={"projects/29831892"}`.
16687 pub expected_value: std::string::String,
16688
16689 /// The detected value that violates the deployed posture, for example,
16690 /// `false` or `allowed_values={"projects/22831892"}`.
16691 pub detected_value: std::string::String,
16692
16693 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16694 }
16695
16696 impl PolicyDriftDetails {
16697 /// Creates a new default instance.
16698 pub fn new() -> Self {
16699 std::default::Default::default()
16700 }
16701
16702 /// Sets the value of [field][crate::model::security_posture::PolicyDriftDetails::field].
16703 ///
16704 /// # Example
16705 /// ```ignore,no_run
16706 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16707 /// let x = PolicyDriftDetails::new().set_field("example");
16708 /// ```
16709 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16710 self.field = v.into();
16711 self
16712 }
16713
16714 /// Sets the value of [expected_value][crate::model::security_posture::PolicyDriftDetails::expected_value].
16715 ///
16716 /// # Example
16717 /// ```ignore,no_run
16718 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16719 /// let x = PolicyDriftDetails::new().set_expected_value("example");
16720 /// ```
16721 pub fn set_expected_value<T: std::convert::Into<std::string::String>>(
16722 mut self,
16723 v: T,
16724 ) -> Self {
16725 self.expected_value = v.into();
16726 self
16727 }
16728
16729 /// Sets the value of [detected_value][crate::model::security_posture::PolicyDriftDetails::detected_value].
16730 ///
16731 /// # Example
16732 /// ```ignore,no_run
16733 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16734 /// let x = PolicyDriftDetails::new().set_detected_value("example");
16735 /// ```
16736 pub fn set_detected_value<T: std::convert::Into<std::string::String>>(
16737 mut self,
16738 v: T,
16739 ) -> Self {
16740 self.detected_value = v.into();
16741 self
16742 }
16743 }
16744
16745 impl wkt::message::Message for PolicyDriftDetails {
16746 fn typename() -> &'static str {
16747 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails"
16748 }
16749 }
16750}
16751
16752/// Request message to create multiple resource value configs
16753#[derive(Clone, Default, PartialEq)]
16754#[non_exhaustive]
16755pub struct BatchCreateResourceValueConfigsRequest {
16756 /// Required. Resource name of the new ResourceValueConfig's parent.
16757 /// The parent field in the CreateResourceValueConfigRequest
16758 /// messages must either be empty or match this field.
16759 pub parent: std::string::String,
16760
16761 /// Required. The resource value configs to be created.
16762 pub requests: std::vec::Vec<crate::model::CreateResourceValueConfigRequest>,
16763
16764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16765}
16766
16767impl BatchCreateResourceValueConfigsRequest {
16768 /// Creates a new default instance.
16769 pub fn new() -> Self {
16770 std::default::Default::default()
16771 }
16772
16773 /// Sets the value of [parent][crate::model::BatchCreateResourceValueConfigsRequest::parent].
16774 ///
16775 /// # Example
16776 /// ```ignore,no_run
16777 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsRequest;
16778 /// # let organization_id = "organization_id";
16779 /// let x = BatchCreateResourceValueConfigsRequest::new().set_parent(format!("organizations/{organization_id}"));
16780 /// ```
16781 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16782 self.parent = v.into();
16783 self
16784 }
16785
16786 /// Sets the value of [requests][crate::model::BatchCreateResourceValueConfigsRequest::requests].
16787 ///
16788 /// # Example
16789 /// ```ignore,no_run
16790 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsRequest;
16791 /// use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
16792 /// let x = BatchCreateResourceValueConfigsRequest::new()
16793 /// .set_requests([
16794 /// CreateResourceValueConfigRequest::default()/* use setters */,
16795 /// CreateResourceValueConfigRequest::default()/* use (different) setters */,
16796 /// ]);
16797 /// ```
16798 pub fn set_requests<T, V>(mut self, v: T) -> Self
16799 where
16800 T: std::iter::IntoIterator<Item = V>,
16801 V: std::convert::Into<crate::model::CreateResourceValueConfigRequest>,
16802 {
16803 use std::iter::Iterator;
16804 self.requests = v.into_iter().map(|i| i.into()).collect();
16805 self
16806 }
16807}
16808
16809impl wkt::message::Message for BatchCreateResourceValueConfigsRequest {
16810 fn typename() -> &'static str {
16811 "type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest"
16812 }
16813}
16814
16815/// Response message for BatchCreateResourceValueConfigs
16816#[derive(Clone, Default, PartialEq)]
16817#[non_exhaustive]
16818pub struct BatchCreateResourceValueConfigsResponse {
16819 /// The resource value configs created
16820 pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
16821
16822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16823}
16824
16825impl BatchCreateResourceValueConfigsResponse {
16826 /// Creates a new default instance.
16827 pub fn new() -> Self {
16828 std::default::Default::default()
16829 }
16830
16831 /// Sets the value of [resource_value_configs][crate::model::BatchCreateResourceValueConfigsResponse::resource_value_configs].
16832 ///
16833 /// # Example
16834 /// ```ignore,no_run
16835 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsResponse;
16836 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16837 /// let x = BatchCreateResourceValueConfigsResponse::new()
16838 /// .set_resource_value_configs([
16839 /// ResourceValueConfig::default()/* use setters */,
16840 /// ResourceValueConfig::default()/* use (different) setters */,
16841 /// ]);
16842 /// ```
16843 pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
16844 where
16845 T: std::iter::IntoIterator<Item = V>,
16846 V: std::convert::Into<crate::model::ResourceValueConfig>,
16847 {
16848 use std::iter::Iterator;
16849 self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
16850 self
16851 }
16852}
16853
16854impl wkt::message::Message for BatchCreateResourceValueConfigsResponse {
16855 fn typename() -> &'static str {
16856 "type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse"
16857 }
16858}
16859
16860/// Request message for bulk findings update.
16861///
16862/// Note:
16863///
16864/// 1. If multiple bulk update requests match the same resource, the order in
16865/// which they get executed is not defined.
16866/// 1. Once a bulk operation is started, there is no way to stop it.
16867#[derive(Clone, Default, PartialEq)]
16868#[non_exhaustive]
16869pub struct BulkMuteFindingsRequest {
16870 /// Required. The parent, at which bulk action needs to be applied. If no
16871 /// location is specified, findings are updated in global. The following list
16872 /// shows some examples:
16873 ///
16874 /// + `organizations/[organization_id]`
16875 /// + `organizations/[organization_id]/locations/[location_id]`
16876 /// + `folders/[folder_id]`
16877 /// + `folders/[folder_id]/locations/[location_id]`
16878 /// + `projects/[project_id]`
16879 /// + `projects/[project_id]/locations/[location_id]`
16880 pub parent: std::string::String,
16881
16882 /// Expression that identifies findings that should be updated.
16883 /// The expression is a list of zero or more restrictions combined
16884 /// via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
16885 /// has higher precedence than `AND`.
16886 ///
16887 /// Restrictions have the form `<field> <operator> <value>` and may have a
16888 /// `-` character in front of them to indicate negation. The fields map to
16889 /// those defined in the corresponding resource.
16890 ///
16891 /// The supported operators are:
16892 ///
16893 /// * `=` for all value types.
16894 /// * `>`, `<`, `>=`, `<=` for integer values.
16895 /// * `:`, meaning substring matching, for strings.
16896 ///
16897 /// The supported value types are:
16898 ///
16899 /// * string literals in quotes.
16900 /// * integer literals without quotes.
16901 /// * boolean literals `true` and `false` without quotes.
16902 pub filter: std::string::String,
16903
16904 /// Optional. All findings matching the given filter will have their mute state
16905 /// set to this value. The default value is `MUTED`. Setting this to
16906 /// `UNDEFINED` will clear the mute state on all matching findings.
16907 pub mute_state: crate::model::bulk_mute_findings_request::MuteState,
16908
16909 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16910}
16911
16912impl BulkMuteFindingsRequest {
16913 /// Creates a new default instance.
16914 pub fn new() -> Self {
16915 std::default::Default::default()
16916 }
16917
16918 /// Sets the value of [parent][crate::model::BulkMuteFindingsRequest::parent].
16919 ///
16920 /// # Example
16921 /// ```ignore,no_run
16922 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16923 /// let x = BulkMuteFindingsRequest::new().set_parent("example");
16924 /// ```
16925 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16926 self.parent = v.into();
16927 self
16928 }
16929
16930 /// Sets the value of [filter][crate::model::BulkMuteFindingsRequest::filter].
16931 ///
16932 /// # Example
16933 /// ```ignore,no_run
16934 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16935 /// let x = BulkMuteFindingsRequest::new().set_filter("example");
16936 /// ```
16937 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16938 self.filter = v.into();
16939 self
16940 }
16941
16942 /// Sets the value of [mute_state][crate::model::BulkMuteFindingsRequest::mute_state].
16943 ///
16944 /// # Example
16945 /// ```ignore,no_run
16946 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16947 /// use google_cloud_securitycenter_v2::model::bulk_mute_findings_request::MuteState;
16948 /// let x0 = BulkMuteFindingsRequest::new().set_mute_state(MuteState::Muted);
16949 /// let x1 = BulkMuteFindingsRequest::new().set_mute_state(MuteState::Undefined);
16950 /// ```
16951 pub fn set_mute_state<
16952 T: std::convert::Into<crate::model::bulk_mute_findings_request::MuteState>,
16953 >(
16954 mut self,
16955 v: T,
16956 ) -> Self {
16957 self.mute_state = v.into();
16958 self
16959 }
16960}
16961
16962impl wkt::message::Message for BulkMuteFindingsRequest {
16963 fn typename() -> &'static str {
16964 "type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsRequest"
16965 }
16966}
16967
16968/// Defines additional types related to [BulkMuteFindingsRequest].
16969pub mod bulk_mute_findings_request {
16970 #[allow(unused_imports)]
16971 use super::*;
16972
16973 /// The mute state.
16974 ///
16975 /// # Working with unknown values
16976 ///
16977 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16978 /// additional enum variants at any time. Adding new variants is not considered
16979 /// a breaking change. Applications should write their code in anticipation of:
16980 ///
16981 /// - New values appearing in future releases of the client library, **and**
16982 /// - New values received dynamically, without application changes.
16983 ///
16984 /// Please consult the [Working with enums] section in the user guide for some
16985 /// guidelines.
16986 ///
16987 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16988 #[derive(Clone, Debug, PartialEq)]
16989 #[non_exhaustive]
16990 pub enum MuteState {
16991 /// Unused.
16992 Unspecified,
16993 /// Matching findings will be muted (default).
16994 Muted,
16995 /// Matching findings will have their mute state cleared.
16996 Undefined,
16997 /// If set, the enum was initialized with an unknown value.
16998 ///
16999 /// Applications can examine the value using [MuteState::value] or
17000 /// [MuteState::name].
17001 UnknownValue(mute_state::UnknownValue),
17002 }
17003
17004 #[doc(hidden)]
17005 pub mod mute_state {
17006 #[allow(unused_imports)]
17007 use super::*;
17008 #[derive(Clone, Debug, PartialEq)]
17009 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17010 }
17011
17012 impl MuteState {
17013 /// Gets the enum value.
17014 ///
17015 /// Returns `None` if the enum contains an unknown value deserialized from
17016 /// the string representation of enums.
17017 pub fn value(&self) -> std::option::Option<i32> {
17018 match self {
17019 Self::Unspecified => std::option::Option::Some(0),
17020 Self::Muted => std::option::Option::Some(1),
17021 Self::Undefined => std::option::Option::Some(2),
17022 Self::UnknownValue(u) => u.0.value(),
17023 }
17024 }
17025
17026 /// Gets the enum value as a string.
17027 ///
17028 /// Returns `None` if the enum contains an unknown value deserialized from
17029 /// the integer representation of enums.
17030 pub fn name(&self) -> std::option::Option<&str> {
17031 match self {
17032 Self::Unspecified => std::option::Option::Some("MUTE_STATE_UNSPECIFIED"),
17033 Self::Muted => std::option::Option::Some("MUTED"),
17034 Self::Undefined => std::option::Option::Some("UNDEFINED"),
17035 Self::UnknownValue(u) => u.0.name(),
17036 }
17037 }
17038 }
17039
17040 impl std::default::Default for MuteState {
17041 fn default() -> Self {
17042 use std::convert::From;
17043 Self::from(0)
17044 }
17045 }
17046
17047 impl std::fmt::Display for MuteState {
17048 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17049 wkt::internal::display_enum(f, self.name(), self.value())
17050 }
17051 }
17052
17053 impl std::convert::From<i32> for MuteState {
17054 fn from(value: i32) -> Self {
17055 match value {
17056 0 => Self::Unspecified,
17057 1 => Self::Muted,
17058 2 => Self::Undefined,
17059 _ => Self::UnknownValue(mute_state::UnknownValue(
17060 wkt::internal::UnknownEnumValue::Integer(value),
17061 )),
17062 }
17063 }
17064 }
17065
17066 impl std::convert::From<&str> for MuteState {
17067 fn from(value: &str) -> Self {
17068 use std::string::ToString;
17069 match value {
17070 "MUTE_STATE_UNSPECIFIED" => Self::Unspecified,
17071 "MUTED" => Self::Muted,
17072 "UNDEFINED" => Self::Undefined,
17073 _ => Self::UnknownValue(mute_state::UnknownValue(
17074 wkt::internal::UnknownEnumValue::String(value.to_string()),
17075 )),
17076 }
17077 }
17078 }
17079
17080 impl serde::ser::Serialize for MuteState {
17081 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17082 where
17083 S: serde::Serializer,
17084 {
17085 match self {
17086 Self::Unspecified => serializer.serialize_i32(0),
17087 Self::Muted => serializer.serialize_i32(1),
17088 Self::Undefined => serializer.serialize_i32(2),
17089 Self::UnknownValue(u) => u.0.serialize(serializer),
17090 }
17091 }
17092 }
17093
17094 impl<'de> serde::de::Deserialize<'de> for MuteState {
17095 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17096 where
17097 D: serde::Deserializer<'de>,
17098 {
17099 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteState>::new(
17100 ".google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState",
17101 ))
17102 }
17103 }
17104}
17105
17106/// The response to a BulkMute request. Contains the LRO information.
17107#[derive(Clone, Default, PartialEq)]
17108#[non_exhaustive]
17109pub struct BulkMuteFindingsResponse {
17110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17111}
17112
17113impl BulkMuteFindingsResponse {
17114 /// Creates a new default instance.
17115 pub fn new() -> Self {
17116 std::default::Default::default()
17117 }
17118}
17119
17120impl wkt::message::Message for BulkMuteFindingsResponse {
17121 fn typename() -> &'static str {
17122 "type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsResponse"
17123 }
17124}
17125
17126/// Request message for creating a BigQuery export.
17127#[derive(Clone, Default, PartialEq)]
17128#[non_exhaustive]
17129pub struct CreateBigQueryExportRequest {
17130 /// Required. The name of the parent resource of the new BigQuery export. Its
17131 /// format is `organizations/[organization_id]/locations/[location_id]`,
17132 /// `folders/[folder_id]/locations/[location_id]`, or
17133 /// `projects/[project_id]/locations/[location_id]`.
17134 pub parent: std::string::String,
17135
17136 /// Required. The BigQuery export being created.
17137 pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
17138
17139 /// Required. Unique identifier provided by the client within the parent scope.
17140 /// It must consist of only lowercase letters, numbers, and hyphens, must start
17141 /// with a letter, must end with either a letter or a number, and must be 63
17142 /// characters or less.
17143 pub big_query_export_id: std::string::String,
17144
17145 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17146}
17147
17148impl CreateBigQueryExportRequest {
17149 /// Creates a new default instance.
17150 pub fn new() -> Self {
17151 std::default::Default::default()
17152 }
17153
17154 /// Sets the value of [parent][crate::model::CreateBigQueryExportRequest::parent].
17155 ///
17156 /// # Example
17157 /// ```ignore,no_run
17158 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17159 /// # let organization_id = "organization_id";
17160 /// # let location_id = "location_id";
17161 /// let x = CreateBigQueryExportRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
17162 /// ```
17163 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17164 self.parent = v.into();
17165 self
17166 }
17167
17168 /// Sets the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
17169 ///
17170 /// # Example
17171 /// ```ignore,no_run
17172 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17173 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
17174 /// let x = CreateBigQueryExportRequest::new().set_big_query_export(BigQueryExport::default()/* use setters */);
17175 /// ```
17176 pub fn set_big_query_export<T>(mut self, v: T) -> Self
17177 where
17178 T: std::convert::Into<crate::model::BigQueryExport>,
17179 {
17180 self.big_query_export = std::option::Option::Some(v.into());
17181 self
17182 }
17183
17184 /// Sets or clears the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
17185 ///
17186 /// # Example
17187 /// ```ignore,no_run
17188 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17189 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
17190 /// let x = CreateBigQueryExportRequest::new().set_or_clear_big_query_export(Some(BigQueryExport::default()/* use setters */));
17191 /// let x = CreateBigQueryExportRequest::new().set_or_clear_big_query_export(None::<BigQueryExport>);
17192 /// ```
17193 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
17194 where
17195 T: std::convert::Into<crate::model::BigQueryExport>,
17196 {
17197 self.big_query_export = v.map(|x| x.into());
17198 self
17199 }
17200
17201 /// Sets the value of [big_query_export_id][crate::model::CreateBigQueryExportRequest::big_query_export_id].
17202 ///
17203 /// # Example
17204 /// ```ignore,no_run
17205 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17206 /// let x = CreateBigQueryExportRequest::new().set_big_query_export_id("example");
17207 /// ```
17208 pub fn set_big_query_export_id<T: std::convert::Into<std::string::String>>(
17209 mut self,
17210 v: T,
17211 ) -> Self {
17212 self.big_query_export_id = v.into();
17213 self
17214 }
17215}
17216
17217impl wkt::message::Message for CreateBigQueryExportRequest {
17218 fn typename() -> &'static str {
17219 "type.googleapis.com/google.cloud.securitycenter.v2.CreateBigQueryExportRequest"
17220 }
17221}
17222
17223/// Request message for creating a finding.
17224#[derive(Clone, Default, PartialEq)]
17225#[non_exhaustive]
17226pub struct CreateFindingRequest {
17227 /// Required. Resource name of the new finding's parent. The following list
17228 /// shows some examples of the format:
17229 /// +
17230 /// `organizations/[organization_id]/sources/[source_id]`
17231 /// +
17232 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
17233 pub parent: std::string::String,
17234
17235 /// Required. Unique identifier provided by the client within the parent scope.
17236 /// It must be alphanumeric and less than or equal to 32 characters and
17237 /// greater than 0 characters in length.
17238 pub finding_id: std::string::String,
17239
17240 /// Required. The Finding being created. The name and security_marks will be
17241 /// ignored as they are both output only fields on this resource.
17242 pub finding: std::option::Option<crate::model::Finding>,
17243
17244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17245}
17246
17247impl CreateFindingRequest {
17248 /// Creates a new default instance.
17249 pub fn new() -> Self {
17250 std::default::Default::default()
17251 }
17252
17253 /// Sets the value of [parent][crate::model::CreateFindingRequest::parent].
17254 ///
17255 /// # Example
17256 /// ```ignore,no_run
17257 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17258 /// # let organization_id = "organization_id";
17259 /// # let source_id = "source_id";
17260 /// let x = CreateFindingRequest::new().set_parent(format!("organizations/{organization_id}/sources/{source_id}"));
17261 /// ```
17262 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17263 self.parent = v.into();
17264 self
17265 }
17266
17267 /// Sets the value of [finding_id][crate::model::CreateFindingRequest::finding_id].
17268 ///
17269 /// # Example
17270 /// ```ignore,no_run
17271 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17272 /// let x = CreateFindingRequest::new().set_finding_id("example");
17273 /// ```
17274 pub fn set_finding_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17275 self.finding_id = v.into();
17276 self
17277 }
17278
17279 /// Sets the value of [finding][crate::model::CreateFindingRequest::finding].
17280 ///
17281 /// # Example
17282 /// ```ignore,no_run
17283 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17284 /// use google_cloud_securitycenter_v2::model::Finding;
17285 /// let x = CreateFindingRequest::new().set_finding(Finding::default()/* use setters */);
17286 /// ```
17287 pub fn set_finding<T>(mut self, v: T) -> Self
17288 where
17289 T: std::convert::Into<crate::model::Finding>,
17290 {
17291 self.finding = std::option::Option::Some(v.into());
17292 self
17293 }
17294
17295 /// Sets or clears the value of [finding][crate::model::CreateFindingRequest::finding].
17296 ///
17297 /// # Example
17298 /// ```ignore,no_run
17299 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17300 /// use google_cloud_securitycenter_v2::model::Finding;
17301 /// let x = CreateFindingRequest::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
17302 /// let x = CreateFindingRequest::new().set_or_clear_finding(None::<Finding>);
17303 /// ```
17304 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
17305 where
17306 T: std::convert::Into<crate::model::Finding>,
17307 {
17308 self.finding = v.map(|x| x.into());
17309 self
17310 }
17311}
17312
17313impl wkt::message::Message for CreateFindingRequest {
17314 fn typename() -> &'static str {
17315 "type.googleapis.com/google.cloud.securitycenter.v2.CreateFindingRequest"
17316 }
17317}
17318
17319/// Request message for creating a mute config.
17320#[derive(Clone, Default, PartialEq)]
17321#[non_exhaustive]
17322pub struct CreateMuteConfigRequest {
17323 /// Required. Resource name of the new mute configs's parent. Its format is
17324 /// `organizations/[organization_id]/locations/[location_id]`,
17325 /// `folders/[folder_id]/locations/[location_id]`, or
17326 /// `projects/[project_id]/locations/[location_id]`.
17327 pub parent: std::string::String,
17328
17329 /// Required. The mute config being created.
17330 pub mute_config: std::option::Option<crate::model::MuteConfig>,
17331
17332 /// Required. Unique identifier provided by the client within the parent scope.
17333 /// It must consist of only lowercase letters, numbers, and hyphens, must start
17334 /// with a letter, must end with either a letter or a number, and must be 63
17335 /// characters or less.
17336 pub mute_config_id: std::string::String,
17337
17338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17339}
17340
17341impl CreateMuteConfigRequest {
17342 /// Creates a new default instance.
17343 pub fn new() -> Self {
17344 std::default::Default::default()
17345 }
17346
17347 /// Sets the value of [parent][crate::model::CreateMuteConfigRequest::parent].
17348 ///
17349 /// # Example
17350 /// ```ignore,no_run
17351 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17352 /// # let organization_id = "organization_id";
17353 /// let x = CreateMuteConfigRequest::new().set_parent(format!("organizations/{organization_id}"));
17354 /// ```
17355 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17356 self.parent = v.into();
17357 self
17358 }
17359
17360 /// Sets the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
17361 ///
17362 /// # Example
17363 /// ```ignore,no_run
17364 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17365 /// use google_cloud_securitycenter_v2::model::MuteConfig;
17366 /// let x = CreateMuteConfigRequest::new().set_mute_config(MuteConfig::default()/* use setters */);
17367 /// ```
17368 pub fn set_mute_config<T>(mut self, v: T) -> Self
17369 where
17370 T: std::convert::Into<crate::model::MuteConfig>,
17371 {
17372 self.mute_config = std::option::Option::Some(v.into());
17373 self
17374 }
17375
17376 /// Sets or clears the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
17377 ///
17378 /// # Example
17379 /// ```ignore,no_run
17380 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17381 /// use google_cloud_securitycenter_v2::model::MuteConfig;
17382 /// let x = CreateMuteConfigRequest::new().set_or_clear_mute_config(Some(MuteConfig::default()/* use setters */));
17383 /// let x = CreateMuteConfigRequest::new().set_or_clear_mute_config(None::<MuteConfig>);
17384 /// ```
17385 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
17386 where
17387 T: std::convert::Into<crate::model::MuteConfig>,
17388 {
17389 self.mute_config = v.map(|x| x.into());
17390 self
17391 }
17392
17393 /// Sets the value of [mute_config_id][crate::model::CreateMuteConfigRequest::mute_config_id].
17394 ///
17395 /// # Example
17396 /// ```ignore,no_run
17397 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17398 /// let x = CreateMuteConfigRequest::new().set_mute_config_id("example");
17399 /// ```
17400 pub fn set_mute_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17401 self.mute_config_id = v.into();
17402 self
17403 }
17404}
17405
17406impl wkt::message::Message for CreateMuteConfigRequest {
17407 fn typename() -> &'static str {
17408 "type.googleapis.com/google.cloud.securitycenter.v2.CreateMuteConfigRequest"
17409 }
17410}
17411
17412/// Request message for creating a notification config.
17413#[derive(Clone, Default, PartialEq)]
17414#[non_exhaustive]
17415pub struct CreateNotificationConfigRequest {
17416 /// Required. Resource name of the new notification config's parent. Its format
17417 /// is `organizations/[organization_id]/locations/[location_id]`,
17418 /// `folders/[folder_id]/locations/[location_id]`, or
17419 /// `projects/[project_id]/locations/[location_id]`.
17420 pub parent: std::string::String,
17421
17422 /// Required.
17423 /// Unique identifier provided by the client within the parent scope.
17424 /// It must be between 1 and 128 characters and contain alphanumeric
17425 /// characters, underscores, or hyphens only.
17426 pub config_id: std::string::String,
17427
17428 /// Required. The notification config being created. The name and the service
17429 /// account will be ignored as they are both output only fields on this
17430 /// resource.
17431 pub notification_config: std::option::Option<crate::model::NotificationConfig>,
17432
17433 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17434}
17435
17436impl CreateNotificationConfigRequest {
17437 /// Creates a new default instance.
17438 pub fn new() -> Self {
17439 std::default::Default::default()
17440 }
17441
17442 /// Sets the value of [parent][crate::model::CreateNotificationConfigRequest::parent].
17443 ///
17444 /// # Example
17445 /// ```ignore,no_run
17446 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17447 /// # let organization_id = "organization_id";
17448 /// # let location_id = "location_id";
17449 /// let x = CreateNotificationConfigRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
17450 /// ```
17451 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17452 self.parent = v.into();
17453 self
17454 }
17455
17456 /// Sets the value of [config_id][crate::model::CreateNotificationConfigRequest::config_id].
17457 ///
17458 /// # Example
17459 /// ```ignore,no_run
17460 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17461 /// let x = CreateNotificationConfigRequest::new().set_config_id("example");
17462 /// ```
17463 pub fn set_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17464 self.config_id = v.into();
17465 self
17466 }
17467
17468 /// Sets the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
17469 ///
17470 /// # Example
17471 /// ```ignore,no_run
17472 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17473 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
17474 /// let x = CreateNotificationConfigRequest::new().set_notification_config(NotificationConfig::default()/* use setters */);
17475 /// ```
17476 pub fn set_notification_config<T>(mut self, v: T) -> Self
17477 where
17478 T: std::convert::Into<crate::model::NotificationConfig>,
17479 {
17480 self.notification_config = std::option::Option::Some(v.into());
17481 self
17482 }
17483
17484 /// Sets or clears the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
17485 ///
17486 /// # Example
17487 /// ```ignore,no_run
17488 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17489 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
17490 /// let x = CreateNotificationConfigRequest::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
17491 /// let x = CreateNotificationConfigRequest::new().set_or_clear_notification_config(None::<NotificationConfig>);
17492 /// ```
17493 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
17494 where
17495 T: std::convert::Into<crate::model::NotificationConfig>,
17496 {
17497 self.notification_config = v.map(|x| x.into());
17498 self
17499 }
17500}
17501
17502impl wkt::message::Message for CreateNotificationConfigRequest {
17503 fn typename() -> &'static str {
17504 "type.googleapis.com/google.cloud.securitycenter.v2.CreateNotificationConfigRequest"
17505 }
17506}
17507
17508/// Request message to create single resource value config
17509#[derive(Clone, Default, PartialEq)]
17510#[non_exhaustive]
17511pub struct CreateResourceValueConfigRequest {
17512 /// Required. Resource name of the new ResourceValueConfig's parent.
17513 pub parent: std::string::String,
17514
17515 /// Required. The resource value config being created.
17516 pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
17517
17518 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17519}
17520
17521impl CreateResourceValueConfigRequest {
17522 /// Creates a new default instance.
17523 pub fn new() -> Self {
17524 std::default::Default::default()
17525 }
17526
17527 /// Sets the value of [parent][crate::model::CreateResourceValueConfigRequest::parent].
17528 ///
17529 /// # Example
17530 /// ```ignore,no_run
17531 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17532 /// # let organization_id = "organization_id";
17533 /// let x = CreateResourceValueConfigRequest::new().set_parent(format!("organizations/{organization_id}"));
17534 /// ```
17535 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17536 self.parent = v.into();
17537 self
17538 }
17539
17540 /// Sets the value of [resource_value_config][crate::model::CreateResourceValueConfigRequest::resource_value_config].
17541 ///
17542 /// # Example
17543 /// ```ignore,no_run
17544 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17545 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
17546 /// let x = CreateResourceValueConfigRequest::new().set_resource_value_config(ResourceValueConfig::default()/* use setters */);
17547 /// ```
17548 pub fn set_resource_value_config<T>(mut self, v: T) -> Self
17549 where
17550 T: std::convert::Into<crate::model::ResourceValueConfig>,
17551 {
17552 self.resource_value_config = std::option::Option::Some(v.into());
17553 self
17554 }
17555
17556 /// Sets or clears the value of [resource_value_config][crate::model::CreateResourceValueConfigRequest::resource_value_config].
17557 ///
17558 /// # Example
17559 /// ```ignore,no_run
17560 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17561 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
17562 /// let x = CreateResourceValueConfigRequest::new().set_or_clear_resource_value_config(Some(ResourceValueConfig::default()/* use setters */));
17563 /// let x = CreateResourceValueConfigRequest::new().set_or_clear_resource_value_config(None::<ResourceValueConfig>);
17564 /// ```
17565 pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
17566 where
17567 T: std::convert::Into<crate::model::ResourceValueConfig>,
17568 {
17569 self.resource_value_config = v.map(|x| x.into());
17570 self
17571 }
17572}
17573
17574impl wkt::message::Message for CreateResourceValueConfigRequest {
17575 fn typename() -> &'static str {
17576 "type.googleapis.com/google.cloud.securitycenter.v2.CreateResourceValueConfigRequest"
17577 }
17578}
17579
17580/// Request message for creating a source.
17581#[derive(Clone, Default, PartialEq)]
17582#[non_exhaustive]
17583pub struct CreateSourceRequest {
17584 /// Required. Resource name of the new source's parent. Its format should be
17585 /// `organizations/[organization_id]`.
17586 pub parent: std::string::String,
17587
17588 /// Required. The Source being created, only the display_name and description
17589 /// will be used. All other fields will be ignored.
17590 pub source: std::option::Option<crate::model::Source>,
17591
17592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17593}
17594
17595impl CreateSourceRequest {
17596 /// Creates a new default instance.
17597 pub fn new() -> Self {
17598 std::default::Default::default()
17599 }
17600
17601 /// Sets the value of [parent][crate::model::CreateSourceRequest::parent].
17602 ///
17603 /// # Example
17604 /// ```ignore,no_run
17605 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17606 /// let x = CreateSourceRequest::new().set_parent("example");
17607 /// ```
17608 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17609 self.parent = v.into();
17610 self
17611 }
17612
17613 /// Sets the value of [source][crate::model::CreateSourceRequest::source].
17614 ///
17615 /// # Example
17616 /// ```ignore,no_run
17617 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17618 /// use google_cloud_securitycenter_v2::model::Source;
17619 /// let x = CreateSourceRequest::new().set_source(Source::default()/* use setters */);
17620 /// ```
17621 pub fn set_source<T>(mut self, v: T) -> Self
17622 where
17623 T: std::convert::Into<crate::model::Source>,
17624 {
17625 self.source = std::option::Option::Some(v.into());
17626 self
17627 }
17628
17629 /// Sets or clears the value of [source][crate::model::CreateSourceRequest::source].
17630 ///
17631 /// # Example
17632 /// ```ignore,no_run
17633 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17634 /// use google_cloud_securitycenter_v2::model::Source;
17635 /// let x = CreateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
17636 /// let x = CreateSourceRequest::new().set_or_clear_source(None::<Source>);
17637 /// ```
17638 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
17639 where
17640 T: std::convert::Into<crate::model::Source>,
17641 {
17642 self.source = v.map(|x| x.into());
17643 self
17644 }
17645}
17646
17647impl wkt::message::Message for CreateSourceRequest {
17648 fn typename() -> &'static str {
17649 "type.googleapis.com/google.cloud.securitycenter.v2.CreateSourceRequest"
17650 }
17651}
17652
17653/// Request message for deleting a BigQuery export.
17654#[derive(Clone, Default, PartialEq)]
17655#[non_exhaustive]
17656pub struct DeleteBigQueryExportRequest {
17657 /// Required. The name of the BigQuery export to delete. The following list
17658 /// shows some examples of the format:
17659 ///
17660 ///
17661 /// `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
17662 ///
17663 /// + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
17664 /// + `projects/{project}/locations/{location}/bigQueryExports/{export_id}`
17665 pub name: std::string::String,
17666
17667 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17668}
17669
17670impl DeleteBigQueryExportRequest {
17671 /// Creates a new default instance.
17672 pub fn new() -> Self {
17673 std::default::Default::default()
17674 }
17675
17676 /// Sets the value of [name][crate::model::DeleteBigQueryExportRequest::name].
17677 ///
17678 /// # Example
17679 /// ```ignore,no_run
17680 /// # use google_cloud_securitycenter_v2::model::DeleteBigQueryExportRequest;
17681 /// # let organization_id = "organization_id";
17682 /// # let location_id = "location_id";
17683 /// # let export_id = "export_id";
17684 /// let x = DeleteBigQueryExportRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}"));
17685 /// ```
17686 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17687 self.name = v.into();
17688 self
17689 }
17690}
17691
17692impl wkt::message::Message for DeleteBigQueryExportRequest {
17693 fn typename() -> &'static str {
17694 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteBigQueryExportRequest"
17695 }
17696}
17697
17698/// Request message for deleting a mute config. If no location is specified,
17699/// default is global.
17700#[derive(Clone, Default, PartialEq)]
17701#[non_exhaustive]
17702pub struct DeleteMuteConfigRequest {
17703 /// Required. Name of the mute config to delete. The following list shows some
17704 /// examples of the format:
17705 ///
17706 /// + `organizations/{organization}/muteConfigs/{config_id}`
17707 ///
17708 /// `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
17709 ///
17710 /// + `folders/{folder}/muteConfigs/{config_id}`
17711 /// + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
17712 /// + `projects/{project}/muteConfigs/{config_id}`
17713 /// + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
17714 pub name: std::string::String,
17715
17716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17717}
17718
17719impl DeleteMuteConfigRequest {
17720 /// Creates a new default instance.
17721 pub fn new() -> Self {
17722 std::default::Default::default()
17723 }
17724
17725 /// Sets the value of [name][crate::model::DeleteMuteConfigRequest::name].
17726 ///
17727 /// # Example
17728 /// ```ignore,no_run
17729 /// # use google_cloud_securitycenter_v2::model::DeleteMuteConfigRequest;
17730 /// # let organization_id = "organization_id";
17731 /// # let mute_config_id = "mute_config_id";
17732 /// let x = DeleteMuteConfigRequest::new().set_name(format!("organizations/{organization_id}/muteConfigs/{mute_config_id}"));
17733 /// ```
17734 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17735 self.name = v.into();
17736 self
17737 }
17738}
17739
17740impl wkt::message::Message for DeleteMuteConfigRequest {
17741 fn typename() -> &'static str {
17742 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteMuteConfigRequest"
17743 }
17744}
17745
17746/// Request message for deleting a notification config.
17747#[derive(Clone, Default, PartialEq)]
17748#[non_exhaustive]
17749pub struct DeleteNotificationConfigRequest {
17750 /// Required. Name of the notification config to delete. The following list
17751 /// shows some examples of the format:
17752 ///
17753 ///
17754 /// `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
17755 /// +
17756 /// `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]`
17757 /// +
17758 /// `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]`
17759 pub name: std::string::String,
17760
17761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17762}
17763
17764impl DeleteNotificationConfigRequest {
17765 /// Creates a new default instance.
17766 pub fn new() -> Self {
17767 std::default::Default::default()
17768 }
17769
17770 /// Sets the value of [name][crate::model::DeleteNotificationConfigRequest::name].
17771 ///
17772 /// # Example
17773 /// ```ignore,no_run
17774 /// # use google_cloud_securitycenter_v2::model::DeleteNotificationConfigRequest;
17775 /// # let organization_id = "organization_id";
17776 /// # let location_id = "location_id";
17777 /// # let notification_config_id = "notification_config_id";
17778 /// let x = DeleteNotificationConfigRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/notificationConfigs/{notification_config_id}"));
17779 /// ```
17780 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17781 self.name = v.into();
17782 self
17783 }
17784}
17785
17786impl wkt::message::Message for DeleteNotificationConfigRequest {
17787 fn typename() -> &'static str {
17788 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteNotificationConfigRequest"
17789 }
17790}
17791
17792/// Request message to delete resource value config
17793#[derive(Clone, Default, PartialEq)]
17794#[non_exhaustive]
17795pub struct DeleteResourceValueConfigRequest {
17796 /// Required. Name of the ResourceValueConfig to delete
17797 pub name: std::string::String,
17798
17799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17800}
17801
17802impl DeleteResourceValueConfigRequest {
17803 /// Creates a new default instance.
17804 pub fn new() -> Self {
17805 std::default::Default::default()
17806 }
17807
17808 /// Sets the value of [name][crate::model::DeleteResourceValueConfigRequest::name].
17809 ///
17810 /// # Example
17811 /// ```ignore,no_run
17812 /// # use google_cloud_securitycenter_v2::model::DeleteResourceValueConfigRequest;
17813 /// # let organization_id = "organization_id";
17814 /// # let resource_value_config_id = "resource_value_config_id";
17815 /// let x = DeleteResourceValueConfigRequest::new().set_name(format!("organizations/{organization_id}/resourceValueConfigs/{resource_value_config_id}"));
17816 /// ```
17817 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17818 self.name = v.into();
17819 self
17820 }
17821}
17822
17823impl wkt::message::Message for DeleteResourceValueConfigRequest {
17824 fn typename() -> &'static str {
17825 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest"
17826 }
17827}
17828
17829/// The destination big query dataset to export findings to.
17830#[derive(Clone, Default, PartialEq)]
17831#[non_exhaustive]
17832pub struct BigQueryDestination {
17833 /// Required. The relative resource name of the destination dataset, in the
17834 /// form projects/{projectId}/datasets/{datasetId}.
17835 pub dataset: std::string::String,
17836
17837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17838}
17839
17840impl BigQueryDestination {
17841 /// Creates a new default instance.
17842 pub fn new() -> Self {
17843 std::default::Default::default()
17844 }
17845
17846 /// Sets the value of [dataset][crate::model::BigQueryDestination::dataset].
17847 ///
17848 /// # Example
17849 /// ```ignore,no_run
17850 /// # use google_cloud_securitycenter_v2::model::BigQueryDestination;
17851 /// let x = BigQueryDestination::new().set_dataset("example");
17852 /// ```
17853 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17854 self.dataset = v.into();
17855 self
17856 }
17857}
17858
17859impl wkt::message::Message for BigQueryDestination {
17860 fn typename() -> &'static str {
17861 "type.googleapis.com/google.cloud.securitycenter.v2.BigQueryDestination"
17862 }
17863}
17864
17865/// The LRO metadata for a ExportFindings request.
17866#[derive(Clone, Default, PartialEq)]
17867#[non_exhaustive]
17868pub struct ExportFindingsMetadata {
17869 /// Optional. Timestamp at which export was started
17870 pub export_start_time: std::option::Option<wkt::Timestamp>,
17871
17872 /// The destination to export findings to.
17873 pub destination: std::option::Option<crate::model::export_findings_metadata::Destination>,
17874
17875 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17876}
17877
17878impl ExportFindingsMetadata {
17879 /// Creates a new default instance.
17880 pub fn new() -> Self {
17881 std::default::Default::default()
17882 }
17883
17884 /// Sets the value of [export_start_time][crate::model::ExportFindingsMetadata::export_start_time].
17885 ///
17886 /// # Example
17887 /// ```ignore,no_run
17888 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17889 /// use wkt::Timestamp;
17890 /// let x = ExportFindingsMetadata::new().set_export_start_time(Timestamp::default()/* use setters */);
17891 /// ```
17892 pub fn set_export_start_time<T>(mut self, v: T) -> Self
17893 where
17894 T: std::convert::Into<wkt::Timestamp>,
17895 {
17896 self.export_start_time = std::option::Option::Some(v.into());
17897 self
17898 }
17899
17900 /// Sets or clears the value of [export_start_time][crate::model::ExportFindingsMetadata::export_start_time].
17901 ///
17902 /// # Example
17903 /// ```ignore,no_run
17904 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17905 /// use wkt::Timestamp;
17906 /// let x = ExportFindingsMetadata::new().set_or_clear_export_start_time(Some(Timestamp::default()/* use setters */));
17907 /// let x = ExportFindingsMetadata::new().set_or_clear_export_start_time(None::<Timestamp>);
17908 /// ```
17909 pub fn set_or_clear_export_start_time<T>(mut self, v: std::option::Option<T>) -> Self
17910 where
17911 T: std::convert::Into<wkt::Timestamp>,
17912 {
17913 self.export_start_time = v.map(|x| x.into());
17914 self
17915 }
17916
17917 /// Sets the value of [destination][crate::model::ExportFindingsMetadata::destination].
17918 ///
17919 /// Note that all the setters affecting `destination` are mutually
17920 /// exclusive.
17921 ///
17922 /// # Example
17923 /// ```ignore,no_run
17924 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17925 /// use google_cloud_securitycenter_v2::model::BigQueryDestination;
17926 /// let x = ExportFindingsMetadata::new().set_destination(Some(
17927 /// google_cloud_securitycenter_v2::model::export_findings_metadata::Destination::BigQueryDestination(BigQueryDestination::default().into())));
17928 /// ```
17929 pub fn set_destination<
17930 T: std::convert::Into<
17931 std::option::Option<crate::model::export_findings_metadata::Destination>,
17932 >,
17933 >(
17934 mut self,
17935 v: T,
17936 ) -> Self {
17937 self.destination = v.into();
17938 self
17939 }
17940
17941 /// The value of [destination][crate::model::ExportFindingsMetadata::destination]
17942 /// if it holds a `BigQueryDestination`, `None` if the field is not set or
17943 /// holds a different branch.
17944 pub fn big_query_destination(
17945 &self,
17946 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestination>> {
17947 #[allow(unreachable_patterns)]
17948 self.destination.as_ref().and_then(|v| match v {
17949 crate::model::export_findings_metadata::Destination::BigQueryDestination(v) => {
17950 std::option::Option::Some(v)
17951 }
17952 _ => std::option::Option::None,
17953 })
17954 }
17955
17956 /// Sets the value of [destination][crate::model::ExportFindingsMetadata::destination]
17957 /// to hold a `BigQueryDestination`.
17958 ///
17959 /// Note that all the setters affecting `destination` are
17960 /// mutually exclusive.
17961 ///
17962 /// # Example
17963 /// ```ignore,no_run
17964 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17965 /// use google_cloud_securitycenter_v2::model::BigQueryDestination;
17966 /// let x = ExportFindingsMetadata::new().set_big_query_destination(BigQueryDestination::default()/* use setters */);
17967 /// assert!(x.big_query_destination().is_some());
17968 /// ```
17969 pub fn set_big_query_destination<
17970 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestination>>,
17971 >(
17972 mut self,
17973 v: T,
17974 ) -> Self {
17975 self.destination = std::option::Option::Some(
17976 crate::model::export_findings_metadata::Destination::BigQueryDestination(v.into()),
17977 );
17978 self
17979 }
17980}
17981
17982impl wkt::message::Message for ExportFindingsMetadata {
17983 fn typename() -> &'static str {
17984 "type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsMetadata"
17985 }
17986}
17987
17988/// Defines additional types related to [ExportFindingsMetadata].
17989pub mod export_findings_metadata {
17990 #[allow(unused_imports)]
17991 use super::*;
17992
17993 /// The destination to export findings to.
17994 #[derive(Clone, Debug, PartialEq)]
17995 #[non_exhaustive]
17996 pub enum Destination {
17997 /// Required. The destination big query dataset to export findings to.
17998 BigQueryDestination(std::boxed::Box<crate::model::BigQueryDestination>),
17999 }
18000}
18001
18002/// The response to a ExportFindings request. Contains the LRO information.
18003#[derive(Clone, Default, PartialEq)]
18004#[non_exhaustive]
18005pub struct ExportFindingsResponse {
18006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18007}
18008
18009impl ExportFindingsResponse {
18010 /// Creates a new default instance.
18011 pub fn new() -> Self {
18012 std::default::Default::default()
18013 }
18014}
18015
18016impl wkt::message::Message for ExportFindingsResponse {
18017 fn typename() -> &'static str {
18018 "type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsResponse"
18019 }
18020}
18021
18022/// Request message for retrieving a BigQuery export.
18023#[derive(Clone, Default, PartialEq)]
18024#[non_exhaustive]
18025pub struct GetBigQueryExportRequest {
18026 /// Required. Name of the BigQuery export to retrieve. The following list shows
18027 /// some examples of the format:
18028 ///
18029 ///
18030 /// `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
18031 ///
18032 /// + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
18033 /// + `projects/{project}locations/{location}//bigQueryExports/{export_id}`
18034 pub name: std::string::String,
18035
18036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18037}
18038
18039impl GetBigQueryExportRequest {
18040 /// Creates a new default instance.
18041 pub fn new() -> Self {
18042 std::default::Default::default()
18043 }
18044
18045 /// Sets the value of [name][crate::model::GetBigQueryExportRequest::name].
18046 ///
18047 /// # Example
18048 /// ```ignore,no_run
18049 /// # use google_cloud_securitycenter_v2::model::GetBigQueryExportRequest;
18050 /// # let organization_id = "organization_id";
18051 /// # let location_id = "location_id";
18052 /// # let export_id = "export_id";
18053 /// let x = GetBigQueryExportRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}"));
18054 /// ```
18055 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18056 self.name = v.into();
18057 self
18058 }
18059}
18060
18061impl wkt::message::Message for GetBigQueryExportRequest {
18062 fn typename() -> &'static str {
18063 "type.googleapis.com/google.cloud.securitycenter.v2.GetBigQueryExportRequest"
18064 }
18065}
18066
18067/// Request message for retrieving a mute config. If no location is specified,
18068/// default is global.
18069#[derive(Clone, Default, PartialEq)]
18070#[non_exhaustive]
18071pub struct GetMuteConfigRequest {
18072 /// Required. Name of the mute config to retrieve. The following list shows
18073 /// some examples of the format:
18074 ///
18075 /// + `organizations/{organization}/muteConfigs/{config_id}`
18076 ///
18077 /// `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
18078 ///
18079 /// + `folders/{folder}/muteConfigs/{config_id}`
18080 /// + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
18081 /// + `projects/{project}/muteConfigs/{config_id}`
18082 /// + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
18083 pub name: std::string::String,
18084
18085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18086}
18087
18088impl GetMuteConfigRequest {
18089 /// Creates a new default instance.
18090 pub fn new() -> Self {
18091 std::default::Default::default()
18092 }
18093
18094 /// Sets the value of [name][crate::model::GetMuteConfigRequest::name].
18095 ///
18096 /// # Example
18097 /// ```ignore,no_run
18098 /// # use google_cloud_securitycenter_v2::model::GetMuteConfigRequest;
18099 /// # let organization_id = "organization_id";
18100 /// # let mute_config_id = "mute_config_id";
18101 /// let x = GetMuteConfigRequest::new().set_name(format!("organizations/{organization_id}/muteConfigs/{mute_config_id}"));
18102 /// ```
18103 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18104 self.name = v.into();
18105 self
18106 }
18107}
18108
18109impl wkt::message::Message for GetMuteConfigRequest {
18110 fn typename() -> &'static str {
18111 "type.googleapis.com/google.cloud.securitycenter.v2.GetMuteConfigRequest"
18112 }
18113}
18114
18115/// Request message for getting a notification config.
18116#[derive(Clone, Default, PartialEq)]
18117#[non_exhaustive]
18118pub struct GetNotificationConfigRequest {
18119 /// Required. Name of the notification config to get. The following list shows
18120 /// some examples of the format:
18121 ///
18122 ///
18123 /// `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
18124 /// +
18125 /// `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]`
18126 /// +
18127 /// `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]`
18128 pub name: std::string::String,
18129
18130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18131}
18132
18133impl GetNotificationConfigRequest {
18134 /// Creates a new default instance.
18135 pub fn new() -> Self {
18136 std::default::Default::default()
18137 }
18138
18139 /// Sets the value of [name][crate::model::GetNotificationConfigRequest::name].
18140 ///
18141 /// # Example
18142 /// ```ignore,no_run
18143 /// # use google_cloud_securitycenter_v2::model::GetNotificationConfigRequest;
18144 /// # let organization_id = "organization_id";
18145 /// # let location_id = "location_id";
18146 /// # let notification_config_id = "notification_config_id";
18147 /// let x = GetNotificationConfigRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/notificationConfigs/{notification_config_id}"));
18148 /// ```
18149 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18150 self.name = v.into();
18151 self
18152 }
18153}
18154
18155impl wkt::message::Message for GetNotificationConfigRequest {
18156 fn typename() -> &'static str {
18157 "type.googleapis.com/google.cloud.securitycenter.v2.GetNotificationConfigRequest"
18158 }
18159}
18160
18161/// Request message to get resource value config
18162#[derive(Clone, Default, PartialEq)]
18163#[non_exhaustive]
18164pub struct GetResourceValueConfigRequest {
18165 /// Required. Name of the resource value config to retrieve. Its format is
18166 /// organizations/{organization}/resourceValueConfigs/{config_id}.
18167 pub name: std::string::String,
18168
18169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18170}
18171
18172impl GetResourceValueConfigRequest {
18173 /// Creates a new default instance.
18174 pub fn new() -> Self {
18175 std::default::Default::default()
18176 }
18177
18178 /// Sets the value of [name][crate::model::GetResourceValueConfigRequest::name].
18179 ///
18180 /// # Example
18181 /// ```ignore,no_run
18182 /// # use google_cloud_securitycenter_v2::model::GetResourceValueConfigRequest;
18183 /// # let organization_id = "organization_id";
18184 /// # let resource_value_config_id = "resource_value_config_id";
18185 /// let x = GetResourceValueConfigRequest::new().set_name(format!("organizations/{organization_id}/resourceValueConfigs/{resource_value_config_id}"));
18186 /// ```
18187 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18188 self.name = v.into();
18189 self
18190 }
18191}
18192
18193impl wkt::message::Message for GetResourceValueConfigRequest {
18194 fn typename() -> &'static str {
18195 "type.googleapis.com/google.cloud.securitycenter.v2.GetResourceValueConfigRequest"
18196 }
18197}
18198
18199/// Request message for getting a source.
18200#[derive(Clone, Default, PartialEq)]
18201#[non_exhaustive]
18202pub struct GetSourceRequest {
18203 /// Required. Relative resource name of the source. Its format is
18204 /// `organizations/[organization_id]/source/[source_id]`.
18205 pub name: std::string::String,
18206
18207 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18208}
18209
18210impl GetSourceRequest {
18211 /// Creates a new default instance.
18212 pub fn new() -> Self {
18213 std::default::Default::default()
18214 }
18215
18216 /// Sets the value of [name][crate::model::GetSourceRequest::name].
18217 ///
18218 /// # Example
18219 /// ```ignore,no_run
18220 /// # use google_cloud_securitycenter_v2::model::GetSourceRequest;
18221 /// # let organization_id = "organization_id";
18222 /// # let source_id = "source_id";
18223 /// let x = GetSourceRequest::new().set_name(format!("organizations/{organization_id}/sources/{source_id}"));
18224 /// ```
18225 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18226 self.name = v.into();
18227 self
18228 }
18229}
18230
18231impl wkt::message::Message for GetSourceRequest {
18232 fn typename() -> &'static str {
18233 "type.googleapis.com/google.cloud.securitycenter.v2.GetSourceRequest"
18234 }
18235}
18236
18237/// Request message for grouping by findings.
18238#[derive(Clone, Default, PartialEq)]
18239#[non_exhaustive]
18240pub struct GroupFindingsRequest {
18241 /// Required. Name of the source to groupBy. If no location is specified,
18242 /// finding is assumed to be in global.
18243 /// The following list shows some examples:
18244 ///
18245 /// + `organizations/[organization_id]/sources/[source_id]`
18246 ///
18247 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
18248 ///
18249 /// + `folders/[folder_id]/sources/[source_id]`
18250 /// + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
18251 /// + `projects/[project_id]/sources/[source_id]`
18252 /// + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
18253 ///
18254 /// To groupBy across all sources provide a source_id of `-`. The following
18255 /// list shows some examples:
18256 ///
18257 /// + `organizations/{organization_id}/sources/-`
18258 /// + `organizations/{organization_id}/sources/-/locations/[location_id]`
18259 /// + `folders/{folder_id}/sources/-`
18260 /// + `folders/{folder_id}/sources/-/locations/[location_id]`
18261 /// + `projects/{project_id}/sources/-`
18262 /// + `projects/{project_id}/sources/-/locations/[location_id]`
18263 pub parent: std::string::String,
18264
18265 /// Expression that defines the filter to apply across findings.
18266 /// The expression is a list of one or more restrictions combined via logical
18267 /// operators `AND` and `OR`.
18268 /// Parentheses are supported, and `OR` has higher precedence than `AND`.
18269 ///
18270 /// Restrictions have the form `<field> <operator> <value>` and may have a `-`
18271 /// character in front of them to indicate negation. Examples include:
18272 ///
18273 /// * name
18274 /// * security_marks.marks.marka
18275 ///
18276 /// The supported operators are:
18277 ///
18278 /// * `=` for all value types.
18279 /// * `>`, `<`, `>=`, `<=` for integer values.
18280 /// * `:`, meaning substring matching, for strings.
18281 ///
18282 /// The supported value types are:
18283 ///
18284 /// * string literals in quotes.
18285 /// * integer literals without quotes.
18286 /// * boolean literals `true` and `false` without quotes.
18287 ///
18288 /// The following field and operator combinations are supported:
18289 ///
18290 /// * name: `=`
18291 ///
18292 /// * parent: `=`, `:`
18293 ///
18294 /// * resource_name: `=`, `:`
18295 ///
18296 /// * state: `=`, `:`
18297 ///
18298 /// * category: `=`, `:`
18299 ///
18300 /// * external_uri: `=`, `:`
18301 ///
18302 /// * event_time: `=`, `>`, `<`, `>=`, `<=`
18303 ///
18304 /// Usage: This should be milliseconds since epoch or an RFC3339 string.
18305 /// Examples:
18306 /// `event_time = "2019-06-10T16:07:18-07:00"`
18307 /// `event_time = 1560208038000`
18308 ///
18309 /// * severity: `=`, `:`
18310 ///
18311 /// * security_marks.marks: `=`, `:`
18312 ///
18313 /// * resource:
18314 ///
18315 /// * resource.name: `=`, `:`
18316 /// * resource.parent_name: `=`, `:`
18317 /// * resource.parent_display_name: `=`, `:`
18318 /// * resource.project_name: `=`, `:`
18319 /// * resource.project_display_name: `=`, `:`
18320 /// * resource.type: `=`, `:`
18321 pub filter: std::string::String,
18322
18323 /// Required. Expression that defines what assets fields to use for grouping.
18324 /// The string value should follow SQL syntax: comma separated list of fields.
18325 /// For example: "parent,resource_name".
18326 pub group_by: std::string::String,
18327
18328 /// The value returned by the last `GroupFindingsResponse`; indicates
18329 /// that this is a continuation of a prior `GroupFindings` call, and
18330 /// that the system should return the next page of data.
18331 pub page_token: std::string::String,
18332
18333 /// The maximum number of results to return in a single response. Default is
18334 /// 10, minimum is 1, maximum is 1000.
18335 pub page_size: i32,
18336
18337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18338}
18339
18340impl GroupFindingsRequest {
18341 /// Creates a new default instance.
18342 pub fn new() -> Self {
18343 std::default::Default::default()
18344 }
18345
18346 /// Sets the value of [parent][crate::model::GroupFindingsRequest::parent].
18347 ///
18348 /// # Example
18349 /// ```ignore,no_run
18350 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18351 /// # let organization_id = "organization_id";
18352 /// # let source_id = "source_id";
18353 /// let x = GroupFindingsRequest::new().set_parent(format!("organizations/{organization_id}/sources/{source_id}"));
18354 /// ```
18355 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18356 self.parent = v.into();
18357 self
18358 }
18359
18360 /// Sets the value of [filter][crate::model::GroupFindingsRequest::filter].
18361 ///
18362 /// # Example
18363 /// ```ignore,no_run
18364 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18365 /// let x = GroupFindingsRequest::new().set_filter("example");
18366 /// ```
18367 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18368 self.filter = v.into();
18369 self
18370 }
18371
18372 /// Sets the value of [group_by][crate::model::GroupFindingsRequest::group_by].
18373 ///
18374 /// # Example
18375 /// ```ignore,no_run
18376 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18377 /// let x = GroupFindingsRequest::new().set_group_by("example");
18378 /// ```
18379 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18380 self.group_by = v.into();
18381 self
18382 }
18383
18384 /// Sets the value of [page_token][crate::model::GroupFindingsRequest::page_token].
18385 ///
18386 /// # Example
18387 /// ```ignore,no_run
18388 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18389 /// let x = GroupFindingsRequest::new().set_page_token("example");
18390 /// ```
18391 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18392 self.page_token = v.into();
18393 self
18394 }
18395
18396 /// Sets the value of [page_size][crate::model::GroupFindingsRequest::page_size].
18397 ///
18398 /// # Example
18399 /// ```ignore,no_run
18400 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18401 /// let x = GroupFindingsRequest::new().set_page_size(42);
18402 /// ```
18403 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18404 self.page_size = v.into();
18405 self
18406 }
18407}
18408
18409impl wkt::message::Message for GroupFindingsRequest {
18410 fn typename() -> &'static str {
18411 "type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsRequest"
18412 }
18413}
18414
18415/// Response message for group by findings.
18416#[derive(Clone, Default, PartialEq)]
18417#[non_exhaustive]
18418pub struct GroupFindingsResponse {
18419 /// Group results. There exists an element for each existing unique
18420 /// combination of property/values. The element contains a count for the number
18421 /// of times those specific property/values appear.
18422 pub group_by_results: std::vec::Vec<crate::model::GroupResult>,
18423
18424 /// Token to retrieve the next page of results, or empty if there are no more
18425 /// results.
18426 pub next_page_token: std::string::String,
18427
18428 /// The total number of results matching the query.
18429 pub total_size: i32,
18430
18431 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18432}
18433
18434impl GroupFindingsResponse {
18435 /// Creates a new default instance.
18436 pub fn new() -> Self {
18437 std::default::Default::default()
18438 }
18439
18440 /// Sets the value of [group_by_results][crate::model::GroupFindingsResponse::group_by_results].
18441 ///
18442 /// # Example
18443 /// ```ignore,no_run
18444 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18445 /// use google_cloud_securitycenter_v2::model::GroupResult;
18446 /// let x = GroupFindingsResponse::new()
18447 /// .set_group_by_results([
18448 /// GroupResult::default()/* use setters */,
18449 /// GroupResult::default()/* use (different) setters */,
18450 /// ]);
18451 /// ```
18452 pub fn set_group_by_results<T, V>(mut self, v: T) -> Self
18453 where
18454 T: std::iter::IntoIterator<Item = V>,
18455 V: std::convert::Into<crate::model::GroupResult>,
18456 {
18457 use std::iter::Iterator;
18458 self.group_by_results = v.into_iter().map(|i| i.into()).collect();
18459 self
18460 }
18461
18462 /// Sets the value of [next_page_token][crate::model::GroupFindingsResponse::next_page_token].
18463 ///
18464 /// # Example
18465 /// ```ignore,no_run
18466 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18467 /// let x = GroupFindingsResponse::new().set_next_page_token("example");
18468 /// ```
18469 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18470 self.next_page_token = v.into();
18471 self
18472 }
18473
18474 /// Sets the value of [total_size][crate::model::GroupFindingsResponse::total_size].
18475 ///
18476 /// # Example
18477 /// ```ignore,no_run
18478 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18479 /// let x = GroupFindingsResponse::new().set_total_size(42);
18480 /// ```
18481 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18482 self.total_size = v.into();
18483 self
18484 }
18485}
18486
18487impl wkt::message::Message for GroupFindingsResponse {
18488 fn typename() -> &'static str {
18489 "type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsResponse"
18490 }
18491}
18492
18493#[doc(hidden)]
18494impl google_cloud_gax::paginator::internal::PageableResponse for GroupFindingsResponse {
18495 type PageItem = crate::model::GroupResult;
18496
18497 fn items(self) -> std::vec::Vec<Self::PageItem> {
18498 self.group_by_results
18499 }
18500
18501 fn next_page_token(&self) -> std::string::String {
18502 use std::clone::Clone;
18503 self.next_page_token.clone()
18504 }
18505}
18506
18507/// Result containing the properties and count of a groupBy request.
18508#[derive(Clone, Default, PartialEq)]
18509#[non_exhaustive]
18510pub struct GroupResult {
18511 /// Properties matching the groupBy fields in the request.
18512 pub properties: std::collections::HashMap<std::string::String, wkt::Value>,
18513
18514 /// Total count of resources for the given properties.
18515 pub count: i64,
18516
18517 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18518}
18519
18520impl GroupResult {
18521 /// Creates a new default instance.
18522 pub fn new() -> Self {
18523 std::default::Default::default()
18524 }
18525
18526 /// Sets the value of [properties][crate::model::GroupResult::properties].
18527 ///
18528 /// # Example
18529 /// ```ignore,no_run
18530 /// # use google_cloud_securitycenter_v2::model::GroupResult;
18531 /// use wkt::Value;
18532 /// let x = GroupResult::new().set_properties([
18533 /// ("key0", Value::default()/* use setters */),
18534 /// ("key1", Value::default()/* use (different) setters */),
18535 /// ]);
18536 /// ```
18537 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
18538 where
18539 T: std::iter::IntoIterator<Item = (K, V)>,
18540 K: std::convert::Into<std::string::String>,
18541 V: std::convert::Into<wkt::Value>,
18542 {
18543 use std::iter::Iterator;
18544 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18545 self
18546 }
18547
18548 /// Sets the value of [count][crate::model::GroupResult::count].
18549 ///
18550 /// # Example
18551 /// ```ignore,no_run
18552 /// # use google_cloud_securitycenter_v2::model::GroupResult;
18553 /// let x = GroupResult::new().set_count(42);
18554 /// ```
18555 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18556 self.count = v.into();
18557 self
18558 }
18559}
18560
18561impl wkt::message::Message for GroupResult {
18562 fn typename() -> &'static str {
18563 "type.googleapis.com/google.cloud.securitycenter.v2.GroupResult"
18564 }
18565}
18566
18567/// Request message for listing the attack paths for a given simulation or valued
18568/// resource.
18569#[derive(Clone, Default, PartialEq)]
18570#[non_exhaustive]
18571pub struct ListAttackPathsRequest {
18572 /// Required. Name of parent to list attack paths.
18573 ///
18574 /// Valid formats:
18575 /// `organizations/{organization}`,
18576 /// `organizations/{organization}/simulations/{simulation}`
18577 /// `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
18578 /// `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
18579 pub parent: std::string::String,
18580
18581 /// The filter expression that filters the attack path in the response.
18582 /// Supported fields:
18583 ///
18584 /// * `valued_resources` supports =
18585 pub filter: std::string::String,
18586
18587 /// The value returned by the last `ListAttackPathsResponse`; indicates
18588 /// that this is a continuation of a prior `ListAttackPaths` call, and
18589 /// that the system should return the next page of data.
18590 pub page_token: std::string::String,
18591
18592 /// The maximum number of results to return in a single response. Default is
18593 /// 10, minimum is 1, maximum is 1000.
18594 pub page_size: i32,
18595
18596 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18597}
18598
18599impl ListAttackPathsRequest {
18600 /// Creates a new default instance.
18601 pub fn new() -> Self {
18602 std::default::Default::default()
18603 }
18604
18605 /// Sets the value of [parent][crate::model::ListAttackPathsRequest::parent].
18606 ///
18607 /// # Example
18608 /// ```ignore,no_run
18609 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18610 /// # let organization_id = "organization_id";
18611 /// # let simulation_id = "simulation_id";
18612 /// # let valued_resource_id = "valued_resource_id";
18613 /// let x = ListAttackPathsRequest::new().set_parent(format!("organizations/{organization_id}/simulations/{simulation_id}/valuedResources/{valued_resource_id}"));
18614 /// ```
18615 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18616 self.parent = v.into();
18617 self
18618 }
18619
18620 /// Sets the value of [filter][crate::model::ListAttackPathsRequest::filter].
18621 ///
18622 /// # Example
18623 /// ```ignore,no_run
18624 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18625 /// let x = ListAttackPathsRequest::new().set_filter("example");
18626 /// ```
18627 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18628 self.filter = v.into();
18629 self
18630 }
18631
18632 /// Sets the value of [page_token][crate::model::ListAttackPathsRequest::page_token].
18633 ///
18634 /// # Example
18635 /// ```ignore,no_run
18636 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18637 /// let x = ListAttackPathsRequest::new().set_page_token("example");
18638 /// ```
18639 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18640 self.page_token = v.into();
18641 self
18642 }
18643
18644 /// Sets the value of [page_size][crate::model::ListAttackPathsRequest::page_size].
18645 ///
18646 /// # Example
18647 /// ```ignore,no_run
18648 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18649 /// let x = ListAttackPathsRequest::new().set_page_size(42);
18650 /// ```
18651 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18652 self.page_size = v.into();
18653 self
18654 }
18655}
18656
18657impl wkt::message::Message for ListAttackPathsRequest {
18658 fn typename() -> &'static str {
18659 "type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsRequest"
18660 }
18661}
18662
18663/// Response message for listing the attack paths for a given simulation or
18664/// valued resource.
18665#[derive(Clone, Default, PartialEq)]
18666#[non_exhaustive]
18667pub struct ListAttackPathsResponse {
18668 /// The attack paths that the attack path simulation identified.
18669 pub attack_paths: std::vec::Vec<crate::model::AttackPath>,
18670
18671 /// Token to retrieve the next page of results, or empty if there are no more
18672 /// results.
18673 pub next_page_token: std::string::String,
18674
18675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18676}
18677
18678impl ListAttackPathsResponse {
18679 /// Creates a new default instance.
18680 pub fn new() -> Self {
18681 std::default::Default::default()
18682 }
18683
18684 /// Sets the value of [attack_paths][crate::model::ListAttackPathsResponse::attack_paths].
18685 ///
18686 /// # Example
18687 /// ```ignore,no_run
18688 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsResponse;
18689 /// use google_cloud_securitycenter_v2::model::AttackPath;
18690 /// let x = ListAttackPathsResponse::new()
18691 /// .set_attack_paths([
18692 /// AttackPath::default()/* use setters */,
18693 /// AttackPath::default()/* use (different) setters */,
18694 /// ]);
18695 /// ```
18696 pub fn set_attack_paths<T, V>(mut self, v: T) -> Self
18697 where
18698 T: std::iter::IntoIterator<Item = V>,
18699 V: std::convert::Into<crate::model::AttackPath>,
18700 {
18701 use std::iter::Iterator;
18702 self.attack_paths = v.into_iter().map(|i| i.into()).collect();
18703 self
18704 }
18705
18706 /// Sets the value of [next_page_token][crate::model::ListAttackPathsResponse::next_page_token].
18707 ///
18708 /// # Example
18709 /// ```ignore,no_run
18710 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsResponse;
18711 /// let x = ListAttackPathsResponse::new().set_next_page_token("example");
18712 /// ```
18713 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18714 self.next_page_token = v.into();
18715 self
18716 }
18717}
18718
18719impl wkt::message::Message for ListAttackPathsResponse {
18720 fn typename() -> &'static str {
18721 "type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsResponse"
18722 }
18723}
18724
18725#[doc(hidden)]
18726impl google_cloud_gax::paginator::internal::PageableResponse for ListAttackPathsResponse {
18727 type PageItem = crate::model::AttackPath;
18728
18729 fn items(self) -> std::vec::Vec<Self::PageItem> {
18730 self.attack_paths
18731 }
18732
18733 fn next_page_token(&self) -> std::string::String {
18734 use std::clone::Clone;
18735 self.next_page_token.clone()
18736 }
18737}
18738
18739/// Request message for getting simulation.
18740/// Simulation name can include "latest" to retrieve the latest simulation
18741/// For example, "organizations/123/simulations/latest"
18742#[derive(Clone, Default, PartialEq)]
18743#[non_exhaustive]
18744pub struct GetSimulationRequest {
18745 /// Required. The organization name or simulation name of this simulation
18746 ///
18747 /// Valid format:
18748 /// `organizations/{organization}/simulations/latest`
18749 /// `organizations/{organization}/simulations/{simulation}`
18750 pub name: std::string::String,
18751
18752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18753}
18754
18755impl GetSimulationRequest {
18756 /// Creates a new default instance.
18757 pub fn new() -> Self {
18758 std::default::Default::default()
18759 }
18760
18761 /// Sets the value of [name][crate::model::GetSimulationRequest::name].
18762 ///
18763 /// # Example
18764 /// ```ignore,no_run
18765 /// # use google_cloud_securitycenter_v2::model::GetSimulationRequest;
18766 /// # let organization_id = "organization_id";
18767 /// # let simulation_id = "simulation_id";
18768 /// let x = GetSimulationRequest::new().set_name(format!("organizations/{organization_id}/simulations/{simulation_id}"));
18769 /// ```
18770 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18771 self.name = v.into();
18772 self
18773 }
18774}
18775
18776impl wkt::message::Message for GetSimulationRequest {
18777 fn typename() -> &'static str {
18778 "type.googleapis.com/google.cloud.securitycenter.v2.GetSimulationRequest"
18779 }
18780}
18781
18782/// Request message for getting a valued resource.
18783#[derive(Clone, Default, PartialEq)]
18784#[non_exhaustive]
18785pub struct GetValuedResourceRequest {
18786 /// Required. The name of this valued resource
18787 ///
18788 /// Valid format:
18789 /// `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
18790 pub name: std::string::String,
18791
18792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18793}
18794
18795impl GetValuedResourceRequest {
18796 /// Creates a new default instance.
18797 pub fn new() -> Self {
18798 std::default::Default::default()
18799 }
18800
18801 /// Sets the value of [name][crate::model::GetValuedResourceRequest::name].
18802 ///
18803 /// # Example
18804 /// ```ignore,no_run
18805 /// # use google_cloud_securitycenter_v2::model::GetValuedResourceRequest;
18806 /// # let organization_id = "organization_id";
18807 /// # let simulation_id = "simulation_id";
18808 /// # let valued_resource_id = "valued_resource_id";
18809 /// let x = GetValuedResourceRequest::new().set_name(format!("organizations/{organization_id}/simulations/{simulation_id}/valuedResources/{valued_resource_id}"));
18810 /// ```
18811 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18812 self.name = v.into();
18813 self
18814 }
18815}
18816
18817impl wkt::message::Message for GetValuedResourceRequest {
18818 fn typename() -> &'static str {
18819 "type.googleapis.com/google.cloud.securitycenter.v2.GetValuedResourceRequest"
18820 }
18821}
18822
18823/// Request message for listing BigQuery exports at a given scope e.g.
18824/// organization, folder or project.
18825#[derive(Clone, Default, PartialEq)]
18826#[non_exhaustive]
18827pub struct ListBigQueryExportsRequest {
18828 /// Required. The parent, which owns the collection of BigQuery exports. Its
18829 /// format is `organizations/[organization_id]/locations/[location_id]`,
18830 /// `folders/[folder_id]/locations/[location_id]`, or
18831 /// `projects/[project_id]/locations/[location_id]`.
18832 pub parent: std::string::String,
18833
18834 /// The maximum number of configs to return. The service may return fewer than
18835 /// this value.
18836 /// If unspecified, at most 10 configs will be returned.
18837 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
18838 pub page_size: i32,
18839
18840 /// A page token, received from a previous `ListBigQueryExports` call.
18841 /// Provide this to retrieve the subsequent page.
18842 /// When paginating, all other parameters provided to `ListBigQueryExports`
18843 /// must match the call that provided the page token.
18844 pub page_token: std::string::String,
18845
18846 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18847}
18848
18849impl ListBigQueryExportsRequest {
18850 /// Creates a new default instance.
18851 pub fn new() -> Self {
18852 std::default::Default::default()
18853 }
18854
18855 /// Sets the value of [parent][crate::model::ListBigQueryExportsRequest::parent].
18856 ///
18857 /// # Example
18858 /// ```ignore,no_run
18859 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18860 /// # let organization_id = "organization_id";
18861 /// # let location_id = "location_id";
18862 /// let x = ListBigQueryExportsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
18863 /// ```
18864 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18865 self.parent = v.into();
18866 self
18867 }
18868
18869 /// Sets the value of [page_size][crate::model::ListBigQueryExportsRequest::page_size].
18870 ///
18871 /// # Example
18872 /// ```ignore,no_run
18873 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18874 /// let x = ListBigQueryExportsRequest::new().set_page_size(42);
18875 /// ```
18876 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18877 self.page_size = v.into();
18878 self
18879 }
18880
18881 /// Sets the value of [page_token][crate::model::ListBigQueryExportsRequest::page_token].
18882 ///
18883 /// # Example
18884 /// ```ignore,no_run
18885 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18886 /// let x = ListBigQueryExportsRequest::new().set_page_token("example");
18887 /// ```
18888 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18889 self.page_token = v.into();
18890 self
18891 }
18892}
18893
18894impl wkt::message::Message for ListBigQueryExportsRequest {
18895 fn typename() -> &'static str {
18896 "type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsRequest"
18897 }
18898}
18899
18900/// Response message for listing BigQuery exports.
18901#[derive(Clone, Default, PartialEq)]
18902#[non_exhaustive]
18903pub struct ListBigQueryExportsResponse {
18904 /// The BigQuery exports from the specified parent.
18905 pub big_query_exports: std::vec::Vec<crate::model::BigQueryExport>,
18906
18907 /// A token, which can be sent as `page_token` to retrieve the next page.
18908 /// If this field is omitted, there are no subsequent pages.
18909 pub next_page_token: std::string::String,
18910
18911 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18912}
18913
18914impl ListBigQueryExportsResponse {
18915 /// Creates a new default instance.
18916 pub fn new() -> Self {
18917 std::default::Default::default()
18918 }
18919
18920 /// Sets the value of [big_query_exports][crate::model::ListBigQueryExportsResponse::big_query_exports].
18921 ///
18922 /// # Example
18923 /// ```ignore,no_run
18924 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsResponse;
18925 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
18926 /// let x = ListBigQueryExportsResponse::new()
18927 /// .set_big_query_exports([
18928 /// BigQueryExport::default()/* use setters */,
18929 /// BigQueryExport::default()/* use (different) setters */,
18930 /// ]);
18931 /// ```
18932 pub fn set_big_query_exports<T, V>(mut self, v: T) -> Self
18933 where
18934 T: std::iter::IntoIterator<Item = V>,
18935 V: std::convert::Into<crate::model::BigQueryExport>,
18936 {
18937 use std::iter::Iterator;
18938 self.big_query_exports = v.into_iter().map(|i| i.into()).collect();
18939 self
18940 }
18941
18942 /// Sets the value of [next_page_token][crate::model::ListBigQueryExportsResponse::next_page_token].
18943 ///
18944 /// # Example
18945 /// ```ignore,no_run
18946 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsResponse;
18947 /// let x = ListBigQueryExportsResponse::new().set_next_page_token("example");
18948 /// ```
18949 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18950 self.next_page_token = v.into();
18951 self
18952 }
18953}
18954
18955impl wkt::message::Message for ListBigQueryExportsResponse {
18956 fn typename() -> &'static str {
18957 "type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsResponse"
18958 }
18959}
18960
18961#[doc(hidden)]
18962impl google_cloud_gax::paginator::internal::PageableResponse for ListBigQueryExportsResponse {
18963 type PageItem = crate::model::BigQueryExport;
18964
18965 fn items(self) -> std::vec::Vec<Self::PageItem> {
18966 self.big_query_exports
18967 }
18968
18969 fn next_page_token(&self) -> std::string::String {
18970 use std::clone::Clone;
18971 self.next_page_token.clone()
18972 }
18973}
18974
18975/// Request message for listing findings.
18976#[derive(Clone, Default, PartialEq)]
18977#[non_exhaustive]
18978pub struct ListFindingsRequest {
18979 /// Required. Name of the source the findings belong to. If no location is
18980 /// specified, the default is global. The following list shows some examples:
18981 ///
18982 /// + `organizations/[organization_id]/sources/[source_id]`
18983 ///
18984 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
18985 ///
18986 /// + `folders/[folder_id]/sources/[source_id]`
18987 /// + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
18988 /// + `projects/[project_id]/sources/[source_id]`
18989 /// + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
18990 ///
18991 /// To list across all sources provide a source_id of `-`. The following
18992 /// list shows some examples:
18993 ///
18994 /// + `organizations/{organization_id}/sources/-`
18995 /// + `organizations/{organization_id}/sources/-/locations/{location_id}`
18996 /// + `folders/{folder_id}/sources/-`
18997 /// + `folders/{folder_id}/sources/-locations/{location_id}`
18998 /// + `projects/{projects_id}/sources/-`
18999 /// + `projects/{projects_id}/sources/-/locations/{location_id}`
19000 pub parent: std::string::String,
19001
19002 /// Expression that defines the filter to apply across findings.
19003 /// The expression is a list of one or more restrictions combined via logical
19004 /// operators `AND` and `OR`.
19005 /// Parentheses are supported, and `OR` has higher precedence than `AND`.
19006 ///
19007 /// Restrictions have the form `<field> <operator> <value>` and may have a `-`
19008 /// character in front of them to indicate negation. Examples include:
19009 ///
19010 /// * name
19011 /// * security_marks.marks.marka
19012 ///
19013 /// The supported operators are:
19014 ///
19015 /// * `=` for all value types.
19016 /// * `>`, `<`, `>=`, `<=` for integer values.
19017 /// * `:`, meaning substring matching, for strings.
19018 ///
19019 /// The supported value types are:
19020 ///
19021 /// * string literals in quotes.
19022 /// * integer literals without quotes.
19023 /// * boolean literals `true` and `false` without quotes.
19024 ///
19025 /// The following field and operator combinations are supported:
19026 ///
19027 /// * name: `=`
19028 ///
19029 /// * parent: `=`, `:`
19030 ///
19031 /// * resource_name: `=`, `:`
19032 ///
19033 /// * state: `=`, `:`
19034 ///
19035 /// * category: `=`, `:`
19036 ///
19037 /// * external_uri: `=`, `:`
19038 ///
19039 /// * event_time: `=`, `>`, `<`, `>=`, `<=`
19040 ///
19041 /// Usage: This should be milliseconds since epoch or an RFC3339 string.
19042 /// Examples:
19043 /// `event_time = "2019-06-10T16:07:18-07:00"`
19044 /// `event_time = 1560208038000`
19045 ///
19046 /// * severity: `=`, `:`
19047 ///
19048 /// * security_marks.marks: `=`, `:`
19049 ///
19050 /// * resource:
19051 ///
19052 /// * resource.name: `=`, `:`
19053 /// * resource.parent_name: `=`, `:`
19054 /// * resource.parent_display_name: `=`, `:`
19055 /// * resource.project_name: `=`, `:`
19056 /// * resource.project_display_name: `=`, `:`
19057 /// * resource.type: `=`, `:`
19058 /// * resource.folders.resource_folder: `=`, `:`
19059 /// * resource.display_name: `=`, `:`
19060 pub filter: std::string::String,
19061
19062 /// Expression that defines what fields and order to use for sorting. The
19063 /// string value should follow SQL syntax: comma separated list of fields. For
19064 /// example: "name,parent". The default sorting order
19065 /// is ascending. To specify descending order for a field, a suffix " desc"
19066 /// should be appended to the field name. For example: "name
19067 /// desc,parent". Redundant space characters in the
19068 /// syntax are insignificant. "name desc,parent" and "
19069 /// name desc , parent " are equivalent.
19070 ///
19071 /// The following fields are supported:
19072 /// name
19073 /// parent
19074 /// state
19075 /// category
19076 /// resource_name
19077 /// event_time
19078 /// security_marks.marks
19079 pub order_by: std::string::String,
19080
19081 /// A field mask to specify the Finding fields to be listed in the response.
19082 /// An empty field mask will list all fields.
19083 pub field_mask: std::option::Option<wkt::FieldMask>,
19084
19085 /// The value returned by the last `ListFindingsResponse`; indicates
19086 /// that this is a continuation of a prior `ListFindings` call, and
19087 /// that the system should return the next page of data.
19088 pub page_token: std::string::String,
19089
19090 /// The maximum number of results to return in a single response. Default is
19091 /// 10, minimum is 1, maximum is 1000.
19092 pub page_size: i32,
19093
19094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19095}
19096
19097impl ListFindingsRequest {
19098 /// Creates a new default instance.
19099 pub fn new() -> Self {
19100 std::default::Default::default()
19101 }
19102
19103 /// Sets the value of [parent][crate::model::ListFindingsRequest::parent].
19104 ///
19105 /// # Example
19106 /// ```ignore,no_run
19107 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19108 /// # let organization_id = "organization_id";
19109 /// # let source_id = "source_id";
19110 /// let x = ListFindingsRequest::new().set_parent(format!("organizations/{organization_id}/sources/{source_id}"));
19111 /// ```
19112 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19113 self.parent = v.into();
19114 self
19115 }
19116
19117 /// Sets the value of [filter][crate::model::ListFindingsRequest::filter].
19118 ///
19119 /// # Example
19120 /// ```ignore,no_run
19121 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19122 /// let x = ListFindingsRequest::new().set_filter("example");
19123 /// ```
19124 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19125 self.filter = v.into();
19126 self
19127 }
19128
19129 /// Sets the value of [order_by][crate::model::ListFindingsRequest::order_by].
19130 ///
19131 /// # Example
19132 /// ```ignore,no_run
19133 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19134 /// let x = ListFindingsRequest::new().set_order_by("example");
19135 /// ```
19136 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19137 self.order_by = v.into();
19138 self
19139 }
19140
19141 /// Sets the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
19142 ///
19143 /// # Example
19144 /// ```ignore,no_run
19145 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19146 /// use wkt::FieldMask;
19147 /// let x = ListFindingsRequest::new().set_field_mask(FieldMask::default()/* use setters */);
19148 /// ```
19149 pub fn set_field_mask<T>(mut self, v: T) -> Self
19150 where
19151 T: std::convert::Into<wkt::FieldMask>,
19152 {
19153 self.field_mask = std::option::Option::Some(v.into());
19154 self
19155 }
19156
19157 /// Sets or clears the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
19158 ///
19159 /// # Example
19160 /// ```ignore,no_run
19161 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19162 /// use wkt::FieldMask;
19163 /// let x = ListFindingsRequest::new().set_or_clear_field_mask(Some(FieldMask::default()/* use setters */));
19164 /// let x = ListFindingsRequest::new().set_or_clear_field_mask(None::<FieldMask>);
19165 /// ```
19166 pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
19167 where
19168 T: std::convert::Into<wkt::FieldMask>,
19169 {
19170 self.field_mask = v.map(|x| x.into());
19171 self
19172 }
19173
19174 /// Sets the value of [page_token][crate::model::ListFindingsRequest::page_token].
19175 ///
19176 /// # Example
19177 /// ```ignore,no_run
19178 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19179 /// let x = ListFindingsRequest::new().set_page_token("example");
19180 /// ```
19181 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19182 self.page_token = v.into();
19183 self
19184 }
19185
19186 /// Sets the value of [page_size][crate::model::ListFindingsRequest::page_size].
19187 ///
19188 /// # Example
19189 /// ```ignore,no_run
19190 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19191 /// let x = ListFindingsRequest::new().set_page_size(42);
19192 /// ```
19193 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19194 self.page_size = v.into();
19195 self
19196 }
19197}
19198
19199impl wkt::message::Message for ListFindingsRequest {
19200 fn typename() -> &'static str {
19201 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsRequest"
19202 }
19203}
19204
19205/// Response message for listing findings.
19206#[derive(Clone, Default, PartialEq)]
19207#[non_exhaustive]
19208pub struct ListFindingsResponse {
19209 /// Findings matching the list request.
19210 pub list_findings_results:
19211 std::vec::Vec<crate::model::list_findings_response::ListFindingsResult>,
19212
19213 /// Token to retrieve the next page of results, or empty if there are no more
19214 /// results.
19215 pub next_page_token: std::string::String,
19216
19217 /// The total number of findings matching the query.
19218 pub total_size: i32,
19219
19220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19221}
19222
19223impl ListFindingsResponse {
19224 /// Creates a new default instance.
19225 pub fn new() -> Self {
19226 std::default::Default::default()
19227 }
19228
19229 /// Sets the value of [list_findings_results][crate::model::ListFindingsResponse::list_findings_results].
19230 ///
19231 /// # Example
19232 /// ```ignore,no_run
19233 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19234 /// use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19235 /// let x = ListFindingsResponse::new()
19236 /// .set_list_findings_results([
19237 /// ListFindingsResult::default()/* use setters */,
19238 /// ListFindingsResult::default()/* use (different) setters */,
19239 /// ]);
19240 /// ```
19241 pub fn set_list_findings_results<T, V>(mut self, v: T) -> Self
19242 where
19243 T: std::iter::IntoIterator<Item = V>,
19244 V: std::convert::Into<crate::model::list_findings_response::ListFindingsResult>,
19245 {
19246 use std::iter::Iterator;
19247 self.list_findings_results = v.into_iter().map(|i| i.into()).collect();
19248 self
19249 }
19250
19251 /// Sets the value of [next_page_token][crate::model::ListFindingsResponse::next_page_token].
19252 ///
19253 /// # Example
19254 /// ```ignore,no_run
19255 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19256 /// let x = ListFindingsResponse::new().set_next_page_token("example");
19257 /// ```
19258 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19259 self.next_page_token = v.into();
19260 self
19261 }
19262
19263 /// Sets the value of [total_size][crate::model::ListFindingsResponse::total_size].
19264 ///
19265 /// # Example
19266 /// ```ignore,no_run
19267 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19268 /// let x = ListFindingsResponse::new().set_total_size(42);
19269 /// ```
19270 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19271 self.total_size = v.into();
19272 self
19273 }
19274}
19275
19276impl wkt::message::Message for ListFindingsResponse {
19277 fn typename() -> &'static str {
19278 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse"
19279 }
19280}
19281
19282#[doc(hidden)]
19283impl google_cloud_gax::paginator::internal::PageableResponse for ListFindingsResponse {
19284 type PageItem = crate::model::list_findings_response::ListFindingsResult;
19285
19286 fn items(self) -> std::vec::Vec<Self::PageItem> {
19287 self.list_findings_results
19288 }
19289
19290 fn next_page_token(&self) -> std::string::String {
19291 use std::clone::Clone;
19292 self.next_page_token.clone()
19293 }
19294}
19295
19296/// Defines additional types related to [ListFindingsResponse].
19297pub mod list_findings_response {
19298 #[allow(unused_imports)]
19299 use super::*;
19300
19301 /// Result containing the Finding.
19302 #[derive(Clone, Default, PartialEq)]
19303 #[non_exhaustive]
19304 pub struct ListFindingsResult {
19305 /// Finding matching the search request.
19306 pub finding: std::option::Option<crate::model::Finding>,
19307
19308 /// Output only. Resource that is associated with this finding.
19309 pub resource: std::option::Option<
19310 crate::model::list_findings_response::list_findings_result::Resource,
19311 >,
19312
19313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19314 }
19315
19316 impl ListFindingsResult {
19317 /// Creates a new default instance.
19318 pub fn new() -> Self {
19319 std::default::Default::default()
19320 }
19321
19322 /// Sets the value of [finding][crate::model::list_findings_response::ListFindingsResult::finding].
19323 ///
19324 /// # Example
19325 /// ```ignore,no_run
19326 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19327 /// use google_cloud_securitycenter_v2::model::Finding;
19328 /// let x = ListFindingsResult::new().set_finding(Finding::default()/* use setters */);
19329 /// ```
19330 pub fn set_finding<T>(mut self, v: T) -> Self
19331 where
19332 T: std::convert::Into<crate::model::Finding>,
19333 {
19334 self.finding = std::option::Option::Some(v.into());
19335 self
19336 }
19337
19338 /// Sets or clears the value of [finding][crate::model::list_findings_response::ListFindingsResult::finding].
19339 ///
19340 /// # Example
19341 /// ```ignore,no_run
19342 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19343 /// use google_cloud_securitycenter_v2::model::Finding;
19344 /// let x = ListFindingsResult::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
19345 /// let x = ListFindingsResult::new().set_or_clear_finding(None::<Finding>);
19346 /// ```
19347 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
19348 where
19349 T: std::convert::Into<crate::model::Finding>,
19350 {
19351 self.finding = v.map(|x| x.into());
19352 self
19353 }
19354
19355 /// Sets the value of [resource][crate::model::list_findings_response::ListFindingsResult::resource].
19356 ///
19357 /// # Example
19358 /// ```ignore,no_run
19359 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19360 /// use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19361 /// let x = ListFindingsResult::new().set_resource(Resource::default()/* use setters */);
19362 /// ```
19363 pub fn set_resource<T>(mut self, v: T) -> Self
19364 where
19365 T: std::convert::Into<
19366 crate::model::list_findings_response::list_findings_result::Resource,
19367 >,
19368 {
19369 self.resource = std::option::Option::Some(v.into());
19370 self
19371 }
19372
19373 /// Sets or clears the value of [resource][crate::model::list_findings_response::ListFindingsResult::resource].
19374 ///
19375 /// # Example
19376 /// ```ignore,no_run
19377 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19378 /// use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19379 /// let x = ListFindingsResult::new().set_or_clear_resource(Some(Resource::default()/* use setters */));
19380 /// let x = ListFindingsResult::new().set_or_clear_resource(None::<Resource>);
19381 /// ```
19382 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
19383 where
19384 T: std::convert::Into<
19385 crate::model::list_findings_response::list_findings_result::Resource,
19386 >,
19387 {
19388 self.resource = v.map(|x| x.into());
19389 self
19390 }
19391 }
19392
19393 impl wkt::message::Message for ListFindingsResult {
19394 fn typename() -> &'static str {
19395 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult"
19396 }
19397 }
19398
19399 /// Defines additional types related to [ListFindingsResult].
19400 pub mod list_findings_result {
19401 #[allow(unused_imports)]
19402 use super::*;
19403
19404 /// Information related to the Google Cloud resource that is
19405 /// associated with this finding.
19406 #[derive(Clone, Default, PartialEq)]
19407 #[non_exhaustive]
19408 pub struct Resource {
19409
19410 /// The full resource name of the resource. See:
19411 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
19412 pub name: std::string::String,
19413
19414 /// The human readable name of the resource.
19415 pub display_name: std::string::String,
19416
19417 /// The full resource type of the resource.
19418 pub r#type: std::string::String,
19419
19420 /// Indicates which cloud provider the finding is from.
19421 pub cloud_provider: crate::model::CloudProvider,
19422
19423 /// The service or resource provider associated with the resource.
19424 pub service: std::string::String,
19425
19426 /// The region or location of the service (if applicable).
19427 pub location: std::string::String,
19428
19429 /// Provides the path to the resource within the resource hierarchy.
19430 pub resource_path: std::option::Option<crate::model::ResourcePath>,
19431
19432 /// A string representation of the resource path.
19433 /// For Google Cloud, it has the format of
19434 /// `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}`
19435 /// where there can be any number of folders.
19436 /// For AWS, it has the format of
19437 /// `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}`
19438 /// where there can be any number of organizational units.
19439 /// For Azure, it has the format of
19440 /// `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}`
19441 /// where there can be any number of management groups.
19442 pub resource_path_string: std::string::String,
19443
19444 /// The metadata associated with the cloud provider.
19445 pub cloud_provider_metadata: std::option::Option<crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata>,
19446
19447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19448 }
19449
19450 impl Resource {
19451 /// Creates a new default instance.
19452 pub fn new() -> Self {
19453 std::default::Default::default()
19454 }
19455
19456 /// Sets the value of [name][crate::model::list_findings_response::list_findings_result::Resource::name].
19457 ///
19458 /// # Example
19459 /// ```ignore,no_run
19460 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19461 /// let x = Resource::new().set_name("example");
19462 /// ```
19463 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19464 self.name = v.into();
19465 self
19466 }
19467
19468 /// Sets the value of [display_name][crate::model::list_findings_response::list_findings_result::Resource::display_name].
19469 ///
19470 /// # Example
19471 /// ```ignore,no_run
19472 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19473 /// let x = Resource::new().set_display_name("example");
19474 /// ```
19475 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
19476 mut self,
19477 v: T,
19478 ) -> Self {
19479 self.display_name = v.into();
19480 self
19481 }
19482
19483 /// Sets the value of [r#type][crate::model::list_findings_response::list_findings_result::Resource::type].
19484 ///
19485 /// # Example
19486 /// ```ignore,no_run
19487 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19488 /// let x = Resource::new().set_type("example");
19489 /// ```
19490 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19491 self.r#type = v.into();
19492 self
19493 }
19494
19495 /// Sets the value of [cloud_provider][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider].
19496 ///
19497 /// # Example
19498 /// ```ignore,no_run
19499 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19500 /// use google_cloud_securitycenter_v2::model::CloudProvider;
19501 /// let x0 = Resource::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
19502 /// let x1 = Resource::new().set_cloud_provider(CloudProvider::AmazonWebServices);
19503 /// let x2 = Resource::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
19504 /// ```
19505 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
19506 mut self,
19507 v: T,
19508 ) -> Self {
19509 self.cloud_provider = v.into();
19510 self
19511 }
19512
19513 /// Sets the value of [service][crate::model::list_findings_response::list_findings_result::Resource::service].
19514 ///
19515 /// # Example
19516 /// ```ignore,no_run
19517 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19518 /// let x = Resource::new().set_service("example");
19519 /// ```
19520 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19521 self.service = v.into();
19522 self
19523 }
19524
19525 /// Sets the value of [location][crate::model::list_findings_response::list_findings_result::Resource::location].
19526 ///
19527 /// # Example
19528 /// ```ignore,no_run
19529 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19530 /// let x = Resource::new().set_location("example");
19531 /// ```
19532 pub fn set_location<T: std::convert::Into<std::string::String>>(
19533 mut self,
19534 v: T,
19535 ) -> Self {
19536 self.location = v.into();
19537 self
19538 }
19539
19540 /// Sets the value of [resource_path][crate::model::list_findings_response::list_findings_result::Resource::resource_path].
19541 ///
19542 /// # Example
19543 /// ```ignore,no_run
19544 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19545 /// use google_cloud_securitycenter_v2::model::ResourcePath;
19546 /// let x = Resource::new().set_resource_path(ResourcePath::default()/* use setters */);
19547 /// ```
19548 pub fn set_resource_path<T>(mut self, v: T) -> Self
19549 where
19550 T: std::convert::Into<crate::model::ResourcePath>,
19551 {
19552 self.resource_path = std::option::Option::Some(v.into());
19553 self
19554 }
19555
19556 /// Sets or clears the value of [resource_path][crate::model::list_findings_response::list_findings_result::Resource::resource_path].
19557 ///
19558 /// # Example
19559 /// ```ignore,no_run
19560 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19561 /// use google_cloud_securitycenter_v2::model::ResourcePath;
19562 /// let x = Resource::new().set_or_clear_resource_path(Some(ResourcePath::default()/* use setters */));
19563 /// let x = Resource::new().set_or_clear_resource_path(None::<ResourcePath>);
19564 /// ```
19565 pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
19566 where
19567 T: std::convert::Into<crate::model::ResourcePath>,
19568 {
19569 self.resource_path = v.map(|x| x.into());
19570 self
19571 }
19572
19573 /// Sets the value of [resource_path_string][crate::model::list_findings_response::list_findings_result::Resource::resource_path_string].
19574 ///
19575 /// # Example
19576 /// ```ignore,no_run
19577 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19578 /// let x = Resource::new().set_resource_path_string("example");
19579 /// ```
19580 pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
19581 mut self,
19582 v: T,
19583 ) -> Self {
19584 self.resource_path_string = v.into();
19585 self
19586 }
19587
19588 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata].
19589 ///
19590 /// Note that all the setters affecting `cloud_provider_metadata` are mutually
19591 /// exclusive.
19592 ///
19593 /// # Example
19594 /// ```ignore,no_run
19595 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19596 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
19597 /// let x = Resource::new().set_cloud_provider_metadata(Some(
19598 /// google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(GcpMetadata::default().into())));
19599 /// ```
19600 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
19601 {
19602 self.cloud_provider_metadata = v.into();
19603 self
19604 }
19605
19606 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19607 /// if it holds a `GcpMetadata`, `None` if the field is not set or
19608 /// holds a different branch.
19609 pub fn gcp_metadata(
19610 &self,
19611 ) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
19612 #[allow(unreachable_patterns)]
19613 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19614 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(v) => std::option::Option::Some(v),
19615 _ => std::option::Option::None,
19616 })
19617 }
19618
19619 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19620 /// to hold a `GcpMetadata`.
19621 ///
19622 /// Note that all the setters affecting `cloud_provider_metadata` are
19623 /// mutually exclusive.
19624 ///
19625 /// # Example
19626 /// ```ignore,no_run
19627 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19628 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
19629 /// let x = Resource::new().set_gcp_metadata(GcpMetadata::default()/* use setters */);
19630 /// assert!(x.gcp_metadata().is_some());
19631 /// assert!(x.aws_metadata().is_none());
19632 /// assert!(x.azure_metadata().is_none());
19633 /// ```
19634 pub fn set_gcp_metadata<
19635 T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>,
19636 >(
19637 mut self,
19638 v: T,
19639 ) -> Self {
19640 self.cloud_provider_metadata = std::option::Option::Some(
19641 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(
19642 v.into()
19643 )
19644 );
19645 self
19646 }
19647
19648 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19649 /// if it holds a `AwsMetadata`, `None` if the field is not set or
19650 /// holds a different branch.
19651 pub fn aws_metadata(
19652 &self,
19653 ) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
19654 #[allow(unreachable_patterns)]
19655 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19656 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(v) => std::option::Option::Some(v),
19657 _ => std::option::Option::None,
19658 })
19659 }
19660
19661 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19662 /// to hold a `AwsMetadata`.
19663 ///
19664 /// Note that all the setters affecting `cloud_provider_metadata` are
19665 /// mutually exclusive.
19666 ///
19667 /// # Example
19668 /// ```ignore,no_run
19669 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19670 /// use google_cloud_securitycenter_v2::model::AwsMetadata;
19671 /// let x = Resource::new().set_aws_metadata(AwsMetadata::default()/* use setters */);
19672 /// assert!(x.aws_metadata().is_some());
19673 /// assert!(x.gcp_metadata().is_none());
19674 /// assert!(x.azure_metadata().is_none());
19675 /// ```
19676 pub fn set_aws_metadata<
19677 T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>,
19678 >(
19679 mut self,
19680 v: T,
19681 ) -> Self {
19682 self.cloud_provider_metadata = std::option::Option::Some(
19683 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(
19684 v.into()
19685 )
19686 );
19687 self
19688 }
19689
19690 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19691 /// if it holds a `AzureMetadata`, `None` if the field is not set or
19692 /// holds a different branch.
19693 pub fn azure_metadata(
19694 &self,
19695 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
19696 #[allow(unreachable_patterns)]
19697 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19698 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(v) => std::option::Option::Some(v),
19699 _ => std::option::Option::None,
19700 })
19701 }
19702
19703 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19704 /// to hold a `AzureMetadata`.
19705 ///
19706 /// Note that all the setters affecting `cloud_provider_metadata` are
19707 /// mutually exclusive.
19708 ///
19709 /// # Example
19710 /// ```ignore,no_run
19711 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19712 /// use google_cloud_securitycenter_v2::model::AzureMetadata;
19713 /// let x = Resource::new().set_azure_metadata(AzureMetadata::default()/* use setters */);
19714 /// assert!(x.azure_metadata().is_some());
19715 /// assert!(x.gcp_metadata().is_none());
19716 /// assert!(x.aws_metadata().is_none());
19717 /// ```
19718 pub fn set_azure_metadata<
19719 T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
19720 >(
19721 mut self,
19722 v: T,
19723 ) -> Self {
19724 self.cloud_provider_metadata = std::option::Option::Some(
19725 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(
19726 v.into()
19727 )
19728 );
19729 self
19730 }
19731 }
19732
19733 impl wkt::message::Message for Resource {
19734 fn typename() -> &'static str {
19735 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource"
19736 }
19737 }
19738
19739 /// Defines additional types related to [Resource].
19740 pub mod resource {
19741 #[allow(unused_imports)]
19742 use super::*;
19743
19744 /// The metadata associated with the cloud provider.
19745 #[derive(Clone, Debug, PartialEq)]
19746 #[non_exhaustive]
19747 pub enum CloudProviderMetadata {
19748 /// The GCP metadata associated with the finding.
19749 GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
19750 /// The AWS metadata associated with the finding.
19751 AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
19752 /// The Azure metadata associated with the finding.
19753 AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
19754 }
19755 }
19756 }
19757}
19758
19759/// Request message for listing mute configs at a given scope e.g. organization,
19760/// folder or project. If no location is specified, default is
19761/// global.
19762#[derive(Clone, Default, PartialEq)]
19763#[non_exhaustive]
19764pub struct ListMuteConfigsRequest {
19765 /// Required. The parent, which owns the collection of mute configs. Its format
19766 /// is `organizations/[organization_id]", "folders/[folder_id]`,
19767 /// `projects/[project_id]`,
19768 /// `organizations/[organization_id]/locations/[location_id]`,
19769 /// `folders/[folder_id]/locations/[location_id]`,
19770 /// `projects/[project_id]/locations/[location_id]`.
19771 pub parent: std::string::String,
19772
19773 /// The maximum number of configs to return. The service may return fewer than
19774 /// this value.
19775 /// If unspecified, at most 10 configs will be returned.
19776 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
19777 pub page_size: i32,
19778
19779 /// A page token, received from a previous `ListMuteConfigs` call.
19780 /// Provide this to retrieve the subsequent page.
19781 ///
19782 /// When paginating, all other parameters provided to `ListMuteConfigs` must
19783 /// match the call that provided the page token.
19784 pub page_token: std::string::String,
19785
19786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19787}
19788
19789impl ListMuteConfigsRequest {
19790 /// Creates a new default instance.
19791 pub fn new() -> Self {
19792 std::default::Default::default()
19793 }
19794
19795 /// Sets the value of [parent][crate::model::ListMuteConfigsRequest::parent].
19796 ///
19797 /// # Example
19798 /// ```ignore,no_run
19799 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19800 /// # let organization_id = "organization_id";
19801 /// let x = ListMuteConfigsRequest::new().set_parent(format!("organizations/{organization_id}"));
19802 /// ```
19803 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19804 self.parent = v.into();
19805 self
19806 }
19807
19808 /// Sets the value of [page_size][crate::model::ListMuteConfigsRequest::page_size].
19809 ///
19810 /// # Example
19811 /// ```ignore,no_run
19812 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19813 /// let x = ListMuteConfigsRequest::new().set_page_size(42);
19814 /// ```
19815 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19816 self.page_size = v.into();
19817 self
19818 }
19819
19820 /// Sets the value of [page_token][crate::model::ListMuteConfigsRequest::page_token].
19821 ///
19822 /// # Example
19823 /// ```ignore,no_run
19824 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19825 /// let x = ListMuteConfigsRequest::new().set_page_token("example");
19826 /// ```
19827 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19828 self.page_token = v.into();
19829 self
19830 }
19831}
19832
19833impl wkt::message::Message for ListMuteConfigsRequest {
19834 fn typename() -> &'static str {
19835 "type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsRequest"
19836 }
19837}
19838
19839/// Response message for listing mute configs.
19840#[derive(Clone, Default, PartialEq)]
19841#[non_exhaustive]
19842pub struct ListMuteConfigsResponse {
19843 /// The mute configs from the specified parent.
19844 pub mute_configs: std::vec::Vec<crate::model::MuteConfig>,
19845
19846 /// A token, which can be sent as `page_token` to retrieve the next page.
19847 /// If this field is omitted, there are no subsequent pages.
19848 pub next_page_token: std::string::String,
19849
19850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19851}
19852
19853impl ListMuteConfigsResponse {
19854 /// Creates a new default instance.
19855 pub fn new() -> Self {
19856 std::default::Default::default()
19857 }
19858
19859 /// Sets the value of [mute_configs][crate::model::ListMuteConfigsResponse::mute_configs].
19860 ///
19861 /// # Example
19862 /// ```ignore,no_run
19863 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsResponse;
19864 /// use google_cloud_securitycenter_v2::model::MuteConfig;
19865 /// let x = ListMuteConfigsResponse::new()
19866 /// .set_mute_configs([
19867 /// MuteConfig::default()/* use setters */,
19868 /// MuteConfig::default()/* use (different) setters */,
19869 /// ]);
19870 /// ```
19871 pub fn set_mute_configs<T, V>(mut self, v: T) -> Self
19872 where
19873 T: std::iter::IntoIterator<Item = V>,
19874 V: std::convert::Into<crate::model::MuteConfig>,
19875 {
19876 use std::iter::Iterator;
19877 self.mute_configs = v.into_iter().map(|i| i.into()).collect();
19878 self
19879 }
19880
19881 /// Sets the value of [next_page_token][crate::model::ListMuteConfigsResponse::next_page_token].
19882 ///
19883 /// # Example
19884 /// ```ignore,no_run
19885 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsResponse;
19886 /// let x = ListMuteConfigsResponse::new().set_next_page_token("example");
19887 /// ```
19888 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19889 self.next_page_token = v.into();
19890 self
19891 }
19892}
19893
19894impl wkt::message::Message for ListMuteConfigsResponse {
19895 fn typename() -> &'static str {
19896 "type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsResponse"
19897 }
19898}
19899
19900#[doc(hidden)]
19901impl google_cloud_gax::paginator::internal::PageableResponse for ListMuteConfigsResponse {
19902 type PageItem = crate::model::MuteConfig;
19903
19904 fn items(self) -> std::vec::Vec<Self::PageItem> {
19905 self.mute_configs
19906 }
19907
19908 fn next_page_token(&self) -> std::string::String {
19909 use std::clone::Clone;
19910 self.next_page_token.clone()
19911 }
19912}
19913
19914/// Request message for listing notification configs.
19915#[derive(Clone, Default, PartialEq)]
19916#[non_exhaustive]
19917pub struct ListNotificationConfigsRequest {
19918 /// Required. The name of the parent in which to list the notification
19919 /// configurations. Its format is
19920 /// "organizations/[organization_id]/locations/[location_id]",
19921 /// "folders/[folder_id]/locations/[location_id]", or
19922 /// "projects/[project_id]/locations/[location_id]".
19923 pub parent: std::string::String,
19924
19925 /// The value returned by the last `ListNotificationConfigsResponse`; indicates
19926 /// that this is a continuation of a prior `ListNotificationConfigs` call, and
19927 /// that the system should return the next page of data.
19928 pub page_token: std::string::String,
19929
19930 /// The maximum number of results to return in a single response. Default is
19931 /// 10, minimum is 1, maximum is 1000.
19932 pub page_size: i32,
19933
19934 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19935}
19936
19937impl ListNotificationConfigsRequest {
19938 /// Creates a new default instance.
19939 pub fn new() -> Self {
19940 std::default::Default::default()
19941 }
19942
19943 /// Sets the value of [parent][crate::model::ListNotificationConfigsRequest::parent].
19944 ///
19945 /// # Example
19946 /// ```ignore,no_run
19947 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19948 /// # let organization_id = "organization_id";
19949 /// # let location_id = "location_id";
19950 /// let x = ListNotificationConfigsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
19951 /// ```
19952 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19953 self.parent = v.into();
19954 self
19955 }
19956
19957 /// Sets the value of [page_token][crate::model::ListNotificationConfigsRequest::page_token].
19958 ///
19959 /// # Example
19960 /// ```ignore,no_run
19961 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19962 /// let x = ListNotificationConfigsRequest::new().set_page_token("example");
19963 /// ```
19964 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19965 self.page_token = v.into();
19966 self
19967 }
19968
19969 /// Sets the value of [page_size][crate::model::ListNotificationConfigsRequest::page_size].
19970 ///
19971 /// # Example
19972 /// ```ignore,no_run
19973 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19974 /// let x = ListNotificationConfigsRequest::new().set_page_size(42);
19975 /// ```
19976 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19977 self.page_size = v.into();
19978 self
19979 }
19980}
19981
19982impl wkt::message::Message for ListNotificationConfigsRequest {
19983 fn typename() -> &'static str {
19984 "type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsRequest"
19985 }
19986}
19987
19988/// Response message for listing notification configs.
19989#[derive(Clone, Default, PartialEq)]
19990#[non_exhaustive]
19991pub struct ListNotificationConfigsResponse {
19992 /// Notification configs belonging to the requested parent.
19993 pub notification_configs: std::vec::Vec<crate::model::NotificationConfig>,
19994
19995 /// Token to retrieve the next page of results, or empty if there are no more
19996 /// results.
19997 pub next_page_token: std::string::String,
19998
19999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20000}
20001
20002impl ListNotificationConfigsResponse {
20003 /// Creates a new default instance.
20004 pub fn new() -> Self {
20005 std::default::Default::default()
20006 }
20007
20008 /// Sets the value of [notification_configs][crate::model::ListNotificationConfigsResponse::notification_configs].
20009 ///
20010 /// # Example
20011 /// ```ignore,no_run
20012 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsResponse;
20013 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
20014 /// let x = ListNotificationConfigsResponse::new()
20015 /// .set_notification_configs([
20016 /// NotificationConfig::default()/* use setters */,
20017 /// NotificationConfig::default()/* use (different) setters */,
20018 /// ]);
20019 /// ```
20020 pub fn set_notification_configs<T, V>(mut self, v: T) -> Self
20021 where
20022 T: std::iter::IntoIterator<Item = V>,
20023 V: std::convert::Into<crate::model::NotificationConfig>,
20024 {
20025 use std::iter::Iterator;
20026 self.notification_configs = v.into_iter().map(|i| i.into()).collect();
20027 self
20028 }
20029
20030 /// Sets the value of [next_page_token][crate::model::ListNotificationConfigsResponse::next_page_token].
20031 ///
20032 /// # Example
20033 /// ```ignore,no_run
20034 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsResponse;
20035 /// let x = ListNotificationConfigsResponse::new().set_next_page_token("example");
20036 /// ```
20037 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20038 self.next_page_token = v.into();
20039 self
20040 }
20041}
20042
20043impl wkt::message::Message for ListNotificationConfigsResponse {
20044 fn typename() -> &'static str {
20045 "type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsResponse"
20046 }
20047}
20048
20049#[doc(hidden)]
20050impl google_cloud_gax::paginator::internal::PageableResponse for ListNotificationConfigsResponse {
20051 type PageItem = crate::model::NotificationConfig;
20052
20053 fn items(self) -> std::vec::Vec<Self::PageItem> {
20054 self.notification_configs
20055 }
20056
20057 fn next_page_token(&self) -> std::string::String {
20058 use std::clone::Clone;
20059 self.next_page_token.clone()
20060 }
20061}
20062
20063/// Request message to list resource value configs of a parent
20064#[derive(Clone, Default, PartialEq)]
20065#[non_exhaustive]
20066pub struct ListResourceValueConfigsRequest {
20067 /// Required. The parent, which owns the collection of resource value configs.
20068 /// Its format is
20069 /// `organizations/[organization_id]`
20070 pub parent: std::string::String,
20071
20072 /// The maximum number of configs to return. The service may return fewer than
20073 /// this value.
20074 /// If unspecified, at most 10 configs will be returned.
20075 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
20076 pub page_size: i32,
20077
20078 /// A page token, received from a previous `ListResourceValueConfigs` call.
20079 /// Provide this to retrieve the subsequent page.
20080 ///
20081 /// When paginating, all other parameters provided to
20082 /// `ListResourceValueConfigs` must match the call that provided the
20083 /// page token.
20084 ///
20085 /// page_size can be specified, and the new page_size will be used.
20086 pub page_token: std::string::String,
20087
20088 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20089}
20090
20091impl ListResourceValueConfigsRequest {
20092 /// Creates a new default instance.
20093 pub fn new() -> Self {
20094 std::default::Default::default()
20095 }
20096
20097 /// Sets the value of [parent][crate::model::ListResourceValueConfigsRequest::parent].
20098 ///
20099 /// # Example
20100 /// ```ignore,no_run
20101 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
20102 /// # let organization_id = "organization_id";
20103 /// let x = ListResourceValueConfigsRequest::new().set_parent(format!("organizations/{organization_id}"));
20104 /// ```
20105 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20106 self.parent = v.into();
20107 self
20108 }
20109
20110 /// Sets the value of [page_size][crate::model::ListResourceValueConfigsRequest::page_size].
20111 ///
20112 /// # Example
20113 /// ```ignore,no_run
20114 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
20115 /// let x = ListResourceValueConfigsRequest::new().set_page_size(42);
20116 /// ```
20117 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20118 self.page_size = v.into();
20119 self
20120 }
20121
20122 /// Sets the value of [page_token][crate::model::ListResourceValueConfigsRequest::page_token].
20123 ///
20124 /// # Example
20125 /// ```ignore,no_run
20126 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
20127 /// let x = ListResourceValueConfigsRequest::new().set_page_token("example");
20128 /// ```
20129 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20130 self.page_token = v.into();
20131 self
20132 }
20133}
20134
20135impl wkt::message::Message for ListResourceValueConfigsRequest {
20136 fn typename() -> &'static str {
20137 "type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsRequest"
20138 }
20139}
20140
20141/// Response message to list resource value configs
20142#[derive(Clone, Default, PartialEq)]
20143#[non_exhaustive]
20144pub struct ListResourceValueConfigsResponse {
20145 /// The resource value configs from the specified parent.
20146 pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
20147
20148 /// A token, which can be sent as `page_token` to retrieve the next page.
20149 /// If this field is empty, there are no subsequent pages.
20150 pub next_page_token: std::string::String,
20151
20152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20153}
20154
20155impl ListResourceValueConfigsResponse {
20156 /// Creates a new default instance.
20157 pub fn new() -> Self {
20158 std::default::Default::default()
20159 }
20160
20161 /// Sets the value of [resource_value_configs][crate::model::ListResourceValueConfigsResponse::resource_value_configs].
20162 ///
20163 /// # Example
20164 /// ```ignore,no_run
20165 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsResponse;
20166 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
20167 /// let x = ListResourceValueConfigsResponse::new()
20168 /// .set_resource_value_configs([
20169 /// ResourceValueConfig::default()/* use setters */,
20170 /// ResourceValueConfig::default()/* use (different) setters */,
20171 /// ]);
20172 /// ```
20173 pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
20174 where
20175 T: std::iter::IntoIterator<Item = V>,
20176 V: std::convert::Into<crate::model::ResourceValueConfig>,
20177 {
20178 use std::iter::Iterator;
20179 self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
20180 self
20181 }
20182
20183 /// Sets the value of [next_page_token][crate::model::ListResourceValueConfigsResponse::next_page_token].
20184 ///
20185 /// # Example
20186 /// ```ignore,no_run
20187 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsResponse;
20188 /// let x = ListResourceValueConfigsResponse::new().set_next_page_token("example");
20189 /// ```
20190 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20191 self.next_page_token = v.into();
20192 self
20193 }
20194}
20195
20196impl wkt::message::Message for ListResourceValueConfigsResponse {
20197 fn typename() -> &'static str {
20198 "type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsResponse"
20199 }
20200}
20201
20202#[doc(hidden)]
20203impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceValueConfigsResponse {
20204 type PageItem = crate::model::ResourceValueConfig;
20205
20206 fn items(self) -> std::vec::Vec<Self::PageItem> {
20207 self.resource_value_configs
20208 }
20209
20210 fn next_page_token(&self) -> std::string::String {
20211 use std::clone::Clone;
20212 self.next_page_token.clone()
20213 }
20214}
20215
20216/// Request message for listing sources.
20217#[derive(Clone, Default, PartialEq)]
20218#[non_exhaustive]
20219pub struct ListSourcesRequest {
20220 /// Required. Resource name of the parent of sources to list. Its format should
20221 /// be `organizations/[organization_id]`, `folders/[folder_id]`, or
20222 /// `projects/[project_id]`.
20223 pub parent: std::string::String,
20224
20225 /// The value returned by the last `ListSourcesResponse`; indicates
20226 /// that this is a continuation of a prior `ListSources` call, and
20227 /// that the system should return the next page of data.
20228 pub page_token: std::string::String,
20229
20230 /// The maximum number of results to return in a single response. Default is
20231 /// 10, minimum is 1, maximum is 1000.
20232 pub page_size: i32,
20233
20234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20235}
20236
20237impl ListSourcesRequest {
20238 /// Creates a new default instance.
20239 pub fn new() -> Self {
20240 std::default::Default::default()
20241 }
20242
20243 /// Sets the value of [parent][crate::model::ListSourcesRequest::parent].
20244 ///
20245 /// # Example
20246 /// ```ignore,no_run
20247 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20248 /// # let organization_id = "organization_id";
20249 /// let x = ListSourcesRequest::new().set_parent(format!("organizations/{organization_id}"));
20250 /// ```
20251 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20252 self.parent = v.into();
20253 self
20254 }
20255
20256 /// Sets the value of [page_token][crate::model::ListSourcesRequest::page_token].
20257 ///
20258 /// # Example
20259 /// ```ignore,no_run
20260 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20261 /// let x = ListSourcesRequest::new().set_page_token("example");
20262 /// ```
20263 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20264 self.page_token = v.into();
20265 self
20266 }
20267
20268 /// Sets the value of [page_size][crate::model::ListSourcesRequest::page_size].
20269 ///
20270 /// # Example
20271 /// ```ignore,no_run
20272 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20273 /// let x = ListSourcesRequest::new().set_page_size(42);
20274 /// ```
20275 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20276 self.page_size = v.into();
20277 self
20278 }
20279}
20280
20281impl wkt::message::Message for ListSourcesRequest {
20282 fn typename() -> &'static str {
20283 "type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesRequest"
20284 }
20285}
20286
20287/// Response message for listing sources.
20288#[derive(Clone, Default, PartialEq)]
20289#[non_exhaustive]
20290pub struct ListSourcesResponse {
20291 /// Sources belonging to the requested parent.
20292 pub sources: std::vec::Vec<crate::model::Source>,
20293
20294 /// Token to retrieve the next page of results, or empty if there are no more
20295 /// results.
20296 pub next_page_token: std::string::String,
20297
20298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20299}
20300
20301impl ListSourcesResponse {
20302 /// Creates a new default instance.
20303 pub fn new() -> Self {
20304 std::default::Default::default()
20305 }
20306
20307 /// Sets the value of [sources][crate::model::ListSourcesResponse::sources].
20308 ///
20309 /// # Example
20310 /// ```ignore,no_run
20311 /// # use google_cloud_securitycenter_v2::model::ListSourcesResponse;
20312 /// use google_cloud_securitycenter_v2::model::Source;
20313 /// let x = ListSourcesResponse::new()
20314 /// .set_sources([
20315 /// Source::default()/* use setters */,
20316 /// Source::default()/* use (different) setters */,
20317 /// ]);
20318 /// ```
20319 pub fn set_sources<T, V>(mut self, v: T) -> Self
20320 where
20321 T: std::iter::IntoIterator<Item = V>,
20322 V: std::convert::Into<crate::model::Source>,
20323 {
20324 use std::iter::Iterator;
20325 self.sources = v.into_iter().map(|i| i.into()).collect();
20326 self
20327 }
20328
20329 /// Sets the value of [next_page_token][crate::model::ListSourcesResponse::next_page_token].
20330 ///
20331 /// # Example
20332 /// ```ignore,no_run
20333 /// # use google_cloud_securitycenter_v2::model::ListSourcesResponse;
20334 /// let x = ListSourcesResponse::new().set_next_page_token("example");
20335 /// ```
20336 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20337 self.next_page_token = v.into();
20338 self
20339 }
20340}
20341
20342impl wkt::message::Message for ListSourcesResponse {
20343 fn typename() -> &'static str {
20344 "type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesResponse"
20345 }
20346}
20347
20348#[doc(hidden)]
20349impl google_cloud_gax::paginator::internal::PageableResponse for ListSourcesResponse {
20350 type PageItem = crate::model::Source;
20351
20352 fn items(self) -> std::vec::Vec<Self::PageItem> {
20353 self.sources
20354 }
20355
20356 fn next_page_token(&self) -> std::string::String {
20357 use std::clone::Clone;
20358 self.next_page_token.clone()
20359 }
20360}
20361
20362/// Request message for listing the valued resources for a given simulation.
20363#[derive(Clone, Default, PartialEq)]
20364#[non_exhaustive]
20365pub struct ListValuedResourcesRequest {
20366 /// Required. Name of parent to list exposed resources.
20367 ///
20368 /// Valid formats:
20369 /// `organizations/{organization}`,
20370 /// `organizations/{organization}/simulations/{simulation}`
20371 /// `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
20372 pub parent: std::string::String,
20373
20374 /// The filter expression that filters the valued resources in the response.
20375 /// Supported fields:
20376 ///
20377 /// * `resource_value` supports =
20378 /// * `resource_type` supports =
20379 pub filter: std::string::String,
20380
20381 /// The value returned by the last `ListValuedResourcesResponse`; indicates
20382 /// that this is a continuation of a prior `ListValuedResources` call, and
20383 /// that the system should return the next page of data.
20384 pub page_token: std::string::String,
20385
20386 /// The maximum number of results to return in a single response. Default is
20387 /// 10, minimum is 1, maximum is 1000.
20388 pub page_size: i32,
20389
20390 /// Optional. The fields by which to order the valued resources response.
20391 ///
20392 /// Supported fields:
20393 ///
20394 /// * `exposed_score`
20395 ///
20396 /// * `resource_value`
20397 ///
20398 /// * `resource_type`
20399 ///
20400 ///
20401 /// Values should be a comma separated list of fields. For example:
20402 /// `exposed_score,resource_value`.
20403 ///
20404 /// The default sorting order is descending. To specify ascending or descending
20405 /// order for a field, append a " ASC" or a " DESC" suffix, respectively; for
20406 /// example: `exposed_score DESC`.
20407 pub order_by: std::string::String,
20408
20409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20410}
20411
20412impl ListValuedResourcesRequest {
20413 /// Creates a new default instance.
20414 pub fn new() -> Self {
20415 std::default::Default::default()
20416 }
20417
20418 /// Sets the value of [parent][crate::model::ListValuedResourcesRequest::parent].
20419 ///
20420 /// # Example
20421 /// ```ignore,no_run
20422 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20423 /// # let organization_id = "organization_id";
20424 /// # let simulation_id = "simulation_id";
20425 /// let x = ListValuedResourcesRequest::new().set_parent(format!("organizations/{organization_id}/simulations/{simulation_id}"));
20426 /// ```
20427 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20428 self.parent = v.into();
20429 self
20430 }
20431
20432 /// Sets the value of [filter][crate::model::ListValuedResourcesRequest::filter].
20433 ///
20434 /// # Example
20435 /// ```ignore,no_run
20436 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20437 /// let x = ListValuedResourcesRequest::new().set_filter("example");
20438 /// ```
20439 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20440 self.filter = v.into();
20441 self
20442 }
20443
20444 /// Sets the value of [page_token][crate::model::ListValuedResourcesRequest::page_token].
20445 ///
20446 /// # Example
20447 /// ```ignore,no_run
20448 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20449 /// let x = ListValuedResourcesRequest::new().set_page_token("example");
20450 /// ```
20451 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20452 self.page_token = v.into();
20453 self
20454 }
20455
20456 /// Sets the value of [page_size][crate::model::ListValuedResourcesRequest::page_size].
20457 ///
20458 /// # Example
20459 /// ```ignore,no_run
20460 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20461 /// let x = ListValuedResourcesRequest::new().set_page_size(42);
20462 /// ```
20463 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20464 self.page_size = v.into();
20465 self
20466 }
20467
20468 /// Sets the value of [order_by][crate::model::ListValuedResourcesRequest::order_by].
20469 ///
20470 /// # Example
20471 /// ```ignore,no_run
20472 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20473 /// let x = ListValuedResourcesRequest::new().set_order_by("example");
20474 /// ```
20475 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20476 self.order_by = v.into();
20477 self
20478 }
20479}
20480
20481impl wkt::message::Message for ListValuedResourcesRequest {
20482 fn typename() -> &'static str {
20483 "type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesRequest"
20484 }
20485}
20486
20487/// Response message for listing the valued resources for a given simulation.
20488#[derive(Clone, Default, PartialEq)]
20489#[non_exhaustive]
20490pub struct ListValuedResourcesResponse {
20491 /// The valued resources that the attack path simulation identified.
20492 pub valued_resources: std::vec::Vec<crate::model::ValuedResource>,
20493
20494 /// Token to retrieve the next page of results, or empty if there are no more
20495 /// results.
20496 pub next_page_token: std::string::String,
20497
20498 /// The estimated total number of results matching the query.
20499 pub total_size: i32,
20500
20501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20502}
20503
20504impl ListValuedResourcesResponse {
20505 /// Creates a new default instance.
20506 pub fn new() -> Self {
20507 std::default::Default::default()
20508 }
20509
20510 /// Sets the value of [valued_resources][crate::model::ListValuedResourcesResponse::valued_resources].
20511 ///
20512 /// # Example
20513 /// ```ignore,no_run
20514 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20515 /// use google_cloud_securitycenter_v2::model::ValuedResource;
20516 /// let x = ListValuedResourcesResponse::new()
20517 /// .set_valued_resources([
20518 /// ValuedResource::default()/* use setters */,
20519 /// ValuedResource::default()/* use (different) setters */,
20520 /// ]);
20521 /// ```
20522 pub fn set_valued_resources<T, V>(mut self, v: T) -> Self
20523 where
20524 T: std::iter::IntoIterator<Item = V>,
20525 V: std::convert::Into<crate::model::ValuedResource>,
20526 {
20527 use std::iter::Iterator;
20528 self.valued_resources = v.into_iter().map(|i| i.into()).collect();
20529 self
20530 }
20531
20532 /// Sets the value of [next_page_token][crate::model::ListValuedResourcesResponse::next_page_token].
20533 ///
20534 /// # Example
20535 /// ```ignore,no_run
20536 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20537 /// let x = ListValuedResourcesResponse::new().set_next_page_token("example");
20538 /// ```
20539 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20540 self.next_page_token = v.into();
20541 self
20542 }
20543
20544 /// Sets the value of [total_size][crate::model::ListValuedResourcesResponse::total_size].
20545 ///
20546 /// # Example
20547 /// ```ignore,no_run
20548 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20549 /// let x = ListValuedResourcesResponse::new().set_total_size(42);
20550 /// ```
20551 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20552 self.total_size = v.into();
20553 self
20554 }
20555}
20556
20557impl wkt::message::Message for ListValuedResourcesResponse {
20558 fn typename() -> &'static str {
20559 "type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesResponse"
20560 }
20561}
20562
20563#[doc(hidden)]
20564impl google_cloud_gax::paginator::internal::PageableResponse for ListValuedResourcesResponse {
20565 type PageItem = crate::model::ValuedResource;
20566
20567 fn items(self) -> std::vec::Vec<Self::PageItem> {
20568 self.valued_resources
20569 }
20570
20571 fn next_page_token(&self) -> std::string::String {
20572 use std::clone::Clone;
20573 self.next_page_token.clone()
20574 }
20575}
20576
20577/// Request message for updating a finding's state.
20578#[derive(Clone, Default, PartialEq)]
20579#[non_exhaustive]
20580pub struct SetFindingStateRequest {
20581 /// Required. The [relative resource
20582 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
20583 /// of the finding. If no location is specified, finding is assumed to be in
20584 /// global. The following list shows some examples:
20585 ///
20586 ///
20587 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
20588 /// +
20589 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20590 ///
20591 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
20592 ///
20593 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20594 ///
20595 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
20596 ///
20597 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20598 pub name: std::string::String,
20599
20600 /// Required. The desired State of the finding.
20601 pub state: crate::model::finding::State,
20602
20603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20604}
20605
20606impl SetFindingStateRequest {
20607 /// Creates a new default instance.
20608 pub fn new() -> Self {
20609 std::default::Default::default()
20610 }
20611
20612 /// Sets the value of [name][crate::model::SetFindingStateRequest::name].
20613 ///
20614 /// # Example
20615 /// ```ignore,no_run
20616 /// # use google_cloud_securitycenter_v2::model::SetFindingStateRequest;
20617 /// # let organization_id = "organization_id";
20618 /// # let source_id = "source_id";
20619 /// # let finding_id = "finding_id";
20620 /// let x = SetFindingStateRequest::new().set_name(format!("organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"));
20621 /// ```
20622 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20623 self.name = v.into();
20624 self
20625 }
20626
20627 /// Sets the value of [state][crate::model::SetFindingStateRequest::state].
20628 ///
20629 /// # Example
20630 /// ```ignore,no_run
20631 /// # use google_cloud_securitycenter_v2::model::SetFindingStateRequest;
20632 /// use google_cloud_securitycenter_v2::model::finding::State;
20633 /// let x0 = SetFindingStateRequest::new().set_state(State::Active);
20634 /// let x1 = SetFindingStateRequest::new().set_state(State::Inactive);
20635 /// ```
20636 pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
20637 self.state = v.into();
20638 self
20639 }
20640}
20641
20642impl wkt::message::Message for SetFindingStateRequest {
20643 fn typename() -> &'static str {
20644 "type.googleapis.com/google.cloud.securitycenter.v2.SetFindingStateRequest"
20645 }
20646}
20647
20648/// Request message for updating a finding's mute status.
20649#[derive(Clone, Default, PartialEq)]
20650#[non_exhaustive]
20651pub struct SetMuteRequest {
20652 /// Required. The [relative resource
20653 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
20654 /// of the finding. If no location is specified, finding is assumed to be in
20655 /// global. The following list shows some examples:
20656 ///
20657 ///
20658 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
20659 /// +
20660 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20661 ///
20662 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
20663 ///
20664 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20665 ///
20666 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
20667 ///
20668 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20669 pub name: std::string::String,
20670
20671 /// Required. The desired state of the Mute.
20672 pub mute: crate::model::finding::Mute,
20673
20674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20675}
20676
20677impl SetMuteRequest {
20678 /// Creates a new default instance.
20679 pub fn new() -> Self {
20680 std::default::Default::default()
20681 }
20682
20683 /// Sets the value of [name][crate::model::SetMuteRequest::name].
20684 ///
20685 /// # Example
20686 /// ```ignore,no_run
20687 /// # use google_cloud_securitycenter_v2::model::SetMuteRequest;
20688 /// # let organization_id = "organization_id";
20689 /// # let source_id = "source_id";
20690 /// # let finding_id = "finding_id";
20691 /// let x = SetMuteRequest::new().set_name(format!("organizations/{organization_id}/sources/{source_id}/findings/{finding_id}"));
20692 /// ```
20693 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20694 self.name = v.into();
20695 self
20696 }
20697
20698 /// Sets the value of [mute][crate::model::SetMuteRequest::mute].
20699 ///
20700 /// # Example
20701 /// ```ignore,no_run
20702 /// # use google_cloud_securitycenter_v2::model::SetMuteRequest;
20703 /// use google_cloud_securitycenter_v2::model::finding::Mute;
20704 /// let x0 = SetMuteRequest::new().set_mute(Mute::Muted);
20705 /// let x1 = SetMuteRequest::new().set_mute(Mute::Unmuted);
20706 /// let x2 = SetMuteRequest::new().set_mute(Mute::Undefined);
20707 /// ```
20708 pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
20709 self.mute = v.into();
20710 self
20711 }
20712}
20713
20714impl wkt::message::Message for SetMuteRequest {
20715 fn typename() -> &'static str {
20716 "type.googleapis.com/google.cloud.securitycenter.v2.SetMuteRequest"
20717 }
20718}
20719
20720/// Request message for updating a BigQuery export.
20721#[derive(Clone, Default, PartialEq)]
20722#[non_exhaustive]
20723pub struct UpdateBigQueryExportRequest {
20724 /// Required. The BigQuery export being updated.
20725 pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
20726
20727 /// The list of fields to be updated.
20728 /// If empty all mutable fields will be updated.
20729 pub update_mask: std::option::Option<wkt::FieldMask>,
20730
20731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20732}
20733
20734impl UpdateBigQueryExportRequest {
20735 /// Creates a new default instance.
20736 pub fn new() -> Self {
20737 std::default::Default::default()
20738 }
20739
20740 /// Sets the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
20741 ///
20742 /// # Example
20743 /// ```ignore,no_run
20744 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20745 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
20746 /// let x = UpdateBigQueryExportRequest::new().set_big_query_export(BigQueryExport::default()/* use setters */);
20747 /// ```
20748 pub fn set_big_query_export<T>(mut self, v: T) -> Self
20749 where
20750 T: std::convert::Into<crate::model::BigQueryExport>,
20751 {
20752 self.big_query_export = std::option::Option::Some(v.into());
20753 self
20754 }
20755
20756 /// Sets or clears the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
20757 ///
20758 /// # Example
20759 /// ```ignore,no_run
20760 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20761 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
20762 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_big_query_export(Some(BigQueryExport::default()/* use setters */));
20763 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_big_query_export(None::<BigQueryExport>);
20764 /// ```
20765 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
20766 where
20767 T: std::convert::Into<crate::model::BigQueryExport>,
20768 {
20769 self.big_query_export = v.map(|x| x.into());
20770 self
20771 }
20772
20773 /// Sets the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
20774 ///
20775 /// # Example
20776 /// ```ignore,no_run
20777 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20778 /// use wkt::FieldMask;
20779 /// let x = UpdateBigQueryExportRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20780 /// ```
20781 pub fn set_update_mask<T>(mut self, v: T) -> Self
20782 where
20783 T: std::convert::Into<wkt::FieldMask>,
20784 {
20785 self.update_mask = std::option::Option::Some(v.into());
20786 self
20787 }
20788
20789 /// Sets or clears the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
20790 ///
20791 /// # Example
20792 /// ```ignore,no_run
20793 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20794 /// use wkt::FieldMask;
20795 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20796 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20797 /// ```
20798 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20799 where
20800 T: std::convert::Into<wkt::FieldMask>,
20801 {
20802 self.update_mask = v.map(|x| x.into());
20803 self
20804 }
20805}
20806
20807impl wkt::message::Message for UpdateBigQueryExportRequest {
20808 fn typename() -> &'static str {
20809 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateBigQueryExportRequest"
20810 }
20811}
20812
20813/// Request message for updating a ExternalSystem resource.
20814#[derive(Clone, Default, PartialEq)]
20815#[non_exhaustive]
20816pub struct UpdateExternalSystemRequest {
20817 /// Required. The external system resource to update.
20818 pub external_system: std::option::Option<crate::model::ExternalSystem>,
20819
20820 /// The FieldMask to use when updating the external system resource.
20821 ///
20822 /// If empty all mutable fields will be updated.
20823 pub update_mask: std::option::Option<wkt::FieldMask>,
20824
20825 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20826}
20827
20828impl UpdateExternalSystemRequest {
20829 /// Creates a new default instance.
20830 pub fn new() -> Self {
20831 std::default::Default::default()
20832 }
20833
20834 /// Sets the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
20835 ///
20836 /// # Example
20837 /// ```ignore,no_run
20838 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20839 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
20840 /// let x = UpdateExternalSystemRequest::new().set_external_system(ExternalSystem::default()/* use setters */);
20841 /// ```
20842 pub fn set_external_system<T>(mut self, v: T) -> Self
20843 where
20844 T: std::convert::Into<crate::model::ExternalSystem>,
20845 {
20846 self.external_system = std::option::Option::Some(v.into());
20847 self
20848 }
20849
20850 /// Sets or clears the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
20851 ///
20852 /// # Example
20853 /// ```ignore,no_run
20854 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20855 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
20856 /// let x = UpdateExternalSystemRequest::new().set_or_clear_external_system(Some(ExternalSystem::default()/* use setters */));
20857 /// let x = UpdateExternalSystemRequest::new().set_or_clear_external_system(None::<ExternalSystem>);
20858 /// ```
20859 pub fn set_or_clear_external_system<T>(mut self, v: std::option::Option<T>) -> Self
20860 where
20861 T: std::convert::Into<crate::model::ExternalSystem>,
20862 {
20863 self.external_system = v.map(|x| x.into());
20864 self
20865 }
20866
20867 /// Sets the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
20868 ///
20869 /// # Example
20870 /// ```ignore,no_run
20871 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20872 /// use wkt::FieldMask;
20873 /// let x = UpdateExternalSystemRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20874 /// ```
20875 pub fn set_update_mask<T>(mut self, v: T) -> Self
20876 where
20877 T: std::convert::Into<wkt::FieldMask>,
20878 {
20879 self.update_mask = std::option::Option::Some(v.into());
20880 self
20881 }
20882
20883 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
20884 ///
20885 /// # Example
20886 /// ```ignore,no_run
20887 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20888 /// use wkt::FieldMask;
20889 /// let x = UpdateExternalSystemRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20890 /// let x = UpdateExternalSystemRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20891 /// ```
20892 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20893 where
20894 T: std::convert::Into<wkt::FieldMask>,
20895 {
20896 self.update_mask = v.map(|x| x.into());
20897 self
20898 }
20899}
20900
20901impl wkt::message::Message for UpdateExternalSystemRequest {
20902 fn typename() -> &'static str {
20903 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateExternalSystemRequest"
20904 }
20905}
20906
20907/// Request message for updating or creating a finding.
20908#[derive(Clone, Default, PartialEq)]
20909#[non_exhaustive]
20910pub struct UpdateFindingRequest {
20911 /// Required. The finding resource to update or create if it does not already
20912 /// exist. parent, security_marks, and update_time will be ignored.
20913 ///
20914 /// In the case of creation, the finding id portion of the name must be
20915 /// alphanumeric and less than or equal to 32 characters and greater than 0
20916 /// characters in length.
20917 pub finding: std::option::Option<crate::model::Finding>,
20918
20919 /// The FieldMask to use when updating the finding resource. This field should
20920 /// not be specified when creating a finding.
20921 ///
20922 /// When updating a finding, an empty mask is treated as updating all mutable
20923 /// fields and replacing source_properties. Individual source_properties can
20924 /// be added/updated by using "source_properties.\<property key\>" in the field
20925 /// mask.
20926 pub update_mask: std::option::Option<wkt::FieldMask>,
20927
20928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20929}
20930
20931impl UpdateFindingRequest {
20932 /// Creates a new default instance.
20933 pub fn new() -> Self {
20934 std::default::Default::default()
20935 }
20936
20937 /// Sets the value of [finding][crate::model::UpdateFindingRequest::finding].
20938 ///
20939 /// # Example
20940 /// ```ignore,no_run
20941 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20942 /// use google_cloud_securitycenter_v2::model::Finding;
20943 /// let x = UpdateFindingRequest::new().set_finding(Finding::default()/* use setters */);
20944 /// ```
20945 pub fn set_finding<T>(mut self, v: T) -> Self
20946 where
20947 T: std::convert::Into<crate::model::Finding>,
20948 {
20949 self.finding = std::option::Option::Some(v.into());
20950 self
20951 }
20952
20953 /// Sets or clears the value of [finding][crate::model::UpdateFindingRequest::finding].
20954 ///
20955 /// # Example
20956 /// ```ignore,no_run
20957 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20958 /// use google_cloud_securitycenter_v2::model::Finding;
20959 /// let x = UpdateFindingRequest::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
20960 /// let x = UpdateFindingRequest::new().set_or_clear_finding(None::<Finding>);
20961 /// ```
20962 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
20963 where
20964 T: std::convert::Into<crate::model::Finding>,
20965 {
20966 self.finding = v.map(|x| x.into());
20967 self
20968 }
20969
20970 /// Sets the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
20971 ///
20972 /// # Example
20973 /// ```ignore,no_run
20974 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20975 /// use wkt::FieldMask;
20976 /// let x = UpdateFindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20977 /// ```
20978 pub fn set_update_mask<T>(mut self, v: T) -> Self
20979 where
20980 T: std::convert::Into<wkt::FieldMask>,
20981 {
20982 self.update_mask = std::option::Option::Some(v.into());
20983 self
20984 }
20985
20986 /// Sets or clears the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
20987 ///
20988 /// # Example
20989 /// ```ignore,no_run
20990 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20991 /// use wkt::FieldMask;
20992 /// let x = UpdateFindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20993 /// let x = UpdateFindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20994 /// ```
20995 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20996 where
20997 T: std::convert::Into<wkt::FieldMask>,
20998 {
20999 self.update_mask = v.map(|x| x.into());
21000 self
21001 }
21002}
21003
21004impl wkt::message::Message for UpdateFindingRequest {
21005 fn typename() -> &'static str {
21006 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateFindingRequest"
21007 }
21008}
21009
21010/// Request message for updating a mute config.
21011#[derive(Clone, Default, PartialEq)]
21012#[non_exhaustive]
21013pub struct UpdateMuteConfigRequest {
21014 /// Required. The mute config being updated.
21015 pub mute_config: std::option::Option<crate::model::MuteConfig>,
21016
21017 /// The list of fields to be updated.
21018 /// If empty all mutable fields will be updated.
21019 pub update_mask: std::option::Option<wkt::FieldMask>,
21020
21021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21022}
21023
21024impl UpdateMuteConfigRequest {
21025 /// Creates a new default instance.
21026 pub fn new() -> Self {
21027 std::default::Default::default()
21028 }
21029
21030 /// Sets the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
21031 ///
21032 /// # Example
21033 /// ```ignore,no_run
21034 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
21035 /// use google_cloud_securitycenter_v2::model::MuteConfig;
21036 /// let x = UpdateMuteConfigRequest::new().set_mute_config(MuteConfig::default()/* use setters */);
21037 /// ```
21038 pub fn set_mute_config<T>(mut self, v: T) -> Self
21039 where
21040 T: std::convert::Into<crate::model::MuteConfig>,
21041 {
21042 self.mute_config = std::option::Option::Some(v.into());
21043 self
21044 }
21045
21046 /// Sets or clears the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
21047 ///
21048 /// # Example
21049 /// ```ignore,no_run
21050 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
21051 /// use google_cloud_securitycenter_v2::model::MuteConfig;
21052 /// let x = UpdateMuteConfigRequest::new().set_or_clear_mute_config(Some(MuteConfig::default()/* use setters */));
21053 /// let x = UpdateMuteConfigRequest::new().set_or_clear_mute_config(None::<MuteConfig>);
21054 /// ```
21055 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
21056 where
21057 T: std::convert::Into<crate::model::MuteConfig>,
21058 {
21059 self.mute_config = v.map(|x| x.into());
21060 self
21061 }
21062
21063 /// Sets the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
21064 ///
21065 /// # Example
21066 /// ```ignore,no_run
21067 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
21068 /// use wkt::FieldMask;
21069 /// let x = UpdateMuteConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21070 /// ```
21071 pub fn set_update_mask<T>(mut self, v: T) -> Self
21072 where
21073 T: std::convert::Into<wkt::FieldMask>,
21074 {
21075 self.update_mask = std::option::Option::Some(v.into());
21076 self
21077 }
21078
21079 /// Sets or clears the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
21080 ///
21081 /// # Example
21082 /// ```ignore,no_run
21083 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
21084 /// use wkt::FieldMask;
21085 /// let x = UpdateMuteConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21086 /// let x = UpdateMuteConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21087 /// ```
21088 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21089 where
21090 T: std::convert::Into<wkt::FieldMask>,
21091 {
21092 self.update_mask = v.map(|x| x.into());
21093 self
21094 }
21095}
21096
21097impl wkt::message::Message for UpdateMuteConfigRequest {
21098 fn typename() -> &'static str {
21099 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateMuteConfigRequest"
21100 }
21101}
21102
21103/// Request message for updating a notification config.
21104#[derive(Clone, Default, PartialEq)]
21105#[non_exhaustive]
21106pub struct UpdateNotificationConfigRequest {
21107 /// Required. The notification config to update.
21108 pub notification_config: std::option::Option<crate::model::NotificationConfig>,
21109
21110 /// The FieldMask to use when updating the notification config.
21111 ///
21112 /// If empty all mutable fields will be updated.
21113 pub update_mask: std::option::Option<wkt::FieldMask>,
21114
21115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21116}
21117
21118impl UpdateNotificationConfigRequest {
21119 /// Creates a new default instance.
21120 pub fn new() -> Self {
21121 std::default::Default::default()
21122 }
21123
21124 /// Sets the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
21125 ///
21126 /// # Example
21127 /// ```ignore,no_run
21128 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
21129 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
21130 /// let x = UpdateNotificationConfigRequest::new().set_notification_config(NotificationConfig::default()/* use setters */);
21131 /// ```
21132 pub fn set_notification_config<T>(mut self, v: T) -> Self
21133 where
21134 T: std::convert::Into<crate::model::NotificationConfig>,
21135 {
21136 self.notification_config = std::option::Option::Some(v.into());
21137 self
21138 }
21139
21140 /// Sets or clears the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
21141 ///
21142 /// # Example
21143 /// ```ignore,no_run
21144 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
21145 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
21146 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
21147 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_notification_config(None::<NotificationConfig>);
21148 /// ```
21149 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
21150 where
21151 T: std::convert::Into<crate::model::NotificationConfig>,
21152 {
21153 self.notification_config = v.map(|x| x.into());
21154 self
21155 }
21156
21157 /// Sets the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
21158 ///
21159 /// # Example
21160 /// ```ignore,no_run
21161 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
21162 /// use wkt::FieldMask;
21163 /// let x = UpdateNotificationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21164 /// ```
21165 pub fn set_update_mask<T>(mut self, v: T) -> Self
21166 where
21167 T: std::convert::Into<wkt::FieldMask>,
21168 {
21169 self.update_mask = std::option::Option::Some(v.into());
21170 self
21171 }
21172
21173 /// Sets or clears the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
21174 ///
21175 /// # Example
21176 /// ```ignore,no_run
21177 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
21178 /// use wkt::FieldMask;
21179 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21180 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21181 /// ```
21182 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21183 where
21184 T: std::convert::Into<wkt::FieldMask>,
21185 {
21186 self.update_mask = v.map(|x| x.into());
21187 self
21188 }
21189}
21190
21191impl wkt::message::Message for UpdateNotificationConfigRequest {
21192 fn typename() -> &'static str {
21193 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateNotificationConfigRequest"
21194 }
21195}
21196
21197/// Request message to update resource value config
21198#[derive(Clone, Default, PartialEq)]
21199#[non_exhaustive]
21200pub struct UpdateResourceValueConfigRequest {
21201 /// Required. The resource value config being updated.
21202 pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
21203
21204 /// The list of fields to be updated.
21205 /// If empty all mutable fields will be updated.
21206 ///
21207 /// To update nested fields, include the top level field in the mask
21208 /// For example, to update gcp_metadata.resource_type, include the
21209 /// "gcp_metadata" field mask
21210 pub update_mask: std::option::Option<wkt::FieldMask>,
21211
21212 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21213}
21214
21215impl UpdateResourceValueConfigRequest {
21216 /// Creates a new default instance.
21217 pub fn new() -> Self {
21218 std::default::Default::default()
21219 }
21220
21221 /// Sets the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
21222 ///
21223 /// # Example
21224 /// ```ignore,no_run
21225 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21226 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
21227 /// let x = UpdateResourceValueConfigRequest::new().set_resource_value_config(ResourceValueConfig::default()/* use setters */);
21228 /// ```
21229 pub fn set_resource_value_config<T>(mut self, v: T) -> Self
21230 where
21231 T: std::convert::Into<crate::model::ResourceValueConfig>,
21232 {
21233 self.resource_value_config = std::option::Option::Some(v.into());
21234 self
21235 }
21236
21237 /// Sets or clears the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
21238 ///
21239 /// # Example
21240 /// ```ignore,no_run
21241 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21242 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
21243 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_resource_value_config(Some(ResourceValueConfig::default()/* use setters */));
21244 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_resource_value_config(None::<ResourceValueConfig>);
21245 /// ```
21246 pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
21247 where
21248 T: std::convert::Into<crate::model::ResourceValueConfig>,
21249 {
21250 self.resource_value_config = v.map(|x| x.into());
21251 self
21252 }
21253
21254 /// Sets the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
21255 ///
21256 /// # Example
21257 /// ```ignore,no_run
21258 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21259 /// use wkt::FieldMask;
21260 /// let x = UpdateResourceValueConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21261 /// ```
21262 pub fn set_update_mask<T>(mut self, v: T) -> Self
21263 where
21264 T: std::convert::Into<wkt::FieldMask>,
21265 {
21266 self.update_mask = std::option::Option::Some(v.into());
21267 self
21268 }
21269
21270 /// Sets or clears the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
21271 ///
21272 /// # Example
21273 /// ```ignore,no_run
21274 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21275 /// use wkt::FieldMask;
21276 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21277 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21278 /// ```
21279 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21280 where
21281 T: std::convert::Into<wkt::FieldMask>,
21282 {
21283 self.update_mask = v.map(|x| x.into());
21284 self
21285 }
21286}
21287
21288impl wkt::message::Message for UpdateResourceValueConfigRequest {
21289 fn typename() -> &'static str {
21290 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest"
21291 }
21292}
21293
21294/// Request message for updating a SecurityMarks resource.
21295#[derive(Clone, Default, PartialEq)]
21296#[non_exhaustive]
21297pub struct UpdateSecurityMarksRequest {
21298 /// Required. The security marks resource to update.
21299 pub security_marks: std::option::Option<crate::model::SecurityMarks>,
21300
21301 /// The FieldMask to use when updating the security marks resource.
21302 ///
21303 /// The field mask must not contain duplicate fields.
21304 /// If empty or set to "marks", all marks will be replaced. Individual
21305 /// marks can be updated using "marks.<mark_key>".
21306 pub update_mask: std::option::Option<wkt::FieldMask>,
21307
21308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21309}
21310
21311impl UpdateSecurityMarksRequest {
21312 /// Creates a new default instance.
21313 pub fn new() -> Self {
21314 std::default::Default::default()
21315 }
21316
21317 /// Sets the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
21318 ///
21319 /// # Example
21320 /// ```ignore,no_run
21321 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21322 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
21323 /// let x = UpdateSecurityMarksRequest::new().set_security_marks(SecurityMarks::default()/* use setters */);
21324 /// ```
21325 pub fn set_security_marks<T>(mut self, v: T) -> Self
21326 where
21327 T: std::convert::Into<crate::model::SecurityMarks>,
21328 {
21329 self.security_marks = std::option::Option::Some(v.into());
21330 self
21331 }
21332
21333 /// Sets or clears the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
21334 ///
21335 /// # Example
21336 /// ```ignore,no_run
21337 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21338 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
21339 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_security_marks(Some(SecurityMarks::default()/* use setters */));
21340 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_security_marks(None::<SecurityMarks>);
21341 /// ```
21342 pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
21343 where
21344 T: std::convert::Into<crate::model::SecurityMarks>,
21345 {
21346 self.security_marks = v.map(|x| x.into());
21347 self
21348 }
21349
21350 /// Sets the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
21351 ///
21352 /// # Example
21353 /// ```ignore,no_run
21354 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21355 /// use wkt::FieldMask;
21356 /// let x = UpdateSecurityMarksRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21357 /// ```
21358 pub fn set_update_mask<T>(mut self, v: T) -> Self
21359 where
21360 T: std::convert::Into<wkt::FieldMask>,
21361 {
21362 self.update_mask = std::option::Option::Some(v.into());
21363 self
21364 }
21365
21366 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
21367 ///
21368 /// # Example
21369 /// ```ignore,no_run
21370 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21371 /// use wkt::FieldMask;
21372 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21373 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21374 /// ```
21375 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21376 where
21377 T: std::convert::Into<wkt::FieldMask>,
21378 {
21379 self.update_mask = v.map(|x| x.into());
21380 self
21381 }
21382}
21383
21384impl wkt::message::Message for UpdateSecurityMarksRequest {
21385 fn typename() -> &'static str {
21386 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateSecurityMarksRequest"
21387 }
21388}
21389
21390/// Request message for updating a source.
21391#[derive(Clone, Default, PartialEq)]
21392#[non_exhaustive]
21393pub struct UpdateSourceRequest {
21394 /// Required. The source resource to update.
21395 pub source: std::option::Option<crate::model::Source>,
21396
21397 /// The FieldMask to use when updating the source resource.
21398 ///
21399 /// If empty all mutable fields will be updated.
21400 pub update_mask: std::option::Option<wkt::FieldMask>,
21401
21402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21403}
21404
21405impl UpdateSourceRequest {
21406 /// Creates a new default instance.
21407 pub fn new() -> Self {
21408 std::default::Default::default()
21409 }
21410
21411 /// Sets the value of [source][crate::model::UpdateSourceRequest::source].
21412 ///
21413 /// # Example
21414 /// ```ignore,no_run
21415 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21416 /// use google_cloud_securitycenter_v2::model::Source;
21417 /// let x = UpdateSourceRequest::new().set_source(Source::default()/* use setters */);
21418 /// ```
21419 pub fn set_source<T>(mut self, v: T) -> Self
21420 where
21421 T: std::convert::Into<crate::model::Source>,
21422 {
21423 self.source = std::option::Option::Some(v.into());
21424 self
21425 }
21426
21427 /// Sets or clears the value of [source][crate::model::UpdateSourceRequest::source].
21428 ///
21429 /// # Example
21430 /// ```ignore,no_run
21431 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21432 /// use google_cloud_securitycenter_v2::model::Source;
21433 /// let x = UpdateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
21434 /// let x = UpdateSourceRequest::new().set_or_clear_source(None::<Source>);
21435 /// ```
21436 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
21437 where
21438 T: std::convert::Into<crate::model::Source>,
21439 {
21440 self.source = v.map(|x| x.into());
21441 self
21442 }
21443
21444 /// Sets the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
21445 ///
21446 /// # Example
21447 /// ```ignore,no_run
21448 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21449 /// use wkt::FieldMask;
21450 /// let x = UpdateSourceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21451 /// ```
21452 pub fn set_update_mask<T>(mut self, v: T) -> Self
21453 where
21454 T: std::convert::Into<wkt::FieldMask>,
21455 {
21456 self.update_mask = std::option::Option::Some(v.into());
21457 self
21458 }
21459
21460 /// Sets or clears the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
21461 ///
21462 /// # Example
21463 /// ```ignore,no_run
21464 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21465 /// use wkt::FieldMask;
21466 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21467 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21468 /// ```
21469 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21470 where
21471 T: std::convert::Into<wkt::FieldMask>,
21472 {
21473 self.update_mask = v.map(|x| x.into());
21474 self
21475 }
21476}
21477
21478impl wkt::message::Message for UpdateSourceRequest {
21479 fn typename() -> &'static str {
21480 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateSourceRequest"
21481 }
21482}
21483
21484/// Attack path simulation
21485#[derive(Clone, Default, PartialEq)]
21486#[non_exhaustive]
21487pub struct Simulation {
21488 /// Full resource name of the Simulation:
21489 /// `organizations/123/simulations/456`
21490 pub name: std::string::String,
21491
21492 /// Output only. Time simulation was created
21493 pub create_time: std::option::Option<wkt::Timestamp>,
21494
21495 /// Resource value configurations' metadata used in this simulation. Maximum of
21496 /// 100.
21497 pub resource_value_configs_metadata: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
21498
21499 /// Indicates which cloud provider was used in this simulation.
21500 pub cloud_provider: crate::model::CloudProvider,
21501
21502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21503}
21504
21505impl Simulation {
21506 /// Creates a new default instance.
21507 pub fn new() -> Self {
21508 std::default::Default::default()
21509 }
21510
21511 /// Sets the value of [name][crate::model::Simulation::name].
21512 ///
21513 /// # Example
21514 /// ```ignore,no_run
21515 /// # use google_cloud_securitycenter_v2::model::Simulation;
21516 /// # let organization_id = "organization_id";
21517 /// # let simulation_id = "simulation_id";
21518 /// let x = Simulation::new().set_name(format!("organizations/{organization_id}/simulations/{simulation_id}"));
21519 /// ```
21520 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21521 self.name = v.into();
21522 self
21523 }
21524
21525 /// Sets the value of [create_time][crate::model::Simulation::create_time].
21526 ///
21527 /// # Example
21528 /// ```ignore,no_run
21529 /// # use google_cloud_securitycenter_v2::model::Simulation;
21530 /// use wkt::Timestamp;
21531 /// let x = Simulation::new().set_create_time(Timestamp::default()/* use setters */);
21532 /// ```
21533 pub fn set_create_time<T>(mut self, v: T) -> Self
21534 where
21535 T: std::convert::Into<wkt::Timestamp>,
21536 {
21537 self.create_time = std::option::Option::Some(v.into());
21538 self
21539 }
21540
21541 /// Sets or clears the value of [create_time][crate::model::Simulation::create_time].
21542 ///
21543 /// # Example
21544 /// ```ignore,no_run
21545 /// # use google_cloud_securitycenter_v2::model::Simulation;
21546 /// use wkt::Timestamp;
21547 /// let x = Simulation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21548 /// let x = Simulation::new().set_or_clear_create_time(None::<Timestamp>);
21549 /// ```
21550 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21551 where
21552 T: std::convert::Into<wkt::Timestamp>,
21553 {
21554 self.create_time = v.map(|x| x.into());
21555 self
21556 }
21557
21558 /// Sets the value of [resource_value_configs_metadata][crate::model::Simulation::resource_value_configs_metadata].
21559 ///
21560 /// # Example
21561 /// ```ignore,no_run
21562 /// # use google_cloud_securitycenter_v2::model::Simulation;
21563 /// use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21564 /// let x = Simulation::new()
21565 /// .set_resource_value_configs_metadata([
21566 /// ResourceValueConfigMetadata::default()/* use setters */,
21567 /// ResourceValueConfigMetadata::default()/* use (different) setters */,
21568 /// ]);
21569 /// ```
21570 pub fn set_resource_value_configs_metadata<T, V>(mut self, v: T) -> Self
21571 where
21572 T: std::iter::IntoIterator<Item = V>,
21573 V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
21574 {
21575 use std::iter::Iterator;
21576 self.resource_value_configs_metadata = v.into_iter().map(|i| i.into()).collect();
21577 self
21578 }
21579
21580 /// Sets the value of [cloud_provider][crate::model::Simulation::cloud_provider].
21581 ///
21582 /// # Example
21583 /// ```ignore,no_run
21584 /// # use google_cloud_securitycenter_v2::model::Simulation;
21585 /// use google_cloud_securitycenter_v2::model::CloudProvider;
21586 /// let x0 = Simulation::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
21587 /// let x1 = Simulation::new().set_cloud_provider(CloudProvider::AmazonWebServices);
21588 /// let x2 = Simulation::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
21589 /// ```
21590 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
21591 mut self,
21592 v: T,
21593 ) -> Self {
21594 self.cloud_provider = v.into();
21595 self
21596 }
21597}
21598
21599impl wkt::message::Message for Simulation {
21600 fn typename() -> &'static str {
21601 "type.googleapis.com/google.cloud.securitycenter.v2.Simulation"
21602 }
21603}
21604
21605/// Security Command Center finding source. A finding source
21606/// is an entity or a mechanism that can produce a finding. A source is like a
21607/// container of findings that come from the same scanner, logger, monitor, and
21608/// other tools.
21609#[derive(Clone, Default, PartialEq)]
21610#[non_exhaustive]
21611pub struct Source {
21612 /// The relative resource name of this source. See:
21613 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
21614 /// Example:
21615 /// "organizations/{organization_id}/sources/{source_id}"
21616 pub name: std::string::String,
21617
21618 /// The source's display name.
21619 /// A source's display name must be unique amongst its siblings, for example,
21620 /// two sources with the same parent can't share the same display name.
21621 /// The display name must have a length between 1 and 64 characters
21622 /// (inclusive).
21623 pub display_name: std::string::String,
21624
21625 /// The description of the source (max of 1024 characters).
21626 /// Example:
21627 /// "Web Security Scanner is a web security scanner for common
21628 /// vulnerabilities in App Engine applications. It can automatically
21629 /// scan and detect four common vulnerabilities, including cross-site-scripting
21630 /// (XSS), Flash injection, mixed content (HTTP in HTTPS), and
21631 /// outdated or insecure libraries."
21632 pub description: std::string::String,
21633
21634 /// The canonical name of the finding source. It's either
21635 /// "organizations/{organization_id}/sources/{source_id}",
21636 /// "folders/{folder_id}/sources/{source_id}", or
21637 /// "projects/{project_number}/sources/{source_id}",
21638 /// depending on the closest CRM ancestor of the resource associated with the
21639 /// finding.
21640 pub canonical_name: std::string::String,
21641
21642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21643}
21644
21645impl Source {
21646 /// Creates a new default instance.
21647 pub fn new() -> Self {
21648 std::default::Default::default()
21649 }
21650
21651 /// Sets the value of [name][crate::model::Source::name].
21652 ///
21653 /// # Example
21654 /// ```ignore,no_run
21655 /// # use google_cloud_securitycenter_v2::model::Source;
21656 /// # let organization_id = "organization_id";
21657 /// # let source_id = "source_id";
21658 /// let x = Source::new().set_name(format!("organizations/{organization_id}/sources/{source_id}"));
21659 /// ```
21660 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21661 self.name = v.into();
21662 self
21663 }
21664
21665 /// Sets the value of [display_name][crate::model::Source::display_name].
21666 ///
21667 /// # Example
21668 /// ```ignore,no_run
21669 /// # use google_cloud_securitycenter_v2::model::Source;
21670 /// let x = Source::new().set_display_name("example");
21671 /// ```
21672 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21673 self.display_name = v.into();
21674 self
21675 }
21676
21677 /// Sets the value of [description][crate::model::Source::description].
21678 ///
21679 /// # Example
21680 /// ```ignore,no_run
21681 /// # use google_cloud_securitycenter_v2::model::Source;
21682 /// let x = Source::new().set_description("example");
21683 /// ```
21684 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21685 self.description = v.into();
21686 self
21687 }
21688
21689 /// Sets the value of [canonical_name][crate::model::Source::canonical_name].
21690 ///
21691 /// # Example
21692 /// ```ignore,no_run
21693 /// # use google_cloud_securitycenter_v2::model::Source;
21694 /// let x = Source::new().set_canonical_name("example");
21695 /// ```
21696 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21697 self.canonical_name = v.into();
21698 self
21699 }
21700}
21701
21702impl wkt::message::Message for Source {
21703 fn typename() -> &'static str {
21704 "type.googleapis.com/google.cloud.securitycenter.v2.Source"
21705 }
21706}
21707
21708/// Contains details about a group of security issues that, when the issues
21709/// occur together, represent a greater risk than when the issues occur
21710/// independently. A group of such issues is referred to as a toxic
21711/// combination.
21712#[derive(Clone, Default, PartialEq)]
21713#[non_exhaustive]
21714pub struct ToxicCombination {
21715 /// The
21716 /// [Attack exposure
21717 /// score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores)
21718 /// of this toxic combination. The score is a measure of how much this toxic
21719 /// combination exposes one or more high-value resources to potential attack.
21720 pub attack_exposure_score: f64,
21721
21722 /// List of resource names of findings associated with this toxic combination.
21723 /// For example, `organizations/123/sources/456/findings/789`.
21724 pub related_findings: std::vec::Vec<std::string::String>,
21725
21726 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21727}
21728
21729impl ToxicCombination {
21730 /// Creates a new default instance.
21731 pub fn new() -> Self {
21732 std::default::Default::default()
21733 }
21734
21735 /// Sets the value of [attack_exposure_score][crate::model::ToxicCombination::attack_exposure_score].
21736 ///
21737 /// # Example
21738 /// ```ignore,no_run
21739 /// # use google_cloud_securitycenter_v2::model::ToxicCombination;
21740 /// let x = ToxicCombination::new().set_attack_exposure_score(42.0);
21741 /// ```
21742 pub fn set_attack_exposure_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
21743 self.attack_exposure_score = v.into();
21744 self
21745 }
21746
21747 /// Sets the value of [related_findings][crate::model::ToxicCombination::related_findings].
21748 ///
21749 /// # Example
21750 /// ```ignore,no_run
21751 /// # use google_cloud_securitycenter_v2::model::ToxicCombination;
21752 /// let x = ToxicCombination::new().set_related_findings(["a", "b", "c"]);
21753 /// ```
21754 pub fn set_related_findings<T, V>(mut self, v: T) -> Self
21755 where
21756 T: std::iter::IntoIterator<Item = V>,
21757 V: std::convert::Into<std::string::String>,
21758 {
21759 use std::iter::Iterator;
21760 self.related_findings = v.into_iter().map(|i| i.into()).collect();
21761 self
21762 }
21763}
21764
21765impl wkt::message::Message for ToxicCombination {
21766 fn typename() -> &'static str {
21767 "type.googleapis.com/google.cloud.securitycenter.v2.ToxicCombination"
21768 }
21769}
21770
21771/// A resource that is determined to have value to a user's system
21772#[derive(Clone, Default, PartialEq)]
21773#[non_exhaustive]
21774pub struct ValuedResource {
21775 /// Valued resource name, for example,
21776 /// e.g.:
21777 /// `organizations/123/simulations/456/valuedResources/789`
21778 pub name: std::string::String,
21779
21780 /// The
21781 /// [full resource
21782 /// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
21783 /// of the valued resource.
21784 pub resource: std::string::String,
21785
21786 /// The [resource
21787 /// type](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
21788 /// of the valued resource.
21789 pub resource_type: std::string::String,
21790
21791 /// Human-readable name of the valued resource.
21792 pub display_name: std::string::String,
21793
21794 /// How valuable this resource is.
21795 pub resource_value: crate::model::valued_resource::ResourceValue,
21796
21797 /// Exposed score for this valued resource. A value of 0 means no exposure was
21798 /// detected exposure.
21799 pub exposed_score: f64,
21800
21801 /// List of resource value configurations' metadata used to determine the value
21802 /// of this resource. Maximum of 100.
21803 pub resource_value_configs_used: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
21804
21805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21806}
21807
21808impl ValuedResource {
21809 /// Creates a new default instance.
21810 pub fn new() -> Self {
21811 std::default::Default::default()
21812 }
21813
21814 /// Sets the value of [name][crate::model::ValuedResource::name].
21815 ///
21816 /// # Example
21817 /// ```ignore,no_run
21818 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21819 /// # let organization_id = "organization_id";
21820 /// # let simulation_id = "simulation_id";
21821 /// # let valued_resource_id = "valued_resource_id";
21822 /// let x = ValuedResource::new().set_name(format!("organizations/{organization_id}/simulations/{simulation_id}/valuedResources/{valued_resource_id}"));
21823 /// ```
21824 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21825 self.name = v.into();
21826 self
21827 }
21828
21829 /// Sets the value of [resource][crate::model::ValuedResource::resource].
21830 ///
21831 /// # Example
21832 /// ```ignore,no_run
21833 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21834 /// let x = ValuedResource::new().set_resource("example");
21835 /// ```
21836 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21837 self.resource = v.into();
21838 self
21839 }
21840
21841 /// Sets the value of [resource_type][crate::model::ValuedResource::resource_type].
21842 ///
21843 /// # Example
21844 /// ```ignore,no_run
21845 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21846 /// let x = ValuedResource::new().set_resource_type("example");
21847 /// ```
21848 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21849 self.resource_type = v.into();
21850 self
21851 }
21852
21853 /// Sets the value of [display_name][crate::model::ValuedResource::display_name].
21854 ///
21855 /// # Example
21856 /// ```ignore,no_run
21857 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21858 /// let x = ValuedResource::new().set_display_name("example");
21859 /// ```
21860 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21861 self.display_name = v.into();
21862 self
21863 }
21864
21865 /// Sets the value of [resource_value][crate::model::ValuedResource::resource_value].
21866 ///
21867 /// # Example
21868 /// ```ignore,no_run
21869 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21870 /// use google_cloud_securitycenter_v2::model::valued_resource::ResourceValue;
21871 /// let x0 = ValuedResource::new().set_resource_value(ResourceValue::Low);
21872 /// let x1 = ValuedResource::new().set_resource_value(ResourceValue::Medium);
21873 /// let x2 = ValuedResource::new().set_resource_value(ResourceValue::High);
21874 /// ```
21875 pub fn set_resource_value<
21876 T: std::convert::Into<crate::model::valued_resource::ResourceValue>,
21877 >(
21878 mut self,
21879 v: T,
21880 ) -> Self {
21881 self.resource_value = v.into();
21882 self
21883 }
21884
21885 /// Sets the value of [exposed_score][crate::model::ValuedResource::exposed_score].
21886 ///
21887 /// # Example
21888 /// ```ignore,no_run
21889 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21890 /// let x = ValuedResource::new().set_exposed_score(42.0);
21891 /// ```
21892 pub fn set_exposed_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
21893 self.exposed_score = v.into();
21894 self
21895 }
21896
21897 /// Sets the value of [resource_value_configs_used][crate::model::ValuedResource::resource_value_configs_used].
21898 ///
21899 /// # Example
21900 /// ```ignore,no_run
21901 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21902 /// use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21903 /// let x = ValuedResource::new()
21904 /// .set_resource_value_configs_used([
21905 /// ResourceValueConfigMetadata::default()/* use setters */,
21906 /// ResourceValueConfigMetadata::default()/* use (different) setters */,
21907 /// ]);
21908 /// ```
21909 pub fn set_resource_value_configs_used<T, V>(mut self, v: T) -> Self
21910 where
21911 T: std::iter::IntoIterator<Item = V>,
21912 V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
21913 {
21914 use std::iter::Iterator;
21915 self.resource_value_configs_used = v.into_iter().map(|i| i.into()).collect();
21916 self
21917 }
21918}
21919
21920impl wkt::message::Message for ValuedResource {
21921 fn typename() -> &'static str {
21922 "type.googleapis.com/google.cloud.securitycenter.v2.ValuedResource"
21923 }
21924}
21925
21926/// Defines additional types related to [ValuedResource].
21927pub mod valued_resource {
21928 #[allow(unused_imports)]
21929 use super::*;
21930
21931 /// How valuable the resource is.
21932 ///
21933 /// # Working with unknown values
21934 ///
21935 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21936 /// additional enum variants at any time. Adding new variants is not considered
21937 /// a breaking change. Applications should write their code in anticipation of:
21938 ///
21939 /// - New values appearing in future releases of the client library, **and**
21940 /// - New values received dynamically, without application changes.
21941 ///
21942 /// Please consult the [Working with enums] section in the user guide for some
21943 /// guidelines.
21944 ///
21945 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21946 #[derive(Clone, Debug, PartialEq)]
21947 #[non_exhaustive]
21948 pub enum ResourceValue {
21949 /// The resource value isn't specified.
21950 Unspecified,
21951 /// This is a low-value resource.
21952 Low,
21953 /// This is a medium-value resource.
21954 Medium,
21955 /// This is a high-value resource.
21956 High,
21957 /// If set, the enum was initialized with an unknown value.
21958 ///
21959 /// Applications can examine the value using [ResourceValue::value] or
21960 /// [ResourceValue::name].
21961 UnknownValue(resource_value::UnknownValue),
21962 }
21963
21964 #[doc(hidden)]
21965 pub mod resource_value {
21966 #[allow(unused_imports)]
21967 use super::*;
21968 #[derive(Clone, Debug, PartialEq)]
21969 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21970 }
21971
21972 impl ResourceValue {
21973 /// Gets the enum value.
21974 ///
21975 /// Returns `None` if the enum contains an unknown value deserialized from
21976 /// the string representation of enums.
21977 pub fn value(&self) -> std::option::Option<i32> {
21978 match self {
21979 Self::Unspecified => std::option::Option::Some(0),
21980 Self::Low => std::option::Option::Some(1),
21981 Self::Medium => std::option::Option::Some(2),
21982 Self::High => std::option::Option::Some(3),
21983 Self::UnknownValue(u) => u.0.value(),
21984 }
21985 }
21986
21987 /// Gets the enum value as a string.
21988 ///
21989 /// Returns `None` if the enum contains an unknown value deserialized from
21990 /// the integer representation of enums.
21991 pub fn name(&self) -> std::option::Option<&str> {
21992 match self {
21993 Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
21994 Self::Low => std::option::Option::Some("RESOURCE_VALUE_LOW"),
21995 Self::Medium => std::option::Option::Some("RESOURCE_VALUE_MEDIUM"),
21996 Self::High => std::option::Option::Some("RESOURCE_VALUE_HIGH"),
21997 Self::UnknownValue(u) => u.0.name(),
21998 }
21999 }
22000 }
22001
22002 impl std::default::Default for ResourceValue {
22003 fn default() -> Self {
22004 use std::convert::From;
22005 Self::from(0)
22006 }
22007 }
22008
22009 impl std::fmt::Display for ResourceValue {
22010 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22011 wkt::internal::display_enum(f, self.name(), self.value())
22012 }
22013 }
22014
22015 impl std::convert::From<i32> for ResourceValue {
22016 fn from(value: i32) -> Self {
22017 match value {
22018 0 => Self::Unspecified,
22019 1 => Self::Low,
22020 2 => Self::Medium,
22021 3 => Self::High,
22022 _ => Self::UnknownValue(resource_value::UnknownValue(
22023 wkt::internal::UnknownEnumValue::Integer(value),
22024 )),
22025 }
22026 }
22027 }
22028
22029 impl std::convert::From<&str> for ResourceValue {
22030 fn from(value: &str) -> Self {
22031 use std::string::ToString;
22032 match value {
22033 "RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
22034 "RESOURCE_VALUE_LOW" => Self::Low,
22035 "RESOURCE_VALUE_MEDIUM" => Self::Medium,
22036 "RESOURCE_VALUE_HIGH" => Self::High,
22037 _ => Self::UnknownValue(resource_value::UnknownValue(
22038 wkt::internal::UnknownEnumValue::String(value.to_string()),
22039 )),
22040 }
22041 }
22042 }
22043
22044 impl serde::ser::Serialize for ResourceValue {
22045 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22046 where
22047 S: serde::Serializer,
22048 {
22049 match self {
22050 Self::Unspecified => serializer.serialize_i32(0),
22051 Self::Low => serializer.serialize_i32(1),
22052 Self::Medium => serializer.serialize_i32(2),
22053 Self::High => serializer.serialize_i32(3),
22054 Self::UnknownValue(u) => u.0.serialize(serializer),
22055 }
22056 }
22057 }
22058
22059 impl<'de> serde::de::Deserialize<'de> for ResourceValue {
22060 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22061 where
22062 D: serde::Deserializer<'de>,
22063 {
22064 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
22065 ".google.cloud.securitycenter.v2.ValuedResource.ResourceValue",
22066 ))
22067 }
22068 }
22069}
22070
22071/// Metadata about a ResourceValueConfig. For example, id and name.
22072#[derive(Clone, Default, PartialEq)]
22073#[non_exhaustive]
22074pub struct ResourceValueConfigMetadata {
22075 /// Resource value config name
22076 pub name: std::string::String,
22077
22078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22079}
22080
22081impl ResourceValueConfigMetadata {
22082 /// Creates a new default instance.
22083 pub fn new() -> Self {
22084 std::default::Default::default()
22085 }
22086
22087 /// Sets the value of [name][crate::model::ResourceValueConfigMetadata::name].
22088 ///
22089 /// # Example
22090 /// ```ignore,no_run
22091 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
22092 /// let x = ResourceValueConfigMetadata::new().set_name("example");
22093 /// ```
22094 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22095 self.name = v.into();
22096 self
22097 }
22098}
22099
22100impl wkt::message::Message for ResourceValueConfigMetadata {
22101 fn typename() -> &'static str {
22102 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfigMetadata"
22103 }
22104}
22105
22106/// Vertex AI-related information associated with the finding.
22107#[derive(Clone, Default, PartialEq)]
22108#[non_exhaustive]
22109pub struct VertexAi {
22110 /// Datasets associated with the finding.
22111 pub datasets: std::vec::Vec<crate::model::vertex_ai::Dataset>,
22112
22113 /// Pipelines associated with the finding.
22114 pub pipelines: std::vec::Vec<crate::model::vertex_ai::Pipeline>,
22115
22116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22117}
22118
22119impl VertexAi {
22120 /// Creates a new default instance.
22121 pub fn new() -> Self {
22122 std::default::Default::default()
22123 }
22124
22125 /// Sets the value of [datasets][crate::model::VertexAi::datasets].
22126 ///
22127 /// # Example
22128 /// ```ignore,no_run
22129 /// # use google_cloud_securitycenter_v2::model::VertexAi;
22130 /// use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
22131 /// let x = VertexAi::new()
22132 /// .set_datasets([
22133 /// Dataset::default()/* use setters */,
22134 /// Dataset::default()/* use (different) setters */,
22135 /// ]);
22136 /// ```
22137 pub fn set_datasets<T, V>(mut self, v: T) -> Self
22138 where
22139 T: std::iter::IntoIterator<Item = V>,
22140 V: std::convert::Into<crate::model::vertex_ai::Dataset>,
22141 {
22142 use std::iter::Iterator;
22143 self.datasets = v.into_iter().map(|i| i.into()).collect();
22144 self
22145 }
22146
22147 /// Sets the value of [pipelines][crate::model::VertexAi::pipelines].
22148 ///
22149 /// # Example
22150 /// ```ignore,no_run
22151 /// # use google_cloud_securitycenter_v2::model::VertexAi;
22152 /// use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22153 /// let x = VertexAi::new()
22154 /// .set_pipelines([
22155 /// Pipeline::default()/* use setters */,
22156 /// Pipeline::default()/* use (different) setters */,
22157 /// ]);
22158 /// ```
22159 pub fn set_pipelines<T, V>(mut self, v: T) -> Self
22160 where
22161 T: std::iter::IntoIterator<Item = V>,
22162 V: std::convert::Into<crate::model::vertex_ai::Pipeline>,
22163 {
22164 use std::iter::Iterator;
22165 self.pipelines = v.into_iter().map(|i| i.into()).collect();
22166 self
22167 }
22168}
22169
22170impl wkt::message::Message for VertexAi {
22171 fn typename() -> &'static str {
22172 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi"
22173 }
22174}
22175
22176/// Defines additional types related to [VertexAi].
22177pub mod vertex_ai {
22178 #[allow(unused_imports)]
22179 use super::*;
22180
22181 /// Vertex AI dataset associated with the finding.
22182 #[derive(Clone, Default, PartialEq)]
22183 #[non_exhaustive]
22184 pub struct Dataset {
22185 /// Resource name of the dataset, e.g.
22186 /// projects/{project}/locations/{location}/datasets/2094040236064505856
22187 pub name: std::string::String,
22188
22189 /// The user defined display name of dataset, e.g. plants-dataset
22190 pub display_name: std::string::String,
22191
22192 /// Data source, such as a BigQuery source URI, e.g.
22193 /// bq://scc-nexus-test.AIPPtest.gsod
22194 pub source: std::string::String,
22195
22196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22197 }
22198
22199 impl Dataset {
22200 /// Creates a new default instance.
22201 pub fn new() -> Self {
22202 std::default::Default::default()
22203 }
22204
22205 /// Sets the value of [name][crate::model::vertex_ai::Dataset::name].
22206 ///
22207 /// # Example
22208 /// ```ignore,no_run
22209 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
22210 /// let x = Dataset::new().set_name("example");
22211 /// ```
22212 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22213 self.name = v.into();
22214 self
22215 }
22216
22217 /// Sets the value of [display_name][crate::model::vertex_ai::Dataset::display_name].
22218 ///
22219 /// # Example
22220 /// ```ignore,no_run
22221 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
22222 /// let x = Dataset::new().set_display_name("example");
22223 /// ```
22224 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
22225 mut self,
22226 v: T,
22227 ) -> Self {
22228 self.display_name = v.into();
22229 self
22230 }
22231
22232 /// Sets the value of [source][crate::model::vertex_ai::Dataset::source].
22233 ///
22234 /// # Example
22235 /// ```ignore,no_run
22236 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
22237 /// let x = Dataset::new().set_source("example");
22238 /// ```
22239 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22240 self.source = v.into();
22241 self
22242 }
22243 }
22244
22245 impl wkt::message::Message for Dataset {
22246 fn typename() -> &'static str {
22247 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Dataset"
22248 }
22249 }
22250
22251 /// Vertex AI training pipeline associated with the finding.
22252 #[derive(Clone, Default, PartialEq)]
22253 #[non_exhaustive]
22254 pub struct Pipeline {
22255 /// Resource name of the pipeline, e.g.
22256 /// projects/{project}/locations/{location}/trainingPipelines/5253428229225578496
22257 pub name: std::string::String,
22258
22259 /// The user-defined display name of pipeline, e.g. plants-classification
22260 pub display_name: std::string::String,
22261
22262 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22263 }
22264
22265 impl Pipeline {
22266 /// Creates a new default instance.
22267 pub fn new() -> Self {
22268 std::default::Default::default()
22269 }
22270
22271 /// Sets the value of [name][crate::model::vertex_ai::Pipeline::name].
22272 ///
22273 /// # Example
22274 /// ```ignore,no_run
22275 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22276 /// let x = Pipeline::new().set_name("example");
22277 /// ```
22278 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22279 self.name = v.into();
22280 self
22281 }
22282
22283 /// Sets the value of [display_name][crate::model::vertex_ai::Pipeline::display_name].
22284 ///
22285 /// # Example
22286 /// ```ignore,no_run
22287 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22288 /// let x = Pipeline::new().set_display_name("example");
22289 /// ```
22290 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
22291 mut self,
22292 v: T,
22293 ) -> Self {
22294 self.display_name = v.into();
22295 self
22296 }
22297 }
22298
22299 impl wkt::message::Message for Pipeline {
22300 fn typename() -> &'static str {
22301 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Pipeline"
22302 }
22303 }
22304}
22305
22306/// Refers to common vulnerability fields e.g. cve, cvss, cwe etc.
22307#[derive(Clone, Default, PartialEq)]
22308#[non_exhaustive]
22309pub struct Vulnerability {
22310 /// CVE stands for Common Vulnerabilities and Exposures
22311 /// (<https://cve.mitre.org/about/>)
22312 pub cve: std::option::Option<crate::model::Cve>,
22313
22314 /// The offending package is relevant to the finding.
22315 pub offending_package: std::option::Option<crate::model::Package>,
22316
22317 /// The fixed package is relevant to the finding.
22318 pub fixed_package: std::option::Option<crate::model::Package>,
22319
22320 /// The security bulletin is relevant to this finding.
22321 pub security_bulletin: std::option::Option<crate::model::SecurityBulletin>,
22322
22323 /// Provider provided risk_score based on multiple factors. The higher the risk
22324 /// score, the more risky the vulnerability is.
22325 pub provider_risk_score: i64,
22326
22327 /// Represents whether the vulnerability is reachable (detected via static
22328 /// analysis)
22329 pub reachable: bool,
22330
22331 /// Represents one or more Common Weakness Enumeration (CWE) information on
22332 /// this vulnerability.
22333 pub cwes: std::vec::Vec<crate::model::Cwe>,
22334
22335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22336}
22337
22338impl Vulnerability {
22339 /// Creates a new default instance.
22340 pub fn new() -> Self {
22341 std::default::Default::default()
22342 }
22343
22344 /// Sets the value of [cve][crate::model::Vulnerability::cve].
22345 ///
22346 /// # Example
22347 /// ```ignore,no_run
22348 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22349 /// use google_cloud_securitycenter_v2::model::Cve;
22350 /// let x = Vulnerability::new().set_cve(Cve::default()/* use setters */);
22351 /// ```
22352 pub fn set_cve<T>(mut self, v: T) -> Self
22353 where
22354 T: std::convert::Into<crate::model::Cve>,
22355 {
22356 self.cve = std::option::Option::Some(v.into());
22357 self
22358 }
22359
22360 /// Sets or clears the value of [cve][crate::model::Vulnerability::cve].
22361 ///
22362 /// # Example
22363 /// ```ignore,no_run
22364 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22365 /// use google_cloud_securitycenter_v2::model::Cve;
22366 /// let x = Vulnerability::new().set_or_clear_cve(Some(Cve::default()/* use setters */));
22367 /// let x = Vulnerability::new().set_or_clear_cve(None::<Cve>);
22368 /// ```
22369 pub fn set_or_clear_cve<T>(mut self, v: std::option::Option<T>) -> Self
22370 where
22371 T: std::convert::Into<crate::model::Cve>,
22372 {
22373 self.cve = v.map(|x| x.into());
22374 self
22375 }
22376
22377 /// Sets the value of [offending_package][crate::model::Vulnerability::offending_package].
22378 ///
22379 /// # Example
22380 /// ```ignore,no_run
22381 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22382 /// use google_cloud_securitycenter_v2::model::Package;
22383 /// let x = Vulnerability::new().set_offending_package(Package::default()/* use setters */);
22384 /// ```
22385 pub fn set_offending_package<T>(mut self, v: T) -> Self
22386 where
22387 T: std::convert::Into<crate::model::Package>,
22388 {
22389 self.offending_package = std::option::Option::Some(v.into());
22390 self
22391 }
22392
22393 /// Sets or clears the value of [offending_package][crate::model::Vulnerability::offending_package].
22394 ///
22395 /// # Example
22396 /// ```ignore,no_run
22397 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22398 /// use google_cloud_securitycenter_v2::model::Package;
22399 /// let x = Vulnerability::new().set_or_clear_offending_package(Some(Package::default()/* use setters */));
22400 /// let x = Vulnerability::new().set_or_clear_offending_package(None::<Package>);
22401 /// ```
22402 pub fn set_or_clear_offending_package<T>(mut self, v: std::option::Option<T>) -> Self
22403 where
22404 T: std::convert::Into<crate::model::Package>,
22405 {
22406 self.offending_package = v.map(|x| x.into());
22407 self
22408 }
22409
22410 /// Sets the value of [fixed_package][crate::model::Vulnerability::fixed_package].
22411 ///
22412 /// # Example
22413 /// ```ignore,no_run
22414 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22415 /// use google_cloud_securitycenter_v2::model::Package;
22416 /// let x = Vulnerability::new().set_fixed_package(Package::default()/* use setters */);
22417 /// ```
22418 pub fn set_fixed_package<T>(mut self, v: T) -> Self
22419 where
22420 T: std::convert::Into<crate::model::Package>,
22421 {
22422 self.fixed_package = std::option::Option::Some(v.into());
22423 self
22424 }
22425
22426 /// Sets or clears the value of [fixed_package][crate::model::Vulnerability::fixed_package].
22427 ///
22428 /// # Example
22429 /// ```ignore,no_run
22430 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22431 /// use google_cloud_securitycenter_v2::model::Package;
22432 /// let x = Vulnerability::new().set_or_clear_fixed_package(Some(Package::default()/* use setters */));
22433 /// let x = Vulnerability::new().set_or_clear_fixed_package(None::<Package>);
22434 /// ```
22435 pub fn set_or_clear_fixed_package<T>(mut self, v: std::option::Option<T>) -> Self
22436 where
22437 T: std::convert::Into<crate::model::Package>,
22438 {
22439 self.fixed_package = v.map(|x| x.into());
22440 self
22441 }
22442
22443 /// Sets the value of [security_bulletin][crate::model::Vulnerability::security_bulletin].
22444 ///
22445 /// # Example
22446 /// ```ignore,no_run
22447 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22448 /// use google_cloud_securitycenter_v2::model::SecurityBulletin;
22449 /// let x = Vulnerability::new().set_security_bulletin(SecurityBulletin::default()/* use setters */);
22450 /// ```
22451 pub fn set_security_bulletin<T>(mut self, v: T) -> Self
22452 where
22453 T: std::convert::Into<crate::model::SecurityBulletin>,
22454 {
22455 self.security_bulletin = std::option::Option::Some(v.into());
22456 self
22457 }
22458
22459 /// Sets or clears the value of [security_bulletin][crate::model::Vulnerability::security_bulletin].
22460 ///
22461 /// # Example
22462 /// ```ignore,no_run
22463 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22464 /// use google_cloud_securitycenter_v2::model::SecurityBulletin;
22465 /// let x = Vulnerability::new().set_or_clear_security_bulletin(Some(SecurityBulletin::default()/* use setters */));
22466 /// let x = Vulnerability::new().set_or_clear_security_bulletin(None::<SecurityBulletin>);
22467 /// ```
22468 pub fn set_or_clear_security_bulletin<T>(mut self, v: std::option::Option<T>) -> Self
22469 where
22470 T: std::convert::Into<crate::model::SecurityBulletin>,
22471 {
22472 self.security_bulletin = v.map(|x| x.into());
22473 self
22474 }
22475
22476 /// Sets the value of [provider_risk_score][crate::model::Vulnerability::provider_risk_score].
22477 ///
22478 /// # Example
22479 /// ```ignore,no_run
22480 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22481 /// let x = Vulnerability::new().set_provider_risk_score(42);
22482 /// ```
22483 pub fn set_provider_risk_score<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22484 self.provider_risk_score = v.into();
22485 self
22486 }
22487
22488 /// Sets the value of [reachable][crate::model::Vulnerability::reachable].
22489 ///
22490 /// # Example
22491 /// ```ignore,no_run
22492 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22493 /// let x = Vulnerability::new().set_reachable(true);
22494 /// ```
22495 pub fn set_reachable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22496 self.reachable = v.into();
22497 self
22498 }
22499
22500 /// Sets the value of [cwes][crate::model::Vulnerability::cwes].
22501 ///
22502 /// # Example
22503 /// ```ignore,no_run
22504 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22505 /// use google_cloud_securitycenter_v2::model::Cwe;
22506 /// let x = Vulnerability::new()
22507 /// .set_cwes([
22508 /// Cwe::default()/* use setters */,
22509 /// Cwe::default()/* use (different) setters */,
22510 /// ]);
22511 /// ```
22512 pub fn set_cwes<T, V>(mut self, v: T) -> Self
22513 where
22514 T: std::iter::IntoIterator<Item = V>,
22515 V: std::convert::Into<crate::model::Cwe>,
22516 {
22517 use std::iter::Iterator;
22518 self.cwes = v.into_iter().map(|i| i.into()).collect();
22519 self
22520 }
22521}
22522
22523impl wkt::message::Message for Vulnerability {
22524 fn typename() -> &'static str {
22525 "type.googleapis.com/google.cloud.securitycenter.v2.Vulnerability"
22526 }
22527}
22528
22529/// CVE stands for Common Vulnerabilities and Exposures.
22530/// Information from the [CVE
22531/// record](https://www.cve.org/ResourcesSupport/Glossary) that describes this
22532/// vulnerability.
22533#[derive(Clone, Default, PartialEq)]
22534#[non_exhaustive]
22535pub struct Cve {
22536 /// The unique identifier for the vulnerability. e.g. CVE-2021-34527
22537 pub id: std::string::String,
22538
22539 /// Additional information about the CVE.
22540 /// e.g. <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527>
22541 pub references: std::vec::Vec<crate::model::Reference>,
22542
22543 /// Describe Common Vulnerability Scoring System specified at
22544 /// <https://www.first.org/cvss/v3.1/specification-document>
22545 pub cvssv3: std::option::Option<crate::model::Cvssv3>,
22546
22547 /// Whether upstream fix is available for the CVE.
22548 pub upstream_fix_available: bool,
22549
22550 /// The potential impact of the vulnerability if it was to be exploited.
22551 pub impact: crate::model::cve::RiskRating,
22552
22553 /// The exploitation activity of the vulnerability in the wild.
22554 pub exploitation_activity: crate::model::cve::ExploitationActivity,
22555
22556 /// Whether or not the vulnerability has been observed in the wild.
22557 pub observed_in_the_wild: bool,
22558
22559 /// Whether or not the vulnerability was zero day when the finding was
22560 /// published.
22561 pub zero_day: bool,
22562
22563 /// Date the first publicly available exploit or PoC was released.
22564 pub exploit_release_date: std::option::Option<wkt::Timestamp>,
22565
22566 /// Date of the earliest known exploitation.
22567 pub first_exploitation_date: std::option::Option<wkt::Timestamp>,
22568
22569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22570}
22571
22572impl Cve {
22573 /// Creates a new default instance.
22574 pub fn new() -> Self {
22575 std::default::Default::default()
22576 }
22577
22578 /// Sets the value of [id][crate::model::Cve::id].
22579 ///
22580 /// # Example
22581 /// ```ignore,no_run
22582 /// # use google_cloud_securitycenter_v2::model::Cve;
22583 /// let x = Cve::new().set_id("example");
22584 /// ```
22585 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22586 self.id = v.into();
22587 self
22588 }
22589
22590 /// Sets the value of [references][crate::model::Cve::references].
22591 ///
22592 /// # Example
22593 /// ```ignore,no_run
22594 /// # use google_cloud_securitycenter_v2::model::Cve;
22595 /// use google_cloud_securitycenter_v2::model::Reference;
22596 /// let x = Cve::new()
22597 /// .set_references([
22598 /// Reference::default()/* use setters */,
22599 /// Reference::default()/* use (different) setters */,
22600 /// ]);
22601 /// ```
22602 pub fn set_references<T, V>(mut self, v: T) -> Self
22603 where
22604 T: std::iter::IntoIterator<Item = V>,
22605 V: std::convert::Into<crate::model::Reference>,
22606 {
22607 use std::iter::Iterator;
22608 self.references = v.into_iter().map(|i| i.into()).collect();
22609 self
22610 }
22611
22612 /// Sets the value of [cvssv3][crate::model::Cve::cvssv3].
22613 ///
22614 /// # Example
22615 /// ```ignore,no_run
22616 /// # use google_cloud_securitycenter_v2::model::Cve;
22617 /// use google_cloud_securitycenter_v2::model::Cvssv3;
22618 /// let x = Cve::new().set_cvssv3(Cvssv3::default()/* use setters */);
22619 /// ```
22620 pub fn set_cvssv3<T>(mut self, v: T) -> Self
22621 where
22622 T: std::convert::Into<crate::model::Cvssv3>,
22623 {
22624 self.cvssv3 = std::option::Option::Some(v.into());
22625 self
22626 }
22627
22628 /// Sets or clears the value of [cvssv3][crate::model::Cve::cvssv3].
22629 ///
22630 /// # Example
22631 /// ```ignore,no_run
22632 /// # use google_cloud_securitycenter_v2::model::Cve;
22633 /// use google_cloud_securitycenter_v2::model::Cvssv3;
22634 /// let x = Cve::new().set_or_clear_cvssv3(Some(Cvssv3::default()/* use setters */));
22635 /// let x = Cve::new().set_or_clear_cvssv3(None::<Cvssv3>);
22636 /// ```
22637 pub fn set_or_clear_cvssv3<T>(mut self, v: std::option::Option<T>) -> Self
22638 where
22639 T: std::convert::Into<crate::model::Cvssv3>,
22640 {
22641 self.cvssv3 = v.map(|x| x.into());
22642 self
22643 }
22644
22645 /// Sets the value of [upstream_fix_available][crate::model::Cve::upstream_fix_available].
22646 ///
22647 /// # Example
22648 /// ```ignore,no_run
22649 /// # use google_cloud_securitycenter_v2::model::Cve;
22650 /// let x = Cve::new().set_upstream_fix_available(true);
22651 /// ```
22652 pub fn set_upstream_fix_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22653 self.upstream_fix_available = v.into();
22654 self
22655 }
22656
22657 /// Sets the value of [impact][crate::model::Cve::impact].
22658 ///
22659 /// # Example
22660 /// ```ignore,no_run
22661 /// # use google_cloud_securitycenter_v2::model::Cve;
22662 /// use google_cloud_securitycenter_v2::model::cve::RiskRating;
22663 /// let x0 = Cve::new().set_impact(RiskRating::Low);
22664 /// let x1 = Cve::new().set_impact(RiskRating::Medium);
22665 /// let x2 = Cve::new().set_impact(RiskRating::High);
22666 /// ```
22667 pub fn set_impact<T: std::convert::Into<crate::model::cve::RiskRating>>(
22668 mut self,
22669 v: T,
22670 ) -> Self {
22671 self.impact = v.into();
22672 self
22673 }
22674
22675 /// Sets the value of [exploitation_activity][crate::model::Cve::exploitation_activity].
22676 ///
22677 /// # Example
22678 /// ```ignore,no_run
22679 /// # use google_cloud_securitycenter_v2::model::Cve;
22680 /// use google_cloud_securitycenter_v2::model::cve::ExploitationActivity;
22681 /// let x0 = Cve::new().set_exploitation_activity(ExploitationActivity::Wide);
22682 /// let x1 = Cve::new().set_exploitation_activity(ExploitationActivity::Confirmed);
22683 /// let x2 = Cve::new().set_exploitation_activity(ExploitationActivity::Available);
22684 /// ```
22685 pub fn set_exploitation_activity<
22686 T: std::convert::Into<crate::model::cve::ExploitationActivity>,
22687 >(
22688 mut self,
22689 v: T,
22690 ) -> Self {
22691 self.exploitation_activity = v.into();
22692 self
22693 }
22694
22695 /// Sets the value of [observed_in_the_wild][crate::model::Cve::observed_in_the_wild].
22696 ///
22697 /// # Example
22698 /// ```ignore,no_run
22699 /// # use google_cloud_securitycenter_v2::model::Cve;
22700 /// let x = Cve::new().set_observed_in_the_wild(true);
22701 /// ```
22702 pub fn set_observed_in_the_wild<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22703 self.observed_in_the_wild = v.into();
22704 self
22705 }
22706
22707 /// Sets the value of [zero_day][crate::model::Cve::zero_day].
22708 ///
22709 /// # Example
22710 /// ```ignore,no_run
22711 /// # use google_cloud_securitycenter_v2::model::Cve;
22712 /// let x = Cve::new().set_zero_day(true);
22713 /// ```
22714 pub fn set_zero_day<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22715 self.zero_day = v.into();
22716 self
22717 }
22718
22719 /// Sets the value of [exploit_release_date][crate::model::Cve::exploit_release_date].
22720 ///
22721 /// # Example
22722 /// ```ignore,no_run
22723 /// # use google_cloud_securitycenter_v2::model::Cve;
22724 /// use wkt::Timestamp;
22725 /// let x = Cve::new().set_exploit_release_date(Timestamp::default()/* use setters */);
22726 /// ```
22727 pub fn set_exploit_release_date<T>(mut self, v: T) -> Self
22728 where
22729 T: std::convert::Into<wkt::Timestamp>,
22730 {
22731 self.exploit_release_date = std::option::Option::Some(v.into());
22732 self
22733 }
22734
22735 /// Sets or clears the value of [exploit_release_date][crate::model::Cve::exploit_release_date].
22736 ///
22737 /// # Example
22738 /// ```ignore,no_run
22739 /// # use google_cloud_securitycenter_v2::model::Cve;
22740 /// use wkt::Timestamp;
22741 /// let x = Cve::new().set_or_clear_exploit_release_date(Some(Timestamp::default()/* use setters */));
22742 /// let x = Cve::new().set_or_clear_exploit_release_date(None::<Timestamp>);
22743 /// ```
22744 pub fn set_or_clear_exploit_release_date<T>(mut self, v: std::option::Option<T>) -> Self
22745 where
22746 T: std::convert::Into<wkt::Timestamp>,
22747 {
22748 self.exploit_release_date = v.map(|x| x.into());
22749 self
22750 }
22751
22752 /// Sets the value of [first_exploitation_date][crate::model::Cve::first_exploitation_date].
22753 ///
22754 /// # Example
22755 /// ```ignore,no_run
22756 /// # use google_cloud_securitycenter_v2::model::Cve;
22757 /// use wkt::Timestamp;
22758 /// let x = Cve::new().set_first_exploitation_date(Timestamp::default()/* use setters */);
22759 /// ```
22760 pub fn set_first_exploitation_date<T>(mut self, v: T) -> Self
22761 where
22762 T: std::convert::Into<wkt::Timestamp>,
22763 {
22764 self.first_exploitation_date = std::option::Option::Some(v.into());
22765 self
22766 }
22767
22768 /// Sets or clears the value of [first_exploitation_date][crate::model::Cve::first_exploitation_date].
22769 ///
22770 /// # Example
22771 /// ```ignore,no_run
22772 /// # use google_cloud_securitycenter_v2::model::Cve;
22773 /// use wkt::Timestamp;
22774 /// let x = Cve::new().set_or_clear_first_exploitation_date(Some(Timestamp::default()/* use setters */));
22775 /// let x = Cve::new().set_or_clear_first_exploitation_date(None::<Timestamp>);
22776 /// ```
22777 pub fn set_or_clear_first_exploitation_date<T>(mut self, v: std::option::Option<T>) -> Self
22778 where
22779 T: std::convert::Into<wkt::Timestamp>,
22780 {
22781 self.first_exploitation_date = v.map(|x| x.into());
22782 self
22783 }
22784}
22785
22786impl wkt::message::Message for Cve {
22787 fn typename() -> &'static str {
22788 "type.googleapis.com/google.cloud.securitycenter.v2.Cve"
22789 }
22790}
22791
22792/// Defines additional types related to [Cve].
22793pub mod cve {
22794 #[allow(unused_imports)]
22795 use super::*;
22796
22797 /// The possible values of impact of the vulnerability if it was to be
22798 /// exploited.
22799 ///
22800 /// # Working with unknown values
22801 ///
22802 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22803 /// additional enum variants at any time. Adding new variants is not considered
22804 /// a breaking change. Applications should write their code in anticipation of:
22805 ///
22806 /// - New values appearing in future releases of the client library, **and**
22807 /// - New values received dynamically, without application changes.
22808 ///
22809 /// Please consult the [Working with enums] section in the user guide for some
22810 /// guidelines.
22811 ///
22812 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22813 #[derive(Clone, Debug, PartialEq)]
22814 #[non_exhaustive]
22815 pub enum RiskRating {
22816 /// Invalid or empty value.
22817 Unspecified,
22818 /// Exploitation would have little to no security impact.
22819 Low,
22820 /// Exploitation would enable attackers to perform activities, or could allow
22821 /// attackers to have a direct impact, but would require additional steps.
22822 Medium,
22823 /// Exploitation would enable attackers to have a notable direct impact
22824 /// without needing to overcome any major mitigating factors.
22825 High,
22826 /// Exploitation would fundamentally undermine the security of affected
22827 /// systems, enable actors to perform significant attacks with minimal
22828 /// effort, with little to no mitigating factors to overcome.
22829 Critical,
22830 /// If set, the enum was initialized with an unknown value.
22831 ///
22832 /// Applications can examine the value using [RiskRating::value] or
22833 /// [RiskRating::name].
22834 UnknownValue(risk_rating::UnknownValue),
22835 }
22836
22837 #[doc(hidden)]
22838 pub mod risk_rating {
22839 #[allow(unused_imports)]
22840 use super::*;
22841 #[derive(Clone, Debug, PartialEq)]
22842 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22843 }
22844
22845 impl RiskRating {
22846 /// Gets the enum value.
22847 ///
22848 /// Returns `None` if the enum contains an unknown value deserialized from
22849 /// the string representation of enums.
22850 pub fn value(&self) -> std::option::Option<i32> {
22851 match self {
22852 Self::Unspecified => std::option::Option::Some(0),
22853 Self::Low => std::option::Option::Some(1),
22854 Self::Medium => std::option::Option::Some(2),
22855 Self::High => std::option::Option::Some(3),
22856 Self::Critical => std::option::Option::Some(4),
22857 Self::UnknownValue(u) => u.0.value(),
22858 }
22859 }
22860
22861 /// Gets the enum value as a string.
22862 ///
22863 /// Returns `None` if the enum contains an unknown value deserialized from
22864 /// the integer representation of enums.
22865 pub fn name(&self) -> std::option::Option<&str> {
22866 match self {
22867 Self::Unspecified => std::option::Option::Some("RISK_RATING_UNSPECIFIED"),
22868 Self::Low => std::option::Option::Some("LOW"),
22869 Self::Medium => std::option::Option::Some("MEDIUM"),
22870 Self::High => std::option::Option::Some("HIGH"),
22871 Self::Critical => std::option::Option::Some("CRITICAL"),
22872 Self::UnknownValue(u) => u.0.name(),
22873 }
22874 }
22875 }
22876
22877 impl std::default::Default for RiskRating {
22878 fn default() -> Self {
22879 use std::convert::From;
22880 Self::from(0)
22881 }
22882 }
22883
22884 impl std::fmt::Display for RiskRating {
22885 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22886 wkt::internal::display_enum(f, self.name(), self.value())
22887 }
22888 }
22889
22890 impl std::convert::From<i32> for RiskRating {
22891 fn from(value: i32) -> Self {
22892 match value {
22893 0 => Self::Unspecified,
22894 1 => Self::Low,
22895 2 => Self::Medium,
22896 3 => Self::High,
22897 4 => Self::Critical,
22898 _ => Self::UnknownValue(risk_rating::UnknownValue(
22899 wkt::internal::UnknownEnumValue::Integer(value),
22900 )),
22901 }
22902 }
22903 }
22904
22905 impl std::convert::From<&str> for RiskRating {
22906 fn from(value: &str) -> Self {
22907 use std::string::ToString;
22908 match value {
22909 "RISK_RATING_UNSPECIFIED" => Self::Unspecified,
22910 "LOW" => Self::Low,
22911 "MEDIUM" => Self::Medium,
22912 "HIGH" => Self::High,
22913 "CRITICAL" => Self::Critical,
22914 _ => Self::UnknownValue(risk_rating::UnknownValue(
22915 wkt::internal::UnknownEnumValue::String(value.to_string()),
22916 )),
22917 }
22918 }
22919 }
22920
22921 impl serde::ser::Serialize for RiskRating {
22922 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22923 where
22924 S: serde::Serializer,
22925 {
22926 match self {
22927 Self::Unspecified => serializer.serialize_i32(0),
22928 Self::Low => serializer.serialize_i32(1),
22929 Self::Medium => serializer.serialize_i32(2),
22930 Self::High => serializer.serialize_i32(3),
22931 Self::Critical => serializer.serialize_i32(4),
22932 Self::UnknownValue(u) => u.0.serialize(serializer),
22933 }
22934 }
22935 }
22936
22937 impl<'de> serde::de::Deserialize<'de> for RiskRating {
22938 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22939 where
22940 D: serde::Deserializer<'de>,
22941 {
22942 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RiskRating>::new(
22943 ".google.cloud.securitycenter.v2.Cve.RiskRating",
22944 ))
22945 }
22946 }
22947
22948 /// The possible values of exploitation activity of the vulnerability in the
22949 /// wild.
22950 ///
22951 /// # Working with unknown values
22952 ///
22953 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22954 /// additional enum variants at any time. Adding new variants is not considered
22955 /// a breaking change. Applications should write their code in anticipation of:
22956 ///
22957 /// - New values appearing in future releases of the client library, **and**
22958 /// - New values received dynamically, without application changes.
22959 ///
22960 /// Please consult the [Working with enums] section in the user guide for some
22961 /// guidelines.
22962 ///
22963 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22964 #[derive(Clone, Debug, PartialEq)]
22965 #[non_exhaustive]
22966 pub enum ExploitationActivity {
22967 /// Invalid or empty value.
22968 Unspecified,
22969 /// Exploitation has been reported or confirmed to widely occur.
22970 Wide,
22971 /// Limited reported or confirmed exploitation activities.
22972 Confirmed,
22973 /// Exploit is publicly available.
22974 Available,
22975 /// No known exploitation activity, but has a high potential for
22976 /// exploitation.
22977 Anticipated,
22978 /// No known exploitation activity.
22979 NoKnown,
22980 /// If set, the enum was initialized with an unknown value.
22981 ///
22982 /// Applications can examine the value using [ExploitationActivity::value] or
22983 /// [ExploitationActivity::name].
22984 UnknownValue(exploitation_activity::UnknownValue),
22985 }
22986
22987 #[doc(hidden)]
22988 pub mod exploitation_activity {
22989 #[allow(unused_imports)]
22990 use super::*;
22991 #[derive(Clone, Debug, PartialEq)]
22992 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22993 }
22994
22995 impl ExploitationActivity {
22996 /// Gets the enum value.
22997 ///
22998 /// Returns `None` if the enum contains an unknown value deserialized from
22999 /// the string representation of enums.
23000 pub fn value(&self) -> std::option::Option<i32> {
23001 match self {
23002 Self::Unspecified => std::option::Option::Some(0),
23003 Self::Wide => std::option::Option::Some(1),
23004 Self::Confirmed => std::option::Option::Some(2),
23005 Self::Available => std::option::Option::Some(3),
23006 Self::Anticipated => std::option::Option::Some(4),
23007 Self::NoKnown => std::option::Option::Some(5),
23008 Self::UnknownValue(u) => u.0.value(),
23009 }
23010 }
23011
23012 /// Gets the enum value as a string.
23013 ///
23014 /// Returns `None` if the enum contains an unknown value deserialized from
23015 /// the integer representation of enums.
23016 pub fn name(&self) -> std::option::Option<&str> {
23017 match self {
23018 Self::Unspecified => std::option::Option::Some("EXPLOITATION_ACTIVITY_UNSPECIFIED"),
23019 Self::Wide => std::option::Option::Some("WIDE"),
23020 Self::Confirmed => std::option::Option::Some("CONFIRMED"),
23021 Self::Available => std::option::Option::Some("AVAILABLE"),
23022 Self::Anticipated => std::option::Option::Some("ANTICIPATED"),
23023 Self::NoKnown => std::option::Option::Some("NO_KNOWN"),
23024 Self::UnknownValue(u) => u.0.name(),
23025 }
23026 }
23027 }
23028
23029 impl std::default::Default for ExploitationActivity {
23030 fn default() -> Self {
23031 use std::convert::From;
23032 Self::from(0)
23033 }
23034 }
23035
23036 impl std::fmt::Display for ExploitationActivity {
23037 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23038 wkt::internal::display_enum(f, self.name(), self.value())
23039 }
23040 }
23041
23042 impl std::convert::From<i32> for ExploitationActivity {
23043 fn from(value: i32) -> Self {
23044 match value {
23045 0 => Self::Unspecified,
23046 1 => Self::Wide,
23047 2 => Self::Confirmed,
23048 3 => Self::Available,
23049 4 => Self::Anticipated,
23050 5 => Self::NoKnown,
23051 _ => Self::UnknownValue(exploitation_activity::UnknownValue(
23052 wkt::internal::UnknownEnumValue::Integer(value),
23053 )),
23054 }
23055 }
23056 }
23057
23058 impl std::convert::From<&str> for ExploitationActivity {
23059 fn from(value: &str) -> Self {
23060 use std::string::ToString;
23061 match value {
23062 "EXPLOITATION_ACTIVITY_UNSPECIFIED" => Self::Unspecified,
23063 "WIDE" => Self::Wide,
23064 "CONFIRMED" => Self::Confirmed,
23065 "AVAILABLE" => Self::Available,
23066 "ANTICIPATED" => Self::Anticipated,
23067 "NO_KNOWN" => Self::NoKnown,
23068 _ => Self::UnknownValue(exploitation_activity::UnknownValue(
23069 wkt::internal::UnknownEnumValue::String(value.to_string()),
23070 )),
23071 }
23072 }
23073 }
23074
23075 impl serde::ser::Serialize for ExploitationActivity {
23076 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23077 where
23078 S: serde::Serializer,
23079 {
23080 match self {
23081 Self::Unspecified => serializer.serialize_i32(0),
23082 Self::Wide => serializer.serialize_i32(1),
23083 Self::Confirmed => serializer.serialize_i32(2),
23084 Self::Available => serializer.serialize_i32(3),
23085 Self::Anticipated => serializer.serialize_i32(4),
23086 Self::NoKnown => serializer.serialize_i32(5),
23087 Self::UnknownValue(u) => u.0.serialize(serializer),
23088 }
23089 }
23090 }
23091
23092 impl<'de> serde::de::Deserialize<'de> for ExploitationActivity {
23093 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23094 where
23095 D: serde::Deserializer<'de>,
23096 {
23097 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExploitationActivity>::new(
23098 ".google.cloud.securitycenter.v2.Cve.ExploitationActivity",
23099 ))
23100 }
23101 }
23102}
23103
23104/// Additional Links
23105#[derive(Clone, Default, PartialEq)]
23106#[non_exhaustive]
23107pub struct Reference {
23108 /// Source of the reference e.g. NVD
23109 pub source: std::string::String,
23110
23111 /// Uri for the mentioned source e.g.
23112 /// <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527>.
23113 pub uri: std::string::String,
23114
23115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23116}
23117
23118impl Reference {
23119 /// Creates a new default instance.
23120 pub fn new() -> Self {
23121 std::default::Default::default()
23122 }
23123
23124 /// Sets the value of [source][crate::model::Reference::source].
23125 ///
23126 /// # Example
23127 /// ```ignore,no_run
23128 /// # use google_cloud_securitycenter_v2::model::Reference;
23129 /// let x = Reference::new().set_source("example");
23130 /// ```
23131 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23132 self.source = v.into();
23133 self
23134 }
23135
23136 /// Sets the value of [uri][crate::model::Reference::uri].
23137 ///
23138 /// # Example
23139 /// ```ignore,no_run
23140 /// # use google_cloud_securitycenter_v2::model::Reference;
23141 /// let x = Reference::new().set_uri("example");
23142 /// ```
23143 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23144 self.uri = v.into();
23145 self
23146 }
23147}
23148
23149impl wkt::message::Message for Reference {
23150 fn typename() -> &'static str {
23151 "type.googleapis.com/google.cloud.securitycenter.v2.Reference"
23152 }
23153}
23154
23155/// Common Vulnerability Scoring System version 3.
23156#[derive(Clone, Default, PartialEq)]
23157#[non_exhaustive]
23158pub struct Cvssv3 {
23159 /// The base score is a function of the base metric scores.
23160 pub base_score: f64,
23161
23162 /// Base Metrics
23163 /// Represents the intrinsic characteristics of a vulnerability that are
23164 /// constant over time and across user environments.
23165 /// This metric reflects the context by which vulnerability exploitation is
23166 /// possible.
23167 pub attack_vector: crate::model::cvssv_3::AttackVector,
23168
23169 /// This metric describes the conditions beyond the attacker's control that
23170 /// must exist in order to exploit the vulnerability.
23171 pub attack_complexity: crate::model::cvssv_3::AttackComplexity,
23172
23173 /// This metric describes the level of privileges an attacker must possess
23174 /// before successfully exploiting the vulnerability.
23175 pub privileges_required: crate::model::cvssv_3::PrivilegesRequired,
23176
23177 /// This metric captures the requirement for a human user, other than the
23178 /// attacker, to participate in the successful compromise of the vulnerable
23179 /// component.
23180 pub user_interaction: crate::model::cvssv_3::UserInteraction,
23181
23182 /// The Scope metric captures whether a vulnerability in one vulnerable
23183 /// component impacts resources in components beyond its security scope.
23184 pub scope: crate::model::cvssv_3::Scope,
23185
23186 /// This metric measures the impact to the confidentiality of the information
23187 /// resources managed by a software component due to a successfully exploited
23188 /// vulnerability.
23189 pub confidentiality_impact: crate::model::cvssv_3::Impact,
23190
23191 /// This metric measures the impact to integrity of a successfully exploited
23192 /// vulnerability.
23193 pub integrity_impact: crate::model::cvssv_3::Impact,
23194
23195 /// This metric measures the impact to the availability of the impacted
23196 /// component resulting from a successfully exploited vulnerability.
23197 pub availability_impact: crate::model::cvssv_3::Impact,
23198
23199 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23200}
23201
23202impl Cvssv3 {
23203 /// Creates a new default instance.
23204 pub fn new() -> Self {
23205 std::default::Default::default()
23206 }
23207
23208 /// Sets the value of [base_score][crate::model::Cvssv3::base_score].
23209 ///
23210 /// # Example
23211 /// ```ignore,no_run
23212 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23213 /// let x = Cvssv3::new().set_base_score(42.0);
23214 /// ```
23215 pub fn set_base_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
23216 self.base_score = v.into();
23217 self
23218 }
23219
23220 /// Sets the value of [attack_vector][crate::model::Cvssv3::attack_vector].
23221 ///
23222 /// # Example
23223 /// ```ignore,no_run
23224 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23225 /// use google_cloud_securitycenter_v2::model::cvssv_3::AttackVector;
23226 /// let x0 = Cvssv3::new().set_attack_vector(AttackVector::Network);
23227 /// let x1 = Cvssv3::new().set_attack_vector(AttackVector::Adjacent);
23228 /// let x2 = Cvssv3::new().set_attack_vector(AttackVector::Local);
23229 /// ```
23230 pub fn set_attack_vector<T: std::convert::Into<crate::model::cvssv_3::AttackVector>>(
23231 mut self,
23232 v: T,
23233 ) -> Self {
23234 self.attack_vector = v.into();
23235 self
23236 }
23237
23238 /// Sets the value of [attack_complexity][crate::model::Cvssv3::attack_complexity].
23239 ///
23240 /// # Example
23241 /// ```ignore,no_run
23242 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23243 /// use google_cloud_securitycenter_v2::model::cvssv_3::AttackComplexity;
23244 /// let x0 = Cvssv3::new().set_attack_complexity(AttackComplexity::Low);
23245 /// let x1 = Cvssv3::new().set_attack_complexity(AttackComplexity::High);
23246 /// ```
23247 pub fn set_attack_complexity<T: std::convert::Into<crate::model::cvssv_3::AttackComplexity>>(
23248 mut self,
23249 v: T,
23250 ) -> Self {
23251 self.attack_complexity = v.into();
23252 self
23253 }
23254
23255 /// Sets the value of [privileges_required][crate::model::Cvssv3::privileges_required].
23256 ///
23257 /// # Example
23258 /// ```ignore,no_run
23259 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23260 /// use google_cloud_securitycenter_v2::model::cvssv_3::PrivilegesRequired;
23261 /// let x0 = Cvssv3::new().set_privileges_required(PrivilegesRequired::None);
23262 /// let x1 = Cvssv3::new().set_privileges_required(PrivilegesRequired::Low);
23263 /// let x2 = Cvssv3::new().set_privileges_required(PrivilegesRequired::High);
23264 /// ```
23265 pub fn set_privileges_required<
23266 T: std::convert::Into<crate::model::cvssv_3::PrivilegesRequired>,
23267 >(
23268 mut self,
23269 v: T,
23270 ) -> Self {
23271 self.privileges_required = v.into();
23272 self
23273 }
23274
23275 /// Sets the value of [user_interaction][crate::model::Cvssv3::user_interaction].
23276 ///
23277 /// # Example
23278 /// ```ignore,no_run
23279 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23280 /// use google_cloud_securitycenter_v2::model::cvssv_3::UserInteraction;
23281 /// let x0 = Cvssv3::new().set_user_interaction(UserInteraction::None);
23282 /// let x1 = Cvssv3::new().set_user_interaction(UserInteraction::Required);
23283 /// ```
23284 pub fn set_user_interaction<T: std::convert::Into<crate::model::cvssv_3::UserInteraction>>(
23285 mut self,
23286 v: T,
23287 ) -> Self {
23288 self.user_interaction = v.into();
23289 self
23290 }
23291
23292 /// Sets the value of [scope][crate::model::Cvssv3::scope].
23293 ///
23294 /// # Example
23295 /// ```ignore,no_run
23296 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23297 /// use google_cloud_securitycenter_v2::model::cvssv_3::Scope;
23298 /// let x0 = Cvssv3::new().set_scope(Scope::Unchanged);
23299 /// let x1 = Cvssv3::new().set_scope(Scope::Changed);
23300 /// ```
23301 pub fn set_scope<T: std::convert::Into<crate::model::cvssv_3::Scope>>(mut self, v: T) -> Self {
23302 self.scope = v.into();
23303 self
23304 }
23305
23306 /// Sets the value of [confidentiality_impact][crate::model::Cvssv3::confidentiality_impact].
23307 ///
23308 /// # Example
23309 /// ```ignore,no_run
23310 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23311 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23312 /// let x0 = Cvssv3::new().set_confidentiality_impact(Impact::High);
23313 /// let x1 = Cvssv3::new().set_confidentiality_impact(Impact::Low);
23314 /// let x2 = Cvssv3::new().set_confidentiality_impact(Impact::None);
23315 /// ```
23316 pub fn set_confidentiality_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23317 mut self,
23318 v: T,
23319 ) -> Self {
23320 self.confidentiality_impact = v.into();
23321 self
23322 }
23323
23324 /// Sets the value of [integrity_impact][crate::model::Cvssv3::integrity_impact].
23325 ///
23326 /// # Example
23327 /// ```ignore,no_run
23328 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23329 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23330 /// let x0 = Cvssv3::new().set_integrity_impact(Impact::High);
23331 /// let x1 = Cvssv3::new().set_integrity_impact(Impact::Low);
23332 /// let x2 = Cvssv3::new().set_integrity_impact(Impact::None);
23333 /// ```
23334 pub fn set_integrity_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23335 mut self,
23336 v: T,
23337 ) -> Self {
23338 self.integrity_impact = v.into();
23339 self
23340 }
23341
23342 /// Sets the value of [availability_impact][crate::model::Cvssv3::availability_impact].
23343 ///
23344 /// # Example
23345 /// ```ignore,no_run
23346 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23347 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23348 /// let x0 = Cvssv3::new().set_availability_impact(Impact::High);
23349 /// let x1 = Cvssv3::new().set_availability_impact(Impact::Low);
23350 /// let x2 = Cvssv3::new().set_availability_impact(Impact::None);
23351 /// ```
23352 pub fn set_availability_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23353 mut self,
23354 v: T,
23355 ) -> Self {
23356 self.availability_impact = v.into();
23357 self
23358 }
23359}
23360
23361impl wkt::message::Message for Cvssv3 {
23362 fn typename() -> &'static str {
23363 "type.googleapis.com/google.cloud.securitycenter.v2.Cvssv3"
23364 }
23365}
23366
23367/// Defines additional types related to [Cvssv3].
23368pub mod cvssv_3 {
23369 #[allow(unused_imports)]
23370 use super::*;
23371
23372 /// This metric reflects the context by which vulnerability exploitation is
23373 /// possible.
23374 ///
23375 /// # Working with unknown values
23376 ///
23377 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23378 /// additional enum variants at any time. Adding new variants is not considered
23379 /// a breaking change. Applications should write their code in anticipation of:
23380 ///
23381 /// - New values appearing in future releases of the client library, **and**
23382 /// - New values received dynamically, without application changes.
23383 ///
23384 /// Please consult the [Working with enums] section in the user guide for some
23385 /// guidelines.
23386 ///
23387 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23388 #[derive(Clone, Debug, PartialEq)]
23389 #[non_exhaustive]
23390 pub enum AttackVector {
23391 /// Invalid value.
23392 Unspecified,
23393 /// The vulnerable component is bound to the network stack and the set of
23394 /// possible attackers extends beyond the other options listed below, up to
23395 /// and including the entire Internet.
23396 Network,
23397 /// The vulnerable component is bound to the network stack, but the attack is
23398 /// limited at the protocol level to a logically adjacent topology.
23399 Adjacent,
23400 /// The vulnerable component is not bound to the network stack and the
23401 /// attacker's path is via read/write/execute capabilities.
23402 Local,
23403 /// The attack requires the attacker to physically touch or manipulate the
23404 /// vulnerable component.
23405 Physical,
23406 /// If set, the enum was initialized with an unknown value.
23407 ///
23408 /// Applications can examine the value using [AttackVector::value] or
23409 /// [AttackVector::name].
23410 UnknownValue(attack_vector::UnknownValue),
23411 }
23412
23413 #[doc(hidden)]
23414 pub mod attack_vector {
23415 #[allow(unused_imports)]
23416 use super::*;
23417 #[derive(Clone, Debug, PartialEq)]
23418 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23419 }
23420
23421 impl AttackVector {
23422 /// Gets the enum value.
23423 ///
23424 /// Returns `None` if the enum contains an unknown value deserialized from
23425 /// the string representation of enums.
23426 pub fn value(&self) -> std::option::Option<i32> {
23427 match self {
23428 Self::Unspecified => std::option::Option::Some(0),
23429 Self::Network => std::option::Option::Some(1),
23430 Self::Adjacent => std::option::Option::Some(2),
23431 Self::Local => std::option::Option::Some(3),
23432 Self::Physical => std::option::Option::Some(4),
23433 Self::UnknownValue(u) => u.0.value(),
23434 }
23435 }
23436
23437 /// Gets the enum value as a string.
23438 ///
23439 /// Returns `None` if the enum contains an unknown value deserialized from
23440 /// the integer representation of enums.
23441 pub fn name(&self) -> std::option::Option<&str> {
23442 match self {
23443 Self::Unspecified => std::option::Option::Some("ATTACK_VECTOR_UNSPECIFIED"),
23444 Self::Network => std::option::Option::Some("ATTACK_VECTOR_NETWORK"),
23445 Self::Adjacent => std::option::Option::Some("ATTACK_VECTOR_ADJACENT"),
23446 Self::Local => std::option::Option::Some("ATTACK_VECTOR_LOCAL"),
23447 Self::Physical => std::option::Option::Some("ATTACK_VECTOR_PHYSICAL"),
23448 Self::UnknownValue(u) => u.0.name(),
23449 }
23450 }
23451 }
23452
23453 impl std::default::Default for AttackVector {
23454 fn default() -> Self {
23455 use std::convert::From;
23456 Self::from(0)
23457 }
23458 }
23459
23460 impl std::fmt::Display for AttackVector {
23461 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23462 wkt::internal::display_enum(f, self.name(), self.value())
23463 }
23464 }
23465
23466 impl std::convert::From<i32> for AttackVector {
23467 fn from(value: i32) -> Self {
23468 match value {
23469 0 => Self::Unspecified,
23470 1 => Self::Network,
23471 2 => Self::Adjacent,
23472 3 => Self::Local,
23473 4 => Self::Physical,
23474 _ => Self::UnknownValue(attack_vector::UnknownValue(
23475 wkt::internal::UnknownEnumValue::Integer(value),
23476 )),
23477 }
23478 }
23479 }
23480
23481 impl std::convert::From<&str> for AttackVector {
23482 fn from(value: &str) -> Self {
23483 use std::string::ToString;
23484 match value {
23485 "ATTACK_VECTOR_UNSPECIFIED" => Self::Unspecified,
23486 "ATTACK_VECTOR_NETWORK" => Self::Network,
23487 "ATTACK_VECTOR_ADJACENT" => Self::Adjacent,
23488 "ATTACK_VECTOR_LOCAL" => Self::Local,
23489 "ATTACK_VECTOR_PHYSICAL" => Self::Physical,
23490 _ => Self::UnknownValue(attack_vector::UnknownValue(
23491 wkt::internal::UnknownEnumValue::String(value.to_string()),
23492 )),
23493 }
23494 }
23495 }
23496
23497 impl serde::ser::Serialize for AttackVector {
23498 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23499 where
23500 S: serde::Serializer,
23501 {
23502 match self {
23503 Self::Unspecified => serializer.serialize_i32(0),
23504 Self::Network => serializer.serialize_i32(1),
23505 Self::Adjacent => serializer.serialize_i32(2),
23506 Self::Local => serializer.serialize_i32(3),
23507 Self::Physical => serializer.serialize_i32(4),
23508 Self::UnknownValue(u) => u.0.serialize(serializer),
23509 }
23510 }
23511 }
23512
23513 impl<'de> serde::de::Deserialize<'de> for AttackVector {
23514 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23515 where
23516 D: serde::Deserializer<'de>,
23517 {
23518 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackVector>::new(
23519 ".google.cloud.securitycenter.v2.Cvssv3.AttackVector",
23520 ))
23521 }
23522 }
23523
23524 /// This metric describes the conditions beyond the attacker's control that
23525 /// must exist in order to exploit the vulnerability.
23526 ///
23527 /// # Working with unknown values
23528 ///
23529 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23530 /// additional enum variants at any time. Adding new variants is not considered
23531 /// a breaking change. Applications should write their code in anticipation of:
23532 ///
23533 /// - New values appearing in future releases of the client library, **and**
23534 /// - New values received dynamically, without application changes.
23535 ///
23536 /// Please consult the [Working with enums] section in the user guide for some
23537 /// guidelines.
23538 ///
23539 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23540 #[derive(Clone, Debug, PartialEq)]
23541 #[non_exhaustive]
23542 pub enum AttackComplexity {
23543 /// Invalid value.
23544 Unspecified,
23545 /// Specialized access conditions or extenuating circumstances do not exist.
23546 /// An attacker can expect repeatable success when attacking the vulnerable
23547 /// component.
23548 Low,
23549 /// A successful attack depends on conditions beyond the attacker's control.
23550 /// That is, a successful attack cannot be accomplished at will, but requires
23551 /// the attacker to invest in some measurable amount of effort in preparation
23552 /// or execution against the vulnerable component before a successful attack
23553 /// can be expected.
23554 High,
23555 /// If set, the enum was initialized with an unknown value.
23556 ///
23557 /// Applications can examine the value using [AttackComplexity::value] or
23558 /// [AttackComplexity::name].
23559 UnknownValue(attack_complexity::UnknownValue),
23560 }
23561
23562 #[doc(hidden)]
23563 pub mod attack_complexity {
23564 #[allow(unused_imports)]
23565 use super::*;
23566 #[derive(Clone, Debug, PartialEq)]
23567 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23568 }
23569
23570 impl AttackComplexity {
23571 /// Gets the enum value.
23572 ///
23573 /// Returns `None` if the enum contains an unknown value deserialized from
23574 /// the string representation of enums.
23575 pub fn value(&self) -> std::option::Option<i32> {
23576 match self {
23577 Self::Unspecified => std::option::Option::Some(0),
23578 Self::Low => std::option::Option::Some(1),
23579 Self::High => std::option::Option::Some(2),
23580 Self::UnknownValue(u) => u.0.value(),
23581 }
23582 }
23583
23584 /// Gets the enum value as a string.
23585 ///
23586 /// Returns `None` if the enum contains an unknown value deserialized from
23587 /// the integer representation of enums.
23588 pub fn name(&self) -> std::option::Option<&str> {
23589 match self {
23590 Self::Unspecified => std::option::Option::Some("ATTACK_COMPLEXITY_UNSPECIFIED"),
23591 Self::Low => std::option::Option::Some("ATTACK_COMPLEXITY_LOW"),
23592 Self::High => std::option::Option::Some("ATTACK_COMPLEXITY_HIGH"),
23593 Self::UnknownValue(u) => u.0.name(),
23594 }
23595 }
23596 }
23597
23598 impl std::default::Default for AttackComplexity {
23599 fn default() -> Self {
23600 use std::convert::From;
23601 Self::from(0)
23602 }
23603 }
23604
23605 impl std::fmt::Display for AttackComplexity {
23606 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23607 wkt::internal::display_enum(f, self.name(), self.value())
23608 }
23609 }
23610
23611 impl std::convert::From<i32> for AttackComplexity {
23612 fn from(value: i32) -> Self {
23613 match value {
23614 0 => Self::Unspecified,
23615 1 => Self::Low,
23616 2 => Self::High,
23617 _ => Self::UnknownValue(attack_complexity::UnknownValue(
23618 wkt::internal::UnknownEnumValue::Integer(value),
23619 )),
23620 }
23621 }
23622 }
23623
23624 impl std::convert::From<&str> for AttackComplexity {
23625 fn from(value: &str) -> Self {
23626 use std::string::ToString;
23627 match value {
23628 "ATTACK_COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
23629 "ATTACK_COMPLEXITY_LOW" => Self::Low,
23630 "ATTACK_COMPLEXITY_HIGH" => Self::High,
23631 _ => Self::UnknownValue(attack_complexity::UnknownValue(
23632 wkt::internal::UnknownEnumValue::String(value.to_string()),
23633 )),
23634 }
23635 }
23636 }
23637
23638 impl serde::ser::Serialize for AttackComplexity {
23639 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23640 where
23641 S: serde::Serializer,
23642 {
23643 match self {
23644 Self::Unspecified => serializer.serialize_i32(0),
23645 Self::Low => serializer.serialize_i32(1),
23646 Self::High => serializer.serialize_i32(2),
23647 Self::UnknownValue(u) => u.0.serialize(serializer),
23648 }
23649 }
23650 }
23651
23652 impl<'de> serde::de::Deserialize<'de> for AttackComplexity {
23653 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23654 where
23655 D: serde::Deserializer<'de>,
23656 {
23657 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackComplexity>::new(
23658 ".google.cloud.securitycenter.v2.Cvssv3.AttackComplexity",
23659 ))
23660 }
23661 }
23662
23663 /// This metric describes the level of privileges an attacker must possess
23664 /// before successfully exploiting the vulnerability.
23665 ///
23666 /// # Working with unknown values
23667 ///
23668 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23669 /// additional enum variants at any time. Adding new variants is not considered
23670 /// a breaking change. Applications should write their code in anticipation of:
23671 ///
23672 /// - New values appearing in future releases of the client library, **and**
23673 /// - New values received dynamically, without application changes.
23674 ///
23675 /// Please consult the [Working with enums] section in the user guide for some
23676 /// guidelines.
23677 ///
23678 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23679 #[derive(Clone, Debug, PartialEq)]
23680 #[non_exhaustive]
23681 pub enum PrivilegesRequired {
23682 /// Invalid value.
23683 Unspecified,
23684 /// The attacker is unauthorized prior to attack, and therefore does not
23685 /// require any access to settings or files of the vulnerable system to
23686 /// carry out an attack.
23687 None,
23688 /// The attacker requires privileges that provide basic user capabilities
23689 /// that could normally affect only settings and files owned by a user.
23690 /// Alternatively, an attacker with Low privileges has the ability to access
23691 /// only non-sensitive resources.
23692 Low,
23693 /// The attacker requires privileges that provide significant (e.g.,
23694 /// administrative) control over the vulnerable component allowing access to
23695 /// component-wide settings and files.
23696 High,
23697 /// If set, the enum was initialized with an unknown value.
23698 ///
23699 /// Applications can examine the value using [PrivilegesRequired::value] or
23700 /// [PrivilegesRequired::name].
23701 UnknownValue(privileges_required::UnknownValue),
23702 }
23703
23704 #[doc(hidden)]
23705 pub mod privileges_required {
23706 #[allow(unused_imports)]
23707 use super::*;
23708 #[derive(Clone, Debug, PartialEq)]
23709 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23710 }
23711
23712 impl PrivilegesRequired {
23713 /// Gets the enum value.
23714 ///
23715 /// Returns `None` if the enum contains an unknown value deserialized from
23716 /// the string representation of enums.
23717 pub fn value(&self) -> std::option::Option<i32> {
23718 match self {
23719 Self::Unspecified => std::option::Option::Some(0),
23720 Self::None => std::option::Option::Some(1),
23721 Self::Low => std::option::Option::Some(2),
23722 Self::High => std::option::Option::Some(3),
23723 Self::UnknownValue(u) => u.0.value(),
23724 }
23725 }
23726
23727 /// Gets the enum value as a string.
23728 ///
23729 /// Returns `None` if the enum contains an unknown value deserialized from
23730 /// the integer representation of enums.
23731 pub fn name(&self) -> std::option::Option<&str> {
23732 match self {
23733 Self::Unspecified => std::option::Option::Some("PRIVILEGES_REQUIRED_UNSPECIFIED"),
23734 Self::None => std::option::Option::Some("PRIVILEGES_REQUIRED_NONE"),
23735 Self::Low => std::option::Option::Some("PRIVILEGES_REQUIRED_LOW"),
23736 Self::High => std::option::Option::Some("PRIVILEGES_REQUIRED_HIGH"),
23737 Self::UnknownValue(u) => u.0.name(),
23738 }
23739 }
23740 }
23741
23742 impl std::default::Default for PrivilegesRequired {
23743 fn default() -> Self {
23744 use std::convert::From;
23745 Self::from(0)
23746 }
23747 }
23748
23749 impl std::fmt::Display for PrivilegesRequired {
23750 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23751 wkt::internal::display_enum(f, self.name(), self.value())
23752 }
23753 }
23754
23755 impl std::convert::From<i32> for PrivilegesRequired {
23756 fn from(value: i32) -> Self {
23757 match value {
23758 0 => Self::Unspecified,
23759 1 => Self::None,
23760 2 => Self::Low,
23761 3 => Self::High,
23762 _ => Self::UnknownValue(privileges_required::UnknownValue(
23763 wkt::internal::UnknownEnumValue::Integer(value),
23764 )),
23765 }
23766 }
23767 }
23768
23769 impl std::convert::From<&str> for PrivilegesRequired {
23770 fn from(value: &str) -> Self {
23771 use std::string::ToString;
23772 match value {
23773 "PRIVILEGES_REQUIRED_UNSPECIFIED" => Self::Unspecified,
23774 "PRIVILEGES_REQUIRED_NONE" => Self::None,
23775 "PRIVILEGES_REQUIRED_LOW" => Self::Low,
23776 "PRIVILEGES_REQUIRED_HIGH" => Self::High,
23777 _ => Self::UnknownValue(privileges_required::UnknownValue(
23778 wkt::internal::UnknownEnumValue::String(value.to_string()),
23779 )),
23780 }
23781 }
23782 }
23783
23784 impl serde::ser::Serialize for PrivilegesRequired {
23785 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23786 where
23787 S: serde::Serializer,
23788 {
23789 match self {
23790 Self::Unspecified => serializer.serialize_i32(0),
23791 Self::None => serializer.serialize_i32(1),
23792 Self::Low => serializer.serialize_i32(2),
23793 Self::High => serializer.serialize_i32(3),
23794 Self::UnknownValue(u) => u.0.serialize(serializer),
23795 }
23796 }
23797 }
23798
23799 impl<'de> serde::de::Deserialize<'de> for PrivilegesRequired {
23800 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23801 where
23802 D: serde::Deserializer<'de>,
23803 {
23804 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrivilegesRequired>::new(
23805 ".google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired",
23806 ))
23807 }
23808 }
23809
23810 /// This metric captures the requirement for a human user, other than the
23811 /// attacker, to participate in the successful compromise of the vulnerable
23812 /// component.
23813 ///
23814 /// # Working with unknown values
23815 ///
23816 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23817 /// additional enum variants at any time. Adding new variants is not considered
23818 /// a breaking change. Applications should write their code in anticipation of:
23819 ///
23820 /// - New values appearing in future releases of the client library, **and**
23821 /// - New values received dynamically, without application changes.
23822 ///
23823 /// Please consult the [Working with enums] section in the user guide for some
23824 /// guidelines.
23825 ///
23826 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23827 #[derive(Clone, Debug, PartialEq)]
23828 #[non_exhaustive]
23829 pub enum UserInteraction {
23830 /// Invalid value.
23831 Unspecified,
23832 /// The vulnerable system can be exploited without interaction from any user.
23833 None,
23834 /// Successful exploitation of this vulnerability requires a user to take
23835 /// some action before the vulnerability can be exploited.
23836 Required,
23837 /// If set, the enum was initialized with an unknown value.
23838 ///
23839 /// Applications can examine the value using [UserInteraction::value] or
23840 /// [UserInteraction::name].
23841 UnknownValue(user_interaction::UnknownValue),
23842 }
23843
23844 #[doc(hidden)]
23845 pub mod user_interaction {
23846 #[allow(unused_imports)]
23847 use super::*;
23848 #[derive(Clone, Debug, PartialEq)]
23849 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23850 }
23851
23852 impl UserInteraction {
23853 /// Gets the enum value.
23854 ///
23855 /// Returns `None` if the enum contains an unknown value deserialized from
23856 /// the string representation of enums.
23857 pub fn value(&self) -> std::option::Option<i32> {
23858 match self {
23859 Self::Unspecified => std::option::Option::Some(0),
23860 Self::None => std::option::Option::Some(1),
23861 Self::Required => std::option::Option::Some(2),
23862 Self::UnknownValue(u) => u.0.value(),
23863 }
23864 }
23865
23866 /// Gets the enum value as a string.
23867 ///
23868 /// Returns `None` if the enum contains an unknown value deserialized from
23869 /// the integer representation of enums.
23870 pub fn name(&self) -> std::option::Option<&str> {
23871 match self {
23872 Self::Unspecified => std::option::Option::Some("USER_INTERACTION_UNSPECIFIED"),
23873 Self::None => std::option::Option::Some("USER_INTERACTION_NONE"),
23874 Self::Required => std::option::Option::Some("USER_INTERACTION_REQUIRED"),
23875 Self::UnknownValue(u) => u.0.name(),
23876 }
23877 }
23878 }
23879
23880 impl std::default::Default for UserInteraction {
23881 fn default() -> Self {
23882 use std::convert::From;
23883 Self::from(0)
23884 }
23885 }
23886
23887 impl std::fmt::Display for UserInteraction {
23888 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23889 wkt::internal::display_enum(f, self.name(), self.value())
23890 }
23891 }
23892
23893 impl std::convert::From<i32> for UserInteraction {
23894 fn from(value: i32) -> Self {
23895 match value {
23896 0 => Self::Unspecified,
23897 1 => Self::None,
23898 2 => Self::Required,
23899 _ => Self::UnknownValue(user_interaction::UnknownValue(
23900 wkt::internal::UnknownEnumValue::Integer(value),
23901 )),
23902 }
23903 }
23904 }
23905
23906 impl std::convert::From<&str> for UserInteraction {
23907 fn from(value: &str) -> Self {
23908 use std::string::ToString;
23909 match value {
23910 "USER_INTERACTION_UNSPECIFIED" => Self::Unspecified,
23911 "USER_INTERACTION_NONE" => Self::None,
23912 "USER_INTERACTION_REQUIRED" => Self::Required,
23913 _ => Self::UnknownValue(user_interaction::UnknownValue(
23914 wkt::internal::UnknownEnumValue::String(value.to_string()),
23915 )),
23916 }
23917 }
23918 }
23919
23920 impl serde::ser::Serialize for UserInteraction {
23921 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23922 where
23923 S: serde::Serializer,
23924 {
23925 match self {
23926 Self::Unspecified => serializer.serialize_i32(0),
23927 Self::None => serializer.serialize_i32(1),
23928 Self::Required => serializer.serialize_i32(2),
23929 Self::UnknownValue(u) => u.0.serialize(serializer),
23930 }
23931 }
23932 }
23933
23934 impl<'de> serde::de::Deserialize<'de> for UserInteraction {
23935 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23936 where
23937 D: serde::Deserializer<'de>,
23938 {
23939 deserializer.deserialize_any(wkt::internal::EnumVisitor::<UserInteraction>::new(
23940 ".google.cloud.securitycenter.v2.Cvssv3.UserInteraction",
23941 ))
23942 }
23943 }
23944
23945 /// The Scope metric captures whether a vulnerability in one vulnerable
23946 /// component impacts resources in components beyond its security scope.
23947 ///
23948 /// # Working with unknown values
23949 ///
23950 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23951 /// additional enum variants at any time. Adding new variants is not considered
23952 /// a breaking change. Applications should write their code in anticipation of:
23953 ///
23954 /// - New values appearing in future releases of the client library, **and**
23955 /// - New values received dynamically, without application changes.
23956 ///
23957 /// Please consult the [Working with enums] section in the user guide for some
23958 /// guidelines.
23959 ///
23960 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23961 #[derive(Clone, Debug, PartialEq)]
23962 #[non_exhaustive]
23963 pub enum Scope {
23964 /// Invalid value.
23965 Unspecified,
23966 /// An exploited vulnerability can only affect resources managed by the same
23967 /// security authority.
23968 Unchanged,
23969 /// An exploited vulnerability can affect resources beyond the security scope
23970 /// managed by the security authority of the vulnerable component.
23971 Changed,
23972 /// If set, the enum was initialized with an unknown value.
23973 ///
23974 /// Applications can examine the value using [Scope::value] or
23975 /// [Scope::name].
23976 UnknownValue(scope::UnknownValue),
23977 }
23978
23979 #[doc(hidden)]
23980 pub mod scope {
23981 #[allow(unused_imports)]
23982 use super::*;
23983 #[derive(Clone, Debug, PartialEq)]
23984 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23985 }
23986
23987 impl Scope {
23988 /// Gets the enum value.
23989 ///
23990 /// Returns `None` if the enum contains an unknown value deserialized from
23991 /// the string representation of enums.
23992 pub fn value(&self) -> std::option::Option<i32> {
23993 match self {
23994 Self::Unspecified => std::option::Option::Some(0),
23995 Self::Unchanged => std::option::Option::Some(1),
23996 Self::Changed => std::option::Option::Some(2),
23997 Self::UnknownValue(u) => u.0.value(),
23998 }
23999 }
24000
24001 /// Gets the enum value as a string.
24002 ///
24003 /// Returns `None` if the enum contains an unknown value deserialized from
24004 /// the integer representation of enums.
24005 pub fn name(&self) -> std::option::Option<&str> {
24006 match self {
24007 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
24008 Self::Unchanged => std::option::Option::Some("SCOPE_UNCHANGED"),
24009 Self::Changed => std::option::Option::Some("SCOPE_CHANGED"),
24010 Self::UnknownValue(u) => u.0.name(),
24011 }
24012 }
24013 }
24014
24015 impl std::default::Default for Scope {
24016 fn default() -> Self {
24017 use std::convert::From;
24018 Self::from(0)
24019 }
24020 }
24021
24022 impl std::fmt::Display for Scope {
24023 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24024 wkt::internal::display_enum(f, self.name(), self.value())
24025 }
24026 }
24027
24028 impl std::convert::From<i32> for Scope {
24029 fn from(value: i32) -> Self {
24030 match value {
24031 0 => Self::Unspecified,
24032 1 => Self::Unchanged,
24033 2 => Self::Changed,
24034 _ => Self::UnknownValue(scope::UnknownValue(
24035 wkt::internal::UnknownEnumValue::Integer(value),
24036 )),
24037 }
24038 }
24039 }
24040
24041 impl std::convert::From<&str> for Scope {
24042 fn from(value: &str) -> Self {
24043 use std::string::ToString;
24044 match value {
24045 "SCOPE_UNSPECIFIED" => Self::Unspecified,
24046 "SCOPE_UNCHANGED" => Self::Unchanged,
24047 "SCOPE_CHANGED" => Self::Changed,
24048 _ => Self::UnknownValue(scope::UnknownValue(
24049 wkt::internal::UnknownEnumValue::String(value.to_string()),
24050 )),
24051 }
24052 }
24053 }
24054
24055 impl serde::ser::Serialize for Scope {
24056 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24057 where
24058 S: serde::Serializer,
24059 {
24060 match self {
24061 Self::Unspecified => serializer.serialize_i32(0),
24062 Self::Unchanged => serializer.serialize_i32(1),
24063 Self::Changed => serializer.serialize_i32(2),
24064 Self::UnknownValue(u) => u.0.serialize(serializer),
24065 }
24066 }
24067 }
24068
24069 impl<'de> serde::de::Deserialize<'de> for Scope {
24070 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24071 where
24072 D: serde::Deserializer<'de>,
24073 {
24074 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
24075 ".google.cloud.securitycenter.v2.Cvssv3.Scope",
24076 ))
24077 }
24078 }
24079
24080 /// The Impact metrics capture the effects of a successfully exploited
24081 /// vulnerability on the component that suffers the worst outcome that is most
24082 /// directly and predictably associated with the attack.
24083 ///
24084 /// # Working with unknown values
24085 ///
24086 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24087 /// additional enum variants at any time. Adding new variants is not considered
24088 /// a breaking change. Applications should write their code in anticipation of:
24089 ///
24090 /// - New values appearing in future releases of the client library, **and**
24091 /// - New values received dynamically, without application changes.
24092 ///
24093 /// Please consult the [Working with enums] section in the user guide for some
24094 /// guidelines.
24095 ///
24096 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24097 #[derive(Clone, Debug, PartialEq)]
24098 #[non_exhaustive]
24099 pub enum Impact {
24100 /// Invalid value.
24101 Unspecified,
24102 /// High impact.
24103 High,
24104 /// Low impact.
24105 Low,
24106 /// No impact.
24107 None,
24108 /// If set, the enum was initialized with an unknown value.
24109 ///
24110 /// Applications can examine the value using [Impact::value] or
24111 /// [Impact::name].
24112 UnknownValue(impact::UnknownValue),
24113 }
24114
24115 #[doc(hidden)]
24116 pub mod impact {
24117 #[allow(unused_imports)]
24118 use super::*;
24119 #[derive(Clone, Debug, PartialEq)]
24120 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24121 }
24122
24123 impl Impact {
24124 /// Gets the enum value.
24125 ///
24126 /// Returns `None` if the enum contains an unknown value deserialized from
24127 /// the string representation of enums.
24128 pub fn value(&self) -> std::option::Option<i32> {
24129 match self {
24130 Self::Unspecified => std::option::Option::Some(0),
24131 Self::High => std::option::Option::Some(1),
24132 Self::Low => std::option::Option::Some(2),
24133 Self::None => std::option::Option::Some(3),
24134 Self::UnknownValue(u) => u.0.value(),
24135 }
24136 }
24137
24138 /// Gets the enum value as a string.
24139 ///
24140 /// Returns `None` if the enum contains an unknown value deserialized from
24141 /// the integer representation of enums.
24142 pub fn name(&self) -> std::option::Option<&str> {
24143 match self {
24144 Self::Unspecified => std::option::Option::Some("IMPACT_UNSPECIFIED"),
24145 Self::High => std::option::Option::Some("IMPACT_HIGH"),
24146 Self::Low => std::option::Option::Some("IMPACT_LOW"),
24147 Self::None => std::option::Option::Some("IMPACT_NONE"),
24148 Self::UnknownValue(u) => u.0.name(),
24149 }
24150 }
24151 }
24152
24153 impl std::default::Default for Impact {
24154 fn default() -> Self {
24155 use std::convert::From;
24156 Self::from(0)
24157 }
24158 }
24159
24160 impl std::fmt::Display for Impact {
24161 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24162 wkt::internal::display_enum(f, self.name(), self.value())
24163 }
24164 }
24165
24166 impl std::convert::From<i32> for Impact {
24167 fn from(value: i32) -> Self {
24168 match value {
24169 0 => Self::Unspecified,
24170 1 => Self::High,
24171 2 => Self::Low,
24172 3 => Self::None,
24173 _ => Self::UnknownValue(impact::UnknownValue(
24174 wkt::internal::UnknownEnumValue::Integer(value),
24175 )),
24176 }
24177 }
24178 }
24179
24180 impl std::convert::From<&str> for Impact {
24181 fn from(value: &str) -> Self {
24182 use std::string::ToString;
24183 match value {
24184 "IMPACT_UNSPECIFIED" => Self::Unspecified,
24185 "IMPACT_HIGH" => Self::High,
24186 "IMPACT_LOW" => Self::Low,
24187 "IMPACT_NONE" => Self::None,
24188 _ => Self::UnknownValue(impact::UnknownValue(
24189 wkt::internal::UnknownEnumValue::String(value.to_string()),
24190 )),
24191 }
24192 }
24193 }
24194
24195 impl serde::ser::Serialize for Impact {
24196 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24197 where
24198 S: serde::Serializer,
24199 {
24200 match self {
24201 Self::Unspecified => serializer.serialize_i32(0),
24202 Self::High => serializer.serialize_i32(1),
24203 Self::Low => serializer.serialize_i32(2),
24204 Self::None => serializer.serialize_i32(3),
24205 Self::UnknownValue(u) => u.0.serialize(serializer),
24206 }
24207 }
24208 }
24209
24210 impl<'de> serde::de::Deserialize<'de> for Impact {
24211 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24212 where
24213 D: serde::Deserializer<'de>,
24214 {
24215 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Impact>::new(
24216 ".google.cloud.securitycenter.v2.Cvssv3.Impact",
24217 ))
24218 }
24219 }
24220}
24221
24222/// Package is a generic definition of a package.
24223#[derive(Clone, Default, PartialEq)]
24224#[non_exhaustive]
24225pub struct Package {
24226 /// The name of the package where the vulnerability was detected.
24227 pub package_name: std::string::String,
24228
24229 /// The CPE URI where the vulnerability was detected.
24230 pub cpe_uri: std::string::String,
24231
24232 /// Type of package, for example, os, maven, or go.
24233 pub package_type: std::string::String,
24234
24235 /// The version of the package.
24236 pub package_version: std::string::String,
24237
24238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24239}
24240
24241impl Package {
24242 /// Creates a new default instance.
24243 pub fn new() -> Self {
24244 std::default::Default::default()
24245 }
24246
24247 /// Sets the value of [package_name][crate::model::Package::package_name].
24248 ///
24249 /// # Example
24250 /// ```ignore,no_run
24251 /// # use google_cloud_securitycenter_v2::model::Package;
24252 /// let x = Package::new().set_package_name("example");
24253 /// ```
24254 pub fn set_package_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24255 self.package_name = v.into();
24256 self
24257 }
24258
24259 /// Sets the value of [cpe_uri][crate::model::Package::cpe_uri].
24260 ///
24261 /// # Example
24262 /// ```ignore,no_run
24263 /// # use google_cloud_securitycenter_v2::model::Package;
24264 /// let x = Package::new().set_cpe_uri("example");
24265 /// ```
24266 pub fn set_cpe_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24267 self.cpe_uri = v.into();
24268 self
24269 }
24270
24271 /// Sets the value of [package_type][crate::model::Package::package_type].
24272 ///
24273 /// # Example
24274 /// ```ignore,no_run
24275 /// # use google_cloud_securitycenter_v2::model::Package;
24276 /// let x = Package::new().set_package_type("example");
24277 /// ```
24278 pub fn set_package_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24279 self.package_type = v.into();
24280 self
24281 }
24282
24283 /// Sets the value of [package_version][crate::model::Package::package_version].
24284 ///
24285 /// # Example
24286 /// ```ignore,no_run
24287 /// # use google_cloud_securitycenter_v2::model::Package;
24288 /// let x = Package::new().set_package_version("example");
24289 /// ```
24290 pub fn set_package_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24291 self.package_version = v.into();
24292 self
24293 }
24294}
24295
24296impl wkt::message::Message for Package {
24297 fn typename() -> &'static str {
24298 "type.googleapis.com/google.cloud.securitycenter.v2.Package"
24299 }
24300}
24301
24302/// SecurityBulletin are notifications of vulnerabilities of Google products.
24303#[derive(Clone, Default, PartialEq)]
24304#[non_exhaustive]
24305pub struct SecurityBulletin {
24306 /// ID of the bulletin corresponding to the vulnerability.
24307 pub bulletin_id: std::string::String,
24308
24309 /// Submission time of this Security Bulletin.
24310 pub submission_time: std::option::Option<wkt::Timestamp>,
24311
24312 /// This represents a version that the cluster receiving this notification
24313 /// should be upgraded to, based on its current version. For example, 1.15.0
24314 pub suggested_upgrade_version: std::string::String,
24315
24316 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24317}
24318
24319impl SecurityBulletin {
24320 /// Creates a new default instance.
24321 pub fn new() -> Self {
24322 std::default::Default::default()
24323 }
24324
24325 /// Sets the value of [bulletin_id][crate::model::SecurityBulletin::bulletin_id].
24326 ///
24327 /// # Example
24328 /// ```ignore,no_run
24329 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24330 /// let x = SecurityBulletin::new().set_bulletin_id("example");
24331 /// ```
24332 pub fn set_bulletin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24333 self.bulletin_id = v.into();
24334 self
24335 }
24336
24337 /// Sets the value of [submission_time][crate::model::SecurityBulletin::submission_time].
24338 ///
24339 /// # Example
24340 /// ```ignore,no_run
24341 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24342 /// use wkt::Timestamp;
24343 /// let x = SecurityBulletin::new().set_submission_time(Timestamp::default()/* use setters */);
24344 /// ```
24345 pub fn set_submission_time<T>(mut self, v: T) -> Self
24346 where
24347 T: std::convert::Into<wkt::Timestamp>,
24348 {
24349 self.submission_time = std::option::Option::Some(v.into());
24350 self
24351 }
24352
24353 /// Sets or clears the value of [submission_time][crate::model::SecurityBulletin::submission_time].
24354 ///
24355 /// # Example
24356 /// ```ignore,no_run
24357 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24358 /// use wkt::Timestamp;
24359 /// let x = SecurityBulletin::new().set_or_clear_submission_time(Some(Timestamp::default()/* use setters */));
24360 /// let x = SecurityBulletin::new().set_or_clear_submission_time(None::<Timestamp>);
24361 /// ```
24362 pub fn set_or_clear_submission_time<T>(mut self, v: std::option::Option<T>) -> Self
24363 where
24364 T: std::convert::Into<wkt::Timestamp>,
24365 {
24366 self.submission_time = v.map(|x| x.into());
24367 self
24368 }
24369
24370 /// Sets the value of [suggested_upgrade_version][crate::model::SecurityBulletin::suggested_upgrade_version].
24371 ///
24372 /// # Example
24373 /// ```ignore,no_run
24374 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24375 /// let x = SecurityBulletin::new().set_suggested_upgrade_version("example");
24376 /// ```
24377 pub fn set_suggested_upgrade_version<T: std::convert::Into<std::string::String>>(
24378 mut self,
24379 v: T,
24380 ) -> Self {
24381 self.suggested_upgrade_version = v.into();
24382 self
24383 }
24384}
24385
24386impl wkt::message::Message for SecurityBulletin {
24387 fn typename() -> &'static str {
24388 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityBulletin"
24389 }
24390}
24391
24392/// CWE stands for Common Weakness Enumeration. Information about this weakness,
24393/// as described by [CWE](https://cwe.mitre.org/).
24394#[derive(Clone, Default, PartialEq)]
24395#[non_exhaustive]
24396pub struct Cwe {
24397 /// The CWE identifier, e.g. CWE-94
24398 pub id: std::string::String,
24399
24400 /// Any reference to the details on the CWE, for example,
24401 /// <https://cwe.mitre.org/data/definitions/94.html>
24402 pub references: std::vec::Vec<crate::model::Reference>,
24403
24404 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24405}
24406
24407impl Cwe {
24408 /// Creates a new default instance.
24409 pub fn new() -> Self {
24410 std::default::Default::default()
24411 }
24412
24413 /// Sets the value of [id][crate::model::Cwe::id].
24414 ///
24415 /// # Example
24416 /// ```ignore,no_run
24417 /// # use google_cloud_securitycenter_v2::model::Cwe;
24418 /// let x = Cwe::new().set_id("example");
24419 /// ```
24420 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24421 self.id = v.into();
24422 self
24423 }
24424
24425 /// Sets the value of [references][crate::model::Cwe::references].
24426 ///
24427 /// # Example
24428 /// ```ignore,no_run
24429 /// # use google_cloud_securitycenter_v2::model::Cwe;
24430 /// use google_cloud_securitycenter_v2::model::Reference;
24431 /// let x = Cwe::new()
24432 /// .set_references([
24433 /// Reference::default()/* use setters */,
24434 /// Reference::default()/* use (different) setters */,
24435 /// ]);
24436 /// ```
24437 pub fn set_references<T, V>(mut self, v: T) -> Self
24438 where
24439 T: std::iter::IntoIterator<Item = V>,
24440 V: std::convert::Into<crate::model::Reference>,
24441 {
24442 use std::iter::Iterator;
24443 self.references = v.into_iter().map(|i| i.into()).collect();
24444 self
24445 }
24446}
24447
24448impl wkt::message::Message for Cwe {
24449 fn typename() -> &'static str {
24450 "type.googleapis.com/google.cloud.securitycenter.v2.Cwe"
24451 }
24452}
24453
24454/// JobState represents the state of the job.
24455///
24456/// # Working with unknown values
24457///
24458/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24459/// additional enum variants at any time. Adding new variants is not considered
24460/// a breaking change. Applications should write their code in anticipation of:
24461///
24462/// - New values appearing in future releases of the client library, **and**
24463/// - New values received dynamically, without application changes.
24464///
24465/// Please consult the [Working with enums] section in the user guide for some
24466/// guidelines.
24467///
24468/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24469#[derive(Clone, Debug, PartialEq)]
24470#[non_exhaustive]
24471pub enum JobState {
24472 /// Unspecified represents an unknown state and should not be used.
24473 Unspecified,
24474 /// Job is scheduled and pending for run
24475 Pending,
24476 /// Job in progress
24477 Running,
24478 /// Job has completed with success
24479 Succeeded,
24480 /// Job has completed but with failure
24481 Failed,
24482 /// If set, the enum was initialized with an unknown value.
24483 ///
24484 /// Applications can examine the value using [JobState::value] or
24485 /// [JobState::name].
24486 UnknownValue(job_state::UnknownValue),
24487}
24488
24489#[doc(hidden)]
24490pub mod job_state {
24491 #[allow(unused_imports)]
24492 use super::*;
24493 #[derive(Clone, Debug, PartialEq)]
24494 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24495}
24496
24497impl JobState {
24498 /// Gets the enum value.
24499 ///
24500 /// Returns `None` if the enum contains an unknown value deserialized from
24501 /// the string representation of enums.
24502 pub fn value(&self) -> std::option::Option<i32> {
24503 match self {
24504 Self::Unspecified => std::option::Option::Some(0),
24505 Self::Pending => std::option::Option::Some(1),
24506 Self::Running => std::option::Option::Some(2),
24507 Self::Succeeded => std::option::Option::Some(3),
24508 Self::Failed => std::option::Option::Some(4),
24509 Self::UnknownValue(u) => u.0.value(),
24510 }
24511 }
24512
24513 /// Gets the enum value as a string.
24514 ///
24515 /// Returns `None` if the enum contains an unknown value deserialized from
24516 /// the integer representation of enums.
24517 pub fn name(&self) -> std::option::Option<&str> {
24518 match self {
24519 Self::Unspecified => std::option::Option::Some("JOB_STATE_UNSPECIFIED"),
24520 Self::Pending => std::option::Option::Some("PENDING"),
24521 Self::Running => std::option::Option::Some("RUNNING"),
24522 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
24523 Self::Failed => std::option::Option::Some("FAILED"),
24524 Self::UnknownValue(u) => u.0.name(),
24525 }
24526 }
24527}
24528
24529impl std::default::Default for JobState {
24530 fn default() -> Self {
24531 use std::convert::From;
24532 Self::from(0)
24533 }
24534}
24535
24536impl std::fmt::Display for JobState {
24537 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24538 wkt::internal::display_enum(f, self.name(), self.value())
24539 }
24540}
24541
24542impl std::convert::From<i32> for JobState {
24543 fn from(value: i32) -> Self {
24544 match value {
24545 0 => Self::Unspecified,
24546 1 => Self::Pending,
24547 2 => Self::Running,
24548 3 => Self::Succeeded,
24549 4 => Self::Failed,
24550 _ => Self::UnknownValue(job_state::UnknownValue(
24551 wkt::internal::UnknownEnumValue::Integer(value),
24552 )),
24553 }
24554 }
24555}
24556
24557impl std::convert::From<&str> for JobState {
24558 fn from(value: &str) -> Self {
24559 use std::string::ToString;
24560 match value {
24561 "JOB_STATE_UNSPECIFIED" => Self::Unspecified,
24562 "PENDING" => Self::Pending,
24563 "RUNNING" => Self::Running,
24564 "SUCCEEDED" => Self::Succeeded,
24565 "FAILED" => Self::Failed,
24566 _ => Self::UnknownValue(job_state::UnknownValue(
24567 wkt::internal::UnknownEnumValue::String(value.to_string()),
24568 )),
24569 }
24570 }
24571}
24572
24573impl serde::ser::Serialize for JobState {
24574 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24575 where
24576 S: serde::Serializer,
24577 {
24578 match self {
24579 Self::Unspecified => serializer.serialize_i32(0),
24580 Self::Pending => serializer.serialize_i32(1),
24581 Self::Running => serializer.serialize_i32(2),
24582 Self::Succeeded => serializer.serialize_i32(3),
24583 Self::Failed => serializer.serialize_i32(4),
24584 Self::UnknownValue(u) => u.0.serialize(serializer),
24585 }
24586 }
24587}
24588
24589impl<'de> serde::de::Deserialize<'de> for JobState {
24590 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24591 where
24592 D: serde::Deserializer<'de>,
24593 {
24594 deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobState>::new(
24595 ".google.cloud.securitycenter.v2.JobState",
24596 ))
24597 }
24598}
24599
24600/// The cloud provider the finding pertains to.
24601///
24602/// # Working with unknown values
24603///
24604/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24605/// additional enum variants at any time. Adding new variants is not considered
24606/// a breaking change. Applications should write their code in anticipation of:
24607///
24608/// - New values appearing in future releases of the client library, **and**
24609/// - New values received dynamically, without application changes.
24610///
24611/// Please consult the [Working with enums] section in the user guide for some
24612/// guidelines.
24613///
24614/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24615#[derive(Clone, Debug, PartialEq)]
24616#[non_exhaustive]
24617pub enum CloudProvider {
24618 /// The cloud provider is unspecified.
24619 Unspecified,
24620 /// The cloud provider is Google Cloud.
24621 GoogleCloudPlatform,
24622 /// The cloud provider is Amazon Web Services.
24623 AmazonWebServices,
24624 /// The cloud provider is Microsoft Azure.
24625 MicrosoftAzure,
24626 /// If set, the enum was initialized with an unknown value.
24627 ///
24628 /// Applications can examine the value using [CloudProvider::value] or
24629 /// [CloudProvider::name].
24630 UnknownValue(cloud_provider::UnknownValue),
24631}
24632
24633#[doc(hidden)]
24634pub mod cloud_provider {
24635 #[allow(unused_imports)]
24636 use super::*;
24637 #[derive(Clone, Debug, PartialEq)]
24638 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24639}
24640
24641impl CloudProvider {
24642 /// Gets the enum value.
24643 ///
24644 /// Returns `None` if the enum contains an unknown value deserialized from
24645 /// the string representation of enums.
24646 pub fn value(&self) -> std::option::Option<i32> {
24647 match self {
24648 Self::Unspecified => std::option::Option::Some(0),
24649 Self::GoogleCloudPlatform => std::option::Option::Some(1),
24650 Self::AmazonWebServices => std::option::Option::Some(2),
24651 Self::MicrosoftAzure => std::option::Option::Some(3),
24652 Self::UnknownValue(u) => u.0.value(),
24653 }
24654 }
24655
24656 /// Gets the enum value as a string.
24657 ///
24658 /// Returns `None` if the enum contains an unknown value deserialized from
24659 /// the integer representation of enums.
24660 pub fn name(&self) -> std::option::Option<&str> {
24661 match self {
24662 Self::Unspecified => std::option::Option::Some("CLOUD_PROVIDER_UNSPECIFIED"),
24663 Self::GoogleCloudPlatform => std::option::Option::Some("GOOGLE_CLOUD_PLATFORM"),
24664 Self::AmazonWebServices => std::option::Option::Some("AMAZON_WEB_SERVICES"),
24665 Self::MicrosoftAzure => std::option::Option::Some("MICROSOFT_AZURE"),
24666 Self::UnknownValue(u) => u.0.name(),
24667 }
24668 }
24669}
24670
24671impl std::default::Default for CloudProvider {
24672 fn default() -> Self {
24673 use std::convert::From;
24674 Self::from(0)
24675 }
24676}
24677
24678impl std::fmt::Display for CloudProvider {
24679 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24680 wkt::internal::display_enum(f, self.name(), self.value())
24681 }
24682}
24683
24684impl std::convert::From<i32> for CloudProvider {
24685 fn from(value: i32) -> Self {
24686 match value {
24687 0 => Self::Unspecified,
24688 1 => Self::GoogleCloudPlatform,
24689 2 => Self::AmazonWebServices,
24690 3 => Self::MicrosoftAzure,
24691 _ => Self::UnknownValue(cloud_provider::UnknownValue(
24692 wkt::internal::UnknownEnumValue::Integer(value),
24693 )),
24694 }
24695 }
24696}
24697
24698impl std::convert::From<&str> for CloudProvider {
24699 fn from(value: &str) -> Self {
24700 use std::string::ToString;
24701 match value {
24702 "CLOUD_PROVIDER_UNSPECIFIED" => Self::Unspecified,
24703 "GOOGLE_CLOUD_PLATFORM" => Self::GoogleCloudPlatform,
24704 "AMAZON_WEB_SERVICES" => Self::AmazonWebServices,
24705 "MICROSOFT_AZURE" => Self::MicrosoftAzure,
24706 _ => Self::UnknownValue(cloud_provider::UnknownValue(
24707 wkt::internal::UnknownEnumValue::String(value.to_string()),
24708 )),
24709 }
24710 }
24711}
24712
24713impl serde::ser::Serialize for CloudProvider {
24714 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24715 where
24716 S: serde::Serializer,
24717 {
24718 match self {
24719 Self::Unspecified => serializer.serialize_i32(0),
24720 Self::GoogleCloudPlatform => serializer.serialize_i32(1),
24721 Self::AmazonWebServices => serializer.serialize_i32(2),
24722 Self::MicrosoftAzure => serializer.serialize_i32(3),
24723 Self::UnknownValue(u) => u.0.serialize(serializer),
24724 }
24725 }
24726}
24727
24728impl<'de> serde::de::Deserialize<'de> for CloudProvider {
24729 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24730 where
24731 D: serde::Deserializer<'de>,
24732 {
24733 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudProvider>::new(
24734 ".google.cloud.securitycenter.v2.CloudProvider",
24735 ))
24736 }
24737}
24738
24739/// Value enum to map to a resource
24740///
24741/// # Working with unknown values
24742///
24743/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24744/// additional enum variants at any time. Adding new variants is not considered
24745/// a breaking change. Applications should write their code in anticipation of:
24746///
24747/// - New values appearing in future releases of the client library, **and**
24748/// - New values received dynamically, without application changes.
24749///
24750/// Please consult the [Working with enums] section in the user guide for some
24751/// guidelines.
24752///
24753/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24754#[derive(Clone, Debug, PartialEq)]
24755#[non_exhaustive]
24756pub enum ResourceValue {
24757 /// Unspecific value
24758 Unspecified,
24759 /// High resource value
24760 High,
24761 /// Medium resource value
24762 Medium,
24763 /// Low resource value
24764 Low,
24765 /// No resource value, e.g. ignore these resources
24766 None,
24767 /// If set, the enum was initialized with an unknown value.
24768 ///
24769 /// Applications can examine the value using [ResourceValue::value] or
24770 /// [ResourceValue::name].
24771 UnknownValue(resource_value::UnknownValue),
24772}
24773
24774#[doc(hidden)]
24775pub mod resource_value {
24776 #[allow(unused_imports)]
24777 use super::*;
24778 #[derive(Clone, Debug, PartialEq)]
24779 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24780}
24781
24782impl ResourceValue {
24783 /// Gets the enum value.
24784 ///
24785 /// Returns `None` if the enum contains an unknown value deserialized from
24786 /// the string representation of enums.
24787 pub fn value(&self) -> std::option::Option<i32> {
24788 match self {
24789 Self::Unspecified => std::option::Option::Some(0),
24790 Self::High => std::option::Option::Some(1),
24791 Self::Medium => std::option::Option::Some(2),
24792 Self::Low => std::option::Option::Some(3),
24793 Self::None => std::option::Option::Some(4),
24794 Self::UnknownValue(u) => u.0.value(),
24795 }
24796 }
24797
24798 /// Gets the enum value as a string.
24799 ///
24800 /// Returns `None` if the enum contains an unknown value deserialized from
24801 /// the integer representation of enums.
24802 pub fn name(&self) -> std::option::Option<&str> {
24803 match self {
24804 Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
24805 Self::High => std::option::Option::Some("HIGH"),
24806 Self::Medium => std::option::Option::Some("MEDIUM"),
24807 Self::Low => std::option::Option::Some("LOW"),
24808 Self::None => std::option::Option::Some("NONE"),
24809 Self::UnknownValue(u) => u.0.name(),
24810 }
24811 }
24812}
24813
24814impl std::default::Default for ResourceValue {
24815 fn default() -> Self {
24816 use std::convert::From;
24817 Self::from(0)
24818 }
24819}
24820
24821impl std::fmt::Display for ResourceValue {
24822 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24823 wkt::internal::display_enum(f, self.name(), self.value())
24824 }
24825}
24826
24827impl std::convert::From<i32> for ResourceValue {
24828 fn from(value: i32) -> Self {
24829 match value {
24830 0 => Self::Unspecified,
24831 1 => Self::High,
24832 2 => Self::Medium,
24833 3 => Self::Low,
24834 4 => Self::None,
24835 _ => Self::UnknownValue(resource_value::UnknownValue(
24836 wkt::internal::UnknownEnumValue::Integer(value),
24837 )),
24838 }
24839 }
24840}
24841
24842impl std::convert::From<&str> for ResourceValue {
24843 fn from(value: &str) -> Self {
24844 use std::string::ToString;
24845 match value {
24846 "RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
24847 "HIGH" => Self::High,
24848 "MEDIUM" => Self::Medium,
24849 "LOW" => Self::Low,
24850 "NONE" => Self::None,
24851 _ => Self::UnknownValue(resource_value::UnknownValue(
24852 wkt::internal::UnknownEnumValue::String(value.to_string()),
24853 )),
24854 }
24855 }
24856}
24857
24858impl serde::ser::Serialize for ResourceValue {
24859 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24860 where
24861 S: serde::Serializer,
24862 {
24863 match self {
24864 Self::Unspecified => serializer.serialize_i32(0),
24865 Self::High => serializer.serialize_i32(1),
24866 Self::Medium => serializer.serialize_i32(2),
24867 Self::Low => serializer.serialize_i32(3),
24868 Self::None => serializer.serialize_i32(4),
24869 Self::UnknownValue(u) => u.0.serialize(serializer),
24870 }
24871 }
24872}
24873
24874impl<'de> serde::de::Deserialize<'de> for ResourceValue {
24875 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24876 where
24877 D: serde::Deserializer<'de>,
24878 {
24879 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
24880 ".google.cloud.securitycenter.v2.ResourceValue",
24881 ))
24882 }
24883}