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 lazy_static;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Represents an access event.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Access {
43 /// Associated email, such as "foo@google.com".
44 ///
45 /// The email address of the authenticated user or a service account acting on
46 /// behalf of a third party principal making the request. For third party
47 /// identity callers, the `principal_subject` field is populated instead of
48 /// this field. For privacy reasons, the principal email address is sometimes
49 /// redacted. For more information, see [Caller identities in audit
50 /// logs](https://cloud.google.com/logging/docs/audit#user-id).
51 pub principal_email: std::string::String,
52
53 /// Caller's IP address, such as "1.1.1.1".
54 pub caller_ip: std::string::String,
55
56 /// The caller IP's geolocation, which identifies where the call came from.
57 pub caller_ip_geo: std::option::Option<crate::model::Geolocation>,
58
59 /// Type of user agent associated with the finding. For example, an operating
60 /// system shell or an embedded or standalone application.
61 pub user_agent_family: std::string::String,
62
63 /// The caller's user agent string associated with the finding.
64 pub user_agent: std::string::String,
65
66 /// This is the API service that the service account made a call to, e.g.
67 /// "iam.googleapis.com"
68 pub service_name: std::string::String,
69
70 /// The method that the service account called, e.g. "SetIamPolicy".
71 pub method_name: std::string::String,
72
73 /// A string that represents the principal_subject that is associated with the
74 /// identity. Unlike `principal_email`, `principal_subject` supports principals
75 /// that aren't associated with email addresses, such as third party
76 /// principals. For most identities, the format is
77 /// `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`.
78 /// Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD,
79 /// still use the legacy format `serviceAccount:{identity pool
80 /// name}[{subject}]`.
81 pub principal_subject: std::string::String,
82
83 /// The name of the service account key that was used to create or exchange
84 /// credentials when authenticating the service account that made the request.
85 /// This is a scheme-less URI full resource name. For example:
86 ///
87 /// "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}".
88 pub service_account_key_name: std::string::String,
89
90 /// The identity delegation history of an authenticated service account that
91 /// made the request. The `serviceAccountDelegationInfo[]` object contains
92 /// information about the real authorities that try to access Google Cloud
93 /// resources by delegating on a service account. When multiple authorities are
94 /// present, they are guaranteed to be sorted based on the original ordering of
95 /// the identity delegation events.
96 pub service_account_delegation_info: std::vec::Vec<crate::model::ServiceAccountDelegationInfo>,
97
98 /// A string that represents a username. The username provided depends on the
99 /// type of the finding and is likely not an IAM principal. For example, this
100 /// can be a system username if the finding is related to a virtual machine, or
101 /// it can be an application login username.
102 pub user_name: std::string::String,
103
104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
105}
106
107impl Access {
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 pub fn new() -> Self {
312 std::default::Default::default()
313 }
314
315 /// Sets the value of [principal_email][crate::model::ServiceAccountDelegationInfo::principal_email].
316 ///
317 /// # Example
318 /// ```ignore,no_run
319 /// # use google_cloud_securitycenter_v2::model::ServiceAccountDelegationInfo;
320 /// let x = ServiceAccountDelegationInfo::new().set_principal_email("example");
321 /// ```
322 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
323 self.principal_email = v.into();
324 self
325 }
326
327 /// Sets the value of [principal_subject][crate::model::ServiceAccountDelegationInfo::principal_subject].
328 ///
329 /// # Example
330 /// ```ignore,no_run
331 /// # use google_cloud_securitycenter_v2::model::ServiceAccountDelegationInfo;
332 /// let x = ServiceAccountDelegationInfo::new().set_principal_subject("example");
333 /// ```
334 pub fn set_principal_subject<T: std::convert::Into<std::string::String>>(
335 mut self,
336 v: T,
337 ) -> Self {
338 self.principal_subject = v.into();
339 self
340 }
341}
342
343impl wkt::message::Message for ServiceAccountDelegationInfo {
344 fn typename() -> &'static str {
345 "type.googleapis.com/google.cloud.securitycenter.v2.ServiceAccountDelegationInfo"
346 }
347}
348
349/// Represents a geographical location for a given access.
350#[derive(Clone, Default, PartialEq)]
351#[non_exhaustive]
352pub struct Geolocation {
353 /// A CLDR.
354 pub region_code: std::string::String,
355
356 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
357}
358
359impl Geolocation {
360 pub fn new() -> Self {
361 std::default::Default::default()
362 }
363
364 /// Sets the value of [region_code][crate::model::Geolocation::region_code].
365 ///
366 /// # Example
367 /// ```ignore,no_run
368 /// # use google_cloud_securitycenter_v2::model::Geolocation;
369 /// let x = Geolocation::new().set_region_code("example");
370 /// ```
371 pub fn set_region_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
372 self.region_code = v.into();
373 self
374 }
375}
376
377impl wkt::message::Message for Geolocation {
378 fn typename() -> &'static str {
379 "type.googleapis.com/google.cloud.securitycenter.v2.Geolocation"
380 }
381}
382
383/// Details about resources affected by this finding.
384#[derive(Clone, Default, PartialEq)]
385#[non_exhaustive]
386pub struct AffectedResources {
387 /// The count of resources affected by the finding.
388 pub count: i64,
389
390 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
391}
392
393impl AffectedResources {
394 pub fn new() -> Self {
395 std::default::Default::default()
396 }
397
398 /// Sets the value of [count][crate::model::AffectedResources::count].
399 ///
400 /// # Example
401 /// ```ignore,no_run
402 /// # use google_cloud_securitycenter_v2::model::AffectedResources;
403 /// let x = AffectedResources::new().set_count(42);
404 /// ```
405 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
406 self.count = v.into();
407 self
408 }
409}
410
411impl wkt::message::Message for AffectedResources {
412 fn typename() -> &'static str {
413 "type.googleapis.com/google.cloud.securitycenter.v2.AffectedResources"
414 }
415}
416
417/// Contains information about the AI model associated with the finding.
418#[derive(Clone, Default, PartialEq)]
419#[non_exhaustive]
420pub struct AiModel {
421 /// The name of the AI model, for example, "gemini:1.0.0".
422 pub name: std::string::String,
423
424 /// The domain of the model, for example, “image-classification”.
425 pub domain: std::string::String,
426
427 /// The name of the model library, for example, “transformers”.
428 pub library: std::string::String,
429
430 /// The region in which the model is used, for example, “us-central1”.
431 pub location: std::string::String,
432
433 /// The publisher of the model, for example, “google” or “nvidia”.
434 pub publisher: std::string::String,
435
436 /// The platform on which the model is deployed.
437 pub deployment_platform: crate::model::ai_model::DeploymentPlatform,
438
439 /// The user defined display name of model. Ex. baseline-classification-model
440 pub display_name: std::string::String,
441
442 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
443}
444
445impl AiModel {
446 pub fn new() -> Self {
447 std::default::Default::default()
448 }
449
450 /// Sets the value of [name][crate::model::AiModel::name].
451 ///
452 /// # Example
453 /// ```ignore,no_run
454 /// # use google_cloud_securitycenter_v2::model::AiModel;
455 /// let x = AiModel::new().set_name("example");
456 /// ```
457 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
458 self.name = v.into();
459 self
460 }
461
462 /// Sets the value of [domain][crate::model::AiModel::domain].
463 ///
464 /// # Example
465 /// ```ignore,no_run
466 /// # use google_cloud_securitycenter_v2::model::AiModel;
467 /// let x = AiModel::new().set_domain("example");
468 /// ```
469 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
470 self.domain = v.into();
471 self
472 }
473
474 /// Sets the value of [library][crate::model::AiModel::library].
475 ///
476 /// # Example
477 /// ```ignore,no_run
478 /// # use google_cloud_securitycenter_v2::model::AiModel;
479 /// let x = AiModel::new().set_library("example");
480 /// ```
481 pub fn set_library<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
482 self.library = v.into();
483 self
484 }
485
486 /// Sets the value of [location][crate::model::AiModel::location].
487 ///
488 /// # Example
489 /// ```ignore,no_run
490 /// # use google_cloud_securitycenter_v2::model::AiModel;
491 /// let x = AiModel::new().set_location("example");
492 /// ```
493 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
494 self.location = v.into();
495 self
496 }
497
498 /// Sets the value of [publisher][crate::model::AiModel::publisher].
499 ///
500 /// # Example
501 /// ```ignore,no_run
502 /// # use google_cloud_securitycenter_v2::model::AiModel;
503 /// let x = AiModel::new().set_publisher("example");
504 /// ```
505 pub fn set_publisher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
506 self.publisher = v.into();
507 self
508 }
509
510 /// Sets the value of [deployment_platform][crate::model::AiModel::deployment_platform].
511 ///
512 /// # Example
513 /// ```ignore,no_run
514 /// # use google_cloud_securitycenter_v2::model::AiModel;
515 /// use google_cloud_securitycenter_v2::model::ai_model::DeploymentPlatform;
516 /// let x0 = AiModel::new().set_deployment_platform(DeploymentPlatform::VertexAi);
517 /// let x1 = AiModel::new().set_deployment_platform(DeploymentPlatform::Gke);
518 /// let x2 = AiModel::new().set_deployment_platform(DeploymentPlatform::Gce);
519 /// ```
520 pub fn set_deployment_platform<
521 T: std::convert::Into<crate::model::ai_model::DeploymentPlatform>,
522 >(
523 mut self,
524 v: T,
525 ) -> Self {
526 self.deployment_platform = v.into();
527 self
528 }
529
530 /// Sets the value of [display_name][crate::model::AiModel::display_name].
531 ///
532 /// # Example
533 /// ```ignore,no_run
534 /// # use google_cloud_securitycenter_v2::model::AiModel;
535 /// let x = AiModel::new().set_display_name("example");
536 /// ```
537 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
538 self.display_name = v.into();
539 self
540 }
541}
542
543impl wkt::message::Message for AiModel {
544 fn typename() -> &'static str {
545 "type.googleapis.com/google.cloud.securitycenter.v2.AiModel"
546 }
547}
548
549/// Defines additional types related to [AiModel].
550pub mod ai_model {
551 #[allow(unused_imports)]
552 use super::*;
553
554 /// The platform on which the model is deployed.
555 ///
556 /// # Working with unknown values
557 ///
558 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
559 /// additional enum variants at any time. Adding new variants is not considered
560 /// a breaking change. Applications should write their code in anticipation of:
561 ///
562 /// - New values appearing in future releases of the client library, **and**
563 /// - New values received dynamically, without application changes.
564 ///
565 /// Please consult the [Working with enums] section in the user guide for some
566 /// guidelines.
567 ///
568 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
569 #[derive(Clone, Debug, PartialEq)]
570 #[non_exhaustive]
571 pub enum DeploymentPlatform {
572 /// Unspecified deployment platform.
573 Unspecified,
574 /// Vertex AI.
575 VertexAi,
576 /// Google Kubernetes Engine.
577 Gke,
578 /// Google Compute Engine.
579 Gce,
580 /// Fine tuned model.
581 FineTunedModel,
582 /// If set, the enum was initialized with an unknown value.
583 ///
584 /// Applications can examine the value using [DeploymentPlatform::value] or
585 /// [DeploymentPlatform::name].
586 UnknownValue(deployment_platform::UnknownValue),
587 }
588
589 #[doc(hidden)]
590 pub mod deployment_platform {
591 #[allow(unused_imports)]
592 use super::*;
593 #[derive(Clone, Debug, PartialEq)]
594 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
595 }
596
597 impl DeploymentPlatform {
598 /// Gets the enum value.
599 ///
600 /// Returns `None` if the enum contains an unknown value deserialized from
601 /// the string representation of enums.
602 pub fn value(&self) -> std::option::Option<i32> {
603 match self {
604 Self::Unspecified => std::option::Option::Some(0),
605 Self::VertexAi => std::option::Option::Some(1),
606 Self::Gke => std::option::Option::Some(2),
607 Self::Gce => std::option::Option::Some(3),
608 Self::FineTunedModel => std::option::Option::Some(4),
609 Self::UnknownValue(u) => u.0.value(),
610 }
611 }
612
613 /// Gets the enum value as a string.
614 ///
615 /// Returns `None` if the enum contains an unknown value deserialized from
616 /// the integer representation of enums.
617 pub fn name(&self) -> std::option::Option<&str> {
618 match self {
619 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_PLATFORM_UNSPECIFIED"),
620 Self::VertexAi => std::option::Option::Some("VERTEX_AI"),
621 Self::Gke => std::option::Option::Some("GKE"),
622 Self::Gce => std::option::Option::Some("GCE"),
623 Self::FineTunedModel => std::option::Option::Some("FINE_TUNED_MODEL"),
624 Self::UnknownValue(u) => u.0.name(),
625 }
626 }
627 }
628
629 impl std::default::Default for DeploymentPlatform {
630 fn default() -> Self {
631 use std::convert::From;
632 Self::from(0)
633 }
634 }
635
636 impl std::fmt::Display for DeploymentPlatform {
637 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
638 wkt::internal::display_enum(f, self.name(), self.value())
639 }
640 }
641
642 impl std::convert::From<i32> for DeploymentPlatform {
643 fn from(value: i32) -> Self {
644 match value {
645 0 => Self::Unspecified,
646 1 => Self::VertexAi,
647 2 => Self::Gke,
648 3 => Self::Gce,
649 4 => Self::FineTunedModel,
650 _ => Self::UnknownValue(deployment_platform::UnknownValue(
651 wkt::internal::UnknownEnumValue::Integer(value),
652 )),
653 }
654 }
655 }
656
657 impl std::convert::From<&str> for DeploymentPlatform {
658 fn from(value: &str) -> Self {
659 use std::string::ToString;
660 match value {
661 "DEPLOYMENT_PLATFORM_UNSPECIFIED" => Self::Unspecified,
662 "VERTEX_AI" => Self::VertexAi,
663 "GKE" => Self::Gke,
664 "GCE" => Self::Gce,
665 "FINE_TUNED_MODEL" => Self::FineTunedModel,
666 _ => Self::UnknownValue(deployment_platform::UnknownValue(
667 wkt::internal::UnknownEnumValue::String(value.to_string()),
668 )),
669 }
670 }
671 }
672
673 impl serde::ser::Serialize for DeploymentPlatform {
674 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
675 where
676 S: serde::Serializer,
677 {
678 match self {
679 Self::Unspecified => serializer.serialize_i32(0),
680 Self::VertexAi => serializer.serialize_i32(1),
681 Self::Gke => serializer.serialize_i32(2),
682 Self::Gce => serializer.serialize_i32(3),
683 Self::FineTunedModel => serializer.serialize_i32(4),
684 Self::UnknownValue(u) => u.0.serialize(serializer),
685 }
686 }
687 }
688
689 impl<'de> serde::de::Deserialize<'de> for DeploymentPlatform {
690 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
691 where
692 D: serde::Deserializer<'de>,
693 {
694 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentPlatform>::new(
695 ".google.cloud.securitycenter.v2.AiModel.DeploymentPlatform",
696 ))
697 }
698 }
699}
700
701/// Represents an application associated with a finding.
702#[derive(Clone, Default, PartialEq)]
703#[non_exhaustive]
704pub struct Application {
705 /// The base URI that identifies the network location of the application in
706 /// which the vulnerability was detected. For example, `<http://example.com>`.
707 pub base_uri: std::string::String,
708
709 /// The full URI with payload that could be used to reproduce the
710 /// vulnerability. For example, `<http://example.com>?p=aMmYgI6H`.
711 pub full_uri: std::string::String,
712
713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
714}
715
716impl Application {
717 pub fn new() -> Self {
718 std::default::Default::default()
719 }
720
721 /// Sets the value of [base_uri][crate::model::Application::base_uri].
722 ///
723 /// # Example
724 /// ```ignore,no_run
725 /// # use google_cloud_securitycenter_v2::model::Application;
726 /// let x = Application::new().set_base_uri("example");
727 /// ```
728 pub fn set_base_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
729 self.base_uri = v.into();
730 self
731 }
732
733 /// Sets the value of [full_uri][crate::model::Application::full_uri].
734 ///
735 /// # Example
736 /// ```ignore,no_run
737 /// # use google_cloud_securitycenter_v2::model::Application;
738 /// let x = Application::new().set_full_uri("example");
739 /// ```
740 pub fn set_full_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
741 self.full_uri = v.into();
742 self
743 }
744}
745
746impl wkt::message::Message for Application {
747 fn typename() -> &'static str {
748 "type.googleapis.com/google.cloud.securitycenter.v2.Application"
749 }
750}
751
752/// An attack exposure contains the results of an attack path simulation run.
753#[derive(Clone, Default, PartialEq)]
754#[non_exhaustive]
755pub struct AttackExposure {
756 /// A number between 0 (inclusive) and infinity that represents how important
757 /// this finding is to remediate. The higher the score, the more important it
758 /// is to remediate.
759 pub score: f64,
760
761 /// The most recent time the attack exposure was updated on this finding.
762 pub latest_calculation_time: std::option::Option<wkt::Timestamp>,
763
764 /// The resource name of the attack path simulation result that contains the
765 /// details regarding this attack exposure score.
766 /// Example: `organizations/123/simulations/456/attackExposureResults/789`
767 pub attack_exposure_result: std::string::String,
768
769 /// Output only. What state this AttackExposure is in. This captures whether or
770 /// not an attack exposure has been calculated or not.
771 pub state: crate::model::attack_exposure::State,
772
773 /// The number of high value resources that are exposed as a result of this
774 /// finding.
775 pub exposed_high_value_resources_count: i32,
776
777 /// The number of medium value resources that are exposed as a result of this
778 /// finding.
779 pub exposed_medium_value_resources_count: i32,
780
781 /// The number of high value resources that are exposed as a result of this
782 /// finding.
783 pub exposed_low_value_resources_count: i32,
784
785 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
786}
787
788impl AttackExposure {
789 pub fn new() -> Self {
790 std::default::Default::default()
791 }
792
793 /// Sets the value of [score][crate::model::AttackExposure::score].
794 ///
795 /// # Example
796 /// ```ignore,no_run
797 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
798 /// let x = AttackExposure::new().set_score(42.0);
799 /// ```
800 pub fn set_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
801 self.score = v.into();
802 self
803 }
804
805 /// Sets the value of [latest_calculation_time][crate::model::AttackExposure::latest_calculation_time].
806 ///
807 /// # Example
808 /// ```ignore,no_run
809 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
810 /// use wkt::Timestamp;
811 /// let x = AttackExposure::new().set_latest_calculation_time(Timestamp::default()/* use setters */);
812 /// ```
813 pub fn set_latest_calculation_time<T>(mut self, v: T) -> Self
814 where
815 T: std::convert::Into<wkt::Timestamp>,
816 {
817 self.latest_calculation_time = std::option::Option::Some(v.into());
818 self
819 }
820
821 /// Sets or clears the value of [latest_calculation_time][crate::model::AttackExposure::latest_calculation_time].
822 ///
823 /// # Example
824 /// ```ignore,no_run
825 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
826 /// use wkt::Timestamp;
827 /// let x = AttackExposure::new().set_or_clear_latest_calculation_time(Some(Timestamp::default()/* use setters */));
828 /// let x = AttackExposure::new().set_or_clear_latest_calculation_time(None::<Timestamp>);
829 /// ```
830 pub fn set_or_clear_latest_calculation_time<T>(mut self, v: std::option::Option<T>) -> Self
831 where
832 T: std::convert::Into<wkt::Timestamp>,
833 {
834 self.latest_calculation_time = v.map(|x| x.into());
835 self
836 }
837
838 /// Sets the value of [attack_exposure_result][crate::model::AttackExposure::attack_exposure_result].
839 ///
840 /// # Example
841 /// ```ignore,no_run
842 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
843 /// let x = AttackExposure::new().set_attack_exposure_result("example");
844 /// ```
845 pub fn set_attack_exposure_result<T: std::convert::Into<std::string::String>>(
846 mut self,
847 v: T,
848 ) -> Self {
849 self.attack_exposure_result = v.into();
850 self
851 }
852
853 /// Sets the value of [state][crate::model::AttackExposure::state].
854 ///
855 /// # Example
856 /// ```ignore,no_run
857 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
858 /// use google_cloud_securitycenter_v2::model::attack_exposure::State;
859 /// let x0 = AttackExposure::new().set_state(State::Calculated);
860 /// let x1 = AttackExposure::new().set_state(State::NotCalculated);
861 /// ```
862 pub fn set_state<T: std::convert::Into<crate::model::attack_exposure::State>>(
863 mut self,
864 v: T,
865 ) -> Self {
866 self.state = v.into();
867 self
868 }
869
870 /// Sets the value of [exposed_high_value_resources_count][crate::model::AttackExposure::exposed_high_value_resources_count].
871 ///
872 /// # Example
873 /// ```ignore,no_run
874 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
875 /// let x = AttackExposure::new().set_exposed_high_value_resources_count(42);
876 /// ```
877 pub fn set_exposed_high_value_resources_count<T: std::convert::Into<i32>>(
878 mut self,
879 v: T,
880 ) -> Self {
881 self.exposed_high_value_resources_count = v.into();
882 self
883 }
884
885 /// Sets the value of [exposed_medium_value_resources_count][crate::model::AttackExposure::exposed_medium_value_resources_count].
886 ///
887 /// # Example
888 /// ```ignore,no_run
889 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
890 /// let x = AttackExposure::new().set_exposed_medium_value_resources_count(42);
891 /// ```
892 pub fn set_exposed_medium_value_resources_count<T: std::convert::Into<i32>>(
893 mut self,
894 v: T,
895 ) -> Self {
896 self.exposed_medium_value_resources_count = v.into();
897 self
898 }
899
900 /// Sets the value of [exposed_low_value_resources_count][crate::model::AttackExposure::exposed_low_value_resources_count].
901 ///
902 /// # Example
903 /// ```ignore,no_run
904 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
905 /// let x = AttackExposure::new().set_exposed_low_value_resources_count(42);
906 /// ```
907 pub fn set_exposed_low_value_resources_count<T: std::convert::Into<i32>>(
908 mut self,
909 v: T,
910 ) -> Self {
911 self.exposed_low_value_resources_count = v.into();
912 self
913 }
914}
915
916impl wkt::message::Message for AttackExposure {
917 fn typename() -> &'static str {
918 "type.googleapis.com/google.cloud.securitycenter.v2.AttackExposure"
919 }
920}
921
922/// Defines additional types related to [AttackExposure].
923pub mod attack_exposure {
924 #[allow(unused_imports)]
925 use super::*;
926
927 /// This enum defines the various states an AttackExposure can be in.
928 ///
929 /// # Working with unknown values
930 ///
931 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
932 /// additional enum variants at any time. Adding new variants is not considered
933 /// a breaking change. Applications should write their code in anticipation of:
934 ///
935 /// - New values appearing in future releases of the client library, **and**
936 /// - New values received dynamically, without application changes.
937 ///
938 /// Please consult the [Working with enums] section in the user guide for some
939 /// guidelines.
940 ///
941 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
942 #[derive(Clone, Debug, PartialEq)]
943 #[non_exhaustive]
944 pub enum State {
945 /// The state is not specified.
946 Unspecified,
947 /// The attack exposure has been calculated.
948 Calculated,
949 /// The attack exposure has not been calculated.
950 NotCalculated,
951 /// If set, the enum was initialized with an unknown value.
952 ///
953 /// Applications can examine the value using [State::value] or
954 /// [State::name].
955 UnknownValue(state::UnknownValue),
956 }
957
958 #[doc(hidden)]
959 pub mod state {
960 #[allow(unused_imports)]
961 use super::*;
962 #[derive(Clone, Debug, PartialEq)]
963 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
964 }
965
966 impl State {
967 /// Gets the enum value.
968 ///
969 /// Returns `None` if the enum contains an unknown value deserialized from
970 /// the string representation of enums.
971 pub fn value(&self) -> std::option::Option<i32> {
972 match self {
973 Self::Unspecified => std::option::Option::Some(0),
974 Self::Calculated => std::option::Option::Some(1),
975 Self::NotCalculated => std::option::Option::Some(2),
976 Self::UnknownValue(u) => u.0.value(),
977 }
978 }
979
980 /// Gets the enum value as a string.
981 ///
982 /// Returns `None` if the enum contains an unknown value deserialized from
983 /// the integer representation of enums.
984 pub fn name(&self) -> std::option::Option<&str> {
985 match self {
986 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
987 Self::Calculated => std::option::Option::Some("CALCULATED"),
988 Self::NotCalculated => std::option::Option::Some("NOT_CALCULATED"),
989 Self::UnknownValue(u) => u.0.name(),
990 }
991 }
992 }
993
994 impl std::default::Default for State {
995 fn default() -> Self {
996 use std::convert::From;
997 Self::from(0)
998 }
999 }
1000
1001 impl std::fmt::Display for State {
1002 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1003 wkt::internal::display_enum(f, self.name(), self.value())
1004 }
1005 }
1006
1007 impl std::convert::From<i32> for State {
1008 fn from(value: i32) -> Self {
1009 match value {
1010 0 => Self::Unspecified,
1011 1 => Self::Calculated,
1012 2 => Self::NotCalculated,
1013 _ => Self::UnknownValue(state::UnknownValue(
1014 wkt::internal::UnknownEnumValue::Integer(value),
1015 )),
1016 }
1017 }
1018 }
1019
1020 impl std::convert::From<&str> for State {
1021 fn from(value: &str) -> Self {
1022 use std::string::ToString;
1023 match value {
1024 "STATE_UNSPECIFIED" => Self::Unspecified,
1025 "CALCULATED" => Self::Calculated,
1026 "NOT_CALCULATED" => Self::NotCalculated,
1027 _ => Self::UnknownValue(state::UnknownValue(
1028 wkt::internal::UnknownEnumValue::String(value.to_string()),
1029 )),
1030 }
1031 }
1032 }
1033
1034 impl serde::ser::Serialize for State {
1035 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1036 where
1037 S: serde::Serializer,
1038 {
1039 match self {
1040 Self::Unspecified => serializer.serialize_i32(0),
1041 Self::Calculated => serializer.serialize_i32(1),
1042 Self::NotCalculated => serializer.serialize_i32(2),
1043 Self::UnknownValue(u) => u.0.serialize(serializer),
1044 }
1045 }
1046 }
1047
1048 impl<'de> serde::de::Deserialize<'de> for State {
1049 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1050 where
1051 D: serde::Deserializer<'de>,
1052 {
1053 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1054 ".google.cloud.securitycenter.v2.AttackExposure.State",
1055 ))
1056 }
1057 }
1058}
1059
1060/// A path that an attacker could take to reach an exposed resource.
1061#[derive(Clone, Default, PartialEq)]
1062#[non_exhaustive]
1063pub struct AttackPath {
1064 /// The attack path name, for example,
1065 /// `organizations/12/simulations/34/valuedResources/56/attackPaths/78`
1066 pub name: std::string::String,
1067
1068 /// A list of nodes that exist in this attack path.
1069 pub path_nodes: std::vec::Vec<crate::model::attack_path::AttackPathNode>,
1070
1071 /// A list of the edges between nodes in this attack path.
1072 pub edges: std::vec::Vec<crate::model::attack_path::AttackPathEdge>,
1073
1074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1075}
1076
1077impl AttackPath {
1078 pub fn new() -> Self {
1079 std::default::Default::default()
1080 }
1081
1082 /// Sets the value of [name][crate::model::AttackPath::name].
1083 ///
1084 /// # Example
1085 /// ```ignore,no_run
1086 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1087 /// let x = AttackPath::new().set_name("example");
1088 /// ```
1089 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1090 self.name = v.into();
1091 self
1092 }
1093
1094 /// Sets the value of [path_nodes][crate::model::AttackPath::path_nodes].
1095 ///
1096 /// # Example
1097 /// ```ignore,no_run
1098 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1099 /// use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1100 /// let x = AttackPath::new()
1101 /// .set_path_nodes([
1102 /// AttackPathNode::default()/* use setters */,
1103 /// AttackPathNode::default()/* use (different) setters */,
1104 /// ]);
1105 /// ```
1106 pub fn set_path_nodes<T, V>(mut self, v: T) -> Self
1107 where
1108 T: std::iter::IntoIterator<Item = V>,
1109 V: std::convert::Into<crate::model::attack_path::AttackPathNode>,
1110 {
1111 use std::iter::Iterator;
1112 self.path_nodes = v.into_iter().map(|i| i.into()).collect();
1113 self
1114 }
1115
1116 /// Sets the value of [edges][crate::model::AttackPath::edges].
1117 ///
1118 /// # Example
1119 /// ```ignore,no_run
1120 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1121 /// use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1122 /// let x = AttackPath::new()
1123 /// .set_edges([
1124 /// AttackPathEdge::default()/* use setters */,
1125 /// AttackPathEdge::default()/* use (different) setters */,
1126 /// ]);
1127 /// ```
1128 pub fn set_edges<T, V>(mut self, v: T) -> Self
1129 where
1130 T: std::iter::IntoIterator<Item = V>,
1131 V: std::convert::Into<crate::model::attack_path::AttackPathEdge>,
1132 {
1133 use std::iter::Iterator;
1134 self.edges = v.into_iter().map(|i| i.into()).collect();
1135 self
1136 }
1137}
1138
1139impl wkt::message::Message for AttackPath {
1140 fn typename() -> &'static str {
1141 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath"
1142 }
1143}
1144
1145/// Defines additional types related to [AttackPath].
1146pub mod attack_path {
1147 #[allow(unused_imports)]
1148 use super::*;
1149
1150 /// Represents one point that an attacker passes through in this attack path.
1151 #[derive(Clone, Default, PartialEq)]
1152 #[non_exhaustive]
1153 pub struct AttackPathNode {
1154 /// The name of the resource at this point in the attack path.
1155 /// The format of the name follows the Cloud Asset Inventory [resource
1156 /// name
1157 /// format](https://cloud.google.com/asset-inventory/docs/resource-name-format)
1158 pub resource: std::string::String,
1159
1160 /// The [supported resource
1161 /// type](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
1162 pub resource_type: std::string::String,
1163
1164 /// Human-readable name of this resource.
1165 pub display_name: std::string::String,
1166
1167 /// The findings associated with this node in the attack path.
1168 pub associated_findings:
1169 std::vec::Vec<crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding>,
1170
1171 /// Unique id of the attack path node.
1172 pub uuid: std::string::String,
1173
1174 /// A list of attack step nodes that exist in this attack path node.
1175 pub attack_steps:
1176 std::vec::Vec<crate::model::attack_path::attack_path_node::AttackStepNode>,
1177
1178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1179 }
1180
1181 impl AttackPathNode {
1182 pub fn new() -> Self {
1183 std::default::Default::default()
1184 }
1185
1186 /// Sets the value of [resource][crate::model::attack_path::AttackPathNode::resource].
1187 ///
1188 /// # Example
1189 /// ```ignore,no_run
1190 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1191 /// let x = AttackPathNode::new().set_resource("example");
1192 /// ```
1193 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1194 self.resource = v.into();
1195 self
1196 }
1197
1198 /// Sets the value of [resource_type][crate::model::attack_path::AttackPathNode::resource_type].
1199 ///
1200 /// # Example
1201 /// ```ignore,no_run
1202 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1203 /// let x = AttackPathNode::new().set_resource_type("example");
1204 /// ```
1205 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(
1206 mut self,
1207 v: T,
1208 ) -> Self {
1209 self.resource_type = v.into();
1210 self
1211 }
1212
1213 /// Sets the value of [display_name][crate::model::attack_path::AttackPathNode::display_name].
1214 ///
1215 /// # Example
1216 /// ```ignore,no_run
1217 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1218 /// let x = AttackPathNode::new().set_display_name("example");
1219 /// ```
1220 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
1221 mut self,
1222 v: T,
1223 ) -> Self {
1224 self.display_name = v.into();
1225 self
1226 }
1227
1228 /// Sets the value of [associated_findings][crate::model::attack_path::AttackPathNode::associated_findings].
1229 ///
1230 /// # Example
1231 /// ```ignore,no_run
1232 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1233 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1234 /// let x = AttackPathNode::new()
1235 /// .set_associated_findings([
1236 /// PathNodeAssociatedFinding::default()/* use setters */,
1237 /// PathNodeAssociatedFinding::default()/* use (different) setters */,
1238 /// ]);
1239 /// ```
1240 pub fn set_associated_findings<T, V>(mut self, v: T) -> Self
1241 where
1242 T: std::iter::IntoIterator<Item = V>,
1243 V: std::convert::Into<
1244 crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding,
1245 >,
1246 {
1247 use std::iter::Iterator;
1248 self.associated_findings = v.into_iter().map(|i| i.into()).collect();
1249 self
1250 }
1251
1252 /// Sets the value of [uuid][crate::model::attack_path::AttackPathNode::uuid].
1253 ///
1254 /// # Example
1255 /// ```ignore,no_run
1256 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1257 /// let x = AttackPathNode::new().set_uuid("example");
1258 /// ```
1259 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1260 self.uuid = v.into();
1261 self
1262 }
1263
1264 /// Sets the value of [attack_steps][crate::model::attack_path::AttackPathNode::attack_steps].
1265 ///
1266 /// # Example
1267 /// ```ignore,no_run
1268 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1269 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1270 /// let x = AttackPathNode::new()
1271 /// .set_attack_steps([
1272 /// AttackStepNode::default()/* use setters */,
1273 /// AttackStepNode::default()/* use (different) setters */,
1274 /// ]);
1275 /// ```
1276 pub fn set_attack_steps<T, V>(mut self, v: T) -> Self
1277 where
1278 T: std::iter::IntoIterator<Item = V>,
1279 V: std::convert::Into<crate::model::attack_path::attack_path_node::AttackStepNode>,
1280 {
1281 use std::iter::Iterator;
1282 self.attack_steps = v.into_iter().map(|i| i.into()).collect();
1283 self
1284 }
1285 }
1286
1287 impl wkt::message::Message for AttackPathNode {
1288 fn typename() -> &'static str {
1289 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode"
1290 }
1291 }
1292
1293 /// Defines additional types related to [AttackPathNode].
1294 pub mod attack_path_node {
1295 #[allow(unused_imports)]
1296 use super::*;
1297
1298 /// A finding that is associated with this node in the attack path.
1299 #[derive(Clone, Default, PartialEq)]
1300 #[non_exhaustive]
1301 pub struct PathNodeAssociatedFinding {
1302 /// Canonical name of the associated findings. Example:
1303 /// `organizations/123/sources/456/findings/789`
1304 pub canonical_finding: std::string::String,
1305
1306 /// The additional taxonomy group within findings from a given source.
1307 pub finding_category: std::string::String,
1308
1309 /// Full resource name of the finding.
1310 pub name: std::string::String,
1311
1312 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1313 }
1314
1315 impl PathNodeAssociatedFinding {
1316 pub fn new() -> Self {
1317 std::default::Default::default()
1318 }
1319
1320 /// Sets the value of [canonical_finding][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::canonical_finding].
1321 ///
1322 /// # Example
1323 /// ```ignore,no_run
1324 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1325 /// let x = PathNodeAssociatedFinding::new().set_canonical_finding("example");
1326 /// ```
1327 pub fn set_canonical_finding<T: std::convert::Into<std::string::String>>(
1328 mut self,
1329 v: T,
1330 ) -> Self {
1331 self.canonical_finding = v.into();
1332 self
1333 }
1334
1335 /// Sets the value of [finding_category][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::finding_category].
1336 ///
1337 /// # Example
1338 /// ```ignore,no_run
1339 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1340 /// let x = PathNodeAssociatedFinding::new().set_finding_category("example");
1341 /// ```
1342 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
1343 mut self,
1344 v: T,
1345 ) -> Self {
1346 self.finding_category = v.into();
1347 self
1348 }
1349
1350 /// Sets the value of [name][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::name].
1351 ///
1352 /// # Example
1353 /// ```ignore,no_run
1354 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1355 /// let x = PathNodeAssociatedFinding::new().set_name("example");
1356 /// ```
1357 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1358 self.name = v.into();
1359 self
1360 }
1361 }
1362
1363 impl wkt::message::Message for PathNodeAssociatedFinding {
1364 fn typename() -> &'static str {
1365 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding"
1366 }
1367 }
1368
1369 /// Detailed steps the attack can take between path nodes.
1370 #[derive(Clone, Default, PartialEq)]
1371 #[non_exhaustive]
1372 pub struct AttackStepNode {
1373 /// Unique ID for one Node
1374 pub uuid: std::string::String,
1375
1376 /// Attack step type. Can be either AND, OR or DEFENSE
1377 pub r#type: crate::model::attack_path::attack_path_node::NodeType,
1378
1379 /// User friendly name of the attack step
1380 pub display_name: std::string::String,
1381
1382 /// Attack step labels for metadata
1383 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1384
1385 /// Attack step description
1386 pub description: std::string::String,
1387
1388 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1389 }
1390
1391 impl AttackStepNode {
1392 pub fn new() -> Self {
1393 std::default::Default::default()
1394 }
1395
1396 /// Sets the value of [uuid][crate::model::attack_path::attack_path_node::AttackStepNode::uuid].
1397 ///
1398 /// # Example
1399 /// ```ignore,no_run
1400 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1401 /// let x = AttackStepNode::new().set_uuid("example");
1402 /// ```
1403 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1404 self.uuid = v.into();
1405 self
1406 }
1407
1408 /// Sets the value of [r#type][crate::model::attack_path::attack_path_node::AttackStepNode::type].
1409 ///
1410 /// # Example
1411 /// ```ignore,no_run
1412 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1413 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::NodeType;
1414 /// let x0 = AttackStepNode::new().set_type(NodeType::And);
1415 /// let x1 = AttackStepNode::new().set_type(NodeType::Or);
1416 /// let x2 = AttackStepNode::new().set_type(NodeType::Defense);
1417 /// ```
1418 pub fn set_type<
1419 T: std::convert::Into<crate::model::attack_path::attack_path_node::NodeType>,
1420 >(
1421 mut self,
1422 v: T,
1423 ) -> Self {
1424 self.r#type = v.into();
1425 self
1426 }
1427
1428 /// Sets the value of [display_name][crate::model::attack_path::attack_path_node::AttackStepNode::display_name].
1429 ///
1430 /// # Example
1431 /// ```ignore,no_run
1432 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1433 /// let x = AttackStepNode::new().set_display_name("example");
1434 /// ```
1435 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
1436 mut self,
1437 v: T,
1438 ) -> Self {
1439 self.display_name = v.into();
1440 self
1441 }
1442
1443 /// Sets the value of [labels][crate::model::attack_path::attack_path_node::AttackStepNode::labels].
1444 ///
1445 /// # Example
1446 /// ```ignore,no_run
1447 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1448 /// let x = AttackStepNode::new().set_labels([
1449 /// ("key0", "abc"),
1450 /// ("key1", "xyz"),
1451 /// ]);
1452 /// ```
1453 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1454 where
1455 T: std::iter::IntoIterator<Item = (K, V)>,
1456 K: std::convert::Into<std::string::String>,
1457 V: std::convert::Into<std::string::String>,
1458 {
1459 use std::iter::Iterator;
1460 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1461 self
1462 }
1463
1464 /// Sets the value of [description][crate::model::attack_path::attack_path_node::AttackStepNode::description].
1465 ///
1466 /// # Example
1467 /// ```ignore,no_run
1468 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1469 /// let x = AttackStepNode::new().set_description("example");
1470 /// ```
1471 pub fn set_description<T: std::convert::Into<std::string::String>>(
1472 mut self,
1473 v: T,
1474 ) -> Self {
1475 self.description = v.into();
1476 self
1477 }
1478 }
1479
1480 impl wkt::message::Message for AttackStepNode {
1481 fn typename() -> &'static str {
1482 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode"
1483 }
1484 }
1485
1486 /// The type of the incoming attack step node.
1487 ///
1488 /// # Working with unknown values
1489 ///
1490 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1491 /// additional enum variants at any time. Adding new variants is not considered
1492 /// a breaking change. Applications should write their code in anticipation of:
1493 ///
1494 /// - New values appearing in future releases of the client library, **and**
1495 /// - New values received dynamically, without application changes.
1496 ///
1497 /// Please consult the [Working with enums] section in the user guide for some
1498 /// guidelines.
1499 ///
1500 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1501 #[derive(Clone, Debug, PartialEq)]
1502 #[non_exhaustive]
1503 pub enum NodeType {
1504 /// Type not specified
1505 Unspecified,
1506 /// Incoming edge joined with AND
1507 And,
1508 /// Incoming edge joined with OR
1509 Or,
1510 /// Incoming edge is defense
1511 Defense,
1512 /// Incoming edge is attacker
1513 Attacker,
1514 /// If set, the enum was initialized with an unknown value.
1515 ///
1516 /// Applications can examine the value using [NodeType::value] or
1517 /// [NodeType::name].
1518 UnknownValue(node_type::UnknownValue),
1519 }
1520
1521 #[doc(hidden)]
1522 pub mod node_type {
1523 #[allow(unused_imports)]
1524 use super::*;
1525 #[derive(Clone, Debug, PartialEq)]
1526 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1527 }
1528
1529 impl NodeType {
1530 /// Gets the enum value.
1531 ///
1532 /// Returns `None` if the enum contains an unknown value deserialized from
1533 /// the string representation of enums.
1534 pub fn value(&self) -> std::option::Option<i32> {
1535 match self {
1536 Self::Unspecified => std::option::Option::Some(0),
1537 Self::And => std::option::Option::Some(1),
1538 Self::Or => std::option::Option::Some(2),
1539 Self::Defense => std::option::Option::Some(3),
1540 Self::Attacker => std::option::Option::Some(4),
1541 Self::UnknownValue(u) => u.0.value(),
1542 }
1543 }
1544
1545 /// Gets the enum value as a string.
1546 ///
1547 /// Returns `None` if the enum contains an unknown value deserialized from
1548 /// the integer representation of enums.
1549 pub fn name(&self) -> std::option::Option<&str> {
1550 match self {
1551 Self::Unspecified => std::option::Option::Some("NODE_TYPE_UNSPECIFIED"),
1552 Self::And => std::option::Option::Some("NODE_TYPE_AND"),
1553 Self::Or => std::option::Option::Some("NODE_TYPE_OR"),
1554 Self::Defense => std::option::Option::Some("NODE_TYPE_DEFENSE"),
1555 Self::Attacker => std::option::Option::Some("NODE_TYPE_ATTACKER"),
1556 Self::UnknownValue(u) => u.0.name(),
1557 }
1558 }
1559 }
1560
1561 impl std::default::Default for NodeType {
1562 fn default() -> Self {
1563 use std::convert::From;
1564 Self::from(0)
1565 }
1566 }
1567
1568 impl std::fmt::Display for NodeType {
1569 fn fmt(
1570 &self,
1571 f: &mut std::fmt::Formatter<'_>,
1572 ) -> std::result::Result<(), std::fmt::Error> {
1573 wkt::internal::display_enum(f, self.name(), self.value())
1574 }
1575 }
1576
1577 impl std::convert::From<i32> for NodeType {
1578 fn from(value: i32) -> Self {
1579 match value {
1580 0 => Self::Unspecified,
1581 1 => Self::And,
1582 2 => Self::Or,
1583 3 => Self::Defense,
1584 4 => Self::Attacker,
1585 _ => Self::UnknownValue(node_type::UnknownValue(
1586 wkt::internal::UnknownEnumValue::Integer(value),
1587 )),
1588 }
1589 }
1590 }
1591
1592 impl std::convert::From<&str> for NodeType {
1593 fn from(value: &str) -> Self {
1594 use std::string::ToString;
1595 match value {
1596 "NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
1597 "NODE_TYPE_AND" => Self::And,
1598 "NODE_TYPE_OR" => Self::Or,
1599 "NODE_TYPE_DEFENSE" => Self::Defense,
1600 "NODE_TYPE_ATTACKER" => Self::Attacker,
1601 _ => Self::UnknownValue(node_type::UnknownValue(
1602 wkt::internal::UnknownEnumValue::String(value.to_string()),
1603 )),
1604 }
1605 }
1606 }
1607
1608 impl serde::ser::Serialize for NodeType {
1609 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1610 where
1611 S: serde::Serializer,
1612 {
1613 match self {
1614 Self::Unspecified => serializer.serialize_i32(0),
1615 Self::And => serializer.serialize_i32(1),
1616 Self::Or => serializer.serialize_i32(2),
1617 Self::Defense => serializer.serialize_i32(3),
1618 Self::Attacker => serializer.serialize_i32(4),
1619 Self::UnknownValue(u) => u.0.serialize(serializer),
1620 }
1621 }
1622 }
1623
1624 impl<'de> serde::de::Deserialize<'de> for NodeType {
1625 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1626 where
1627 D: serde::Deserializer<'de>,
1628 {
1629 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeType>::new(
1630 ".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType",
1631 ))
1632 }
1633 }
1634 }
1635
1636 /// Represents a connection between a source node and a destination node in
1637 /// this attack path.
1638 #[derive(Clone, Default, PartialEq)]
1639 #[non_exhaustive]
1640 pub struct AttackPathEdge {
1641 /// The attack node uuid of the source node.
1642 pub source: std::string::String,
1643
1644 /// The attack node uuid of the destination node.
1645 pub destination: std::string::String,
1646
1647 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1648 }
1649
1650 impl AttackPathEdge {
1651 pub fn new() -> Self {
1652 std::default::Default::default()
1653 }
1654
1655 /// Sets the value of [source][crate::model::attack_path::AttackPathEdge::source].
1656 ///
1657 /// # Example
1658 /// ```ignore,no_run
1659 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1660 /// let x = AttackPathEdge::new().set_source("example");
1661 /// ```
1662 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1663 self.source = v.into();
1664 self
1665 }
1666
1667 /// Sets the value of [destination][crate::model::attack_path::AttackPathEdge::destination].
1668 ///
1669 /// # Example
1670 /// ```ignore,no_run
1671 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1672 /// let x = AttackPathEdge::new().set_destination("example");
1673 /// ```
1674 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1675 self.destination = v.into();
1676 self
1677 }
1678 }
1679
1680 impl wkt::message::Message for AttackPathEdge {
1681 fn typename() -> &'static str {
1682 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathEdge"
1683 }
1684 }
1685}
1686
1687/// Information related to Google Cloud Backup and DR Service findings.
1688#[derive(Clone, Default, PartialEq)]
1689#[non_exhaustive]
1690pub struct BackupDisasterRecovery {
1691 /// The name of a Backup and DR template which comprises one or more backup
1692 /// policies. See the [Backup and DR
1693 /// documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp)
1694 /// for more information. For example, `snap-ov`.
1695 pub backup_template: std::string::String,
1696
1697 /// The names of Backup and DR policies that are associated with a template
1698 /// and that define when to run a backup, how frequently to run a backup, and
1699 /// how long to retain the backup image. For example, `onvaults`.
1700 pub policies: std::vec::Vec<std::string::String>,
1701
1702 /// The name of a Backup and DR host, which is managed by the backup and
1703 /// recovery appliance and known to the management console. The host can be of
1704 /// type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file
1705 /// system, etc.), vCenter, or an ESX server. See the [Backup and DR
1706 /// documentation on
1707 /// hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications)
1708 /// for more information. For example, `centos7-01`.
1709 pub host: std::string::String,
1710
1711 /// The names of Backup and DR applications. An application is a VM, database,
1712 /// or file system on a managed host monitored by a backup and recovery
1713 /// appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`,
1714 /// `centos7-01-vol02`.
1715 pub applications: std::vec::Vec<std::string::String>,
1716
1717 /// The name of the Backup and DR storage pool that the backup and recovery
1718 /// appliance is storing data in. The storage pool could be of type Cloud,
1719 /// Primary, Snapshot, or OnVault. See the [Backup and DR documentation on
1720 /// storage
1721 /// pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools).
1722 /// For example, `DiskPoolOne`.
1723 pub storage_pool: std::string::String,
1724
1725 /// The names of Backup and DR advanced policy options of a policy applying to
1726 /// an application. See the [Backup and DR documentation on policy
1727 /// options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings).
1728 /// For example, `skipofflineappsincongrp, nounmap`.
1729 pub policy_options: std::vec::Vec<std::string::String>,
1730
1731 /// The name of the Backup and DR resource profile that specifies the storage
1732 /// media for backups of application and VM data. See the [Backup and DR
1733 /// documentation on
1734 /// profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile).
1735 /// For example, `GCP`.
1736 pub profile: std::string::String,
1737
1738 /// The name of the Backup and DR appliance that captures, moves, and manages
1739 /// the lifecycle of backup data. For example, `backup-server-57137`.
1740 pub appliance: std::string::String,
1741
1742 /// The backup type of the Backup and DR image.
1743 /// For example, `Snapshot`, `Remote Snapshot`, `OnVault`.
1744 pub backup_type: std::string::String,
1745
1746 /// The timestamp at which the Backup and DR backup was created.
1747 pub backup_create_time: std::option::Option<wkt::Timestamp>,
1748
1749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1750}
1751
1752impl BackupDisasterRecovery {
1753 pub fn new() -> Self {
1754 std::default::Default::default()
1755 }
1756
1757 /// Sets the value of [backup_template][crate::model::BackupDisasterRecovery::backup_template].
1758 ///
1759 /// # Example
1760 /// ```ignore,no_run
1761 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1762 /// let x = BackupDisasterRecovery::new().set_backup_template("example");
1763 /// ```
1764 pub fn set_backup_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1765 self.backup_template = v.into();
1766 self
1767 }
1768
1769 /// Sets the value of [policies][crate::model::BackupDisasterRecovery::policies].
1770 ///
1771 /// # Example
1772 /// ```ignore,no_run
1773 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1774 /// let x = BackupDisasterRecovery::new().set_policies(["a", "b", "c"]);
1775 /// ```
1776 pub fn set_policies<T, V>(mut self, v: T) -> Self
1777 where
1778 T: std::iter::IntoIterator<Item = V>,
1779 V: std::convert::Into<std::string::String>,
1780 {
1781 use std::iter::Iterator;
1782 self.policies = v.into_iter().map(|i| i.into()).collect();
1783 self
1784 }
1785
1786 /// Sets the value of [host][crate::model::BackupDisasterRecovery::host].
1787 ///
1788 /// # Example
1789 /// ```ignore,no_run
1790 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1791 /// let x = BackupDisasterRecovery::new().set_host("example");
1792 /// ```
1793 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1794 self.host = v.into();
1795 self
1796 }
1797
1798 /// Sets the value of [applications][crate::model::BackupDisasterRecovery::applications].
1799 ///
1800 /// # Example
1801 /// ```ignore,no_run
1802 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1803 /// let x = BackupDisasterRecovery::new().set_applications(["a", "b", "c"]);
1804 /// ```
1805 pub fn set_applications<T, V>(mut self, v: T) -> Self
1806 where
1807 T: std::iter::IntoIterator<Item = V>,
1808 V: std::convert::Into<std::string::String>,
1809 {
1810 use std::iter::Iterator;
1811 self.applications = v.into_iter().map(|i| i.into()).collect();
1812 self
1813 }
1814
1815 /// Sets the value of [storage_pool][crate::model::BackupDisasterRecovery::storage_pool].
1816 ///
1817 /// # Example
1818 /// ```ignore,no_run
1819 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1820 /// let x = BackupDisasterRecovery::new().set_storage_pool("example");
1821 /// ```
1822 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1823 self.storage_pool = v.into();
1824 self
1825 }
1826
1827 /// Sets the value of [policy_options][crate::model::BackupDisasterRecovery::policy_options].
1828 ///
1829 /// # Example
1830 /// ```ignore,no_run
1831 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1832 /// let x = BackupDisasterRecovery::new().set_policy_options(["a", "b", "c"]);
1833 /// ```
1834 pub fn set_policy_options<T, V>(mut self, v: T) -> Self
1835 where
1836 T: std::iter::IntoIterator<Item = V>,
1837 V: std::convert::Into<std::string::String>,
1838 {
1839 use std::iter::Iterator;
1840 self.policy_options = v.into_iter().map(|i| i.into()).collect();
1841 self
1842 }
1843
1844 /// Sets the value of [profile][crate::model::BackupDisasterRecovery::profile].
1845 ///
1846 /// # Example
1847 /// ```ignore,no_run
1848 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1849 /// let x = BackupDisasterRecovery::new().set_profile("example");
1850 /// ```
1851 pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1852 self.profile = v.into();
1853 self
1854 }
1855
1856 /// Sets the value of [appliance][crate::model::BackupDisasterRecovery::appliance].
1857 ///
1858 /// # Example
1859 /// ```ignore,no_run
1860 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1861 /// let x = BackupDisasterRecovery::new().set_appliance("example");
1862 /// ```
1863 pub fn set_appliance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1864 self.appliance = v.into();
1865 self
1866 }
1867
1868 /// Sets the value of [backup_type][crate::model::BackupDisasterRecovery::backup_type].
1869 ///
1870 /// # Example
1871 /// ```ignore,no_run
1872 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1873 /// let x = BackupDisasterRecovery::new().set_backup_type("example");
1874 /// ```
1875 pub fn set_backup_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1876 self.backup_type = v.into();
1877 self
1878 }
1879
1880 /// Sets the value of [backup_create_time][crate::model::BackupDisasterRecovery::backup_create_time].
1881 ///
1882 /// # Example
1883 /// ```ignore,no_run
1884 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1885 /// use wkt::Timestamp;
1886 /// let x = BackupDisasterRecovery::new().set_backup_create_time(Timestamp::default()/* use setters */);
1887 /// ```
1888 pub fn set_backup_create_time<T>(mut self, v: T) -> Self
1889 where
1890 T: std::convert::Into<wkt::Timestamp>,
1891 {
1892 self.backup_create_time = std::option::Option::Some(v.into());
1893 self
1894 }
1895
1896 /// Sets or clears 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_or_clear_backup_create_time(Some(Timestamp::default()/* use setters */));
1903 /// let x = BackupDisasterRecovery::new().set_or_clear_backup_create_time(None::<Timestamp>);
1904 /// ```
1905 pub fn set_or_clear_backup_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1906 where
1907 T: std::convert::Into<wkt::Timestamp>,
1908 {
1909 self.backup_create_time = v.map(|x| x.into());
1910 self
1911 }
1912}
1913
1914impl wkt::message::Message for BackupDisasterRecovery {
1915 fn typename() -> &'static str {
1916 "type.googleapis.com/google.cloud.securitycenter.v2.BackupDisasterRecovery"
1917 }
1918}
1919
1920/// Configures how to deliver Findings to BigQuery Instance.
1921#[derive(Clone, Default, PartialEq)]
1922#[non_exhaustive]
1923pub struct BigQueryExport {
1924 /// Identifier. The relative resource name of this export. See:
1925 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>.
1926 /// The following list shows some examples:
1927 ///
1928 ///
1929 /// `organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}`
1930 ///
1931 /// + `folders/{folder_id}/locations/{location_id}/bigQueryExports/{export_id}`
1932 ///
1933 /// `projects/{project_id}/locations/{location_id}/bigQueryExports/{export_id}`
1934 ///
1935 /// This field is provided in responses, and is ignored when provided in create
1936 /// requests.
1937 pub name: std::string::String,
1938
1939 /// The description of the export (max of 1024 characters).
1940 pub description: std::string::String,
1941
1942 /// Expression that defines the filter to apply across create/update events
1943 /// of findings. The expression is a list of zero or more restrictions combined
1944 /// via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
1945 /// has higher precedence than `AND`.
1946 ///
1947 /// Restrictions have the form `<field> <operator> <value>` and may have a
1948 /// `-` character in front of them to indicate negation. The fields map to
1949 /// those defined in the corresponding resource.
1950 ///
1951 /// The supported operators are:
1952 ///
1953 /// * `=` for all value types.
1954 /// * `>`, `<`, `>=`, `<=` for integer values.
1955 /// * `:`, meaning substring matching, for strings.
1956 ///
1957 /// The supported value types are:
1958 ///
1959 /// * string literals in quotes.
1960 /// * integer literals without quotes.
1961 /// * boolean literals `true` and `false` without quotes.
1962 pub filter: std::string::String,
1963
1964 /// The dataset to write findings' updates to. Its format is
1965 /// "projects/[project_id]/datasets/[bigquery_dataset_id]".
1966 /// BigQuery dataset unique ID must contain only letters (a-z, A-Z), numbers
1967 /// (0-9), or underscores (_).
1968 pub dataset: std::string::String,
1969
1970 /// Output only. The time at which the BigQuery export was created.
1971 /// This field is set by the server and will be ignored if provided on export
1972 /// on creation.
1973 pub create_time: std::option::Option<wkt::Timestamp>,
1974
1975 /// Output only. The most recent time at which the BigQuery export was updated.
1976 /// This field is set by the server and will be ignored if provided on export
1977 /// creation or update.
1978 pub update_time: std::option::Option<wkt::Timestamp>,
1979
1980 /// Output only. Email address of the user who last edited the BigQuery export.
1981 /// This field is set by the server and will be ignored if provided on export
1982 /// creation or update.
1983 pub most_recent_editor: std::string::String,
1984
1985 /// Output only. The service account that needs permission to create table and
1986 /// upload data to the BigQuery dataset.
1987 pub principal: std::string::String,
1988
1989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1990}
1991
1992impl BigQueryExport {
1993 pub fn new() -> Self {
1994 std::default::Default::default()
1995 }
1996
1997 /// Sets the value of [name][crate::model::BigQueryExport::name].
1998 ///
1999 /// # Example
2000 /// ```ignore,no_run
2001 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2002 /// let x = BigQueryExport::new().set_name("example");
2003 /// ```
2004 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2005 self.name = v.into();
2006 self
2007 }
2008
2009 /// Sets the value of [description][crate::model::BigQueryExport::description].
2010 ///
2011 /// # Example
2012 /// ```ignore,no_run
2013 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2014 /// let x = BigQueryExport::new().set_description("example");
2015 /// ```
2016 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2017 self.description = v.into();
2018 self
2019 }
2020
2021 /// Sets the value of [filter][crate::model::BigQueryExport::filter].
2022 ///
2023 /// # Example
2024 /// ```ignore,no_run
2025 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2026 /// let x = BigQueryExport::new().set_filter("example");
2027 /// ```
2028 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2029 self.filter = v.into();
2030 self
2031 }
2032
2033 /// Sets the value of [dataset][crate::model::BigQueryExport::dataset].
2034 ///
2035 /// # Example
2036 /// ```ignore,no_run
2037 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2038 /// let x = BigQueryExport::new().set_dataset("example");
2039 /// ```
2040 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2041 self.dataset = v.into();
2042 self
2043 }
2044
2045 /// Sets the value of [create_time][crate::model::BigQueryExport::create_time].
2046 ///
2047 /// # Example
2048 /// ```ignore,no_run
2049 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2050 /// use wkt::Timestamp;
2051 /// let x = BigQueryExport::new().set_create_time(Timestamp::default()/* use setters */);
2052 /// ```
2053 pub fn set_create_time<T>(mut self, v: T) -> Self
2054 where
2055 T: std::convert::Into<wkt::Timestamp>,
2056 {
2057 self.create_time = std::option::Option::Some(v.into());
2058 self
2059 }
2060
2061 /// Sets or clears the value of [create_time][crate::model::BigQueryExport::create_time].
2062 ///
2063 /// # Example
2064 /// ```ignore,no_run
2065 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2066 /// use wkt::Timestamp;
2067 /// let x = BigQueryExport::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2068 /// let x = BigQueryExport::new().set_or_clear_create_time(None::<Timestamp>);
2069 /// ```
2070 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2071 where
2072 T: std::convert::Into<wkt::Timestamp>,
2073 {
2074 self.create_time = v.map(|x| x.into());
2075 self
2076 }
2077
2078 /// Sets the value of [update_time][crate::model::BigQueryExport::update_time].
2079 ///
2080 /// # Example
2081 /// ```ignore,no_run
2082 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2083 /// use wkt::Timestamp;
2084 /// let x = BigQueryExport::new().set_update_time(Timestamp::default()/* use setters */);
2085 /// ```
2086 pub fn set_update_time<T>(mut self, v: T) -> Self
2087 where
2088 T: std::convert::Into<wkt::Timestamp>,
2089 {
2090 self.update_time = std::option::Option::Some(v.into());
2091 self
2092 }
2093
2094 /// Sets or clears the value of [update_time][crate::model::BigQueryExport::update_time].
2095 ///
2096 /// # Example
2097 /// ```ignore,no_run
2098 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2099 /// use wkt::Timestamp;
2100 /// let x = BigQueryExport::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2101 /// let x = BigQueryExport::new().set_or_clear_update_time(None::<Timestamp>);
2102 /// ```
2103 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2104 where
2105 T: std::convert::Into<wkt::Timestamp>,
2106 {
2107 self.update_time = v.map(|x| x.into());
2108 self
2109 }
2110
2111 /// Sets the value of [most_recent_editor][crate::model::BigQueryExport::most_recent_editor].
2112 ///
2113 /// # Example
2114 /// ```ignore,no_run
2115 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2116 /// let x = BigQueryExport::new().set_most_recent_editor("example");
2117 /// ```
2118 pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
2119 mut self,
2120 v: T,
2121 ) -> Self {
2122 self.most_recent_editor = v.into();
2123 self
2124 }
2125
2126 /// Sets the value of [principal][crate::model::BigQueryExport::principal].
2127 ///
2128 /// # Example
2129 /// ```ignore,no_run
2130 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2131 /// let x = BigQueryExport::new().set_principal("example");
2132 /// ```
2133 pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2134 self.principal = v.into();
2135 self
2136 }
2137}
2138
2139impl wkt::message::Message for BigQueryExport {
2140 fn typename() -> &'static str {
2141 "type.googleapis.com/google.cloud.securitycenter.v2.BigQueryExport"
2142 }
2143}
2144
2145/// Contains details about a chokepoint, which is a resource or resource group
2146/// where high-risk attack paths converge, based on [attack path simulations]
2147/// (<https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations>).
2148#[derive(Clone, Default, PartialEq)]
2149#[non_exhaustive]
2150pub struct Chokepoint {
2151 /// List of resource names of findings associated with this chokepoint.
2152 /// For example, organizations/123/sources/456/findings/789.
2153 /// This list will have at most 100 findings.
2154 pub related_findings: std::vec::Vec<std::string::String>,
2155
2156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2157}
2158
2159impl Chokepoint {
2160 pub fn new() -> Self {
2161 std::default::Default::default()
2162 }
2163
2164 /// Sets the value of [related_findings][crate::model::Chokepoint::related_findings].
2165 ///
2166 /// # Example
2167 /// ```ignore,no_run
2168 /// # use google_cloud_securitycenter_v2::model::Chokepoint;
2169 /// let x = Chokepoint::new().set_related_findings(["a", "b", "c"]);
2170 /// ```
2171 pub fn set_related_findings<T, V>(mut self, v: T) -> Self
2172 where
2173 T: std::iter::IntoIterator<Item = V>,
2174 V: std::convert::Into<std::string::String>,
2175 {
2176 use std::iter::Iterator;
2177 self.related_findings = v.into_iter().map(|i| i.into()).collect();
2178 self
2179 }
2180}
2181
2182impl wkt::message::Message for Chokepoint {
2183 fn typename() -> &'static str {
2184 "type.googleapis.com/google.cloud.securitycenter.v2.Chokepoint"
2185 }
2186}
2187
2188/// Fields related to Google Cloud Armor findings.
2189#[derive(Clone, Default, PartialEq)]
2190#[non_exhaustive]
2191pub struct CloudArmor {
2192 /// Information about the [Google Cloud Armor security
2193 /// policy](https://cloud.google.com/armor/docs/security-policy-overview)
2194 /// relevant to the finding.
2195 pub security_policy: std::option::Option<crate::model::SecurityPolicy>,
2196
2197 /// Information about incoming requests evaluated by [Google Cloud Armor
2198 /// security
2199 /// policies](https://cloud.google.com/armor/docs/security-policy-overview).
2200 pub requests: std::option::Option<crate::model::Requests>,
2201
2202 /// Information about potential Layer 7 DDoS attacks identified by [Google
2203 /// Cloud Armor Adaptive
2204 /// Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
2205 pub adaptive_protection: std::option::Option<crate::model::AdaptiveProtection>,
2206
2207 /// Information about DDoS attack volume and classification.
2208 pub attack: std::option::Option<crate::model::Attack>,
2209
2210 /// Distinguish between volumetric & protocol DDoS attack and
2211 /// application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
2212 /// attacks, or "L_7" for Layer 7 DDoS attacks.
2213 pub threat_vector: std::string::String,
2214
2215 /// Duration of attack from the start until the current moment (updated every 5
2216 /// minutes).
2217 pub duration: std::option::Option<wkt::Duration>,
2218
2219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2220}
2221
2222impl CloudArmor {
2223 pub fn new() -> Self {
2224 std::default::Default::default()
2225 }
2226
2227 /// Sets the value of [security_policy][crate::model::CloudArmor::security_policy].
2228 ///
2229 /// # Example
2230 /// ```ignore,no_run
2231 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2232 /// use google_cloud_securitycenter_v2::model::SecurityPolicy;
2233 /// let x = CloudArmor::new().set_security_policy(SecurityPolicy::default()/* use setters */);
2234 /// ```
2235 pub fn set_security_policy<T>(mut self, v: T) -> Self
2236 where
2237 T: std::convert::Into<crate::model::SecurityPolicy>,
2238 {
2239 self.security_policy = std::option::Option::Some(v.into());
2240 self
2241 }
2242
2243 /// Sets or clears the value of [security_policy][crate::model::CloudArmor::security_policy].
2244 ///
2245 /// # Example
2246 /// ```ignore,no_run
2247 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2248 /// use google_cloud_securitycenter_v2::model::SecurityPolicy;
2249 /// let x = CloudArmor::new().set_or_clear_security_policy(Some(SecurityPolicy::default()/* use setters */));
2250 /// let x = CloudArmor::new().set_or_clear_security_policy(None::<SecurityPolicy>);
2251 /// ```
2252 pub fn set_or_clear_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
2253 where
2254 T: std::convert::Into<crate::model::SecurityPolicy>,
2255 {
2256 self.security_policy = v.map(|x| x.into());
2257 self
2258 }
2259
2260 /// Sets the value of [requests][crate::model::CloudArmor::requests].
2261 ///
2262 /// # Example
2263 /// ```ignore,no_run
2264 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2265 /// use google_cloud_securitycenter_v2::model::Requests;
2266 /// let x = CloudArmor::new().set_requests(Requests::default()/* use setters */);
2267 /// ```
2268 pub fn set_requests<T>(mut self, v: T) -> Self
2269 where
2270 T: std::convert::Into<crate::model::Requests>,
2271 {
2272 self.requests = std::option::Option::Some(v.into());
2273 self
2274 }
2275
2276 /// Sets or clears the value of [requests][crate::model::CloudArmor::requests].
2277 ///
2278 /// # Example
2279 /// ```ignore,no_run
2280 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2281 /// use google_cloud_securitycenter_v2::model::Requests;
2282 /// let x = CloudArmor::new().set_or_clear_requests(Some(Requests::default()/* use setters */));
2283 /// let x = CloudArmor::new().set_or_clear_requests(None::<Requests>);
2284 /// ```
2285 pub fn set_or_clear_requests<T>(mut self, v: std::option::Option<T>) -> Self
2286 where
2287 T: std::convert::Into<crate::model::Requests>,
2288 {
2289 self.requests = v.map(|x| x.into());
2290 self
2291 }
2292
2293 /// Sets the value of [adaptive_protection][crate::model::CloudArmor::adaptive_protection].
2294 ///
2295 /// # Example
2296 /// ```ignore,no_run
2297 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2298 /// use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2299 /// let x = CloudArmor::new().set_adaptive_protection(AdaptiveProtection::default()/* use setters */);
2300 /// ```
2301 pub fn set_adaptive_protection<T>(mut self, v: T) -> Self
2302 where
2303 T: std::convert::Into<crate::model::AdaptiveProtection>,
2304 {
2305 self.adaptive_protection = std::option::Option::Some(v.into());
2306 self
2307 }
2308
2309 /// Sets or clears the value of [adaptive_protection][crate::model::CloudArmor::adaptive_protection].
2310 ///
2311 /// # Example
2312 /// ```ignore,no_run
2313 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2314 /// use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2315 /// let x = CloudArmor::new().set_or_clear_adaptive_protection(Some(AdaptiveProtection::default()/* use setters */));
2316 /// let x = CloudArmor::new().set_or_clear_adaptive_protection(None::<AdaptiveProtection>);
2317 /// ```
2318 pub fn set_or_clear_adaptive_protection<T>(mut self, v: std::option::Option<T>) -> Self
2319 where
2320 T: std::convert::Into<crate::model::AdaptiveProtection>,
2321 {
2322 self.adaptive_protection = v.map(|x| x.into());
2323 self
2324 }
2325
2326 /// Sets the value of [attack][crate::model::CloudArmor::attack].
2327 ///
2328 /// # Example
2329 /// ```ignore,no_run
2330 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2331 /// use google_cloud_securitycenter_v2::model::Attack;
2332 /// let x = CloudArmor::new().set_attack(Attack::default()/* use setters */);
2333 /// ```
2334 pub fn set_attack<T>(mut self, v: T) -> Self
2335 where
2336 T: std::convert::Into<crate::model::Attack>,
2337 {
2338 self.attack = std::option::Option::Some(v.into());
2339 self
2340 }
2341
2342 /// Sets or clears the value of [attack][crate::model::CloudArmor::attack].
2343 ///
2344 /// # Example
2345 /// ```ignore,no_run
2346 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2347 /// use google_cloud_securitycenter_v2::model::Attack;
2348 /// let x = CloudArmor::new().set_or_clear_attack(Some(Attack::default()/* use setters */));
2349 /// let x = CloudArmor::new().set_or_clear_attack(None::<Attack>);
2350 /// ```
2351 pub fn set_or_clear_attack<T>(mut self, v: std::option::Option<T>) -> Self
2352 where
2353 T: std::convert::Into<crate::model::Attack>,
2354 {
2355 self.attack = v.map(|x| x.into());
2356 self
2357 }
2358
2359 /// Sets the value of [threat_vector][crate::model::CloudArmor::threat_vector].
2360 ///
2361 /// # Example
2362 /// ```ignore,no_run
2363 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2364 /// let x = CloudArmor::new().set_threat_vector("example");
2365 /// ```
2366 pub fn set_threat_vector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2367 self.threat_vector = v.into();
2368 self
2369 }
2370
2371 /// Sets the value of [duration][crate::model::CloudArmor::duration].
2372 ///
2373 /// # Example
2374 /// ```ignore,no_run
2375 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2376 /// use wkt::Duration;
2377 /// let x = CloudArmor::new().set_duration(Duration::default()/* use setters */);
2378 /// ```
2379 pub fn set_duration<T>(mut self, v: T) -> Self
2380 where
2381 T: std::convert::Into<wkt::Duration>,
2382 {
2383 self.duration = std::option::Option::Some(v.into());
2384 self
2385 }
2386
2387 /// Sets or clears the value of [duration][crate::model::CloudArmor::duration].
2388 ///
2389 /// # Example
2390 /// ```ignore,no_run
2391 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2392 /// use wkt::Duration;
2393 /// let x = CloudArmor::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
2394 /// let x = CloudArmor::new().set_or_clear_duration(None::<Duration>);
2395 /// ```
2396 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
2397 where
2398 T: std::convert::Into<wkt::Duration>,
2399 {
2400 self.duration = v.map(|x| x.into());
2401 self
2402 }
2403}
2404
2405impl wkt::message::Message for CloudArmor {
2406 fn typename() -> &'static str {
2407 "type.googleapis.com/google.cloud.securitycenter.v2.CloudArmor"
2408 }
2409}
2410
2411/// Information about the [Google Cloud Armor security
2412/// policy](https://cloud.google.com/armor/docs/security-policy-overview)
2413/// relevant to the finding.
2414#[derive(Clone, Default, PartialEq)]
2415#[non_exhaustive]
2416pub struct SecurityPolicy {
2417 /// The name of the Google Cloud Armor security policy, for example,
2418 /// "my-security-policy".
2419 pub name: std::string::String,
2420
2421 /// The type of Google Cloud Armor security policy for example, 'backend
2422 /// security policy', 'edge security policy', 'network edge security policy',
2423 /// or 'always-on DDoS protection'.
2424 pub r#type: std::string::String,
2425
2426 /// Whether or not the associated rule or policy is in preview mode.
2427 pub preview: bool,
2428
2429 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2430}
2431
2432impl SecurityPolicy {
2433 pub fn new() -> Self {
2434 std::default::Default::default()
2435 }
2436
2437 /// Sets the value of [name][crate::model::SecurityPolicy::name].
2438 ///
2439 /// # Example
2440 /// ```ignore,no_run
2441 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2442 /// let x = SecurityPolicy::new().set_name("example");
2443 /// ```
2444 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2445 self.name = v.into();
2446 self
2447 }
2448
2449 /// Sets the value of [r#type][crate::model::SecurityPolicy::type].
2450 ///
2451 /// # Example
2452 /// ```ignore,no_run
2453 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2454 /// let x = SecurityPolicy::new().set_type("example");
2455 /// ```
2456 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2457 self.r#type = v.into();
2458 self
2459 }
2460
2461 /// Sets the value of [preview][crate::model::SecurityPolicy::preview].
2462 ///
2463 /// # Example
2464 /// ```ignore,no_run
2465 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2466 /// let x = SecurityPolicy::new().set_preview(true);
2467 /// ```
2468 pub fn set_preview<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2469 self.preview = v.into();
2470 self
2471 }
2472}
2473
2474impl wkt::message::Message for SecurityPolicy {
2475 fn typename() -> &'static str {
2476 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPolicy"
2477 }
2478}
2479
2480/// Information about the requests relevant to the finding.
2481#[derive(Clone, Default, PartialEq)]
2482#[non_exhaustive]
2483pub struct Requests {
2484 /// For 'Increasing deny ratio', the ratio is the denied traffic divided by the
2485 /// allowed traffic. For 'Allowed traffic spike', the ratio is the allowed
2486 /// traffic in the short term divided by allowed traffic in the long term.
2487 pub ratio: f64,
2488
2489 /// Allowed RPS (requests per second) in the short term.
2490 pub short_term_allowed: i32,
2491
2492 /// Allowed RPS (requests per second) over the long term.
2493 pub long_term_allowed: i32,
2494
2495 /// Denied RPS (requests per second) over the long term.
2496 pub long_term_denied: i32,
2497
2498 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2499}
2500
2501impl Requests {
2502 pub fn new() -> Self {
2503 std::default::Default::default()
2504 }
2505
2506 /// Sets the value of [ratio][crate::model::Requests::ratio].
2507 ///
2508 /// # Example
2509 /// ```ignore,no_run
2510 /// # use google_cloud_securitycenter_v2::model::Requests;
2511 /// let x = Requests::new().set_ratio(42.0);
2512 /// ```
2513 pub fn set_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2514 self.ratio = v.into();
2515 self
2516 }
2517
2518 /// Sets the value of [short_term_allowed][crate::model::Requests::short_term_allowed].
2519 ///
2520 /// # Example
2521 /// ```ignore,no_run
2522 /// # use google_cloud_securitycenter_v2::model::Requests;
2523 /// let x = Requests::new().set_short_term_allowed(42);
2524 /// ```
2525 pub fn set_short_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2526 self.short_term_allowed = v.into();
2527 self
2528 }
2529
2530 /// Sets the value of [long_term_allowed][crate::model::Requests::long_term_allowed].
2531 ///
2532 /// # Example
2533 /// ```ignore,no_run
2534 /// # use google_cloud_securitycenter_v2::model::Requests;
2535 /// let x = Requests::new().set_long_term_allowed(42);
2536 /// ```
2537 pub fn set_long_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2538 self.long_term_allowed = v.into();
2539 self
2540 }
2541
2542 /// Sets the value of [long_term_denied][crate::model::Requests::long_term_denied].
2543 ///
2544 /// # Example
2545 /// ```ignore,no_run
2546 /// # use google_cloud_securitycenter_v2::model::Requests;
2547 /// let x = Requests::new().set_long_term_denied(42);
2548 /// ```
2549 pub fn set_long_term_denied<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2550 self.long_term_denied = v.into();
2551 self
2552 }
2553}
2554
2555impl wkt::message::Message for Requests {
2556 fn typename() -> &'static str {
2557 "type.googleapis.com/google.cloud.securitycenter.v2.Requests"
2558 }
2559}
2560
2561/// Information about [Google Cloud Armor Adaptive
2562/// Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection).
2563#[derive(Clone, Default, PartialEq)]
2564#[non_exhaustive]
2565pub struct AdaptiveProtection {
2566 /// A score of 0 means that there is low confidence that the detected event is
2567 /// an actual attack. A score of 1 means that there is high confidence that the
2568 /// detected event is an attack. See the [Adaptive Protection
2569 /// documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning)
2570 /// for further explanation.
2571 pub confidence: f64,
2572
2573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2574}
2575
2576impl AdaptiveProtection {
2577 pub fn new() -> Self {
2578 std::default::Default::default()
2579 }
2580
2581 /// Sets the value of [confidence][crate::model::AdaptiveProtection::confidence].
2582 ///
2583 /// # Example
2584 /// ```ignore,no_run
2585 /// # use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2586 /// let x = AdaptiveProtection::new().set_confidence(42.0);
2587 /// ```
2588 pub fn set_confidence<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2589 self.confidence = v.into();
2590 self
2591 }
2592}
2593
2594impl wkt::message::Message for AdaptiveProtection {
2595 fn typename() -> &'static str {
2596 "type.googleapis.com/google.cloud.securitycenter.v2.AdaptiveProtection"
2597 }
2598}
2599
2600/// Information about DDoS attack volume and classification.
2601#[derive(Clone, Default, PartialEq)]
2602#[non_exhaustive]
2603pub struct Attack {
2604 /// Total PPS (packets per second) volume of attack.
2605 pub volume_pps_long: i64,
2606
2607 /// Total BPS (bytes per second) volume of attack.
2608 pub volume_bps_long: i64,
2609
2610 /// Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
2611 pub classification: std::string::String,
2612
2613 /// Total PPS (packets per second) volume of attack. Deprecated - refer to
2614 /// volume_pps_long instead.
2615 #[deprecated]
2616 pub volume_pps: i32,
2617
2618 /// Total BPS (bytes per second) volume of attack. Deprecated - refer to
2619 /// volume_bps_long instead.
2620 #[deprecated]
2621 pub volume_bps: i32,
2622
2623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2624}
2625
2626impl Attack {
2627 pub fn new() -> Self {
2628 std::default::Default::default()
2629 }
2630
2631 /// Sets the value of [volume_pps_long][crate::model::Attack::volume_pps_long].
2632 ///
2633 /// # Example
2634 /// ```ignore,no_run
2635 /// # use google_cloud_securitycenter_v2::model::Attack;
2636 /// let x = Attack::new().set_volume_pps_long(42);
2637 /// ```
2638 pub fn set_volume_pps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2639 self.volume_pps_long = v.into();
2640 self
2641 }
2642
2643 /// Sets the value of [volume_bps_long][crate::model::Attack::volume_bps_long].
2644 ///
2645 /// # Example
2646 /// ```ignore,no_run
2647 /// # use google_cloud_securitycenter_v2::model::Attack;
2648 /// let x = Attack::new().set_volume_bps_long(42);
2649 /// ```
2650 pub fn set_volume_bps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2651 self.volume_bps_long = v.into();
2652 self
2653 }
2654
2655 /// Sets the value of [classification][crate::model::Attack::classification].
2656 ///
2657 /// # Example
2658 /// ```ignore,no_run
2659 /// # use google_cloud_securitycenter_v2::model::Attack;
2660 /// let x = Attack::new().set_classification("example");
2661 /// ```
2662 pub fn set_classification<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2663 self.classification = v.into();
2664 self
2665 }
2666
2667 /// Sets the value of [volume_pps][crate::model::Attack::volume_pps].
2668 ///
2669 /// # Example
2670 /// ```ignore,no_run
2671 /// # use google_cloud_securitycenter_v2::model::Attack;
2672 /// let x = Attack::new().set_volume_pps(42);
2673 /// ```
2674 #[deprecated]
2675 pub fn set_volume_pps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2676 self.volume_pps = v.into();
2677 self
2678 }
2679
2680 /// Sets the value of [volume_bps][crate::model::Attack::volume_bps].
2681 ///
2682 /// # Example
2683 /// ```ignore,no_run
2684 /// # use google_cloud_securitycenter_v2::model::Attack;
2685 /// let x = Attack::new().set_volume_bps(42);
2686 /// ```
2687 #[deprecated]
2688 pub fn set_volume_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2689 self.volume_bps = v.into();
2690 self
2691 }
2692}
2693
2694impl wkt::message::Message for Attack {
2695 fn typename() -> &'static str {
2696 "type.googleapis.com/google.cloud.securitycenter.v2.Attack"
2697 }
2698}
2699
2700/// The [data profile](https://cloud.google.com/dlp/docs/data-profiles)
2701/// associated with the finding.
2702#[derive(Clone, Default, PartialEq)]
2703#[non_exhaustive]
2704pub struct CloudDlpDataProfile {
2705 /// Name of the data profile, for example,
2706 /// `projects/123/locations/europe/tableProfiles/8383929`.
2707 pub data_profile: std::string::String,
2708
2709 /// The resource hierarchy level at which the data profile was generated.
2710 pub parent_type: crate::model::cloud_dlp_data_profile::ParentType,
2711
2712 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2713}
2714
2715impl CloudDlpDataProfile {
2716 pub fn new() -> Self {
2717 std::default::Default::default()
2718 }
2719
2720 /// Sets the value of [data_profile][crate::model::CloudDlpDataProfile::data_profile].
2721 ///
2722 /// # Example
2723 /// ```ignore,no_run
2724 /// # use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
2725 /// let x = CloudDlpDataProfile::new().set_data_profile("example");
2726 /// ```
2727 pub fn set_data_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2728 self.data_profile = v.into();
2729 self
2730 }
2731
2732 /// Sets the value of [parent_type][crate::model::CloudDlpDataProfile::parent_type].
2733 ///
2734 /// # Example
2735 /// ```ignore,no_run
2736 /// # use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
2737 /// use google_cloud_securitycenter_v2::model::cloud_dlp_data_profile::ParentType;
2738 /// let x0 = CloudDlpDataProfile::new().set_parent_type(ParentType::Organization);
2739 /// let x1 = CloudDlpDataProfile::new().set_parent_type(ParentType::Project);
2740 /// ```
2741 pub fn set_parent_type<
2742 T: std::convert::Into<crate::model::cloud_dlp_data_profile::ParentType>,
2743 >(
2744 mut self,
2745 v: T,
2746 ) -> Self {
2747 self.parent_type = v.into();
2748 self
2749 }
2750}
2751
2752impl wkt::message::Message for CloudDlpDataProfile {
2753 fn typename() -> &'static str {
2754 "type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpDataProfile"
2755 }
2756}
2757
2758/// Defines additional types related to [CloudDlpDataProfile].
2759pub mod cloud_dlp_data_profile {
2760 #[allow(unused_imports)]
2761 use super::*;
2762
2763 /// Parents for configurations that produce data profile findings.
2764 ///
2765 /// # Working with unknown values
2766 ///
2767 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2768 /// additional enum variants at any time. Adding new variants is not considered
2769 /// a breaking change. Applications should write their code in anticipation of:
2770 ///
2771 /// - New values appearing in future releases of the client library, **and**
2772 /// - New values received dynamically, without application changes.
2773 ///
2774 /// Please consult the [Working with enums] section in the user guide for some
2775 /// guidelines.
2776 ///
2777 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2778 #[derive(Clone, Debug, PartialEq)]
2779 #[non_exhaustive]
2780 pub enum ParentType {
2781 /// Unspecified parent type.
2782 Unspecified,
2783 /// Organization-level configurations.
2784 Organization,
2785 /// Project-level configurations.
2786 Project,
2787 /// If set, the enum was initialized with an unknown value.
2788 ///
2789 /// Applications can examine the value using [ParentType::value] or
2790 /// [ParentType::name].
2791 UnknownValue(parent_type::UnknownValue),
2792 }
2793
2794 #[doc(hidden)]
2795 pub mod parent_type {
2796 #[allow(unused_imports)]
2797 use super::*;
2798 #[derive(Clone, Debug, PartialEq)]
2799 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2800 }
2801
2802 impl ParentType {
2803 /// Gets the enum value.
2804 ///
2805 /// Returns `None` if the enum contains an unknown value deserialized from
2806 /// the string representation of enums.
2807 pub fn value(&self) -> std::option::Option<i32> {
2808 match self {
2809 Self::Unspecified => std::option::Option::Some(0),
2810 Self::Organization => std::option::Option::Some(1),
2811 Self::Project => std::option::Option::Some(2),
2812 Self::UnknownValue(u) => u.0.value(),
2813 }
2814 }
2815
2816 /// Gets the enum value as a string.
2817 ///
2818 /// Returns `None` if the enum contains an unknown value deserialized from
2819 /// the integer representation of enums.
2820 pub fn name(&self) -> std::option::Option<&str> {
2821 match self {
2822 Self::Unspecified => std::option::Option::Some("PARENT_TYPE_UNSPECIFIED"),
2823 Self::Organization => std::option::Option::Some("ORGANIZATION"),
2824 Self::Project => std::option::Option::Some("PROJECT"),
2825 Self::UnknownValue(u) => u.0.name(),
2826 }
2827 }
2828 }
2829
2830 impl std::default::Default for ParentType {
2831 fn default() -> Self {
2832 use std::convert::From;
2833 Self::from(0)
2834 }
2835 }
2836
2837 impl std::fmt::Display for ParentType {
2838 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2839 wkt::internal::display_enum(f, self.name(), self.value())
2840 }
2841 }
2842
2843 impl std::convert::From<i32> for ParentType {
2844 fn from(value: i32) -> Self {
2845 match value {
2846 0 => Self::Unspecified,
2847 1 => Self::Organization,
2848 2 => Self::Project,
2849 _ => Self::UnknownValue(parent_type::UnknownValue(
2850 wkt::internal::UnknownEnumValue::Integer(value),
2851 )),
2852 }
2853 }
2854 }
2855
2856 impl std::convert::From<&str> for ParentType {
2857 fn from(value: &str) -> Self {
2858 use std::string::ToString;
2859 match value {
2860 "PARENT_TYPE_UNSPECIFIED" => Self::Unspecified,
2861 "ORGANIZATION" => Self::Organization,
2862 "PROJECT" => Self::Project,
2863 _ => Self::UnknownValue(parent_type::UnknownValue(
2864 wkt::internal::UnknownEnumValue::String(value.to_string()),
2865 )),
2866 }
2867 }
2868 }
2869
2870 impl serde::ser::Serialize for ParentType {
2871 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2872 where
2873 S: serde::Serializer,
2874 {
2875 match self {
2876 Self::Unspecified => serializer.serialize_i32(0),
2877 Self::Organization => serializer.serialize_i32(1),
2878 Self::Project => serializer.serialize_i32(2),
2879 Self::UnknownValue(u) => u.0.serialize(serializer),
2880 }
2881 }
2882 }
2883
2884 impl<'de> serde::de::Deserialize<'de> for ParentType {
2885 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2886 where
2887 D: serde::Deserializer<'de>,
2888 {
2889 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ParentType>::new(
2890 ".google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType",
2891 ))
2892 }
2893 }
2894}
2895
2896/// Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection
2897/// job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced
2898/// the finding.
2899#[derive(Clone, Default, PartialEq)]
2900#[non_exhaustive]
2901pub struct CloudDlpInspection {
2902 /// Name of the inspection job, for example,
2903 /// `projects/123/locations/europe/dlpJobs/i-8383929`.
2904 pub inspect_job: std::string::String,
2905
2906 /// The type of information (or
2907 /// *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found,
2908 /// for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`.
2909 pub info_type: std::string::String,
2910
2911 /// The number of times Cloud DLP found this infoType within this job
2912 /// and resource.
2913 pub info_type_count: i64,
2914
2915 /// Whether Cloud DLP scanned the complete resource or a sampled subset.
2916 pub full_scan: bool,
2917
2918 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2919}
2920
2921impl CloudDlpInspection {
2922 pub fn new() -> Self {
2923 std::default::Default::default()
2924 }
2925
2926 /// Sets the value of [inspect_job][crate::model::CloudDlpInspection::inspect_job].
2927 ///
2928 /// # Example
2929 /// ```ignore,no_run
2930 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2931 /// let x = CloudDlpInspection::new().set_inspect_job("example");
2932 /// ```
2933 pub fn set_inspect_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2934 self.inspect_job = v.into();
2935 self
2936 }
2937
2938 /// Sets the value of [info_type][crate::model::CloudDlpInspection::info_type].
2939 ///
2940 /// # Example
2941 /// ```ignore,no_run
2942 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2943 /// let x = CloudDlpInspection::new().set_info_type("example");
2944 /// ```
2945 pub fn set_info_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2946 self.info_type = v.into();
2947 self
2948 }
2949
2950 /// Sets the value of [info_type_count][crate::model::CloudDlpInspection::info_type_count].
2951 ///
2952 /// # Example
2953 /// ```ignore,no_run
2954 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2955 /// let x = CloudDlpInspection::new().set_info_type_count(42);
2956 /// ```
2957 pub fn set_info_type_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2958 self.info_type_count = v.into();
2959 self
2960 }
2961
2962 /// Sets the value of [full_scan][crate::model::CloudDlpInspection::full_scan].
2963 ///
2964 /// # Example
2965 /// ```ignore,no_run
2966 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2967 /// let x = CloudDlpInspection::new().set_full_scan(true);
2968 /// ```
2969 pub fn set_full_scan<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2970 self.full_scan = v.into();
2971 self
2972 }
2973}
2974
2975impl wkt::message::Message for CloudDlpInspection {
2976 fn typename() -> &'static str {
2977 "type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpInspection"
2978 }
2979}
2980
2981/// Contains compliance information about a security standard indicating unmet
2982/// recommendations.
2983#[derive(Clone, Default, PartialEq)]
2984#[non_exhaustive]
2985pub struct Compliance {
2986 /// Industry-wide compliance standards or benchmarks, such as CIS, PCI, and
2987 /// OWASP.
2988 pub standard: std::string::String,
2989
2990 /// Version of the standard or benchmark, for example, 1.1
2991 pub version: std::string::String,
2992
2993 /// Policies within the standard or benchmark, for example, A.12.4.1
2994 pub ids: std::vec::Vec<std::string::String>,
2995
2996 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2997}
2998
2999impl Compliance {
3000 pub fn new() -> Self {
3001 std::default::Default::default()
3002 }
3003
3004 /// Sets the value of [standard][crate::model::Compliance::standard].
3005 ///
3006 /// # Example
3007 /// ```ignore,no_run
3008 /// # use google_cloud_securitycenter_v2::model::Compliance;
3009 /// let x = Compliance::new().set_standard("example");
3010 /// ```
3011 pub fn set_standard<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3012 self.standard = v.into();
3013 self
3014 }
3015
3016 /// Sets the value of [version][crate::model::Compliance::version].
3017 ///
3018 /// # Example
3019 /// ```ignore,no_run
3020 /// # use google_cloud_securitycenter_v2::model::Compliance;
3021 /// let x = Compliance::new().set_version("example");
3022 /// ```
3023 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3024 self.version = v.into();
3025 self
3026 }
3027
3028 /// Sets the value of [ids][crate::model::Compliance::ids].
3029 ///
3030 /// # Example
3031 /// ```ignore,no_run
3032 /// # use google_cloud_securitycenter_v2::model::Compliance;
3033 /// let x = Compliance::new().set_ids(["a", "b", "c"]);
3034 /// ```
3035 pub fn set_ids<T, V>(mut self, v: T) -> Self
3036 where
3037 T: std::iter::IntoIterator<Item = V>,
3038 V: std::convert::Into<std::string::String>,
3039 {
3040 use std::iter::Iterator;
3041 self.ids = v.into_iter().map(|i| i.into()).collect();
3042 self
3043 }
3044}
3045
3046impl wkt::message::Message for Compliance {
3047 fn typename() -> &'static str {
3048 "type.googleapis.com/google.cloud.securitycenter.v2.Compliance"
3049 }
3050}
3051
3052/// Contains information about the IP connection associated with the finding.
3053#[derive(Clone, Default, PartialEq)]
3054#[non_exhaustive]
3055pub struct Connection {
3056 /// Destination IP address. Not present for sockets that are listening and not
3057 /// connected.
3058 pub destination_ip: std::string::String,
3059
3060 /// Destination port. Not present for sockets that are listening and not
3061 /// connected.
3062 pub destination_port: i32,
3063
3064 /// Source IP address.
3065 pub source_ip: std::string::String,
3066
3067 /// Source port.
3068 pub source_port: i32,
3069
3070 /// IANA Internet Protocol Number such as TCP(6) and UDP(17).
3071 pub protocol: crate::model::connection::Protocol,
3072
3073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3074}
3075
3076impl Connection {
3077 pub fn new() -> Self {
3078 std::default::Default::default()
3079 }
3080
3081 /// Sets the value of [destination_ip][crate::model::Connection::destination_ip].
3082 ///
3083 /// # Example
3084 /// ```ignore,no_run
3085 /// # use google_cloud_securitycenter_v2::model::Connection;
3086 /// let x = Connection::new().set_destination_ip("example");
3087 /// ```
3088 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3089 self.destination_ip = v.into();
3090 self
3091 }
3092
3093 /// Sets the value of [destination_port][crate::model::Connection::destination_port].
3094 ///
3095 /// # Example
3096 /// ```ignore,no_run
3097 /// # use google_cloud_securitycenter_v2::model::Connection;
3098 /// let x = Connection::new().set_destination_port(42);
3099 /// ```
3100 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3101 self.destination_port = v.into();
3102 self
3103 }
3104
3105 /// Sets the value of [source_ip][crate::model::Connection::source_ip].
3106 ///
3107 /// # Example
3108 /// ```ignore,no_run
3109 /// # use google_cloud_securitycenter_v2::model::Connection;
3110 /// let x = Connection::new().set_source_ip("example");
3111 /// ```
3112 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3113 self.source_ip = v.into();
3114 self
3115 }
3116
3117 /// Sets the value of [source_port][crate::model::Connection::source_port].
3118 ///
3119 /// # Example
3120 /// ```ignore,no_run
3121 /// # use google_cloud_securitycenter_v2::model::Connection;
3122 /// let x = Connection::new().set_source_port(42);
3123 /// ```
3124 pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3125 self.source_port = v.into();
3126 self
3127 }
3128
3129 /// Sets the value of [protocol][crate::model::Connection::protocol].
3130 ///
3131 /// # Example
3132 /// ```ignore,no_run
3133 /// # use google_cloud_securitycenter_v2::model::Connection;
3134 /// use google_cloud_securitycenter_v2::model::connection::Protocol;
3135 /// let x0 = Connection::new().set_protocol(Protocol::Icmp);
3136 /// let x1 = Connection::new().set_protocol(Protocol::Tcp);
3137 /// let x2 = Connection::new().set_protocol(Protocol::Udp);
3138 /// ```
3139 pub fn set_protocol<T: std::convert::Into<crate::model::connection::Protocol>>(
3140 mut self,
3141 v: T,
3142 ) -> Self {
3143 self.protocol = v.into();
3144 self
3145 }
3146}
3147
3148impl wkt::message::Message for Connection {
3149 fn typename() -> &'static str {
3150 "type.googleapis.com/google.cloud.securitycenter.v2.Connection"
3151 }
3152}
3153
3154/// Defines additional types related to [Connection].
3155pub mod connection {
3156 #[allow(unused_imports)]
3157 use super::*;
3158
3159 /// IANA Internet Protocol Number such as TCP(6) and UDP(17).
3160 ///
3161 /// # Working with unknown values
3162 ///
3163 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3164 /// additional enum variants at any time. Adding new variants is not considered
3165 /// a breaking change. Applications should write their code in anticipation of:
3166 ///
3167 /// - New values appearing in future releases of the client library, **and**
3168 /// - New values received dynamically, without application changes.
3169 ///
3170 /// Please consult the [Working with enums] section in the user guide for some
3171 /// guidelines.
3172 ///
3173 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3174 #[derive(Clone, Debug, PartialEq)]
3175 #[non_exhaustive]
3176 pub enum Protocol {
3177 /// Unspecified protocol (not HOPOPT).
3178 Unspecified,
3179 /// Internet Control Message Protocol.
3180 Icmp,
3181 /// Transmission Control Protocol.
3182 Tcp,
3183 /// User Datagram Protocol.
3184 Udp,
3185 /// Generic Routing Encapsulation.
3186 Gre,
3187 /// Encap Security Payload.
3188 Esp,
3189 /// If set, the enum was initialized with an unknown value.
3190 ///
3191 /// Applications can examine the value using [Protocol::value] or
3192 /// [Protocol::name].
3193 UnknownValue(protocol::UnknownValue),
3194 }
3195
3196 #[doc(hidden)]
3197 pub mod protocol {
3198 #[allow(unused_imports)]
3199 use super::*;
3200 #[derive(Clone, Debug, PartialEq)]
3201 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3202 }
3203
3204 impl Protocol {
3205 /// Gets the enum value.
3206 ///
3207 /// Returns `None` if the enum contains an unknown value deserialized from
3208 /// the string representation of enums.
3209 pub fn value(&self) -> std::option::Option<i32> {
3210 match self {
3211 Self::Unspecified => std::option::Option::Some(0),
3212 Self::Icmp => std::option::Option::Some(1),
3213 Self::Tcp => std::option::Option::Some(6),
3214 Self::Udp => std::option::Option::Some(17),
3215 Self::Gre => std::option::Option::Some(47),
3216 Self::Esp => std::option::Option::Some(50),
3217 Self::UnknownValue(u) => u.0.value(),
3218 }
3219 }
3220
3221 /// Gets the enum value as a string.
3222 ///
3223 /// Returns `None` if the enum contains an unknown value deserialized from
3224 /// the integer representation of enums.
3225 pub fn name(&self) -> std::option::Option<&str> {
3226 match self {
3227 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
3228 Self::Icmp => std::option::Option::Some("ICMP"),
3229 Self::Tcp => std::option::Option::Some("TCP"),
3230 Self::Udp => std::option::Option::Some("UDP"),
3231 Self::Gre => std::option::Option::Some("GRE"),
3232 Self::Esp => std::option::Option::Some("ESP"),
3233 Self::UnknownValue(u) => u.0.name(),
3234 }
3235 }
3236 }
3237
3238 impl std::default::Default for Protocol {
3239 fn default() -> Self {
3240 use std::convert::From;
3241 Self::from(0)
3242 }
3243 }
3244
3245 impl std::fmt::Display for Protocol {
3246 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3247 wkt::internal::display_enum(f, self.name(), self.value())
3248 }
3249 }
3250
3251 impl std::convert::From<i32> for Protocol {
3252 fn from(value: i32) -> Self {
3253 match value {
3254 0 => Self::Unspecified,
3255 1 => Self::Icmp,
3256 6 => Self::Tcp,
3257 17 => Self::Udp,
3258 47 => Self::Gre,
3259 50 => Self::Esp,
3260 _ => Self::UnknownValue(protocol::UnknownValue(
3261 wkt::internal::UnknownEnumValue::Integer(value),
3262 )),
3263 }
3264 }
3265 }
3266
3267 impl std::convert::From<&str> for Protocol {
3268 fn from(value: &str) -> Self {
3269 use std::string::ToString;
3270 match value {
3271 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
3272 "ICMP" => Self::Icmp,
3273 "TCP" => Self::Tcp,
3274 "UDP" => Self::Udp,
3275 "GRE" => Self::Gre,
3276 "ESP" => Self::Esp,
3277 _ => Self::UnknownValue(protocol::UnknownValue(
3278 wkt::internal::UnknownEnumValue::String(value.to_string()),
3279 )),
3280 }
3281 }
3282 }
3283
3284 impl serde::ser::Serialize for Protocol {
3285 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3286 where
3287 S: serde::Serializer,
3288 {
3289 match self {
3290 Self::Unspecified => serializer.serialize_i32(0),
3291 Self::Icmp => serializer.serialize_i32(1),
3292 Self::Tcp => serializer.serialize_i32(6),
3293 Self::Udp => serializer.serialize_i32(17),
3294 Self::Gre => serializer.serialize_i32(47),
3295 Self::Esp => serializer.serialize_i32(50),
3296 Self::UnknownValue(u) => u.0.serialize(serializer),
3297 }
3298 }
3299 }
3300
3301 impl<'de> serde::de::Deserialize<'de> for Protocol {
3302 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3303 where
3304 D: serde::Deserializer<'de>,
3305 {
3306 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
3307 ".google.cloud.securitycenter.v2.Connection.Protocol",
3308 ))
3309 }
3310 }
3311}
3312
3313/// Details about specific contacts
3314#[derive(Clone, Default, PartialEq)]
3315#[non_exhaustive]
3316pub struct ContactDetails {
3317 /// A list of contacts
3318 pub contacts: std::vec::Vec<crate::model::Contact>,
3319
3320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3321}
3322
3323impl ContactDetails {
3324 pub fn new() -> Self {
3325 std::default::Default::default()
3326 }
3327
3328 /// Sets the value of [contacts][crate::model::ContactDetails::contacts].
3329 ///
3330 /// # Example
3331 /// ```ignore,no_run
3332 /// # use google_cloud_securitycenter_v2::model::ContactDetails;
3333 /// use google_cloud_securitycenter_v2::model::Contact;
3334 /// let x = ContactDetails::new()
3335 /// .set_contacts([
3336 /// Contact::default()/* use setters */,
3337 /// Contact::default()/* use (different) setters */,
3338 /// ]);
3339 /// ```
3340 pub fn set_contacts<T, V>(mut self, v: T) -> Self
3341 where
3342 T: std::iter::IntoIterator<Item = V>,
3343 V: std::convert::Into<crate::model::Contact>,
3344 {
3345 use std::iter::Iterator;
3346 self.contacts = v.into_iter().map(|i| i.into()).collect();
3347 self
3348 }
3349}
3350
3351impl wkt::message::Message for ContactDetails {
3352 fn typename() -> &'static str {
3353 "type.googleapis.com/google.cloud.securitycenter.v2.ContactDetails"
3354 }
3355}
3356
3357/// The email address of a contact.
3358#[derive(Clone, Default, PartialEq)]
3359#[non_exhaustive]
3360pub struct Contact {
3361 /// An email address. For example, "`person123@company.com`".
3362 pub email: std::string::String,
3363
3364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3365}
3366
3367impl Contact {
3368 pub fn new() -> Self {
3369 std::default::Default::default()
3370 }
3371
3372 /// Sets the value of [email][crate::model::Contact::email].
3373 ///
3374 /// # Example
3375 /// ```ignore,no_run
3376 /// # use google_cloud_securitycenter_v2::model::Contact;
3377 /// let x = Contact::new().set_email("example");
3378 /// ```
3379 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3380 self.email = v.into();
3381 self
3382 }
3383}
3384
3385impl wkt::message::Message for Contact {
3386 fn typename() -> &'static str {
3387 "type.googleapis.com/google.cloud.securitycenter.v2.Contact"
3388 }
3389}
3390
3391/// Container associated with the finding.
3392#[derive(Clone, Default, PartialEq)]
3393#[non_exhaustive]
3394pub struct Container {
3395 /// Name of the container.
3396 pub name: std::string::String,
3397
3398 /// Container image URI provided when configuring a pod or container. This
3399 /// string can identify a container image version using mutable tags.
3400 pub uri: std::string::String,
3401
3402 /// Optional container image ID, if provided by the container runtime. Uniquely
3403 /// identifies the container image launched using a container image digest.
3404 pub image_id: std::string::String,
3405
3406 /// Container labels, as provided by the container runtime.
3407 pub labels: std::vec::Vec<crate::model::Label>,
3408
3409 /// The time that the container was created.
3410 pub create_time: std::option::Option<wkt::Timestamp>,
3411
3412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3413}
3414
3415impl Container {
3416 pub fn new() -> Self {
3417 std::default::Default::default()
3418 }
3419
3420 /// Sets the value of [name][crate::model::Container::name].
3421 ///
3422 /// # Example
3423 /// ```ignore,no_run
3424 /// # use google_cloud_securitycenter_v2::model::Container;
3425 /// let x = Container::new().set_name("example");
3426 /// ```
3427 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3428 self.name = v.into();
3429 self
3430 }
3431
3432 /// Sets the value of [uri][crate::model::Container::uri].
3433 ///
3434 /// # Example
3435 /// ```ignore,no_run
3436 /// # use google_cloud_securitycenter_v2::model::Container;
3437 /// let x = Container::new().set_uri("example");
3438 /// ```
3439 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3440 self.uri = v.into();
3441 self
3442 }
3443
3444 /// Sets the value of [image_id][crate::model::Container::image_id].
3445 ///
3446 /// # Example
3447 /// ```ignore,no_run
3448 /// # use google_cloud_securitycenter_v2::model::Container;
3449 /// let x = Container::new().set_image_id("example");
3450 /// ```
3451 pub fn set_image_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3452 self.image_id = v.into();
3453 self
3454 }
3455
3456 /// Sets the value of [labels][crate::model::Container::labels].
3457 ///
3458 /// # Example
3459 /// ```ignore,no_run
3460 /// # use google_cloud_securitycenter_v2::model::Container;
3461 /// use google_cloud_securitycenter_v2::model::Label;
3462 /// let x = Container::new()
3463 /// .set_labels([
3464 /// Label::default()/* use setters */,
3465 /// Label::default()/* use (different) setters */,
3466 /// ]);
3467 /// ```
3468 pub fn set_labels<T, V>(mut self, v: T) -> Self
3469 where
3470 T: std::iter::IntoIterator<Item = V>,
3471 V: std::convert::Into<crate::model::Label>,
3472 {
3473 use std::iter::Iterator;
3474 self.labels = v.into_iter().map(|i| i.into()).collect();
3475 self
3476 }
3477
3478 /// Sets the value of [create_time][crate::model::Container::create_time].
3479 ///
3480 /// # Example
3481 /// ```ignore,no_run
3482 /// # use google_cloud_securitycenter_v2::model::Container;
3483 /// use wkt::Timestamp;
3484 /// let x = Container::new().set_create_time(Timestamp::default()/* use setters */);
3485 /// ```
3486 pub fn set_create_time<T>(mut self, v: T) -> Self
3487 where
3488 T: std::convert::Into<wkt::Timestamp>,
3489 {
3490 self.create_time = std::option::Option::Some(v.into());
3491 self
3492 }
3493
3494 /// Sets or clears the value of [create_time][crate::model::Container::create_time].
3495 ///
3496 /// # Example
3497 /// ```ignore,no_run
3498 /// # use google_cloud_securitycenter_v2::model::Container;
3499 /// use wkt::Timestamp;
3500 /// let x = Container::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3501 /// let x = Container::new().set_or_clear_create_time(None::<Timestamp>);
3502 /// ```
3503 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3504 where
3505 T: std::convert::Into<wkt::Timestamp>,
3506 {
3507 self.create_time = v.map(|x| x.into());
3508 self
3509 }
3510}
3511
3512impl wkt::message::Message for Container {
3513 fn typename() -> &'static str {
3514 "type.googleapis.com/google.cloud.securitycenter.v2.Container"
3515 }
3516}
3517
3518/// Details about a data access attempt made by a principal not authorized under
3519/// applicable data security policy.
3520#[derive(Clone, Default, PartialEq)]
3521#[non_exhaustive]
3522pub struct DataAccessEvent {
3523 /// Unique identifier for data access event.
3524 pub event_id: std::string::String,
3525
3526 /// The email address of the principal that accessed the data. The principal
3527 /// could be a user account, service account, Google group, or other.
3528 pub principal_email: std::string::String,
3529
3530 /// The operation performed by the principal to access the data.
3531 pub operation: crate::model::data_access_event::Operation,
3532
3533 /// Timestamp of data access event.
3534 pub event_time: std::option::Option<wkt::Timestamp>,
3535
3536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3537}
3538
3539impl DataAccessEvent {
3540 pub fn new() -> Self {
3541 std::default::Default::default()
3542 }
3543
3544 /// Sets the value of [event_id][crate::model::DataAccessEvent::event_id].
3545 ///
3546 /// # Example
3547 /// ```ignore,no_run
3548 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3549 /// let x = DataAccessEvent::new().set_event_id("example");
3550 /// ```
3551 pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3552 self.event_id = v.into();
3553 self
3554 }
3555
3556 /// Sets the value of [principal_email][crate::model::DataAccessEvent::principal_email].
3557 ///
3558 /// # Example
3559 /// ```ignore,no_run
3560 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3561 /// let x = DataAccessEvent::new().set_principal_email("example");
3562 /// ```
3563 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3564 self.principal_email = v.into();
3565 self
3566 }
3567
3568 /// Sets the value of [operation][crate::model::DataAccessEvent::operation].
3569 ///
3570 /// # Example
3571 /// ```ignore,no_run
3572 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3573 /// use google_cloud_securitycenter_v2::model::data_access_event::Operation;
3574 /// let x0 = DataAccessEvent::new().set_operation(Operation::Read);
3575 /// let x1 = DataAccessEvent::new().set_operation(Operation::Move);
3576 /// let x2 = DataAccessEvent::new().set_operation(Operation::Copy);
3577 /// ```
3578 pub fn set_operation<T: std::convert::Into<crate::model::data_access_event::Operation>>(
3579 mut self,
3580 v: T,
3581 ) -> Self {
3582 self.operation = v.into();
3583 self
3584 }
3585
3586 /// Sets the value of [event_time][crate::model::DataAccessEvent::event_time].
3587 ///
3588 /// # Example
3589 /// ```ignore,no_run
3590 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3591 /// use wkt::Timestamp;
3592 /// let x = DataAccessEvent::new().set_event_time(Timestamp::default()/* use setters */);
3593 /// ```
3594 pub fn set_event_time<T>(mut self, v: T) -> Self
3595 where
3596 T: std::convert::Into<wkt::Timestamp>,
3597 {
3598 self.event_time = std::option::Option::Some(v.into());
3599 self
3600 }
3601
3602 /// Sets or clears the value of [event_time][crate::model::DataAccessEvent::event_time].
3603 ///
3604 /// # Example
3605 /// ```ignore,no_run
3606 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3607 /// use wkt::Timestamp;
3608 /// let x = DataAccessEvent::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
3609 /// let x = DataAccessEvent::new().set_or_clear_event_time(None::<Timestamp>);
3610 /// ```
3611 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
3612 where
3613 T: std::convert::Into<wkt::Timestamp>,
3614 {
3615 self.event_time = v.map(|x| x.into());
3616 self
3617 }
3618}
3619
3620impl wkt::message::Message for DataAccessEvent {
3621 fn typename() -> &'static str {
3622 "type.googleapis.com/google.cloud.securitycenter.v2.DataAccessEvent"
3623 }
3624}
3625
3626/// Defines additional types related to [DataAccessEvent].
3627pub mod data_access_event {
3628 #[allow(unused_imports)]
3629 use super::*;
3630
3631 /// The operation of a data access event.
3632 ///
3633 /// # Working with unknown values
3634 ///
3635 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3636 /// additional enum variants at any time. Adding new variants is not considered
3637 /// a breaking change. Applications should write their code in anticipation of:
3638 ///
3639 /// - New values appearing in future releases of the client library, **and**
3640 /// - New values received dynamically, without application changes.
3641 ///
3642 /// Please consult the [Working with enums] section in the user guide for some
3643 /// guidelines.
3644 ///
3645 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3646 #[derive(Clone, Debug, PartialEq)]
3647 #[non_exhaustive]
3648 pub enum Operation {
3649 /// The operation is unspecified.
3650 Unspecified,
3651 /// Represents a read operation.
3652 Read,
3653 /// Represents a move operation.
3654 Move,
3655 /// Represents a copy operation.
3656 Copy,
3657 /// If set, the enum was initialized with an unknown value.
3658 ///
3659 /// Applications can examine the value using [Operation::value] or
3660 /// [Operation::name].
3661 UnknownValue(operation::UnknownValue),
3662 }
3663
3664 #[doc(hidden)]
3665 pub mod operation {
3666 #[allow(unused_imports)]
3667 use super::*;
3668 #[derive(Clone, Debug, PartialEq)]
3669 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3670 }
3671
3672 impl Operation {
3673 /// Gets the enum value.
3674 ///
3675 /// Returns `None` if the enum contains an unknown value deserialized from
3676 /// the string representation of enums.
3677 pub fn value(&self) -> std::option::Option<i32> {
3678 match self {
3679 Self::Unspecified => std::option::Option::Some(0),
3680 Self::Read => std::option::Option::Some(1),
3681 Self::Move => std::option::Option::Some(2),
3682 Self::Copy => std::option::Option::Some(3),
3683 Self::UnknownValue(u) => u.0.value(),
3684 }
3685 }
3686
3687 /// Gets the enum value as a string.
3688 ///
3689 /// Returns `None` if the enum contains an unknown value deserialized from
3690 /// the integer representation of enums.
3691 pub fn name(&self) -> std::option::Option<&str> {
3692 match self {
3693 Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
3694 Self::Read => std::option::Option::Some("READ"),
3695 Self::Move => std::option::Option::Some("MOVE"),
3696 Self::Copy => std::option::Option::Some("COPY"),
3697 Self::UnknownValue(u) => u.0.name(),
3698 }
3699 }
3700 }
3701
3702 impl std::default::Default for Operation {
3703 fn default() -> Self {
3704 use std::convert::From;
3705 Self::from(0)
3706 }
3707 }
3708
3709 impl std::fmt::Display for Operation {
3710 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3711 wkt::internal::display_enum(f, self.name(), self.value())
3712 }
3713 }
3714
3715 impl std::convert::From<i32> for Operation {
3716 fn from(value: i32) -> Self {
3717 match value {
3718 0 => Self::Unspecified,
3719 1 => Self::Read,
3720 2 => Self::Move,
3721 3 => Self::Copy,
3722 _ => Self::UnknownValue(operation::UnknownValue(
3723 wkt::internal::UnknownEnumValue::Integer(value),
3724 )),
3725 }
3726 }
3727 }
3728
3729 impl std::convert::From<&str> for Operation {
3730 fn from(value: &str) -> Self {
3731 use std::string::ToString;
3732 match value {
3733 "OPERATION_UNSPECIFIED" => Self::Unspecified,
3734 "READ" => Self::Read,
3735 "MOVE" => Self::Move,
3736 "COPY" => Self::Copy,
3737 _ => Self::UnknownValue(operation::UnknownValue(
3738 wkt::internal::UnknownEnumValue::String(value.to_string()),
3739 )),
3740 }
3741 }
3742 }
3743
3744 impl serde::ser::Serialize for Operation {
3745 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3746 where
3747 S: serde::Serializer,
3748 {
3749 match self {
3750 Self::Unspecified => serializer.serialize_i32(0),
3751 Self::Read => serializer.serialize_i32(1),
3752 Self::Move => serializer.serialize_i32(2),
3753 Self::Copy => serializer.serialize_i32(3),
3754 Self::UnknownValue(u) => u.0.serialize(serializer),
3755 }
3756 }
3757 }
3758
3759 impl<'de> serde::de::Deserialize<'de> for Operation {
3760 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3761 where
3762 D: serde::Deserializer<'de>,
3763 {
3764 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
3765 ".google.cloud.securitycenter.v2.DataAccessEvent.Operation",
3766 ))
3767 }
3768 }
3769}
3770
3771/// Details about a data flow event, in which either the data is moved to or is
3772/// accessed from a non-compliant geo-location, as defined in the applicable data
3773/// security policy.
3774#[derive(Clone, Default, PartialEq)]
3775#[non_exhaustive]
3776pub struct DataFlowEvent {
3777 /// Unique identifier for data flow event.
3778 pub event_id: std::string::String,
3779
3780 /// The email address of the principal that initiated the data flow event. The
3781 /// principal could be a user account, service account, Google group, or other.
3782 pub principal_email: std::string::String,
3783
3784 /// The operation performed by the principal for the data flow event.
3785 pub operation: crate::model::data_flow_event::Operation,
3786
3787 /// Non-compliant location of the principal or the data destination.
3788 pub violated_location: std::string::String,
3789
3790 /// Timestamp of data flow event.
3791 pub event_time: std::option::Option<wkt::Timestamp>,
3792
3793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3794}
3795
3796impl DataFlowEvent {
3797 pub fn new() -> Self {
3798 std::default::Default::default()
3799 }
3800
3801 /// Sets the value of [event_id][crate::model::DataFlowEvent::event_id].
3802 ///
3803 /// # Example
3804 /// ```ignore,no_run
3805 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3806 /// let x = DataFlowEvent::new().set_event_id("example");
3807 /// ```
3808 pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3809 self.event_id = v.into();
3810 self
3811 }
3812
3813 /// Sets the value of [principal_email][crate::model::DataFlowEvent::principal_email].
3814 ///
3815 /// # Example
3816 /// ```ignore,no_run
3817 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3818 /// let x = DataFlowEvent::new().set_principal_email("example");
3819 /// ```
3820 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3821 self.principal_email = v.into();
3822 self
3823 }
3824
3825 /// Sets the value of [operation][crate::model::DataFlowEvent::operation].
3826 ///
3827 /// # Example
3828 /// ```ignore,no_run
3829 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3830 /// use google_cloud_securitycenter_v2::model::data_flow_event::Operation;
3831 /// let x0 = DataFlowEvent::new().set_operation(Operation::Read);
3832 /// let x1 = DataFlowEvent::new().set_operation(Operation::Move);
3833 /// let x2 = DataFlowEvent::new().set_operation(Operation::Copy);
3834 /// ```
3835 pub fn set_operation<T: std::convert::Into<crate::model::data_flow_event::Operation>>(
3836 mut self,
3837 v: T,
3838 ) -> Self {
3839 self.operation = v.into();
3840 self
3841 }
3842
3843 /// Sets the value of [violated_location][crate::model::DataFlowEvent::violated_location].
3844 ///
3845 /// # Example
3846 /// ```ignore,no_run
3847 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3848 /// let x = DataFlowEvent::new().set_violated_location("example");
3849 /// ```
3850 pub fn set_violated_location<T: std::convert::Into<std::string::String>>(
3851 mut self,
3852 v: T,
3853 ) -> Self {
3854 self.violated_location = v.into();
3855 self
3856 }
3857
3858 /// Sets the value of [event_time][crate::model::DataFlowEvent::event_time].
3859 ///
3860 /// # Example
3861 /// ```ignore,no_run
3862 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3863 /// use wkt::Timestamp;
3864 /// let x = DataFlowEvent::new().set_event_time(Timestamp::default()/* use setters */);
3865 /// ```
3866 pub fn set_event_time<T>(mut self, v: T) -> Self
3867 where
3868 T: std::convert::Into<wkt::Timestamp>,
3869 {
3870 self.event_time = std::option::Option::Some(v.into());
3871 self
3872 }
3873
3874 /// Sets or clears the value of [event_time][crate::model::DataFlowEvent::event_time].
3875 ///
3876 /// # Example
3877 /// ```ignore,no_run
3878 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3879 /// use wkt::Timestamp;
3880 /// let x = DataFlowEvent::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
3881 /// let x = DataFlowEvent::new().set_or_clear_event_time(None::<Timestamp>);
3882 /// ```
3883 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
3884 where
3885 T: std::convert::Into<wkt::Timestamp>,
3886 {
3887 self.event_time = v.map(|x| x.into());
3888 self
3889 }
3890}
3891
3892impl wkt::message::Message for DataFlowEvent {
3893 fn typename() -> &'static str {
3894 "type.googleapis.com/google.cloud.securitycenter.v2.DataFlowEvent"
3895 }
3896}
3897
3898/// Defines additional types related to [DataFlowEvent].
3899pub mod data_flow_event {
3900 #[allow(unused_imports)]
3901 use super::*;
3902
3903 /// The operation of a data flow event.
3904 ///
3905 /// # Working with unknown values
3906 ///
3907 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3908 /// additional enum variants at any time. Adding new variants is not considered
3909 /// a breaking change. Applications should write their code in anticipation of:
3910 ///
3911 /// - New values appearing in future releases of the client library, **and**
3912 /// - New values received dynamically, without application changes.
3913 ///
3914 /// Please consult the [Working with enums] section in the user guide for some
3915 /// guidelines.
3916 ///
3917 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3918 #[derive(Clone, Debug, PartialEq)]
3919 #[non_exhaustive]
3920 pub enum Operation {
3921 /// The operation is unspecified.
3922 Unspecified,
3923 /// Represents a read operation.
3924 Read,
3925 /// Represents a move operation.
3926 Move,
3927 /// Represents a copy operation.
3928 Copy,
3929 /// If set, the enum was initialized with an unknown value.
3930 ///
3931 /// Applications can examine the value using [Operation::value] or
3932 /// [Operation::name].
3933 UnknownValue(operation::UnknownValue),
3934 }
3935
3936 #[doc(hidden)]
3937 pub mod operation {
3938 #[allow(unused_imports)]
3939 use super::*;
3940 #[derive(Clone, Debug, PartialEq)]
3941 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3942 }
3943
3944 impl Operation {
3945 /// Gets the enum value.
3946 ///
3947 /// Returns `None` if the enum contains an unknown value deserialized from
3948 /// the string representation of enums.
3949 pub fn value(&self) -> std::option::Option<i32> {
3950 match self {
3951 Self::Unspecified => std::option::Option::Some(0),
3952 Self::Read => std::option::Option::Some(1),
3953 Self::Move => std::option::Option::Some(2),
3954 Self::Copy => std::option::Option::Some(3),
3955 Self::UnknownValue(u) => u.0.value(),
3956 }
3957 }
3958
3959 /// Gets the enum value as a string.
3960 ///
3961 /// Returns `None` if the enum contains an unknown value deserialized from
3962 /// the integer representation of enums.
3963 pub fn name(&self) -> std::option::Option<&str> {
3964 match self {
3965 Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
3966 Self::Read => std::option::Option::Some("READ"),
3967 Self::Move => std::option::Option::Some("MOVE"),
3968 Self::Copy => std::option::Option::Some("COPY"),
3969 Self::UnknownValue(u) => u.0.name(),
3970 }
3971 }
3972 }
3973
3974 impl std::default::Default for Operation {
3975 fn default() -> Self {
3976 use std::convert::From;
3977 Self::from(0)
3978 }
3979 }
3980
3981 impl std::fmt::Display for Operation {
3982 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3983 wkt::internal::display_enum(f, self.name(), self.value())
3984 }
3985 }
3986
3987 impl std::convert::From<i32> for Operation {
3988 fn from(value: i32) -> Self {
3989 match value {
3990 0 => Self::Unspecified,
3991 1 => Self::Read,
3992 2 => Self::Move,
3993 3 => Self::Copy,
3994 _ => Self::UnknownValue(operation::UnknownValue(
3995 wkt::internal::UnknownEnumValue::Integer(value),
3996 )),
3997 }
3998 }
3999 }
4000
4001 impl std::convert::From<&str> for Operation {
4002 fn from(value: &str) -> Self {
4003 use std::string::ToString;
4004 match value {
4005 "OPERATION_UNSPECIFIED" => Self::Unspecified,
4006 "READ" => Self::Read,
4007 "MOVE" => Self::Move,
4008 "COPY" => Self::Copy,
4009 _ => Self::UnknownValue(operation::UnknownValue(
4010 wkt::internal::UnknownEnumValue::String(value.to_string()),
4011 )),
4012 }
4013 }
4014 }
4015
4016 impl serde::ser::Serialize for Operation {
4017 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4018 where
4019 S: serde::Serializer,
4020 {
4021 match self {
4022 Self::Unspecified => serializer.serialize_i32(0),
4023 Self::Read => serializer.serialize_i32(1),
4024 Self::Move => serializer.serialize_i32(2),
4025 Self::Copy => serializer.serialize_i32(3),
4026 Self::UnknownValue(u) => u.0.serialize(serializer),
4027 }
4028 }
4029 }
4030
4031 impl<'de> serde::de::Deserialize<'de> for Operation {
4032 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4033 where
4034 D: serde::Deserializer<'de>,
4035 {
4036 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
4037 ".google.cloud.securitycenter.v2.DataFlowEvent.Operation",
4038 ))
4039 }
4040 }
4041}
4042
4043/// Details about data retention deletion violations, in which the data is
4044/// non-compliant based on their retention or deletion time, as defined in the
4045/// applicable data security policy. The Data Retention Deletion (DRD) control is
4046/// a control of the DSPM (Data Security Posture Management) suite that enables
4047/// organizations to manage data retention and deletion policies in compliance
4048/// with regulations, such as GDPR and CRPA. DRD supports two primary policy
4049/// types: maximum storage length (max TTL) and minimum storage length (min TTL).
4050/// Both are aimed at helping organizations meet regulatory and data management
4051/// commitments.
4052#[derive(Clone, Default, PartialEq)]
4053#[non_exhaustive]
4054pub struct DataRetentionDeletionEvent {
4055 /// Timestamp indicating when the event was detected.
4056 pub event_detection_time: std::option::Option<wkt::Timestamp>,
4057
4058 /// Number of objects that violated the policy for this resource. If the number
4059 /// is less than 1,000, then the value of this field is the exact number. If
4060 /// the number of objects that violated the policy is greater than or equal to
4061 /// 1,000, then the value of this field is 1000.
4062 pub data_object_count: i64,
4063
4064 /// Maximum duration of retention allowed from the DRD control. This comes
4065 /// from the DRD control where users set a max TTL for their data. For example,
4066 /// suppose that a user sets the max TTL for a Cloud Storage bucket to 90 days.
4067 /// However, an object in that bucket is 100 days old. In this case, a
4068 /// DataRetentionDeletionEvent will be generated for that Cloud Storage bucket,
4069 /// and the max_retention_allowed is 90 days.
4070 pub max_retention_allowed: std::option::Option<wkt::Duration>,
4071
4072 /// Type of the DRD event.
4073 pub event_type: crate::model::data_retention_deletion_event::EventType,
4074
4075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4076}
4077
4078impl DataRetentionDeletionEvent {
4079 pub fn new() -> Self {
4080 std::default::Default::default()
4081 }
4082
4083 /// Sets the value of [event_detection_time][crate::model::DataRetentionDeletionEvent::event_detection_time].
4084 ///
4085 /// # Example
4086 /// ```ignore,no_run
4087 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4088 /// use wkt::Timestamp;
4089 /// let x = DataRetentionDeletionEvent::new().set_event_detection_time(Timestamp::default()/* use setters */);
4090 /// ```
4091 pub fn set_event_detection_time<T>(mut self, v: T) -> Self
4092 where
4093 T: std::convert::Into<wkt::Timestamp>,
4094 {
4095 self.event_detection_time = std::option::Option::Some(v.into());
4096 self
4097 }
4098
4099 /// Sets or clears the value of [event_detection_time][crate::model::DataRetentionDeletionEvent::event_detection_time].
4100 ///
4101 /// # Example
4102 /// ```ignore,no_run
4103 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4104 /// use wkt::Timestamp;
4105 /// let x = DataRetentionDeletionEvent::new().set_or_clear_event_detection_time(Some(Timestamp::default()/* use setters */));
4106 /// let x = DataRetentionDeletionEvent::new().set_or_clear_event_detection_time(None::<Timestamp>);
4107 /// ```
4108 pub fn set_or_clear_event_detection_time<T>(mut self, v: std::option::Option<T>) -> Self
4109 where
4110 T: std::convert::Into<wkt::Timestamp>,
4111 {
4112 self.event_detection_time = v.map(|x| x.into());
4113 self
4114 }
4115
4116 /// Sets the value of [data_object_count][crate::model::DataRetentionDeletionEvent::data_object_count].
4117 ///
4118 /// # Example
4119 /// ```ignore,no_run
4120 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4121 /// let x = DataRetentionDeletionEvent::new().set_data_object_count(42);
4122 /// ```
4123 pub fn set_data_object_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4124 self.data_object_count = v.into();
4125 self
4126 }
4127
4128 /// Sets the value of [max_retention_allowed][crate::model::DataRetentionDeletionEvent::max_retention_allowed].
4129 ///
4130 /// # Example
4131 /// ```ignore,no_run
4132 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4133 /// use wkt::Duration;
4134 /// let x = DataRetentionDeletionEvent::new().set_max_retention_allowed(Duration::default()/* use setters */);
4135 /// ```
4136 pub fn set_max_retention_allowed<T>(mut self, v: T) -> Self
4137 where
4138 T: std::convert::Into<wkt::Duration>,
4139 {
4140 self.max_retention_allowed = std::option::Option::Some(v.into());
4141 self
4142 }
4143
4144 /// Sets or clears the value of [max_retention_allowed][crate::model::DataRetentionDeletionEvent::max_retention_allowed].
4145 ///
4146 /// # Example
4147 /// ```ignore,no_run
4148 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4149 /// use wkt::Duration;
4150 /// let x = DataRetentionDeletionEvent::new().set_or_clear_max_retention_allowed(Some(Duration::default()/* use setters */));
4151 /// let x = DataRetentionDeletionEvent::new().set_or_clear_max_retention_allowed(None::<Duration>);
4152 /// ```
4153 pub fn set_or_clear_max_retention_allowed<T>(mut self, v: std::option::Option<T>) -> Self
4154 where
4155 T: std::convert::Into<wkt::Duration>,
4156 {
4157 self.max_retention_allowed = v.map(|x| x.into());
4158 self
4159 }
4160
4161 /// Sets the value of [event_type][crate::model::DataRetentionDeletionEvent::event_type].
4162 ///
4163 /// # Example
4164 /// ```ignore,no_run
4165 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4166 /// use google_cloud_securitycenter_v2::model::data_retention_deletion_event::EventType;
4167 /// let x0 = DataRetentionDeletionEvent::new().set_event_type(EventType::MaxTtlExceeded);
4168 /// ```
4169 pub fn set_event_type<
4170 T: std::convert::Into<crate::model::data_retention_deletion_event::EventType>,
4171 >(
4172 mut self,
4173 v: T,
4174 ) -> Self {
4175 self.event_type = v.into();
4176 self
4177 }
4178}
4179
4180impl wkt::message::Message for DataRetentionDeletionEvent {
4181 fn typename() -> &'static str {
4182 "type.googleapis.com/google.cloud.securitycenter.v2.DataRetentionDeletionEvent"
4183 }
4184}
4185
4186/// Defines additional types related to [DataRetentionDeletionEvent].
4187pub mod data_retention_deletion_event {
4188 #[allow(unused_imports)]
4189 use super::*;
4190
4191 /// Type of the DRD event.
4192 ///
4193 /// # Working with unknown values
4194 ///
4195 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4196 /// additional enum variants at any time. Adding new variants is not considered
4197 /// a breaking change. Applications should write their code in anticipation of:
4198 ///
4199 /// - New values appearing in future releases of the client library, **and**
4200 /// - New values received dynamically, without application changes.
4201 ///
4202 /// Please consult the [Working with enums] section in the user guide for some
4203 /// guidelines.
4204 ///
4205 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4206 #[derive(Clone, Debug, PartialEq)]
4207 #[non_exhaustive]
4208 pub enum EventType {
4209 /// Unspecified event type.
4210 Unspecified,
4211 /// The maximum retention time has been exceeded.
4212 MaxTtlExceeded,
4213 /// If set, the enum was initialized with an unknown value.
4214 ///
4215 /// Applications can examine the value using [EventType::value] or
4216 /// [EventType::name].
4217 UnknownValue(event_type::UnknownValue),
4218 }
4219
4220 #[doc(hidden)]
4221 pub mod event_type {
4222 #[allow(unused_imports)]
4223 use super::*;
4224 #[derive(Clone, Debug, PartialEq)]
4225 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4226 }
4227
4228 impl EventType {
4229 /// Gets the enum value.
4230 ///
4231 /// Returns `None` if the enum contains an unknown value deserialized from
4232 /// the string representation of enums.
4233 pub fn value(&self) -> std::option::Option<i32> {
4234 match self {
4235 Self::Unspecified => std::option::Option::Some(0),
4236 Self::MaxTtlExceeded => std::option::Option::Some(1),
4237 Self::UnknownValue(u) => u.0.value(),
4238 }
4239 }
4240
4241 /// Gets the enum value as a string.
4242 ///
4243 /// Returns `None` if the enum contains an unknown value deserialized from
4244 /// the integer representation of enums.
4245 pub fn name(&self) -> std::option::Option<&str> {
4246 match self {
4247 Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
4248 Self::MaxTtlExceeded => std::option::Option::Some("EVENT_TYPE_MAX_TTL_EXCEEDED"),
4249 Self::UnknownValue(u) => u.0.name(),
4250 }
4251 }
4252 }
4253
4254 impl std::default::Default for EventType {
4255 fn default() -> Self {
4256 use std::convert::From;
4257 Self::from(0)
4258 }
4259 }
4260
4261 impl std::fmt::Display for EventType {
4262 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4263 wkt::internal::display_enum(f, self.name(), self.value())
4264 }
4265 }
4266
4267 impl std::convert::From<i32> for EventType {
4268 fn from(value: i32) -> Self {
4269 match value {
4270 0 => Self::Unspecified,
4271 1 => Self::MaxTtlExceeded,
4272 _ => Self::UnknownValue(event_type::UnknownValue(
4273 wkt::internal::UnknownEnumValue::Integer(value),
4274 )),
4275 }
4276 }
4277 }
4278
4279 impl std::convert::From<&str> for EventType {
4280 fn from(value: &str) -> Self {
4281 use std::string::ToString;
4282 match value {
4283 "EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
4284 "EVENT_TYPE_MAX_TTL_EXCEEDED" => Self::MaxTtlExceeded,
4285 _ => Self::UnknownValue(event_type::UnknownValue(
4286 wkt::internal::UnknownEnumValue::String(value.to_string()),
4287 )),
4288 }
4289 }
4290 }
4291
4292 impl serde::ser::Serialize for EventType {
4293 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4294 where
4295 S: serde::Serializer,
4296 {
4297 match self {
4298 Self::Unspecified => serializer.serialize_i32(0),
4299 Self::MaxTtlExceeded => serializer.serialize_i32(1),
4300 Self::UnknownValue(u) => u.0.serialize(serializer),
4301 }
4302 }
4303 }
4304
4305 impl<'de> serde::de::Deserialize<'de> for EventType {
4306 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4307 where
4308 D: serde::Deserializer<'de>,
4309 {
4310 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
4311 ".google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType",
4312 ))
4313 }
4314 }
4315}
4316
4317/// Represents database access information, such as queries. A database may be a
4318/// sub-resource of an instance (as in the case of Cloud SQL instances or Cloud
4319/// Spanner instances), or the database instance itself. Some database resources
4320/// might not have the [full resource
4321/// name](https://google.aip.dev/122#full-resource-names) populated because these
4322/// resource types, such as Cloud SQL databases, are not yet supported by Cloud
4323/// Asset Inventory. In these cases only the display name is provided.
4324#[derive(Clone, Default, PartialEq)]
4325#[non_exhaustive]
4326pub struct Database {
4327 /// Some database resources may not have the [full resource
4328 /// name](https://google.aip.dev/122#full-resource-names) populated because
4329 /// these resource types are not yet supported by Cloud Asset Inventory (e.g.
4330 /// Cloud SQL databases). In these cases only the display name will be
4331 /// provided.
4332 /// The [full resource name](https://google.aip.dev/122#full-resource-names) of
4333 /// the database that the user connected to, if it is supported by Cloud Asset
4334 /// Inventory.
4335 pub name: std::string::String,
4336
4337 /// The human-readable name of the database that the user connected to.
4338 pub display_name: std::string::String,
4339
4340 /// The username used to connect to the database. The username might not be an
4341 /// IAM principal and does not have a set format.
4342 pub user_name: std::string::String,
4343
4344 /// The SQL statement that is associated with the database access.
4345 pub query: std::string::String,
4346
4347 /// The target usernames, roles, or groups of an SQL privilege grant, which is
4348 /// not an IAM policy change.
4349 pub grantees: std::vec::Vec<std::string::String>,
4350
4351 /// The version of the database, for example, POSTGRES_14.
4352 /// See [the complete
4353 /// list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
4354 pub version: std::string::String,
4355
4356 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4357}
4358
4359impl Database {
4360 pub fn new() -> Self {
4361 std::default::Default::default()
4362 }
4363
4364 /// Sets the value of [name][crate::model::Database::name].
4365 ///
4366 /// # Example
4367 /// ```ignore,no_run
4368 /// # use google_cloud_securitycenter_v2::model::Database;
4369 /// let x = Database::new().set_name("example");
4370 /// ```
4371 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4372 self.name = v.into();
4373 self
4374 }
4375
4376 /// Sets the value of [display_name][crate::model::Database::display_name].
4377 ///
4378 /// # Example
4379 /// ```ignore,no_run
4380 /// # use google_cloud_securitycenter_v2::model::Database;
4381 /// let x = Database::new().set_display_name("example");
4382 /// ```
4383 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4384 self.display_name = v.into();
4385 self
4386 }
4387
4388 /// Sets the value of [user_name][crate::model::Database::user_name].
4389 ///
4390 /// # Example
4391 /// ```ignore,no_run
4392 /// # use google_cloud_securitycenter_v2::model::Database;
4393 /// let x = Database::new().set_user_name("example");
4394 /// ```
4395 pub fn set_user_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4396 self.user_name = v.into();
4397 self
4398 }
4399
4400 /// Sets the value of [query][crate::model::Database::query].
4401 ///
4402 /// # Example
4403 /// ```ignore,no_run
4404 /// # use google_cloud_securitycenter_v2::model::Database;
4405 /// let x = Database::new().set_query("example");
4406 /// ```
4407 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4408 self.query = v.into();
4409 self
4410 }
4411
4412 /// Sets the value of [grantees][crate::model::Database::grantees].
4413 ///
4414 /// # Example
4415 /// ```ignore,no_run
4416 /// # use google_cloud_securitycenter_v2::model::Database;
4417 /// let x = Database::new().set_grantees(["a", "b", "c"]);
4418 /// ```
4419 pub fn set_grantees<T, V>(mut self, v: T) -> Self
4420 where
4421 T: std::iter::IntoIterator<Item = V>,
4422 V: std::convert::Into<std::string::String>,
4423 {
4424 use std::iter::Iterator;
4425 self.grantees = v.into_iter().map(|i| i.into()).collect();
4426 self
4427 }
4428
4429 /// Sets the value of [version][crate::model::Database::version].
4430 ///
4431 /// # Example
4432 /// ```ignore,no_run
4433 /// # use google_cloud_securitycenter_v2::model::Database;
4434 /// let x = Database::new().set_version("example");
4435 /// ```
4436 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4437 self.version = v.into();
4438 self
4439 }
4440}
4441
4442impl wkt::message::Message for Database {
4443 fn typename() -> &'static str {
4444 "type.googleapis.com/google.cloud.securitycenter.v2.Database"
4445 }
4446}
4447
4448/// Contains information about the disk associated with the finding.
4449#[derive(Clone, Default, PartialEq)]
4450#[non_exhaustive]
4451pub struct Disk {
4452 /// The name of the disk, for example,
4453 /// `https://www.googleapis.com/compute/v1/projects/{project-id}/zones/{zone-id}/disks/{disk-id}`.
4454 pub name: std::string::String,
4455
4456 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4457}
4458
4459impl Disk {
4460 pub fn new() -> Self {
4461 std::default::Default::default()
4462 }
4463
4464 /// Sets the value of [name][crate::model::Disk::name].
4465 ///
4466 /// # Example
4467 /// ```ignore,no_run
4468 /// # use google_cloud_securitycenter_v2::model::Disk;
4469 /// let x = Disk::new().set_name("example");
4470 /// ```
4471 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4472 self.name = v.into();
4473 self
4474 }
4475}
4476
4477impl wkt::message::Message for Disk {
4478 fn typename() -> &'static str {
4479 "type.googleapis.com/google.cloud.securitycenter.v2.Disk"
4480 }
4481}
4482
4483/// Exfiltration represents a data exfiltration attempt from one or more sources
4484/// to one or more targets. The `sources` attribute lists the sources of the
4485/// exfiltrated data. The `targets` attribute lists the destinations the data was
4486/// copied to.
4487#[derive(Clone, Default, PartialEq)]
4488#[non_exhaustive]
4489pub struct Exfiltration {
4490 /// If there are multiple sources, then the data is considered "joined" between
4491 /// them. For instance, BigQuery can join multiple tables, and each
4492 /// table would be considered a source.
4493 pub sources: std::vec::Vec<crate::model::ExfilResource>,
4494
4495 /// If there are multiple targets, each target would get a complete copy of the
4496 /// "joined" source data.
4497 pub targets: std::vec::Vec<crate::model::ExfilResource>,
4498
4499 /// Total exfiltrated bytes processed for the entire job.
4500 pub total_exfiltrated_bytes: i64,
4501
4502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4503}
4504
4505impl Exfiltration {
4506 pub fn new() -> Self {
4507 std::default::Default::default()
4508 }
4509
4510 /// Sets the value of [sources][crate::model::Exfiltration::sources].
4511 ///
4512 /// # Example
4513 /// ```ignore,no_run
4514 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4515 /// use google_cloud_securitycenter_v2::model::ExfilResource;
4516 /// let x = Exfiltration::new()
4517 /// .set_sources([
4518 /// ExfilResource::default()/* use setters */,
4519 /// ExfilResource::default()/* use (different) setters */,
4520 /// ]);
4521 /// ```
4522 pub fn set_sources<T, V>(mut self, v: T) -> Self
4523 where
4524 T: std::iter::IntoIterator<Item = V>,
4525 V: std::convert::Into<crate::model::ExfilResource>,
4526 {
4527 use std::iter::Iterator;
4528 self.sources = v.into_iter().map(|i| i.into()).collect();
4529 self
4530 }
4531
4532 /// Sets the value of [targets][crate::model::Exfiltration::targets].
4533 ///
4534 /// # Example
4535 /// ```ignore,no_run
4536 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4537 /// use google_cloud_securitycenter_v2::model::ExfilResource;
4538 /// let x = Exfiltration::new()
4539 /// .set_targets([
4540 /// ExfilResource::default()/* use setters */,
4541 /// ExfilResource::default()/* use (different) setters */,
4542 /// ]);
4543 /// ```
4544 pub fn set_targets<T, V>(mut self, v: T) -> Self
4545 where
4546 T: std::iter::IntoIterator<Item = V>,
4547 V: std::convert::Into<crate::model::ExfilResource>,
4548 {
4549 use std::iter::Iterator;
4550 self.targets = v.into_iter().map(|i| i.into()).collect();
4551 self
4552 }
4553
4554 /// Sets the value of [total_exfiltrated_bytes][crate::model::Exfiltration::total_exfiltrated_bytes].
4555 ///
4556 /// # Example
4557 /// ```ignore,no_run
4558 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4559 /// let x = Exfiltration::new().set_total_exfiltrated_bytes(42);
4560 /// ```
4561 pub fn set_total_exfiltrated_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4562 self.total_exfiltrated_bytes = v.into();
4563 self
4564 }
4565}
4566
4567impl wkt::message::Message for Exfiltration {
4568 fn typename() -> &'static str {
4569 "type.googleapis.com/google.cloud.securitycenter.v2.Exfiltration"
4570 }
4571}
4572
4573/// Resource where data was exfiltrated from or exfiltrated to.
4574#[derive(Clone, Default, PartialEq)]
4575#[non_exhaustive]
4576pub struct ExfilResource {
4577 /// The resource's [full resource
4578 /// name](https://cloud.google.com/apis/design/resource_names#full_resource_name).
4579 pub name: std::string::String,
4580
4581 /// Subcomponents of the asset that was exfiltrated, like URIs used during
4582 /// exfiltration, table names, databases, and filenames. For example, multiple
4583 /// tables might have been exfiltrated from the same Cloud SQL instance, or
4584 /// multiple files might have been exfiltrated from the same Cloud Storage
4585 /// bucket.
4586 pub components: std::vec::Vec<std::string::String>,
4587
4588 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4589}
4590
4591impl ExfilResource {
4592 pub fn new() -> Self {
4593 std::default::Default::default()
4594 }
4595
4596 /// Sets the value of [name][crate::model::ExfilResource::name].
4597 ///
4598 /// # Example
4599 /// ```ignore,no_run
4600 /// # use google_cloud_securitycenter_v2::model::ExfilResource;
4601 /// let x = ExfilResource::new().set_name("example");
4602 /// ```
4603 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4604 self.name = v.into();
4605 self
4606 }
4607
4608 /// Sets the value of [components][crate::model::ExfilResource::components].
4609 ///
4610 /// # Example
4611 /// ```ignore,no_run
4612 /// # use google_cloud_securitycenter_v2::model::ExfilResource;
4613 /// let x = ExfilResource::new().set_components(["a", "b", "c"]);
4614 /// ```
4615 pub fn set_components<T, V>(mut self, v: T) -> Self
4616 where
4617 T: std::iter::IntoIterator<Item = V>,
4618 V: std::convert::Into<std::string::String>,
4619 {
4620 use std::iter::Iterator;
4621 self.components = v.into_iter().map(|i| i.into()).collect();
4622 self
4623 }
4624}
4625
4626impl wkt::message::Message for ExfilResource {
4627 fn typename() -> &'static str {
4628 "type.googleapis.com/google.cloud.securitycenter.v2.ExfilResource"
4629 }
4630}
4631
4632/// Representation of third party SIEM/SOAR fields within SCC.
4633#[derive(Clone, Default, PartialEq)]
4634#[non_exhaustive]
4635pub struct ExternalSystem {
4636 /// Full resource name of the external system. The following list
4637 /// shows some examples:
4638 ///
4639 /// + `organizations/1234/sources/5678/findings/123456/externalSystems/jira`
4640 ///
4641 /// `organizations/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4642 ///
4643 /// + `folders/1234/sources/5678/findings/123456/externalSystems/jira`
4644 ///
4645 /// `folders/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4646 ///
4647 /// + `projects/1234/sources/5678/findings/123456/externalSystems/jira`
4648 ///
4649 /// `projects/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4650 pub name: std::string::String,
4651
4652 /// References primary/secondary etc assignees in the external system.
4653 pub assignees: std::vec::Vec<std::string::String>,
4654
4655 /// The identifier that's used to track the finding's corresponding case in the
4656 /// external system.
4657 pub external_uid: std::string::String,
4658
4659 /// The most recent status of the finding's corresponding case, as reported by
4660 /// the external system.
4661 pub status: std::string::String,
4662
4663 /// The time when the case was last updated, as reported by the external
4664 /// system.
4665 pub external_system_update_time: std::option::Option<wkt::Timestamp>,
4666
4667 /// The link to the finding's corresponding case in the external system.
4668 pub case_uri: std::string::String,
4669
4670 /// The priority of the finding's corresponding case in the external system.
4671 pub case_priority: std::string::String,
4672
4673 /// The SLA of the finding's corresponding case in the external system.
4674 pub case_sla: std::option::Option<wkt::Timestamp>,
4675
4676 /// The time when the case was created, as reported by the external system.
4677 pub case_create_time: std::option::Option<wkt::Timestamp>,
4678
4679 /// The time when the case was closed, as reported by the external system.
4680 pub case_close_time: std::option::Option<wkt::Timestamp>,
4681
4682 /// Information about the ticket, if any, that is being used to track the
4683 /// resolution of the issue that is identified by this finding.
4684 pub ticket_info: std::option::Option<crate::model::external_system::TicketInfo>,
4685
4686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4687}
4688
4689impl ExternalSystem {
4690 pub fn new() -> Self {
4691 std::default::Default::default()
4692 }
4693
4694 /// Sets the value of [name][crate::model::ExternalSystem::name].
4695 ///
4696 /// # Example
4697 /// ```ignore,no_run
4698 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4699 /// let x = ExternalSystem::new().set_name("example");
4700 /// ```
4701 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4702 self.name = v.into();
4703 self
4704 }
4705
4706 /// Sets the value of [assignees][crate::model::ExternalSystem::assignees].
4707 ///
4708 /// # Example
4709 /// ```ignore,no_run
4710 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4711 /// let x = ExternalSystem::new().set_assignees(["a", "b", "c"]);
4712 /// ```
4713 pub fn set_assignees<T, V>(mut self, v: T) -> Self
4714 where
4715 T: std::iter::IntoIterator<Item = V>,
4716 V: std::convert::Into<std::string::String>,
4717 {
4718 use std::iter::Iterator;
4719 self.assignees = v.into_iter().map(|i| i.into()).collect();
4720 self
4721 }
4722
4723 /// Sets the value of [external_uid][crate::model::ExternalSystem::external_uid].
4724 ///
4725 /// # Example
4726 /// ```ignore,no_run
4727 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4728 /// let x = ExternalSystem::new().set_external_uid("example");
4729 /// ```
4730 pub fn set_external_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4731 self.external_uid = v.into();
4732 self
4733 }
4734
4735 /// Sets the value of [status][crate::model::ExternalSystem::status].
4736 ///
4737 /// # Example
4738 /// ```ignore,no_run
4739 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4740 /// let x = ExternalSystem::new().set_status("example");
4741 /// ```
4742 pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4743 self.status = v.into();
4744 self
4745 }
4746
4747 /// Sets the value of [external_system_update_time][crate::model::ExternalSystem::external_system_update_time].
4748 ///
4749 /// # Example
4750 /// ```ignore,no_run
4751 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4752 /// use wkt::Timestamp;
4753 /// let x = ExternalSystem::new().set_external_system_update_time(Timestamp::default()/* use setters */);
4754 /// ```
4755 pub fn set_external_system_update_time<T>(mut self, v: T) -> Self
4756 where
4757 T: std::convert::Into<wkt::Timestamp>,
4758 {
4759 self.external_system_update_time = std::option::Option::Some(v.into());
4760 self
4761 }
4762
4763 /// Sets or clears the value of [external_system_update_time][crate::model::ExternalSystem::external_system_update_time].
4764 ///
4765 /// # Example
4766 /// ```ignore,no_run
4767 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4768 /// use wkt::Timestamp;
4769 /// let x = ExternalSystem::new().set_or_clear_external_system_update_time(Some(Timestamp::default()/* use setters */));
4770 /// let x = ExternalSystem::new().set_or_clear_external_system_update_time(None::<Timestamp>);
4771 /// ```
4772 pub fn set_or_clear_external_system_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4773 where
4774 T: std::convert::Into<wkt::Timestamp>,
4775 {
4776 self.external_system_update_time = v.map(|x| x.into());
4777 self
4778 }
4779
4780 /// Sets the value of [case_uri][crate::model::ExternalSystem::case_uri].
4781 ///
4782 /// # Example
4783 /// ```ignore,no_run
4784 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4785 /// let x = ExternalSystem::new().set_case_uri("example");
4786 /// ```
4787 pub fn set_case_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4788 self.case_uri = v.into();
4789 self
4790 }
4791
4792 /// Sets the value of [case_priority][crate::model::ExternalSystem::case_priority].
4793 ///
4794 /// # Example
4795 /// ```ignore,no_run
4796 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4797 /// let x = ExternalSystem::new().set_case_priority("example");
4798 /// ```
4799 pub fn set_case_priority<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4800 self.case_priority = v.into();
4801 self
4802 }
4803
4804 /// Sets the value of [case_sla][crate::model::ExternalSystem::case_sla].
4805 ///
4806 /// # Example
4807 /// ```ignore,no_run
4808 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4809 /// use wkt::Timestamp;
4810 /// let x = ExternalSystem::new().set_case_sla(Timestamp::default()/* use setters */);
4811 /// ```
4812 pub fn set_case_sla<T>(mut self, v: T) -> Self
4813 where
4814 T: std::convert::Into<wkt::Timestamp>,
4815 {
4816 self.case_sla = std::option::Option::Some(v.into());
4817 self
4818 }
4819
4820 /// Sets or clears the value of [case_sla][crate::model::ExternalSystem::case_sla].
4821 ///
4822 /// # Example
4823 /// ```ignore,no_run
4824 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4825 /// use wkt::Timestamp;
4826 /// let x = ExternalSystem::new().set_or_clear_case_sla(Some(Timestamp::default()/* use setters */));
4827 /// let x = ExternalSystem::new().set_or_clear_case_sla(None::<Timestamp>);
4828 /// ```
4829 pub fn set_or_clear_case_sla<T>(mut self, v: std::option::Option<T>) -> Self
4830 where
4831 T: std::convert::Into<wkt::Timestamp>,
4832 {
4833 self.case_sla = v.map(|x| x.into());
4834 self
4835 }
4836
4837 /// Sets the value of [case_create_time][crate::model::ExternalSystem::case_create_time].
4838 ///
4839 /// # Example
4840 /// ```ignore,no_run
4841 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4842 /// use wkt::Timestamp;
4843 /// let x = ExternalSystem::new().set_case_create_time(Timestamp::default()/* use setters */);
4844 /// ```
4845 pub fn set_case_create_time<T>(mut self, v: T) -> Self
4846 where
4847 T: std::convert::Into<wkt::Timestamp>,
4848 {
4849 self.case_create_time = std::option::Option::Some(v.into());
4850 self
4851 }
4852
4853 /// Sets or clears the value of [case_create_time][crate::model::ExternalSystem::case_create_time].
4854 ///
4855 /// # Example
4856 /// ```ignore,no_run
4857 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4858 /// use wkt::Timestamp;
4859 /// let x = ExternalSystem::new().set_or_clear_case_create_time(Some(Timestamp::default()/* use setters */));
4860 /// let x = ExternalSystem::new().set_or_clear_case_create_time(None::<Timestamp>);
4861 /// ```
4862 pub fn set_or_clear_case_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4863 where
4864 T: std::convert::Into<wkt::Timestamp>,
4865 {
4866 self.case_create_time = v.map(|x| x.into());
4867 self
4868 }
4869
4870 /// Sets the value of [case_close_time][crate::model::ExternalSystem::case_close_time].
4871 ///
4872 /// # Example
4873 /// ```ignore,no_run
4874 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4875 /// use wkt::Timestamp;
4876 /// let x = ExternalSystem::new().set_case_close_time(Timestamp::default()/* use setters */);
4877 /// ```
4878 pub fn set_case_close_time<T>(mut self, v: T) -> Self
4879 where
4880 T: std::convert::Into<wkt::Timestamp>,
4881 {
4882 self.case_close_time = std::option::Option::Some(v.into());
4883 self
4884 }
4885
4886 /// Sets or clears the value of [case_close_time][crate::model::ExternalSystem::case_close_time].
4887 ///
4888 /// # Example
4889 /// ```ignore,no_run
4890 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4891 /// use wkt::Timestamp;
4892 /// let x = ExternalSystem::new().set_or_clear_case_close_time(Some(Timestamp::default()/* use setters */));
4893 /// let x = ExternalSystem::new().set_or_clear_case_close_time(None::<Timestamp>);
4894 /// ```
4895 pub fn set_or_clear_case_close_time<T>(mut self, v: std::option::Option<T>) -> Self
4896 where
4897 T: std::convert::Into<wkt::Timestamp>,
4898 {
4899 self.case_close_time = v.map(|x| x.into());
4900 self
4901 }
4902
4903 /// Sets the value of [ticket_info][crate::model::ExternalSystem::ticket_info].
4904 ///
4905 /// # Example
4906 /// ```ignore,no_run
4907 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4908 /// use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4909 /// let x = ExternalSystem::new().set_ticket_info(TicketInfo::default()/* use setters */);
4910 /// ```
4911 pub fn set_ticket_info<T>(mut self, v: T) -> Self
4912 where
4913 T: std::convert::Into<crate::model::external_system::TicketInfo>,
4914 {
4915 self.ticket_info = std::option::Option::Some(v.into());
4916 self
4917 }
4918
4919 /// Sets or clears the value of [ticket_info][crate::model::ExternalSystem::ticket_info].
4920 ///
4921 /// # Example
4922 /// ```ignore,no_run
4923 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4924 /// use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4925 /// let x = ExternalSystem::new().set_or_clear_ticket_info(Some(TicketInfo::default()/* use setters */));
4926 /// let x = ExternalSystem::new().set_or_clear_ticket_info(None::<TicketInfo>);
4927 /// ```
4928 pub fn set_or_clear_ticket_info<T>(mut self, v: std::option::Option<T>) -> Self
4929 where
4930 T: std::convert::Into<crate::model::external_system::TicketInfo>,
4931 {
4932 self.ticket_info = v.map(|x| x.into());
4933 self
4934 }
4935}
4936
4937impl wkt::message::Message for ExternalSystem {
4938 fn typename() -> &'static str {
4939 "type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem"
4940 }
4941}
4942
4943/// Defines additional types related to [ExternalSystem].
4944pub mod external_system {
4945 #[allow(unused_imports)]
4946 use super::*;
4947
4948 /// Information about the ticket, if any, that is being used to track the
4949 /// resolution of the issue that is identified by this finding.
4950 #[derive(Clone, Default, PartialEq)]
4951 #[non_exhaustive]
4952 pub struct TicketInfo {
4953 /// The identifier of the ticket in the ticket system.
4954 pub id: std::string::String,
4955
4956 /// The assignee of the ticket in the ticket system.
4957 pub assignee: std::string::String,
4958
4959 /// The description of the ticket in the ticket system.
4960 pub description: std::string::String,
4961
4962 /// The link to the ticket in the ticket system.
4963 pub uri: std::string::String,
4964
4965 /// The latest status of the ticket, as reported by the ticket system.
4966 pub status: std::string::String,
4967
4968 /// The time when the ticket was last updated, as reported by the ticket
4969 /// system.
4970 pub update_time: std::option::Option<wkt::Timestamp>,
4971
4972 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4973 }
4974
4975 impl TicketInfo {
4976 pub fn new() -> Self {
4977 std::default::Default::default()
4978 }
4979
4980 /// Sets the value of [id][crate::model::external_system::TicketInfo::id].
4981 ///
4982 /// # Example
4983 /// ```ignore,no_run
4984 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4985 /// let x = TicketInfo::new().set_id("example");
4986 /// ```
4987 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4988 self.id = v.into();
4989 self
4990 }
4991
4992 /// Sets the value of [assignee][crate::model::external_system::TicketInfo::assignee].
4993 ///
4994 /// # Example
4995 /// ```ignore,no_run
4996 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4997 /// let x = TicketInfo::new().set_assignee("example");
4998 /// ```
4999 pub fn set_assignee<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5000 self.assignee = v.into();
5001 self
5002 }
5003
5004 /// Sets the value of [description][crate::model::external_system::TicketInfo::description].
5005 ///
5006 /// # Example
5007 /// ```ignore,no_run
5008 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5009 /// let x = TicketInfo::new().set_description("example");
5010 /// ```
5011 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5012 self.description = v.into();
5013 self
5014 }
5015
5016 /// Sets the value of [uri][crate::model::external_system::TicketInfo::uri].
5017 ///
5018 /// # Example
5019 /// ```ignore,no_run
5020 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5021 /// let x = TicketInfo::new().set_uri("example");
5022 /// ```
5023 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5024 self.uri = v.into();
5025 self
5026 }
5027
5028 /// Sets the value of [status][crate::model::external_system::TicketInfo::status].
5029 ///
5030 /// # Example
5031 /// ```ignore,no_run
5032 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5033 /// let x = TicketInfo::new().set_status("example");
5034 /// ```
5035 pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5036 self.status = v.into();
5037 self
5038 }
5039
5040 /// Sets the value of [update_time][crate::model::external_system::TicketInfo::update_time].
5041 ///
5042 /// # Example
5043 /// ```ignore,no_run
5044 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5045 /// use wkt::Timestamp;
5046 /// let x = TicketInfo::new().set_update_time(Timestamp::default()/* use setters */);
5047 /// ```
5048 pub fn set_update_time<T>(mut self, v: T) -> Self
5049 where
5050 T: std::convert::Into<wkt::Timestamp>,
5051 {
5052 self.update_time = std::option::Option::Some(v.into());
5053 self
5054 }
5055
5056 /// Sets or clears the value of [update_time][crate::model::external_system::TicketInfo::update_time].
5057 ///
5058 /// # Example
5059 /// ```ignore,no_run
5060 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5061 /// use wkt::Timestamp;
5062 /// let x = TicketInfo::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5063 /// let x = TicketInfo::new().set_or_clear_update_time(None::<Timestamp>);
5064 /// ```
5065 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5066 where
5067 T: std::convert::Into<wkt::Timestamp>,
5068 {
5069 self.update_time = v.map(|x| x.into());
5070 self
5071 }
5072 }
5073
5074 impl wkt::message::Message for TicketInfo {
5075 fn typename() -> &'static str {
5076 "type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem.TicketInfo"
5077 }
5078 }
5079}
5080
5081/// File information about the related binary/library used by an executable, or
5082/// the script used by a script interpreter
5083#[derive(Clone, Default, PartialEq)]
5084#[non_exhaustive]
5085pub struct File {
5086 /// Absolute path of the file as a JSON encoded string.
5087 pub path: std::string::String,
5088
5089 /// Size of the file in bytes.
5090 pub size: i64,
5091
5092 /// SHA256 hash of the first hashed_size bytes of the file encoded as a
5093 /// hex string. If hashed_size == size, sha256 represents the SHA256 hash
5094 /// of the entire file.
5095 pub sha256: std::string::String,
5096
5097 /// The length in bytes of the file prefix that was hashed. If
5098 /// hashed_size == size, any hashes reported represent the entire
5099 /// file.
5100 pub hashed_size: i64,
5101
5102 /// True when the hash covers only a prefix of the file.
5103 pub partially_hashed: bool,
5104
5105 /// Prefix of the file contents as a JSON-encoded string.
5106 pub contents: std::string::String,
5107
5108 /// Path of the file in terms of underlying disk/partition identifiers.
5109 pub disk_path: std::option::Option<crate::model::file::DiskPath>,
5110
5111 /// Operation(s) performed on a file.
5112 pub operations: std::vec::Vec<crate::model::file::FileOperation>,
5113
5114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5115}
5116
5117impl File {
5118 pub fn new() -> Self {
5119 std::default::Default::default()
5120 }
5121
5122 /// Sets the value of [path][crate::model::File::path].
5123 ///
5124 /// # Example
5125 /// ```ignore,no_run
5126 /// # use google_cloud_securitycenter_v2::model::File;
5127 /// let x = File::new().set_path("example");
5128 /// ```
5129 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5130 self.path = v.into();
5131 self
5132 }
5133
5134 /// Sets the value of [size][crate::model::File::size].
5135 ///
5136 /// # Example
5137 /// ```ignore,no_run
5138 /// # use google_cloud_securitycenter_v2::model::File;
5139 /// let x = File::new().set_size(42);
5140 /// ```
5141 pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5142 self.size = v.into();
5143 self
5144 }
5145
5146 /// Sets the value of [sha256][crate::model::File::sha256].
5147 ///
5148 /// # Example
5149 /// ```ignore,no_run
5150 /// # use google_cloud_securitycenter_v2::model::File;
5151 /// let x = File::new().set_sha256("example");
5152 /// ```
5153 pub fn set_sha256<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5154 self.sha256 = v.into();
5155 self
5156 }
5157
5158 /// Sets the value of [hashed_size][crate::model::File::hashed_size].
5159 ///
5160 /// # Example
5161 /// ```ignore,no_run
5162 /// # use google_cloud_securitycenter_v2::model::File;
5163 /// let x = File::new().set_hashed_size(42);
5164 /// ```
5165 pub fn set_hashed_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5166 self.hashed_size = v.into();
5167 self
5168 }
5169
5170 /// Sets the value of [partially_hashed][crate::model::File::partially_hashed].
5171 ///
5172 /// # Example
5173 /// ```ignore,no_run
5174 /// # use google_cloud_securitycenter_v2::model::File;
5175 /// let x = File::new().set_partially_hashed(true);
5176 /// ```
5177 pub fn set_partially_hashed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5178 self.partially_hashed = v.into();
5179 self
5180 }
5181
5182 /// Sets the value of [contents][crate::model::File::contents].
5183 ///
5184 /// # Example
5185 /// ```ignore,no_run
5186 /// # use google_cloud_securitycenter_v2::model::File;
5187 /// let x = File::new().set_contents("example");
5188 /// ```
5189 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5190 self.contents = v.into();
5191 self
5192 }
5193
5194 /// Sets the value of [disk_path][crate::model::File::disk_path].
5195 ///
5196 /// # Example
5197 /// ```ignore,no_run
5198 /// # use google_cloud_securitycenter_v2::model::File;
5199 /// use google_cloud_securitycenter_v2::model::file::DiskPath;
5200 /// let x = File::new().set_disk_path(DiskPath::default()/* use setters */);
5201 /// ```
5202 pub fn set_disk_path<T>(mut self, v: T) -> Self
5203 where
5204 T: std::convert::Into<crate::model::file::DiskPath>,
5205 {
5206 self.disk_path = std::option::Option::Some(v.into());
5207 self
5208 }
5209
5210 /// Sets or clears the value of [disk_path][crate::model::File::disk_path].
5211 ///
5212 /// # Example
5213 /// ```ignore,no_run
5214 /// # use google_cloud_securitycenter_v2::model::File;
5215 /// use google_cloud_securitycenter_v2::model::file::DiskPath;
5216 /// let x = File::new().set_or_clear_disk_path(Some(DiskPath::default()/* use setters */));
5217 /// let x = File::new().set_or_clear_disk_path(None::<DiskPath>);
5218 /// ```
5219 pub fn set_or_clear_disk_path<T>(mut self, v: std::option::Option<T>) -> Self
5220 where
5221 T: std::convert::Into<crate::model::file::DiskPath>,
5222 {
5223 self.disk_path = v.map(|x| x.into());
5224 self
5225 }
5226
5227 /// Sets the value of [operations][crate::model::File::operations].
5228 ///
5229 /// # Example
5230 /// ```ignore,no_run
5231 /// # use google_cloud_securitycenter_v2::model::File;
5232 /// use google_cloud_securitycenter_v2::model::file::FileOperation;
5233 /// let x = File::new()
5234 /// .set_operations([
5235 /// FileOperation::default()/* use setters */,
5236 /// FileOperation::default()/* use (different) setters */,
5237 /// ]);
5238 /// ```
5239 pub fn set_operations<T, V>(mut self, v: T) -> Self
5240 where
5241 T: std::iter::IntoIterator<Item = V>,
5242 V: std::convert::Into<crate::model::file::FileOperation>,
5243 {
5244 use std::iter::Iterator;
5245 self.operations = v.into_iter().map(|i| i.into()).collect();
5246 self
5247 }
5248}
5249
5250impl wkt::message::Message for File {
5251 fn typename() -> &'static str {
5252 "type.googleapis.com/google.cloud.securitycenter.v2.File"
5253 }
5254}
5255
5256/// Defines additional types related to [File].
5257pub mod file {
5258 #[allow(unused_imports)]
5259 use super::*;
5260
5261 /// Path of the file in terms of underlying disk/partition identifiers.
5262 #[derive(Clone, Default, PartialEq)]
5263 #[non_exhaustive]
5264 pub struct DiskPath {
5265 /// UUID of the partition (format
5266 /// <https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid>)
5267 pub partition_uuid: std::string::String,
5268
5269 /// Relative path of the file in the partition as a JSON encoded string.
5270 /// Example: /home/user1/executable_file.sh
5271 pub relative_path: std::string::String,
5272
5273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5274 }
5275
5276 impl DiskPath {
5277 pub fn new() -> Self {
5278 std::default::Default::default()
5279 }
5280
5281 /// Sets the value of [partition_uuid][crate::model::file::DiskPath::partition_uuid].
5282 ///
5283 /// # Example
5284 /// ```ignore,no_run
5285 /// # use google_cloud_securitycenter_v2::model::file::DiskPath;
5286 /// let x = DiskPath::new().set_partition_uuid("example");
5287 /// ```
5288 pub fn set_partition_uuid<T: std::convert::Into<std::string::String>>(
5289 mut self,
5290 v: T,
5291 ) -> Self {
5292 self.partition_uuid = v.into();
5293 self
5294 }
5295
5296 /// Sets the value of [relative_path][crate::model::file::DiskPath::relative_path].
5297 ///
5298 /// # Example
5299 /// ```ignore,no_run
5300 /// # use google_cloud_securitycenter_v2::model::file::DiskPath;
5301 /// let x = DiskPath::new().set_relative_path("example");
5302 /// ```
5303 pub fn set_relative_path<T: std::convert::Into<std::string::String>>(
5304 mut self,
5305 v: T,
5306 ) -> Self {
5307 self.relative_path = v.into();
5308 self
5309 }
5310 }
5311
5312 impl wkt::message::Message for DiskPath {
5313 fn typename() -> &'static str {
5314 "type.googleapis.com/google.cloud.securitycenter.v2.File.DiskPath"
5315 }
5316 }
5317
5318 /// Operation(s) performed on a file.
5319 #[derive(Clone, Default, PartialEq)]
5320 #[non_exhaustive]
5321 pub struct FileOperation {
5322 /// The type of the operation
5323 pub r#type: crate::model::file::file_operation::OperationType,
5324
5325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5326 }
5327
5328 impl FileOperation {
5329 pub fn new() -> Self {
5330 std::default::Default::default()
5331 }
5332
5333 /// Sets the value of [r#type][crate::model::file::FileOperation::type].
5334 ///
5335 /// # Example
5336 /// ```ignore,no_run
5337 /// # use google_cloud_securitycenter_v2::model::file::FileOperation;
5338 /// use google_cloud_securitycenter_v2::model::file::file_operation::OperationType;
5339 /// let x0 = FileOperation::new().set_type(OperationType::Open);
5340 /// let x1 = FileOperation::new().set_type(OperationType::Read);
5341 /// let x2 = FileOperation::new().set_type(OperationType::Rename);
5342 /// ```
5343 pub fn set_type<
5344 T: std::convert::Into<crate::model::file::file_operation::OperationType>,
5345 >(
5346 mut self,
5347 v: T,
5348 ) -> Self {
5349 self.r#type = v.into();
5350 self
5351 }
5352 }
5353
5354 impl wkt::message::Message for FileOperation {
5355 fn typename() -> &'static str {
5356 "type.googleapis.com/google.cloud.securitycenter.v2.File.FileOperation"
5357 }
5358 }
5359
5360 /// Defines additional types related to [FileOperation].
5361 pub mod file_operation {
5362 #[allow(unused_imports)]
5363 use super::*;
5364
5365 /// The type of the operation
5366 ///
5367 /// # Working with unknown values
5368 ///
5369 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5370 /// additional enum variants at any time. Adding new variants is not considered
5371 /// a breaking change. Applications should write their code in anticipation of:
5372 ///
5373 /// - New values appearing in future releases of the client library, **and**
5374 /// - New values received dynamically, without application changes.
5375 ///
5376 /// Please consult the [Working with enums] section in the user guide for some
5377 /// guidelines.
5378 ///
5379 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5380 #[derive(Clone, Debug, PartialEq)]
5381 #[non_exhaustive]
5382 pub enum OperationType {
5383 /// The operation is unspecified.
5384 Unspecified,
5385 /// Represents an open operation.
5386 Open,
5387 /// Represents a read operation.
5388 Read,
5389 /// Represents a rename operation.
5390 Rename,
5391 /// Represents a write operation.
5392 Write,
5393 /// Represents an execute operation.
5394 Execute,
5395 /// If set, the enum was initialized with an unknown value.
5396 ///
5397 /// Applications can examine the value using [OperationType::value] or
5398 /// [OperationType::name].
5399 UnknownValue(operation_type::UnknownValue),
5400 }
5401
5402 #[doc(hidden)]
5403 pub mod operation_type {
5404 #[allow(unused_imports)]
5405 use super::*;
5406 #[derive(Clone, Debug, PartialEq)]
5407 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5408 }
5409
5410 impl OperationType {
5411 /// Gets the enum value.
5412 ///
5413 /// Returns `None` if the enum contains an unknown value deserialized from
5414 /// the string representation of enums.
5415 pub fn value(&self) -> std::option::Option<i32> {
5416 match self {
5417 Self::Unspecified => std::option::Option::Some(0),
5418 Self::Open => std::option::Option::Some(1),
5419 Self::Read => std::option::Option::Some(2),
5420 Self::Rename => std::option::Option::Some(3),
5421 Self::Write => std::option::Option::Some(4),
5422 Self::Execute => std::option::Option::Some(5),
5423 Self::UnknownValue(u) => u.0.value(),
5424 }
5425 }
5426
5427 /// Gets the enum value as a string.
5428 ///
5429 /// Returns `None` if the enum contains an unknown value deserialized from
5430 /// the integer representation of enums.
5431 pub fn name(&self) -> std::option::Option<&str> {
5432 match self {
5433 Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
5434 Self::Open => std::option::Option::Some("OPEN"),
5435 Self::Read => std::option::Option::Some("READ"),
5436 Self::Rename => std::option::Option::Some("RENAME"),
5437 Self::Write => std::option::Option::Some("WRITE"),
5438 Self::Execute => std::option::Option::Some("EXECUTE"),
5439 Self::UnknownValue(u) => u.0.name(),
5440 }
5441 }
5442 }
5443
5444 impl std::default::Default for OperationType {
5445 fn default() -> Self {
5446 use std::convert::From;
5447 Self::from(0)
5448 }
5449 }
5450
5451 impl std::fmt::Display for OperationType {
5452 fn fmt(
5453 &self,
5454 f: &mut std::fmt::Formatter<'_>,
5455 ) -> std::result::Result<(), std::fmt::Error> {
5456 wkt::internal::display_enum(f, self.name(), self.value())
5457 }
5458 }
5459
5460 impl std::convert::From<i32> for OperationType {
5461 fn from(value: i32) -> Self {
5462 match value {
5463 0 => Self::Unspecified,
5464 1 => Self::Open,
5465 2 => Self::Read,
5466 3 => Self::Rename,
5467 4 => Self::Write,
5468 5 => Self::Execute,
5469 _ => Self::UnknownValue(operation_type::UnknownValue(
5470 wkt::internal::UnknownEnumValue::Integer(value),
5471 )),
5472 }
5473 }
5474 }
5475
5476 impl std::convert::From<&str> for OperationType {
5477 fn from(value: &str) -> Self {
5478 use std::string::ToString;
5479 match value {
5480 "OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
5481 "OPEN" => Self::Open,
5482 "READ" => Self::Read,
5483 "RENAME" => Self::Rename,
5484 "WRITE" => Self::Write,
5485 "EXECUTE" => Self::Execute,
5486 _ => Self::UnknownValue(operation_type::UnknownValue(
5487 wkt::internal::UnknownEnumValue::String(value.to_string()),
5488 )),
5489 }
5490 }
5491 }
5492
5493 impl serde::ser::Serialize for OperationType {
5494 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5495 where
5496 S: serde::Serializer,
5497 {
5498 match self {
5499 Self::Unspecified => serializer.serialize_i32(0),
5500 Self::Open => serializer.serialize_i32(1),
5501 Self::Read => serializer.serialize_i32(2),
5502 Self::Rename => serializer.serialize_i32(3),
5503 Self::Write => serializer.serialize_i32(4),
5504 Self::Execute => serializer.serialize_i32(5),
5505 Self::UnknownValue(u) => u.0.serialize(serializer),
5506 }
5507 }
5508 }
5509
5510 impl<'de> serde::de::Deserialize<'de> for OperationType {
5511 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5512 where
5513 D: serde::Deserializer<'de>,
5514 {
5515 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
5516 ".google.cloud.securitycenter.v2.File.FileOperation.OperationType",
5517 ))
5518 }
5519 }
5520 }
5521}
5522
5523/// Security Command Center finding.
5524///
5525/// A finding is a record of assessment data like security, risk, health, or
5526/// privacy, that is ingested into Security Command Center for presentation,
5527/// notification, analysis, policy testing, and enforcement. For example, a
5528/// cross-site scripting (XSS) vulnerability in an App Engine application is a
5529/// finding.
5530#[derive(Clone, Default, PartialEq)]
5531#[non_exhaustive]
5532pub struct Finding {
5533 /// Identifier. The [relative resource
5534 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
5535 /// of the finding. The following list shows some examples:
5536 ///
5537 ///
5538 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
5539 /// +
5540 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5541 ///
5542 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
5543 ///
5544 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5545 ///
5546 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
5547 ///
5548 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5549 pub name: std::string::String,
5550
5551 /// Output only. The canonical name of the finding. The following list shows
5552 /// some examples:
5553 ///
5554 ///
5555 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
5556 /// +
5557 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5558 ///
5559 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
5560 ///
5561 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5562 ///
5563 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
5564 ///
5565 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5566 ///
5567 /// The prefix is the closest CRM ancestor of the resource associated with the
5568 /// finding.
5569 pub canonical_name: std::string::String,
5570
5571 /// The relative resource name of the source and location the finding belongs
5572 /// to. See:
5573 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
5574 /// This field is immutable after creation time. The following list shows some
5575 /// examples:
5576 ///
5577 /// + `organizations/{organization_id}/sources/{source_id}`
5578 /// + `folders/{folders_id}/sources/{source_id}`
5579 /// + `projects/{projects_id}/sources/{source_id}`
5580 ///
5581 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}`
5582 ///
5583 /// + `folders/{folders_id}/sources/{source_id}/locations/{location_id}`
5584 /// + `projects/{projects_id}/sources/{source_id}/locations/{location_id}`
5585 pub parent: std::string::String,
5586
5587 /// Immutable. For findings on Google Cloud resources, the full resource
5588 /// name of the Google Cloud resource this finding is for. See:
5589 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
5590 /// When the finding is for a non-Google Cloud resource, the resourceName can
5591 /// be a customer or partner defined string.
5592 pub resource_name: std::string::String,
5593
5594 /// Output only. The state of the finding.
5595 pub state: crate::model::finding::State,
5596
5597 /// Immutable. The additional taxonomy group within findings from a given
5598 /// source. Example: "XSS_FLASH_INJECTION"
5599 pub category: std::string::String,
5600
5601 /// The URI that, if available, points to a web page outside of Security
5602 /// Command Center where additional information about the finding can be found.
5603 /// This field is guaranteed to be either empty or a well formed URL.
5604 pub external_uri: std::string::String,
5605
5606 /// Source specific properties. These properties are managed by the source
5607 /// that writes the finding. The key names in the source_properties map must be
5608 /// between 1 and 255 characters, and must start with a letter and contain
5609 /// alphanumeric characters or underscores only.
5610 pub source_properties: std::collections::HashMap<std::string::String, wkt::Value>,
5611
5612 /// Output only. User specified security marks. These marks are entirely
5613 /// managed by the user and come from the SecurityMarks resource that belongs
5614 /// to the finding.
5615 pub security_marks: std::option::Option<crate::model::SecurityMarks>,
5616
5617 /// The time the finding was first detected. If an existing finding is updated,
5618 /// then this is the time the update occurred.
5619 /// For example, if the finding represents an open firewall, this property
5620 /// captures the time the detector believes the firewall became open. The
5621 /// accuracy is determined by the detector. If the finding is later resolved,
5622 /// then this time reflects when the finding was resolved. This must not
5623 /// be set to a value greater than the current timestamp.
5624 pub event_time: std::option::Option<wkt::Timestamp>,
5625
5626 /// Output only. The time at which the finding was created in Security Command
5627 /// Center.
5628 pub create_time: std::option::Option<wkt::Timestamp>,
5629
5630 /// The severity of the finding. This field is managed by the source that
5631 /// writes the finding.
5632 pub severity: crate::model::finding::Severity,
5633
5634 /// Indicates the mute state of a finding (either muted, unmuted
5635 /// or undefined). Unlike other attributes of a finding, a finding provider
5636 /// shouldn't set the value of mute.
5637 pub mute: crate::model::finding::Mute,
5638
5639 /// Output only. The mute information regarding this finding.
5640 pub mute_info: std::option::Option<crate::model::finding::MuteInfo>,
5641
5642 /// The class of the finding.
5643 pub finding_class: crate::model::finding::FindingClass,
5644
5645 /// Represents what's commonly known as an *indicator of compromise* (IoC) in
5646 /// computer forensics. This is an artifact observed on a network or in an
5647 /// operating system that, with high confidence, indicates a computer
5648 /// intrusion. For more information, see [Indicator of
5649 /// compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise).
5650 pub indicator: std::option::Option<crate::model::Indicator>,
5651
5652 /// Represents vulnerability-specific fields like CVE and CVSS scores.
5653 /// CVE stands for Common Vulnerabilities and Exposures
5654 /// (<https://cve.mitre.org/about/>)
5655 pub vulnerability: std::option::Option<crate::model::Vulnerability>,
5656
5657 /// Output only. The most recent time this finding was muted or unmuted.
5658 pub mute_update_time: std::option::Option<wkt::Timestamp>,
5659
5660 /// Output only. Third party SIEM/SOAR fields within SCC, contains external
5661 /// system information and external system finding fields.
5662 pub external_systems:
5663 std::collections::HashMap<std::string::String, crate::model::ExternalSystem>,
5664
5665 /// MITRE ATT&CK tactics and techniques related to this finding.
5666 /// See: <https://attack.mitre.org>
5667 pub mitre_attack: std::option::Option<crate::model::MitreAttack>,
5668
5669 /// Access details associated with the finding, such as more information on the
5670 /// caller, which method was accessed, and from where.
5671 pub access: std::option::Option<crate::model::Access>,
5672
5673 /// Contains information about the IP connection associated with the finding.
5674 pub connections: std::vec::Vec<crate::model::Connection>,
5675
5676 /// Records additional information about the mute operation, for example, the
5677 /// [mute
5678 /// configuration](https://cloud.google.com/security-command-center/docs/how-to-mute-findings)
5679 /// that muted the finding and the user who muted the finding.
5680 pub mute_initiator: std::string::String,
5681
5682 /// Represents operating system processes associated with the Finding.
5683 pub processes: std::vec::Vec<crate::model::Process>,
5684
5685 /// Output only. Map containing the points of contact for the given finding.
5686 /// The key represents the type of contact, while the value contains a list of
5687 /// all the contacts that pertain. Please refer to:
5688 /// <https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories>
5689 ///
5690 /// ```norust
5691 /// {
5692 /// "security": {
5693 /// "contacts": [
5694 /// {
5695 /// "email": "person1@company.com"
5696 /// },
5697 /// {
5698 /// "email": "person2@company.com"
5699 /// }
5700 /// ]
5701 /// }
5702 /// }
5703 /// ```
5704 pub contacts: std::collections::HashMap<std::string::String, crate::model::ContactDetails>,
5705
5706 /// Contains compliance information for security standards associated to the
5707 /// finding.
5708 pub compliances: std::vec::Vec<crate::model::Compliance>,
5709
5710 /// Output only. The human readable display name of the finding source such as
5711 /// "Event Threat Detection" or "Security Health Analytics".
5712 pub parent_display_name: std::string::String,
5713
5714 /// Contains more details about the finding.
5715 pub description: std::string::String,
5716
5717 /// Represents exfiltrations associated with the finding.
5718 pub exfiltration: std::option::Option<crate::model::Exfiltration>,
5719
5720 /// Represents IAM bindings associated with the finding.
5721 pub iam_bindings: std::vec::Vec<crate::model::IamBinding>,
5722
5723 /// Steps to address the finding.
5724 pub next_steps: std::string::String,
5725
5726 /// Unique identifier of the module which generated the finding.
5727 /// Example:
5728 /// folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885
5729 pub module_name: std::string::String,
5730
5731 /// Containers associated with the finding. This field provides information for
5732 /// both Kubernetes and non-Kubernetes containers.
5733 pub containers: std::vec::Vec<crate::model::Container>,
5734
5735 /// Kubernetes resources associated with the finding.
5736 pub kubernetes: std::option::Option<crate::model::Kubernetes>,
5737
5738 /// Database associated with the finding.
5739 pub database: std::option::Option<crate::model::Database>,
5740
5741 /// The results of an attack path simulation relevant to this finding.
5742 pub attack_exposure: std::option::Option<crate::model::AttackExposure>,
5743
5744 /// File associated with the finding.
5745 pub files: std::vec::Vec<crate::model::File>,
5746
5747 /// Cloud Data Loss Prevention (Cloud DLP) inspection results that are
5748 /// associated with the finding.
5749 pub cloud_dlp_inspection: std::option::Option<crate::model::CloudDlpInspection>,
5750
5751 /// Cloud DLP data profile that is associated with the finding.
5752 pub cloud_dlp_data_profile: std::option::Option<crate::model::CloudDlpDataProfile>,
5753
5754 /// Signature of the kernel rootkit.
5755 pub kernel_rootkit: std::option::Option<crate::model::KernelRootkit>,
5756
5757 /// Contains information about the org policies associated with the finding.
5758 pub org_policies: std::vec::Vec<crate::model::OrgPolicy>,
5759
5760 /// Job associated with the finding.
5761 pub job: std::option::Option<crate::model::Job>,
5762
5763 /// Represents an application associated with the finding.
5764 pub application: std::option::Option<crate::model::Application>,
5765
5766 /// IP rules associated with the finding.
5767 pub ip_rules: std::option::Option<crate::model::IpRules>,
5768
5769 /// Fields related to Backup and DR findings.
5770 pub backup_disaster_recovery: std::option::Option<crate::model::BackupDisasterRecovery>,
5771
5772 /// The security posture associated with the finding.
5773 pub security_posture: std::option::Option<crate::model::SecurityPosture>,
5774
5775 /// Log entries that are relevant to the finding.
5776 pub log_entries: std::vec::Vec<crate::model::LogEntry>,
5777
5778 /// The load balancers associated with the finding.
5779 pub load_balancers: std::vec::Vec<crate::model::LoadBalancer>,
5780
5781 /// Fields related to Cloud Armor findings.
5782 pub cloud_armor: std::option::Option<crate::model::CloudArmor>,
5783
5784 /// Notebook associated with the finding.
5785 pub notebook: std::option::Option<crate::model::Notebook>,
5786
5787 /// Contains details about a group of security issues that, when the issues
5788 /// occur together, represent a greater risk than when the issues occur
5789 /// independently. A group of such issues is referred to as a toxic
5790 /// combination.
5791 /// This field cannot be updated. Its value is ignored in all update requests.
5792 pub toxic_combination: std::option::Option<crate::model::ToxicCombination>,
5793
5794 /// Contains details about groups of which this finding is a member. A group is
5795 /// a collection of findings that are related in some way.
5796 /// This field cannot be updated. Its value is ignored in all update requests.
5797 pub group_memberships: std::vec::Vec<crate::model::GroupMembership>,
5798
5799 /// Disk associated with the finding.
5800 pub disk: std::option::Option<crate::model::Disk>,
5801
5802 /// Data access events associated with the finding.
5803 pub data_access_events: std::vec::Vec<crate::model::DataAccessEvent>,
5804
5805 /// Data flow events associated with the finding.
5806 pub data_flow_events: std::vec::Vec<crate::model::DataFlowEvent>,
5807
5808 /// Represents the VPC networks that the resource is attached to.
5809 pub networks: std::vec::Vec<crate::model::Network>,
5810
5811 /// Data retention deletion events associated with the finding.
5812 pub data_retention_deletion_events: std::vec::Vec<crate::model::DataRetentionDeletionEvent>,
5813
5814 /// AffectedResources associated with the finding.
5815 pub affected_resources: std::option::Option<crate::model::AffectedResources>,
5816
5817 /// The AI model associated with the finding.
5818 pub ai_model: std::option::Option<crate::model::AiModel>,
5819
5820 /// Contains details about a chokepoint, which is a resource or resource group
5821 /// where high-risk attack paths converge, based on [attack path simulations]
5822 /// (<https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations>).
5823 /// This field cannot be updated. Its value is ignored in all update requests.
5824 pub chokepoint: std::option::Option<crate::model::Chokepoint>,
5825
5826 /// VertexAi associated with the finding.
5827 pub vertex_ai: std::option::Option<crate::model::VertexAi>,
5828
5829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5830}
5831
5832impl Finding {
5833 pub fn new() -> Self {
5834 std::default::Default::default()
5835 }
5836
5837 /// Sets the value of [name][crate::model::Finding::name].
5838 ///
5839 /// # Example
5840 /// ```ignore,no_run
5841 /// # use google_cloud_securitycenter_v2::model::Finding;
5842 /// let x = Finding::new().set_name("example");
5843 /// ```
5844 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5845 self.name = v.into();
5846 self
5847 }
5848
5849 /// Sets the value of [canonical_name][crate::model::Finding::canonical_name].
5850 ///
5851 /// # Example
5852 /// ```ignore,no_run
5853 /// # use google_cloud_securitycenter_v2::model::Finding;
5854 /// let x = Finding::new().set_canonical_name("example");
5855 /// ```
5856 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5857 self.canonical_name = v.into();
5858 self
5859 }
5860
5861 /// Sets the value of [parent][crate::model::Finding::parent].
5862 ///
5863 /// # Example
5864 /// ```ignore,no_run
5865 /// # use google_cloud_securitycenter_v2::model::Finding;
5866 /// let x = Finding::new().set_parent("example");
5867 /// ```
5868 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5869 self.parent = v.into();
5870 self
5871 }
5872
5873 /// Sets the value of [resource_name][crate::model::Finding::resource_name].
5874 ///
5875 /// # Example
5876 /// ```ignore,no_run
5877 /// # use google_cloud_securitycenter_v2::model::Finding;
5878 /// let x = Finding::new().set_resource_name("example");
5879 /// ```
5880 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5881 self.resource_name = v.into();
5882 self
5883 }
5884
5885 /// Sets the value of [state][crate::model::Finding::state].
5886 ///
5887 /// # Example
5888 /// ```ignore,no_run
5889 /// # use google_cloud_securitycenter_v2::model::Finding;
5890 /// use google_cloud_securitycenter_v2::model::finding::State;
5891 /// let x0 = Finding::new().set_state(State::Active);
5892 /// let x1 = Finding::new().set_state(State::Inactive);
5893 /// ```
5894 pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
5895 self.state = v.into();
5896 self
5897 }
5898
5899 /// Sets the value of [category][crate::model::Finding::category].
5900 ///
5901 /// # Example
5902 /// ```ignore,no_run
5903 /// # use google_cloud_securitycenter_v2::model::Finding;
5904 /// let x = Finding::new().set_category("example");
5905 /// ```
5906 pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5907 self.category = v.into();
5908 self
5909 }
5910
5911 /// Sets the value of [external_uri][crate::model::Finding::external_uri].
5912 ///
5913 /// # Example
5914 /// ```ignore,no_run
5915 /// # use google_cloud_securitycenter_v2::model::Finding;
5916 /// let x = Finding::new().set_external_uri("example");
5917 /// ```
5918 pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5919 self.external_uri = v.into();
5920 self
5921 }
5922
5923 /// Sets the value of [source_properties][crate::model::Finding::source_properties].
5924 ///
5925 /// # Example
5926 /// ```ignore,no_run
5927 /// # use google_cloud_securitycenter_v2::model::Finding;
5928 /// use wkt::Value;
5929 /// let x = Finding::new().set_source_properties([
5930 /// ("key0", Value::default()/* use setters */),
5931 /// ("key1", Value::default()/* use (different) setters */),
5932 /// ]);
5933 /// ```
5934 pub fn set_source_properties<T, K, V>(mut self, v: T) -> Self
5935 where
5936 T: std::iter::IntoIterator<Item = (K, V)>,
5937 K: std::convert::Into<std::string::String>,
5938 V: std::convert::Into<wkt::Value>,
5939 {
5940 use std::iter::Iterator;
5941 self.source_properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5942 self
5943 }
5944
5945 /// Sets the value of [security_marks][crate::model::Finding::security_marks].
5946 ///
5947 /// # Example
5948 /// ```ignore,no_run
5949 /// # use google_cloud_securitycenter_v2::model::Finding;
5950 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
5951 /// let x = Finding::new().set_security_marks(SecurityMarks::default()/* use setters */);
5952 /// ```
5953 pub fn set_security_marks<T>(mut self, v: T) -> Self
5954 where
5955 T: std::convert::Into<crate::model::SecurityMarks>,
5956 {
5957 self.security_marks = std::option::Option::Some(v.into());
5958 self
5959 }
5960
5961 /// Sets or clears the value of [security_marks][crate::model::Finding::security_marks].
5962 ///
5963 /// # Example
5964 /// ```ignore,no_run
5965 /// # use google_cloud_securitycenter_v2::model::Finding;
5966 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
5967 /// let x = Finding::new().set_or_clear_security_marks(Some(SecurityMarks::default()/* use setters */));
5968 /// let x = Finding::new().set_or_clear_security_marks(None::<SecurityMarks>);
5969 /// ```
5970 pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
5971 where
5972 T: std::convert::Into<crate::model::SecurityMarks>,
5973 {
5974 self.security_marks = v.map(|x| x.into());
5975 self
5976 }
5977
5978 /// Sets the value of [event_time][crate::model::Finding::event_time].
5979 ///
5980 /// # Example
5981 /// ```ignore,no_run
5982 /// # use google_cloud_securitycenter_v2::model::Finding;
5983 /// use wkt::Timestamp;
5984 /// let x = Finding::new().set_event_time(Timestamp::default()/* use setters */);
5985 /// ```
5986 pub fn set_event_time<T>(mut self, v: T) -> Self
5987 where
5988 T: std::convert::Into<wkt::Timestamp>,
5989 {
5990 self.event_time = std::option::Option::Some(v.into());
5991 self
5992 }
5993
5994 /// Sets or clears the value of [event_time][crate::model::Finding::event_time].
5995 ///
5996 /// # Example
5997 /// ```ignore,no_run
5998 /// # use google_cloud_securitycenter_v2::model::Finding;
5999 /// use wkt::Timestamp;
6000 /// let x = Finding::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
6001 /// let x = Finding::new().set_or_clear_event_time(None::<Timestamp>);
6002 /// ```
6003 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
6004 where
6005 T: std::convert::Into<wkt::Timestamp>,
6006 {
6007 self.event_time = v.map(|x| x.into());
6008 self
6009 }
6010
6011 /// Sets the value of [create_time][crate::model::Finding::create_time].
6012 ///
6013 /// # Example
6014 /// ```ignore,no_run
6015 /// # use google_cloud_securitycenter_v2::model::Finding;
6016 /// use wkt::Timestamp;
6017 /// let x = Finding::new().set_create_time(Timestamp::default()/* use setters */);
6018 /// ```
6019 pub fn set_create_time<T>(mut self, v: T) -> Self
6020 where
6021 T: std::convert::Into<wkt::Timestamp>,
6022 {
6023 self.create_time = std::option::Option::Some(v.into());
6024 self
6025 }
6026
6027 /// Sets or clears the value of [create_time][crate::model::Finding::create_time].
6028 ///
6029 /// # Example
6030 /// ```ignore,no_run
6031 /// # use google_cloud_securitycenter_v2::model::Finding;
6032 /// use wkt::Timestamp;
6033 /// let x = Finding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6034 /// let x = Finding::new().set_or_clear_create_time(None::<Timestamp>);
6035 /// ```
6036 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6037 where
6038 T: std::convert::Into<wkt::Timestamp>,
6039 {
6040 self.create_time = v.map(|x| x.into());
6041 self
6042 }
6043
6044 /// Sets the value of [severity][crate::model::Finding::severity].
6045 ///
6046 /// # Example
6047 /// ```ignore,no_run
6048 /// # use google_cloud_securitycenter_v2::model::Finding;
6049 /// use google_cloud_securitycenter_v2::model::finding::Severity;
6050 /// let x0 = Finding::new().set_severity(Severity::Critical);
6051 /// let x1 = Finding::new().set_severity(Severity::High);
6052 /// let x2 = Finding::new().set_severity(Severity::Medium);
6053 /// ```
6054 pub fn set_severity<T: std::convert::Into<crate::model::finding::Severity>>(
6055 mut self,
6056 v: T,
6057 ) -> Self {
6058 self.severity = v.into();
6059 self
6060 }
6061
6062 /// Sets the value of [mute][crate::model::Finding::mute].
6063 ///
6064 /// # Example
6065 /// ```ignore,no_run
6066 /// # use google_cloud_securitycenter_v2::model::Finding;
6067 /// use google_cloud_securitycenter_v2::model::finding::Mute;
6068 /// let x0 = Finding::new().set_mute(Mute::Muted);
6069 /// let x1 = Finding::new().set_mute(Mute::Unmuted);
6070 /// let x2 = Finding::new().set_mute(Mute::Undefined);
6071 /// ```
6072 pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
6073 self.mute = v.into();
6074 self
6075 }
6076
6077 /// Sets the value of [mute_info][crate::model::Finding::mute_info].
6078 ///
6079 /// # Example
6080 /// ```ignore,no_run
6081 /// # use google_cloud_securitycenter_v2::model::Finding;
6082 /// use google_cloud_securitycenter_v2::model::finding::MuteInfo;
6083 /// let x = Finding::new().set_mute_info(MuteInfo::default()/* use setters */);
6084 /// ```
6085 pub fn set_mute_info<T>(mut self, v: T) -> Self
6086 where
6087 T: std::convert::Into<crate::model::finding::MuteInfo>,
6088 {
6089 self.mute_info = std::option::Option::Some(v.into());
6090 self
6091 }
6092
6093 /// Sets or clears the value of [mute_info][crate::model::Finding::mute_info].
6094 ///
6095 /// # Example
6096 /// ```ignore,no_run
6097 /// # use google_cloud_securitycenter_v2::model::Finding;
6098 /// use google_cloud_securitycenter_v2::model::finding::MuteInfo;
6099 /// let x = Finding::new().set_or_clear_mute_info(Some(MuteInfo::default()/* use setters */));
6100 /// let x = Finding::new().set_or_clear_mute_info(None::<MuteInfo>);
6101 /// ```
6102 pub fn set_or_clear_mute_info<T>(mut self, v: std::option::Option<T>) -> Self
6103 where
6104 T: std::convert::Into<crate::model::finding::MuteInfo>,
6105 {
6106 self.mute_info = v.map(|x| x.into());
6107 self
6108 }
6109
6110 /// Sets the value of [finding_class][crate::model::Finding::finding_class].
6111 ///
6112 /// # Example
6113 /// ```ignore,no_run
6114 /// # use google_cloud_securitycenter_v2::model::Finding;
6115 /// use google_cloud_securitycenter_v2::model::finding::FindingClass;
6116 /// let x0 = Finding::new().set_finding_class(FindingClass::Threat);
6117 /// let x1 = Finding::new().set_finding_class(FindingClass::Vulnerability);
6118 /// let x2 = Finding::new().set_finding_class(FindingClass::Misconfiguration);
6119 /// ```
6120 pub fn set_finding_class<T: std::convert::Into<crate::model::finding::FindingClass>>(
6121 mut self,
6122 v: T,
6123 ) -> Self {
6124 self.finding_class = v.into();
6125 self
6126 }
6127
6128 /// Sets the value of [indicator][crate::model::Finding::indicator].
6129 ///
6130 /// # Example
6131 /// ```ignore,no_run
6132 /// # use google_cloud_securitycenter_v2::model::Finding;
6133 /// use google_cloud_securitycenter_v2::model::Indicator;
6134 /// let x = Finding::new().set_indicator(Indicator::default()/* use setters */);
6135 /// ```
6136 pub fn set_indicator<T>(mut self, v: T) -> Self
6137 where
6138 T: std::convert::Into<crate::model::Indicator>,
6139 {
6140 self.indicator = std::option::Option::Some(v.into());
6141 self
6142 }
6143
6144 /// Sets or clears the value of [indicator][crate::model::Finding::indicator].
6145 ///
6146 /// # Example
6147 /// ```ignore,no_run
6148 /// # use google_cloud_securitycenter_v2::model::Finding;
6149 /// use google_cloud_securitycenter_v2::model::Indicator;
6150 /// let x = Finding::new().set_or_clear_indicator(Some(Indicator::default()/* use setters */));
6151 /// let x = Finding::new().set_or_clear_indicator(None::<Indicator>);
6152 /// ```
6153 pub fn set_or_clear_indicator<T>(mut self, v: std::option::Option<T>) -> Self
6154 where
6155 T: std::convert::Into<crate::model::Indicator>,
6156 {
6157 self.indicator = v.map(|x| x.into());
6158 self
6159 }
6160
6161 /// Sets the value of [vulnerability][crate::model::Finding::vulnerability].
6162 ///
6163 /// # Example
6164 /// ```ignore,no_run
6165 /// # use google_cloud_securitycenter_v2::model::Finding;
6166 /// use google_cloud_securitycenter_v2::model::Vulnerability;
6167 /// let x = Finding::new().set_vulnerability(Vulnerability::default()/* use setters */);
6168 /// ```
6169 pub fn set_vulnerability<T>(mut self, v: T) -> Self
6170 where
6171 T: std::convert::Into<crate::model::Vulnerability>,
6172 {
6173 self.vulnerability = std::option::Option::Some(v.into());
6174 self
6175 }
6176
6177 /// Sets or clears the value of [vulnerability][crate::model::Finding::vulnerability].
6178 ///
6179 /// # Example
6180 /// ```ignore,no_run
6181 /// # use google_cloud_securitycenter_v2::model::Finding;
6182 /// use google_cloud_securitycenter_v2::model::Vulnerability;
6183 /// let x = Finding::new().set_or_clear_vulnerability(Some(Vulnerability::default()/* use setters */));
6184 /// let x = Finding::new().set_or_clear_vulnerability(None::<Vulnerability>);
6185 /// ```
6186 pub fn set_or_clear_vulnerability<T>(mut self, v: std::option::Option<T>) -> Self
6187 where
6188 T: std::convert::Into<crate::model::Vulnerability>,
6189 {
6190 self.vulnerability = v.map(|x| x.into());
6191 self
6192 }
6193
6194 /// Sets the value of [mute_update_time][crate::model::Finding::mute_update_time].
6195 ///
6196 /// # Example
6197 /// ```ignore,no_run
6198 /// # use google_cloud_securitycenter_v2::model::Finding;
6199 /// use wkt::Timestamp;
6200 /// let x = Finding::new().set_mute_update_time(Timestamp::default()/* use setters */);
6201 /// ```
6202 pub fn set_mute_update_time<T>(mut self, v: T) -> Self
6203 where
6204 T: std::convert::Into<wkt::Timestamp>,
6205 {
6206 self.mute_update_time = std::option::Option::Some(v.into());
6207 self
6208 }
6209
6210 /// Sets or clears the value of [mute_update_time][crate::model::Finding::mute_update_time].
6211 ///
6212 /// # Example
6213 /// ```ignore,no_run
6214 /// # use google_cloud_securitycenter_v2::model::Finding;
6215 /// use wkt::Timestamp;
6216 /// let x = Finding::new().set_or_clear_mute_update_time(Some(Timestamp::default()/* use setters */));
6217 /// let x = Finding::new().set_or_clear_mute_update_time(None::<Timestamp>);
6218 /// ```
6219 pub fn set_or_clear_mute_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6220 where
6221 T: std::convert::Into<wkt::Timestamp>,
6222 {
6223 self.mute_update_time = v.map(|x| x.into());
6224 self
6225 }
6226
6227 /// Sets the value of [external_systems][crate::model::Finding::external_systems].
6228 ///
6229 /// # Example
6230 /// ```ignore,no_run
6231 /// # use google_cloud_securitycenter_v2::model::Finding;
6232 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
6233 /// let x = Finding::new().set_external_systems([
6234 /// ("key0", ExternalSystem::default()/* use setters */),
6235 /// ("key1", ExternalSystem::default()/* use (different) setters */),
6236 /// ]);
6237 /// ```
6238 pub fn set_external_systems<T, K, V>(mut self, v: T) -> Self
6239 where
6240 T: std::iter::IntoIterator<Item = (K, V)>,
6241 K: std::convert::Into<std::string::String>,
6242 V: std::convert::Into<crate::model::ExternalSystem>,
6243 {
6244 use std::iter::Iterator;
6245 self.external_systems = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6246 self
6247 }
6248
6249 /// Sets the value of [mitre_attack][crate::model::Finding::mitre_attack].
6250 ///
6251 /// # Example
6252 /// ```ignore,no_run
6253 /// # use google_cloud_securitycenter_v2::model::Finding;
6254 /// use google_cloud_securitycenter_v2::model::MitreAttack;
6255 /// let x = Finding::new().set_mitre_attack(MitreAttack::default()/* use setters */);
6256 /// ```
6257 pub fn set_mitre_attack<T>(mut self, v: T) -> Self
6258 where
6259 T: std::convert::Into<crate::model::MitreAttack>,
6260 {
6261 self.mitre_attack = std::option::Option::Some(v.into());
6262 self
6263 }
6264
6265 /// Sets or clears the value of [mitre_attack][crate::model::Finding::mitre_attack].
6266 ///
6267 /// # Example
6268 /// ```ignore,no_run
6269 /// # use google_cloud_securitycenter_v2::model::Finding;
6270 /// use google_cloud_securitycenter_v2::model::MitreAttack;
6271 /// let x = Finding::new().set_or_clear_mitre_attack(Some(MitreAttack::default()/* use setters */));
6272 /// let x = Finding::new().set_or_clear_mitre_attack(None::<MitreAttack>);
6273 /// ```
6274 pub fn set_or_clear_mitre_attack<T>(mut self, v: std::option::Option<T>) -> Self
6275 where
6276 T: std::convert::Into<crate::model::MitreAttack>,
6277 {
6278 self.mitre_attack = v.map(|x| x.into());
6279 self
6280 }
6281
6282 /// Sets the value of [access][crate::model::Finding::access].
6283 ///
6284 /// # Example
6285 /// ```ignore,no_run
6286 /// # use google_cloud_securitycenter_v2::model::Finding;
6287 /// use google_cloud_securitycenter_v2::model::Access;
6288 /// let x = Finding::new().set_access(Access::default()/* use setters */);
6289 /// ```
6290 pub fn set_access<T>(mut self, v: T) -> Self
6291 where
6292 T: std::convert::Into<crate::model::Access>,
6293 {
6294 self.access = std::option::Option::Some(v.into());
6295 self
6296 }
6297
6298 /// Sets or clears the value of [access][crate::model::Finding::access].
6299 ///
6300 /// # Example
6301 /// ```ignore,no_run
6302 /// # use google_cloud_securitycenter_v2::model::Finding;
6303 /// use google_cloud_securitycenter_v2::model::Access;
6304 /// let x = Finding::new().set_or_clear_access(Some(Access::default()/* use setters */));
6305 /// let x = Finding::new().set_or_clear_access(None::<Access>);
6306 /// ```
6307 pub fn set_or_clear_access<T>(mut self, v: std::option::Option<T>) -> Self
6308 where
6309 T: std::convert::Into<crate::model::Access>,
6310 {
6311 self.access = v.map(|x| x.into());
6312 self
6313 }
6314
6315 /// Sets the value of [connections][crate::model::Finding::connections].
6316 ///
6317 /// # Example
6318 /// ```ignore,no_run
6319 /// # use google_cloud_securitycenter_v2::model::Finding;
6320 /// use google_cloud_securitycenter_v2::model::Connection;
6321 /// let x = Finding::new()
6322 /// .set_connections([
6323 /// Connection::default()/* use setters */,
6324 /// Connection::default()/* use (different) setters */,
6325 /// ]);
6326 /// ```
6327 pub fn set_connections<T, V>(mut self, v: T) -> Self
6328 where
6329 T: std::iter::IntoIterator<Item = V>,
6330 V: std::convert::Into<crate::model::Connection>,
6331 {
6332 use std::iter::Iterator;
6333 self.connections = v.into_iter().map(|i| i.into()).collect();
6334 self
6335 }
6336
6337 /// Sets the value of [mute_initiator][crate::model::Finding::mute_initiator].
6338 ///
6339 /// # Example
6340 /// ```ignore,no_run
6341 /// # use google_cloud_securitycenter_v2::model::Finding;
6342 /// let x = Finding::new().set_mute_initiator("example");
6343 /// ```
6344 pub fn set_mute_initiator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6345 self.mute_initiator = v.into();
6346 self
6347 }
6348
6349 /// Sets the value of [processes][crate::model::Finding::processes].
6350 ///
6351 /// # Example
6352 /// ```ignore,no_run
6353 /// # use google_cloud_securitycenter_v2::model::Finding;
6354 /// use google_cloud_securitycenter_v2::model::Process;
6355 /// let x = Finding::new()
6356 /// .set_processes([
6357 /// Process::default()/* use setters */,
6358 /// Process::default()/* use (different) setters */,
6359 /// ]);
6360 /// ```
6361 pub fn set_processes<T, V>(mut self, v: T) -> Self
6362 where
6363 T: std::iter::IntoIterator<Item = V>,
6364 V: std::convert::Into<crate::model::Process>,
6365 {
6366 use std::iter::Iterator;
6367 self.processes = v.into_iter().map(|i| i.into()).collect();
6368 self
6369 }
6370
6371 /// Sets the value of [contacts][crate::model::Finding::contacts].
6372 ///
6373 /// # Example
6374 /// ```ignore,no_run
6375 /// # use google_cloud_securitycenter_v2::model::Finding;
6376 /// use google_cloud_securitycenter_v2::model::ContactDetails;
6377 /// let x = Finding::new().set_contacts([
6378 /// ("key0", ContactDetails::default()/* use setters */),
6379 /// ("key1", ContactDetails::default()/* use (different) setters */),
6380 /// ]);
6381 /// ```
6382 pub fn set_contacts<T, K, V>(mut self, v: T) -> Self
6383 where
6384 T: std::iter::IntoIterator<Item = (K, V)>,
6385 K: std::convert::Into<std::string::String>,
6386 V: std::convert::Into<crate::model::ContactDetails>,
6387 {
6388 use std::iter::Iterator;
6389 self.contacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6390 self
6391 }
6392
6393 /// Sets the value of [compliances][crate::model::Finding::compliances].
6394 ///
6395 /// # Example
6396 /// ```ignore,no_run
6397 /// # use google_cloud_securitycenter_v2::model::Finding;
6398 /// use google_cloud_securitycenter_v2::model::Compliance;
6399 /// let x = Finding::new()
6400 /// .set_compliances([
6401 /// Compliance::default()/* use setters */,
6402 /// Compliance::default()/* use (different) setters */,
6403 /// ]);
6404 /// ```
6405 pub fn set_compliances<T, V>(mut self, v: T) -> Self
6406 where
6407 T: std::iter::IntoIterator<Item = V>,
6408 V: std::convert::Into<crate::model::Compliance>,
6409 {
6410 use std::iter::Iterator;
6411 self.compliances = v.into_iter().map(|i| i.into()).collect();
6412 self
6413 }
6414
6415 /// Sets the value of [parent_display_name][crate::model::Finding::parent_display_name].
6416 ///
6417 /// # Example
6418 /// ```ignore,no_run
6419 /// # use google_cloud_securitycenter_v2::model::Finding;
6420 /// let x = Finding::new().set_parent_display_name("example");
6421 /// ```
6422 pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
6423 mut self,
6424 v: T,
6425 ) -> Self {
6426 self.parent_display_name = v.into();
6427 self
6428 }
6429
6430 /// Sets the value of [description][crate::model::Finding::description].
6431 ///
6432 /// # Example
6433 /// ```ignore,no_run
6434 /// # use google_cloud_securitycenter_v2::model::Finding;
6435 /// let x = Finding::new().set_description("example");
6436 /// ```
6437 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6438 self.description = v.into();
6439 self
6440 }
6441
6442 /// Sets the value of [exfiltration][crate::model::Finding::exfiltration].
6443 ///
6444 /// # Example
6445 /// ```ignore,no_run
6446 /// # use google_cloud_securitycenter_v2::model::Finding;
6447 /// use google_cloud_securitycenter_v2::model::Exfiltration;
6448 /// let x = Finding::new().set_exfiltration(Exfiltration::default()/* use setters */);
6449 /// ```
6450 pub fn set_exfiltration<T>(mut self, v: T) -> Self
6451 where
6452 T: std::convert::Into<crate::model::Exfiltration>,
6453 {
6454 self.exfiltration = std::option::Option::Some(v.into());
6455 self
6456 }
6457
6458 /// Sets or clears the value of [exfiltration][crate::model::Finding::exfiltration].
6459 ///
6460 /// # Example
6461 /// ```ignore,no_run
6462 /// # use google_cloud_securitycenter_v2::model::Finding;
6463 /// use google_cloud_securitycenter_v2::model::Exfiltration;
6464 /// let x = Finding::new().set_or_clear_exfiltration(Some(Exfiltration::default()/* use setters */));
6465 /// let x = Finding::new().set_or_clear_exfiltration(None::<Exfiltration>);
6466 /// ```
6467 pub fn set_or_clear_exfiltration<T>(mut self, v: std::option::Option<T>) -> Self
6468 where
6469 T: std::convert::Into<crate::model::Exfiltration>,
6470 {
6471 self.exfiltration = v.map(|x| x.into());
6472 self
6473 }
6474
6475 /// Sets the value of [iam_bindings][crate::model::Finding::iam_bindings].
6476 ///
6477 /// # Example
6478 /// ```ignore,no_run
6479 /// # use google_cloud_securitycenter_v2::model::Finding;
6480 /// use google_cloud_securitycenter_v2::model::IamBinding;
6481 /// let x = Finding::new()
6482 /// .set_iam_bindings([
6483 /// IamBinding::default()/* use setters */,
6484 /// IamBinding::default()/* use (different) setters */,
6485 /// ]);
6486 /// ```
6487 pub fn set_iam_bindings<T, V>(mut self, v: T) -> Self
6488 where
6489 T: std::iter::IntoIterator<Item = V>,
6490 V: std::convert::Into<crate::model::IamBinding>,
6491 {
6492 use std::iter::Iterator;
6493 self.iam_bindings = v.into_iter().map(|i| i.into()).collect();
6494 self
6495 }
6496
6497 /// Sets the value of [next_steps][crate::model::Finding::next_steps].
6498 ///
6499 /// # Example
6500 /// ```ignore,no_run
6501 /// # use google_cloud_securitycenter_v2::model::Finding;
6502 /// let x = Finding::new().set_next_steps("example");
6503 /// ```
6504 pub fn set_next_steps<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6505 self.next_steps = v.into();
6506 self
6507 }
6508
6509 /// Sets the value of [module_name][crate::model::Finding::module_name].
6510 ///
6511 /// # Example
6512 /// ```ignore,no_run
6513 /// # use google_cloud_securitycenter_v2::model::Finding;
6514 /// let x = Finding::new().set_module_name("example");
6515 /// ```
6516 pub fn set_module_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6517 self.module_name = v.into();
6518 self
6519 }
6520
6521 /// Sets the value of [containers][crate::model::Finding::containers].
6522 ///
6523 /// # Example
6524 /// ```ignore,no_run
6525 /// # use google_cloud_securitycenter_v2::model::Finding;
6526 /// use google_cloud_securitycenter_v2::model::Container;
6527 /// let x = Finding::new()
6528 /// .set_containers([
6529 /// Container::default()/* use setters */,
6530 /// Container::default()/* use (different) setters */,
6531 /// ]);
6532 /// ```
6533 pub fn set_containers<T, V>(mut self, v: T) -> Self
6534 where
6535 T: std::iter::IntoIterator<Item = V>,
6536 V: std::convert::Into<crate::model::Container>,
6537 {
6538 use std::iter::Iterator;
6539 self.containers = v.into_iter().map(|i| i.into()).collect();
6540 self
6541 }
6542
6543 /// Sets the value of [kubernetes][crate::model::Finding::kubernetes].
6544 ///
6545 /// # Example
6546 /// ```ignore,no_run
6547 /// # use google_cloud_securitycenter_v2::model::Finding;
6548 /// use google_cloud_securitycenter_v2::model::Kubernetes;
6549 /// let x = Finding::new().set_kubernetes(Kubernetes::default()/* use setters */);
6550 /// ```
6551 pub fn set_kubernetes<T>(mut self, v: T) -> Self
6552 where
6553 T: std::convert::Into<crate::model::Kubernetes>,
6554 {
6555 self.kubernetes = std::option::Option::Some(v.into());
6556 self
6557 }
6558
6559 /// Sets or clears the value of [kubernetes][crate::model::Finding::kubernetes].
6560 ///
6561 /// # Example
6562 /// ```ignore,no_run
6563 /// # use google_cloud_securitycenter_v2::model::Finding;
6564 /// use google_cloud_securitycenter_v2::model::Kubernetes;
6565 /// let x = Finding::new().set_or_clear_kubernetes(Some(Kubernetes::default()/* use setters */));
6566 /// let x = Finding::new().set_or_clear_kubernetes(None::<Kubernetes>);
6567 /// ```
6568 pub fn set_or_clear_kubernetes<T>(mut self, v: std::option::Option<T>) -> Self
6569 where
6570 T: std::convert::Into<crate::model::Kubernetes>,
6571 {
6572 self.kubernetes = v.map(|x| x.into());
6573 self
6574 }
6575
6576 /// Sets the value of [database][crate::model::Finding::database].
6577 ///
6578 /// # Example
6579 /// ```ignore,no_run
6580 /// # use google_cloud_securitycenter_v2::model::Finding;
6581 /// use google_cloud_securitycenter_v2::model::Database;
6582 /// let x = Finding::new().set_database(Database::default()/* use setters */);
6583 /// ```
6584 pub fn set_database<T>(mut self, v: T) -> Self
6585 where
6586 T: std::convert::Into<crate::model::Database>,
6587 {
6588 self.database = std::option::Option::Some(v.into());
6589 self
6590 }
6591
6592 /// Sets or clears the value of [database][crate::model::Finding::database].
6593 ///
6594 /// # Example
6595 /// ```ignore,no_run
6596 /// # use google_cloud_securitycenter_v2::model::Finding;
6597 /// use google_cloud_securitycenter_v2::model::Database;
6598 /// let x = Finding::new().set_or_clear_database(Some(Database::default()/* use setters */));
6599 /// let x = Finding::new().set_or_clear_database(None::<Database>);
6600 /// ```
6601 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
6602 where
6603 T: std::convert::Into<crate::model::Database>,
6604 {
6605 self.database = v.map(|x| x.into());
6606 self
6607 }
6608
6609 /// Sets the value of [attack_exposure][crate::model::Finding::attack_exposure].
6610 ///
6611 /// # Example
6612 /// ```ignore,no_run
6613 /// # use google_cloud_securitycenter_v2::model::Finding;
6614 /// use google_cloud_securitycenter_v2::model::AttackExposure;
6615 /// let x = Finding::new().set_attack_exposure(AttackExposure::default()/* use setters */);
6616 /// ```
6617 pub fn set_attack_exposure<T>(mut self, v: T) -> Self
6618 where
6619 T: std::convert::Into<crate::model::AttackExposure>,
6620 {
6621 self.attack_exposure = std::option::Option::Some(v.into());
6622 self
6623 }
6624
6625 /// Sets or clears the value of [attack_exposure][crate::model::Finding::attack_exposure].
6626 ///
6627 /// # Example
6628 /// ```ignore,no_run
6629 /// # use google_cloud_securitycenter_v2::model::Finding;
6630 /// use google_cloud_securitycenter_v2::model::AttackExposure;
6631 /// let x = Finding::new().set_or_clear_attack_exposure(Some(AttackExposure::default()/* use setters */));
6632 /// let x = Finding::new().set_or_clear_attack_exposure(None::<AttackExposure>);
6633 /// ```
6634 pub fn set_or_clear_attack_exposure<T>(mut self, v: std::option::Option<T>) -> Self
6635 where
6636 T: std::convert::Into<crate::model::AttackExposure>,
6637 {
6638 self.attack_exposure = v.map(|x| x.into());
6639 self
6640 }
6641
6642 /// Sets the value of [files][crate::model::Finding::files].
6643 ///
6644 /// # Example
6645 /// ```ignore,no_run
6646 /// # use google_cloud_securitycenter_v2::model::Finding;
6647 /// use google_cloud_securitycenter_v2::model::File;
6648 /// let x = Finding::new()
6649 /// .set_files([
6650 /// File::default()/* use setters */,
6651 /// File::default()/* use (different) setters */,
6652 /// ]);
6653 /// ```
6654 pub fn set_files<T, V>(mut self, v: T) -> Self
6655 where
6656 T: std::iter::IntoIterator<Item = V>,
6657 V: std::convert::Into<crate::model::File>,
6658 {
6659 use std::iter::Iterator;
6660 self.files = v.into_iter().map(|i| i.into()).collect();
6661 self
6662 }
6663
6664 /// Sets the value of [cloud_dlp_inspection][crate::model::Finding::cloud_dlp_inspection].
6665 ///
6666 /// # Example
6667 /// ```ignore,no_run
6668 /// # use google_cloud_securitycenter_v2::model::Finding;
6669 /// use google_cloud_securitycenter_v2::model::CloudDlpInspection;
6670 /// let x = Finding::new().set_cloud_dlp_inspection(CloudDlpInspection::default()/* use setters */);
6671 /// ```
6672 pub fn set_cloud_dlp_inspection<T>(mut self, v: T) -> Self
6673 where
6674 T: std::convert::Into<crate::model::CloudDlpInspection>,
6675 {
6676 self.cloud_dlp_inspection = std::option::Option::Some(v.into());
6677 self
6678 }
6679
6680 /// Sets or clears the value of [cloud_dlp_inspection][crate::model::Finding::cloud_dlp_inspection].
6681 ///
6682 /// # Example
6683 /// ```ignore,no_run
6684 /// # use google_cloud_securitycenter_v2::model::Finding;
6685 /// use google_cloud_securitycenter_v2::model::CloudDlpInspection;
6686 /// let x = Finding::new().set_or_clear_cloud_dlp_inspection(Some(CloudDlpInspection::default()/* use setters */));
6687 /// let x = Finding::new().set_or_clear_cloud_dlp_inspection(None::<CloudDlpInspection>);
6688 /// ```
6689 pub fn set_or_clear_cloud_dlp_inspection<T>(mut self, v: std::option::Option<T>) -> Self
6690 where
6691 T: std::convert::Into<crate::model::CloudDlpInspection>,
6692 {
6693 self.cloud_dlp_inspection = v.map(|x| x.into());
6694 self
6695 }
6696
6697 /// Sets the value of [cloud_dlp_data_profile][crate::model::Finding::cloud_dlp_data_profile].
6698 ///
6699 /// # Example
6700 /// ```ignore,no_run
6701 /// # use google_cloud_securitycenter_v2::model::Finding;
6702 /// use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
6703 /// let x = Finding::new().set_cloud_dlp_data_profile(CloudDlpDataProfile::default()/* use setters */);
6704 /// ```
6705 pub fn set_cloud_dlp_data_profile<T>(mut self, v: T) -> Self
6706 where
6707 T: std::convert::Into<crate::model::CloudDlpDataProfile>,
6708 {
6709 self.cloud_dlp_data_profile = std::option::Option::Some(v.into());
6710 self
6711 }
6712
6713 /// Sets or clears the value of [cloud_dlp_data_profile][crate::model::Finding::cloud_dlp_data_profile].
6714 ///
6715 /// # Example
6716 /// ```ignore,no_run
6717 /// # use google_cloud_securitycenter_v2::model::Finding;
6718 /// use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
6719 /// let x = Finding::new().set_or_clear_cloud_dlp_data_profile(Some(CloudDlpDataProfile::default()/* use setters */));
6720 /// let x = Finding::new().set_or_clear_cloud_dlp_data_profile(None::<CloudDlpDataProfile>);
6721 /// ```
6722 pub fn set_or_clear_cloud_dlp_data_profile<T>(mut self, v: std::option::Option<T>) -> Self
6723 where
6724 T: std::convert::Into<crate::model::CloudDlpDataProfile>,
6725 {
6726 self.cloud_dlp_data_profile = v.map(|x| x.into());
6727 self
6728 }
6729
6730 /// Sets the value of [kernel_rootkit][crate::model::Finding::kernel_rootkit].
6731 ///
6732 /// # Example
6733 /// ```ignore,no_run
6734 /// # use google_cloud_securitycenter_v2::model::Finding;
6735 /// use google_cloud_securitycenter_v2::model::KernelRootkit;
6736 /// let x = Finding::new().set_kernel_rootkit(KernelRootkit::default()/* use setters */);
6737 /// ```
6738 pub fn set_kernel_rootkit<T>(mut self, v: T) -> Self
6739 where
6740 T: std::convert::Into<crate::model::KernelRootkit>,
6741 {
6742 self.kernel_rootkit = std::option::Option::Some(v.into());
6743 self
6744 }
6745
6746 /// Sets or clears the value of [kernel_rootkit][crate::model::Finding::kernel_rootkit].
6747 ///
6748 /// # Example
6749 /// ```ignore,no_run
6750 /// # use google_cloud_securitycenter_v2::model::Finding;
6751 /// use google_cloud_securitycenter_v2::model::KernelRootkit;
6752 /// let x = Finding::new().set_or_clear_kernel_rootkit(Some(KernelRootkit::default()/* use setters */));
6753 /// let x = Finding::new().set_or_clear_kernel_rootkit(None::<KernelRootkit>);
6754 /// ```
6755 pub fn set_or_clear_kernel_rootkit<T>(mut self, v: std::option::Option<T>) -> Self
6756 where
6757 T: std::convert::Into<crate::model::KernelRootkit>,
6758 {
6759 self.kernel_rootkit = v.map(|x| x.into());
6760 self
6761 }
6762
6763 /// Sets the value of [org_policies][crate::model::Finding::org_policies].
6764 ///
6765 /// # Example
6766 /// ```ignore,no_run
6767 /// # use google_cloud_securitycenter_v2::model::Finding;
6768 /// use google_cloud_securitycenter_v2::model::OrgPolicy;
6769 /// let x = Finding::new()
6770 /// .set_org_policies([
6771 /// OrgPolicy::default()/* use setters */,
6772 /// OrgPolicy::default()/* use (different) setters */,
6773 /// ]);
6774 /// ```
6775 pub fn set_org_policies<T, V>(mut self, v: T) -> Self
6776 where
6777 T: std::iter::IntoIterator<Item = V>,
6778 V: std::convert::Into<crate::model::OrgPolicy>,
6779 {
6780 use std::iter::Iterator;
6781 self.org_policies = v.into_iter().map(|i| i.into()).collect();
6782 self
6783 }
6784
6785 /// Sets the value of [job][crate::model::Finding::job].
6786 ///
6787 /// # Example
6788 /// ```ignore,no_run
6789 /// # use google_cloud_securitycenter_v2::model::Finding;
6790 /// use google_cloud_securitycenter_v2::model::Job;
6791 /// let x = Finding::new().set_job(Job::default()/* use setters */);
6792 /// ```
6793 pub fn set_job<T>(mut self, v: T) -> Self
6794 where
6795 T: std::convert::Into<crate::model::Job>,
6796 {
6797 self.job = std::option::Option::Some(v.into());
6798 self
6799 }
6800
6801 /// Sets or clears the value of [job][crate::model::Finding::job].
6802 ///
6803 /// # Example
6804 /// ```ignore,no_run
6805 /// # use google_cloud_securitycenter_v2::model::Finding;
6806 /// use google_cloud_securitycenter_v2::model::Job;
6807 /// let x = Finding::new().set_or_clear_job(Some(Job::default()/* use setters */));
6808 /// let x = Finding::new().set_or_clear_job(None::<Job>);
6809 /// ```
6810 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
6811 where
6812 T: std::convert::Into<crate::model::Job>,
6813 {
6814 self.job = v.map(|x| x.into());
6815 self
6816 }
6817
6818 /// Sets the value of [application][crate::model::Finding::application].
6819 ///
6820 /// # Example
6821 /// ```ignore,no_run
6822 /// # use google_cloud_securitycenter_v2::model::Finding;
6823 /// use google_cloud_securitycenter_v2::model::Application;
6824 /// let x = Finding::new().set_application(Application::default()/* use setters */);
6825 /// ```
6826 pub fn set_application<T>(mut self, v: T) -> Self
6827 where
6828 T: std::convert::Into<crate::model::Application>,
6829 {
6830 self.application = std::option::Option::Some(v.into());
6831 self
6832 }
6833
6834 /// Sets or clears the value of [application][crate::model::Finding::application].
6835 ///
6836 /// # Example
6837 /// ```ignore,no_run
6838 /// # use google_cloud_securitycenter_v2::model::Finding;
6839 /// use google_cloud_securitycenter_v2::model::Application;
6840 /// let x = Finding::new().set_or_clear_application(Some(Application::default()/* use setters */));
6841 /// let x = Finding::new().set_or_clear_application(None::<Application>);
6842 /// ```
6843 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
6844 where
6845 T: std::convert::Into<crate::model::Application>,
6846 {
6847 self.application = v.map(|x| x.into());
6848 self
6849 }
6850
6851 /// Sets the value of [ip_rules][crate::model::Finding::ip_rules].
6852 ///
6853 /// # Example
6854 /// ```ignore,no_run
6855 /// # use google_cloud_securitycenter_v2::model::Finding;
6856 /// use google_cloud_securitycenter_v2::model::IpRules;
6857 /// let x = Finding::new().set_ip_rules(IpRules::default()/* use setters */);
6858 /// ```
6859 pub fn set_ip_rules<T>(mut self, v: T) -> Self
6860 where
6861 T: std::convert::Into<crate::model::IpRules>,
6862 {
6863 self.ip_rules = std::option::Option::Some(v.into());
6864 self
6865 }
6866
6867 /// Sets or clears the value of [ip_rules][crate::model::Finding::ip_rules].
6868 ///
6869 /// # Example
6870 /// ```ignore,no_run
6871 /// # use google_cloud_securitycenter_v2::model::Finding;
6872 /// use google_cloud_securitycenter_v2::model::IpRules;
6873 /// let x = Finding::new().set_or_clear_ip_rules(Some(IpRules::default()/* use setters */));
6874 /// let x = Finding::new().set_or_clear_ip_rules(None::<IpRules>);
6875 /// ```
6876 pub fn set_or_clear_ip_rules<T>(mut self, v: std::option::Option<T>) -> Self
6877 where
6878 T: std::convert::Into<crate::model::IpRules>,
6879 {
6880 self.ip_rules = v.map(|x| x.into());
6881 self
6882 }
6883
6884 /// Sets the value of [backup_disaster_recovery][crate::model::Finding::backup_disaster_recovery].
6885 ///
6886 /// # Example
6887 /// ```ignore,no_run
6888 /// # use google_cloud_securitycenter_v2::model::Finding;
6889 /// use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
6890 /// let x = Finding::new().set_backup_disaster_recovery(BackupDisasterRecovery::default()/* use setters */);
6891 /// ```
6892 pub fn set_backup_disaster_recovery<T>(mut self, v: T) -> Self
6893 where
6894 T: std::convert::Into<crate::model::BackupDisasterRecovery>,
6895 {
6896 self.backup_disaster_recovery = std::option::Option::Some(v.into());
6897 self
6898 }
6899
6900 /// Sets or clears the value of [backup_disaster_recovery][crate::model::Finding::backup_disaster_recovery].
6901 ///
6902 /// # Example
6903 /// ```ignore,no_run
6904 /// # use google_cloud_securitycenter_v2::model::Finding;
6905 /// use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
6906 /// let x = Finding::new().set_or_clear_backup_disaster_recovery(Some(BackupDisasterRecovery::default()/* use setters */));
6907 /// let x = Finding::new().set_or_clear_backup_disaster_recovery(None::<BackupDisasterRecovery>);
6908 /// ```
6909 pub fn set_or_clear_backup_disaster_recovery<T>(mut self, v: std::option::Option<T>) -> Self
6910 where
6911 T: std::convert::Into<crate::model::BackupDisasterRecovery>,
6912 {
6913 self.backup_disaster_recovery = v.map(|x| x.into());
6914 self
6915 }
6916
6917 /// Sets the value of [security_posture][crate::model::Finding::security_posture].
6918 ///
6919 /// # Example
6920 /// ```ignore,no_run
6921 /// # use google_cloud_securitycenter_v2::model::Finding;
6922 /// use google_cloud_securitycenter_v2::model::SecurityPosture;
6923 /// let x = Finding::new().set_security_posture(SecurityPosture::default()/* use setters */);
6924 /// ```
6925 pub fn set_security_posture<T>(mut self, v: T) -> Self
6926 where
6927 T: std::convert::Into<crate::model::SecurityPosture>,
6928 {
6929 self.security_posture = std::option::Option::Some(v.into());
6930 self
6931 }
6932
6933 /// Sets or clears the value of [security_posture][crate::model::Finding::security_posture].
6934 ///
6935 /// # Example
6936 /// ```ignore,no_run
6937 /// # use google_cloud_securitycenter_v2::model::Finding;
6938 /// use google_cloud_securitycenter_v2::model::SecurityPosture;
6939 /// let x = Finding::new().set_or_clear_security_posture(Some(SecurityPosture::default()/* use setters */));
6940 /// let x = Finding::new().set_or_clear_security_posture(None::<SecurityPosture>);
6941 /// ```
6942 pub fn set_or_clear_security_posture<T>(mut self, v: std::option::Option<T>) -> Self
6943 where
6944 T: std::convert::Into<crate::model::SecurityPosture>,
6945 {
6946 self.security_posture = v.map(|x| x.into());
6947 self
6948 }
6949
6950 /// Sets the value of [log_entries][crate::model::Finding::log_entries].
6951 ///
6952 /// # Example
6953 /// ```ignore,no_run
6954 /// # use google_cloud_securitycenter_v2::model::Finding;
6955 /// use google_cloud_securitycenter_v2::model::LogEntry;
6956 /// let x = Finding::new()
6957 /// .set_log_entries([
6958 /// LogEntry::default()/* use setters */,
6959 /// LogEntry::default()/* use (different) setters */,
6960 /// ]);
6961 /// ```
6962 pub fn set_log_entries<T, V>(mut self, v: T) -> Self
6963 where
6964 T: std::iter::IntoIterator<Item = V>,
6965 V: std::convert::Into<crate::model::LogEntry>,
6966 {
6967 use std::iter::Iterator;
6968 self.log_entries = v.into_iter().map(|i| i.into()).collect();
6969 self
6970 }
6971
6972 /// Sets the value of [load_balancers][crate::model::Finding::load_balancers].
6973 ///
6974 /// # Example
6975 /// ```ignore,no_run
6976 /// # use google_cloud_securitycenter_v2::model::Finding;
6977 /// use google_cloud_securitycenter_v2::model::LoadBalancer;
6978 /// let x = Finding::new()
6979 /// .set_load_balancers([
6980 /// LoadBalancer::default()/* use setters */,
6981 /// LoadBalancer::default()/* use (different) setters */,
6982 /// ]);
6983 /// ```
6984 pub fn set_load_balancers<T, V>(mut self, v: T) -> Self
6985 where
6986 T: std::iter::IntoIterator<Item = V>,
6987 V: std::convert::Into<crate::model::LoadBalancer>,
6988 {
6989 use std::iter::Iterator;
6990 self.load_balancers = v.into_iter().map(|i| i.into()).collect();
6991 self
6992 }
6993
6994 /// Sets the value of [cloud_armor][crate::model::Finding::cloud_armor].
6995 ///
6996 /// # Example
6997 /// ```ignore,no_run
6998 /// # use google_cloud_securitycenter_v2::model::Finding;
6999 /// use google_cloud_securitycenter_v2::model::CloudArmor;
7000 /// let x = Finding::new().set_cloud_armor(CloudArmor::default()/* use setters */);
7001 /// ```
7002 pub fn set_cloud_armor<T>(mut self, v: T) -> Self
7003 where
7004 T: std::convert::Into<crate::model::CloudArmor>,
7005 {
7006 self.cloud_armor = std::option::Option::Some(v.into());
7007 self
7008 }
7009
7010 /// Sets or clears the value of [cloud_armor][crate::model::Finding::cloud_armor].
7011 ///
7012 /// # Example
7013 /// ```ignore,no_run
7014 /// # use google_cloud_securitycenter_v2::model::Finding;
7015 /// use google_cloud_securitycenter_v2::model::CloudArmor;
7016 /// let x = Finding::new().set_or_clear_cloud_armor(Some(CloudArmor::default()/* use setters */));
7017 /// let x = Finding::new().set_or_clear_cloud_armor(None::<CloudArmor>);
7018 /// ```
7019 pub fn set_or_clear_cloud_armor<T>(mut self, v: std::option::Option<T>) -> Self
7020 where
7021 T: std::convert::Into<crate::model::CloudArmor>,
7022 {
7023 self.cloud_armor = v.map(|x| x.into());
7024 self
7025 }
7026
7027 /// Sets the value of [notebook][crate::model::Finding::notebook].
7028 ///
7029 /// # Example
7030 /// ```ignore,no_run
7031 /// # use google_cloud_securitycenter_v2::model::Finding;
7032 /// use google_cloud_securitycenter_v2::model::Notebook;
7033 /// let x = Finding::new().set_notebook(Notebook::default()/* use setters */);
7034 /// ```
7035 pub fn set_notebook<T>(mut self, v: T) -> Self
7036 where
7037 T: std::convert::Into<crate::model::Notebook>,
7038 {
7039 self.notebook = std::option::Option::Some(v.into());
7040 self
7041 }
7042
7043 /// Sets or clears the value of [notebook][crate::model::Finding::notebook].
7044 ///
7045 /// # Example
7046 /// ```ignore,no_run
7047 /// # use google_cloud_securitycenter_v2::model::Finding;
7048 /// use google_cloud_securitycenter_v2::model::Notebook;
7049 /// let x = Finding::new().set_or_clear_notebook(Some(Notebook::default()/* use setters */));
7050 /// let x = Finding::new().set_or_clear_notebook(None::<Notebook>);
7051 /// ```
7052 pub fn set_or_clear_notebook<T>(mut self, v: std::option::Option<T>) -> Self
7053 where
7054 T: std::convert::Into<crate::model::Notebook>,
7055 {
7056 self.notebook = v.map(|x| x.into());
7057 self
7058 }
7059
7060 /// Sets the value of [toxic_combination][crate::model::Finding::toxic_combination].
7061 ///
7062 /// # Example
7063 /// ```ignore,no_run
7064 /// # use google_cloud_securitycenter_v2::model::Finding;
7065 /// use google_cloud_securitycenter_v2::model::ToxicCombination;
7066 /// let x = Finding::new().set_toxic_combination(ToxicCombination::default()/* use setters */);
7067 /// ```
7068 pub fn set_toxic_combination<T>(mut self, v: T) -> Self
7069 where
7070 T: std::convert::Into<crate::model::ToxicCombination>,
7071 {
7072 self.toxic_combination = std::option::Option::Some(v.into());
7073 self
7074 }
7075
7076 /// Sets or clears the value of [toxic_combination][crate::model::Finding::toxic_combination].
7077 ///
7078 /// # Example
7079 /// ```ignore,no_run
7080 /// # use google_cloud_securitycenter_v2::model::Finding;
7081 /// use google_cloud_securitycenter_v2::model::ToxicCombination;
7082 /// let x = Finding::new().set_or_clear_toxic_combination(Some(ToxicCombination::default()/* use setters */));
7083 /// let x = Finding::new().set_or_clear_toxic_combination(None::<ToxicCombination>);
7084 /// ```
7085 pub fn set_or_clear_toxic_combination<T>(mut self, v: std::option::Option<T>) -> Self
7086 where
7087 T: std::convert::Into<crate::model::ToxicCombination>,
7088 {
7089 self.toxic_combination = v.map(|x| x.into());
7090 self
7091 }
7092
7093 /// Sets the value of [group_memberships][crate::model::Finding::group_memberships].
7094 ///
7095 /// # Example
7096 /// ```ignore,no_run
7097 /// # use google_cloud_securitycenter_v2::model::Finding;
7098 /// use google_cloud_securitycenter_v2::model::GroupMembership;
7099 /// let x = Finding::new()
7100 /// .set_group_memberships([
7101 /// GroupMembership::default()/* use setters */,
7102 /// GroupMembership::default()/* use (different) setters */,
7103 /// ]);
7104 /// ```
7105 pub fn set_group_memberships<T, V>(mut self, v: T) -> Self
7106 where
7107 T: std::iter::IntoIterator<Item = V>,
7108 V: std::convert::Into<crate::model::GroupMembership>,
7109 {
7110 use std::iter::Iterator;
7111 self.group_memberships = v.into_iter().map(|i| i.into()).collect();
7112 self
7113 }
7114
7115 /// Sets the value of [disk][crate::model::Finding::disk].
7116 ///
7117 /// # Example
7118 /// ```ignore,no_run
7119 /// # use google_cloud_securitycenter_v2::model::Finding;
7120 /// use google_cloud_securitycenter_v2::model::Disk;
7121 /// let x = Finding::new().set_disk(Disk::default()/* use setters */);
7122 /// ```
7123 pub fn set_disk<T>(mut self, v: T) -> Self
7124 where
7125 T: std::convert::Into<crate::model::Disk>,
7126 {
7127 self.disk = std::option::Option::Some(v.into());
7128 self
7129 }
7130
7131 /// Sets or clears the value of [disk][crate::model::Finding::disk].
7132 ///
7133 /// # Example
7134 /// ```ignore,no_run
7135 /// # use google_cloud_securitycenter_v2::model::Finding;
7136 /// use google_cloud_securitycenter_v2::model::Disk;
7137 /// let x = Finding::new().set_or_clear_disk(Some(Disk::default()/* use setters */));
7138 /// let x = Finding::new().set_or_clear_disk(None::<Disk>);
7139 /// ```
7140 pub fn set_or_clear_disk<T>(mut self, v: std::option::Option<T>) -> Self
7141 where
7142 T: std::convert::Into<crate::model::Disk>,
7143 {
7144 self.disk = v.map(|x| x.into());
7145 self
7146 }
7147
7148 /// Sets the value of [data_access_events][crate::model::Finding::data_access_events].
7149 ///
7150 /// # Example
7151 /// ```ignore,no_run
7152 /// # use google_cloud_securitycenter_v2::model::Finding;
7153 /// use google_cloud_securitycenter_v2::model::DataAccessEvent;
7154 /// let x = Finding::new()
7155 /// .set_data_access_events([
7156 /// DataAccessEvent::default()/* use setters */,
7157 /// DataAccessEvent::default()/* use (different) setters */,
7158 /// ]);
7159 /// ```
7160 pub fn set_data_access_events<T, V>(mut self, v: T) -> Self
7161 where
7162 T: std::iter::IntoIterator<Item = V>,
7163 V: std::convert::Into<crate::model::DataAccessEvent>,
7164 {
7165 use std::iter::Iterator;
7166 self.data_access_events = v.into_iter().map(|i| i.into()).collect();
7167 self
7168 }
7169
7170 /// Sets the value of [data_flow_events][crate::model::Finding::data_flow_events].
7171 ///
7172 /// # Example
7173 /// ```ignore,no_run
7174 /// # use google_cloud_securitycenter_v2::model::Finding;
7175 /// use google_cloud_securitycenter_v2::model::DataFlowEvent;
7176 /// let x = Finding::new()
7177 /// .set_data_flow_events([
7178 /// DataFlowEvent::default()/* use setters */,
7179 /// DataFlowEvent::default()/* use (different) setters */,
7180 /// ]);
7181 /// ```
7182 pub fn set_data_flow_events<T, V>(mut self, v: T) -> Self
7183 where
7184 T: std::iter::IntoIterator<Item = V>,
7185 V: std::convert::Into<crate::model::DataFlowEvent>,
7186 {
7187 use std::iter::Iterator;
7188 self.data_flow_events = v.into_iter().map(|i| i.into()).collect();
7189 self
7190 }
7191
7192 /// Sets the value of [networks][crate::model::Finding::networks].
7193 ///
7194 /// # Example
7195 /// ```ignore,no_run
7196 /// # use google_cloud_securitycenter_v2::model::Finding;
7197 /// use google_cloud_securitycenter_v2::model::Network;
7198 /// let x = Finding::new()
7199 /// .set_networks([
7200 /// Network::default()/* use setters */,
7201 /// Network::default()/* use (different) setters */,
7202 /// ]);
7203 /// ```
7204 pub fn set_networks<T, V>(mut self, v: T) -> Self
7205 where
7206 T: std::iter::IntoIterator<Item = V>,
7207 V: std::convert::Into<crate::model::Network>,
7208 {
7209 use std::iter::Iterator;
7210 self.networks = v.into_iter().map(|i| i.into()).collect();
7211 self
7212 }
7213
7214 /// Sets the value of [data_retention_deletion_events][crate::model::Finding::data_retention_deletion_events].
7215 ///
7216 /// # Example
7217 /// ```ignore,no_run
7218 /// # use google_cloud_securitycenter_v2::model::Finding;
7219 /// use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
7220 /// let x = Finding::new()
7221 /// .set_data_retention_deletion_events([
7222 /// DataRetentionDeletionEvent::default()/* use setters */,
7223 /// DataRetentionDeletionEvent::default()/* use (different) setters */,
7224 /// ]);
7225 /// ```
7226 pub fn set_data_retention_deletion_events<T, V>(mut self, v: T) -> Self
7227 where
7228 T: std::iter::IntoIterator<Item = V>,
7229 V: std::convert::Into<crate::model::DataRetentionDeletionEvent>,
7230 {
7231 use std::iter::Iterator;
7232 self.data_retention_deletion_events = v.into_iter().map(|i| i.into()).collect();
7233 self
7234 }
7235
7236 /// Sets the value of [affected_resources][crate::model::Finding::affected_resources].
7237 ///
7238 /// # Example
7239 /// ```ignore,no_run
7240 /// # use google_cloud_securitycenter_v2::model::Finding;
7241 /// use google_cloud_securitycenter_v2::model::AffectedResources;
7242 /// let x = Finding::new().set_affected_resources(AffectedResources::default()/* use setters */);
7243 /// ```
7244 pub fn set_affected_resources<T>(mut self, v: T) -> Self
7245 where
7246 T: std::convert::Into<crate::model::AffectedResources>,
7247 {
7248 self.affected_resources = std::option::Option::Some(v.into());
7249 self
7250 }
7251
7252 /// Sets or clears the value of [affected_resources][crate::model::Finding::affected_resources].
7253 ///
7254 /// # Example
7255 /// ```ignore,no_run
7256 /// # use google_cloud_securitycenter_v2::model::Finding;
7257 /// use google_cloud_securitycenter_v2::model::AffectedResources;
7258 /// let x = Finding::new().set_or_clear_affected_resources(Some(AffectedResources::default()/* use setters */));
7259 /// let x = Finding::new().set_or_clear_affected_resources(None::<AffectedResources>);
7260 /// ```
7261 pub fn set_or_clear_affected_resources<T>(mut self, v: std::option::Option<T>) -> Self
7262 where
7263 T: std::convert::Into<crate::model::AffectedResources>,
7264 {
7265 self.affected_resources = v.map(|x| x.into());
7266 self
7267 }
7268
7269 /// Sets the value of [ai_model][crate::model::Finding::ai_model].
7270 ///
7271 /// # Example
7272 /// ```ignore,no_run
7273 /// # use google_cloud_securitycenter_v2::model::Finding;
7274 /// use google_cloud_securitycenter_v2::model::AiModel;
7275 /// let x = Finding::new().set_ai_model(AiModel::default()/* use setters */);
7276 /// ```
7277 pub fn set_ai_model<T>(mut self, v: T) -> Self
7278 where
7279 T: std::convert::Into<crate::model::AiModel>,
7280 {
7281 self.ai_model = std::option::Option::Some(v.into());
7282 self
7283 }
7284
7285 /// Sets or clears the value of [ai_model][crate::model::Finding::ai_model].
7286 ///
7287 /// # Example
7288 /// ```ignore,no_run
7289 /// # use google_cloud_securitycenter_v2::model::Finding;
7290 /// use google_cloud_securitycenter_v2::model::AiModel;
7291 /// let x = Finding::new().set_or_clear_ai_model(Some(AiModel::default()/* use setters */));
7292 /// let x = Finding::new().set_or_clear_ai_model(None::<AiModel>);
7293 /// ```
7294 pub fn set_or_clear_ai_model<T>(mut self, v: std::option::Option<T>) -> Self
7295 where
7296 T: std::convert::Into<crate::model::AiModel>,
7297 {
7298 self.ai_model = v.map(|x| x.into());
7299 self
7300 }
7301
7302 /// Sets the value of [chokepoint][crate::model::Finding::chokepoint].
7303 ///
7304 /// # Example
7305 /// ```ignore,no_run
7306 /// # use google_cloud_securitycenter_v2::model::Finding;
7307 /// use google_cloud_securitycenter_v2::model::Chokepoint;
7308 /// let x = Finding::new().set_chokepoint(Chokepoint::default()/* use setters */);
7309 /// ```
7310 pub fn set_chokepoint<T>(mut self, v: T) -> Self
7311 where
7312 T: std::convert::Into<crate::model::Chokepoint>,
7313 {
7314 self.chokepoint = std::option::Option::Some(v.into());
7315 self
7316 }
7317
7318 /// Sets or clears the value of [chokepoint][crate::model::Finding::chokepoint].
7319 ///
7320 /// # Example
7321 /// ```ignore,no_run
7322 /// # use google_cloud_securitycenter_v2::model::Finding;
7323 /// use google_cloud_securitycenter_v2::model::Chokepoint;
7324 /// let x = Finding::new().set_or_clear_chokepoint(Some(Chokepoint::default()/* use setters */));
7325 /// let x = Finding::new().set_or_clear_chokepoint(None::<Chokepoint>);
7326 /// ```
7327 pub fn set_or_clear_chokepoint<T>(mut self, v: std::option::Option<T>) -> Self
7328 where
7329 T: std::convert::Into<crate::model::Chokepoint>,
7330 {
7331 self.chokepoint = v.map(|x| x.into());
7332 self
7333 }
7334
7335 /// Sets the value of [vertex_ai][crate::model::Finding::vertex_ai].
7336 ///
7337 /// # Example
7338 /// ```ignore,no_run
7339 /// # use google_cloud_securitycenter_v2::model::Finding;
7340 /// use google_cloud_securitycenter_v2::model::VertexAi;
7341 /// let x = Finding::new().set_vertex_ai(VertexAi::default()/* use setters */);
7342 /// ```
7343 pub fn set_vertex_ai<T>(mut self, v: T) -> Self
7344 where
7345 T: std::convert::Into<crate::model::VertexAi>,
7346 {
7347 self.vertex_ai = std::option::Option::Some(v.into());
7348 self
7349 }
7350
7351 /// Sets or clears the value of [vertex_ai][crate::model::Finding::vertex_ai].
7352 ///
7353 /// # Example
7354 /// ```ignore,no_run
7355 /// # use google_cloud_securitycenter_v2::model::Finding;
7356 /// use google_cloud_securitycenter_v2::model::VertexAi;
7357 /// let x = Finding::new().set_or_clear_vertex_ai(Some(VertexAi::default()/* use setters */));
7358 /// let x = Finding::new().set_or_clear_vertex_ai(None::<VertexAi>);
7359 /// ```
7360 pub fn set_or_clear_vertex_ai<T>(mut self, v: std::option::Option<T>) -> Self
7361 where
7362 T: std::convert::Into<crate::model::VertexAi>,
7363 {
7364 self.vertex_ai = v.map(|x| x.into());
7365 self
7366 }
7367}
7368
7369impl wkt::message::Message for Finding {
7370 fn typename() -> &'static str {
7371 "type.googleapis.com/google.cloud.securitycenter.v2.Finding"
7372 }
7373}
7374
7375/// Defines additional types related to [Finding].
7376pub mod finding {
7377 #[allow(unused_imports)]
7378 use super::*;
7379
7380 /// Mute information about the finding, including whether the finding has a
7381 /// static mute or any matching dynamic mute rules.
7382 #[derive(Clone, Default, PartialEq)]
7383 #[non_exhaustive]
7384 pub struct MuteInfo {
7385 /// If set, the static mute applied to this finding. Static mutes override
7386 /// dynamic mutes. If unset, there is no static mute.
7387 pub static_mute: std::option::Option<crate::model::finding::mute_info::StaticMute>,
7388
7389 /// The list of dynamic mute rules that currently match the finding.
7390 pub dynamic_mute_records:
7391 std::vec::Vec<crate::model::finding::mute_info::DynamicMuteRecord>,
7392
7393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7394 }
7395
7396 impl MuteInfo {
7397 pub fn new() -> Self {
7398 std::default::Default::default()
7399 }
7400
7401 /// Sets the value of [static_mute][crate::model::finding::MuteInfo::static_mute].
7402 ///
7403 /// # Example
7404 /// ```ignore,no_run
7405 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7406 /// use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7407 /// let x = MuteInfo::new().set_static_mute(StaticMute::default()/* use setters */);
7408 /// ```
7409 pub fn set_static_mute<T>(mut self, v: T) -> Self
7410 where
7411 T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
7412 {
7413 self.static_mute = std::option::Option::Some(v.into());
7414 self
7415 }
7416
7417 /// Sets or clears the value of [static_mute][crate::model::finding::MuteInfo::static_mute].
7418 ///
7419 /// # Example
7420 /// ```ignore,no_run
7421 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7422 /// use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7423 /// let x = MuteInfo::new().set_or_clear_static_mute(Some(StaticMute::default()/* use setters */));
7424 /// let x = MuteInfo::new().set_or_clear_static_mute(None::<StaticMute>);
7425 /// ```
7426 pub fn set_or_clear_static_mute<T>(mut self, v: std::option::Option<T>) -> Self
7427 where
7428 T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
7429 {
7430 self.static_mute = v.map(|x| x.into());
7431 self
7432 }
7433
7434 /// Sets the value of [dynamic_mute_records][crate::model::finding::MuteInfo::dynamic_mute_records].
7435 ///
7436 /// # Example
7437 /// ```ignore,no_run
7438 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7439 /// use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7440 /// let x = MuteInfo::new()
7441 /// .set_dynamic_mute_records([
7442 /// DynamicMuteRecord::default()/* use setters */,
7443 /// DynamicMuteRecord::default()/* use (different) setters */,
7444 /// ]);
7445 /// ```
7446 pub fn set_dynamic_mute_records<T, V>(mut self, v: T) -> Self
7447 where
7448 T: std::iter::IntoIterator<Item = V>,
7449 V: std::convert::Into<crate::model::finding::mute_info::DynamicMuteRecord>,
7450 {
7451 use std::iter::Iterator;
7452 self.dynamic_mute_records = v.into_iter().map(|i| i.into()).collect();
7453 self
7454 }
7455 }
7456
7457 impl wkt::message::Message for MuteInfo {
7458 fn typename() -> &'static str {
7459 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo"
7460 }
7461 }
7462
7463 /// Defines additional types related to [MuteInfo].
7464 pub mod mute_info {
7465 #[allow(unused_imports)]
7466 use super::*;
7467
7468 /// Information about the static mute state. A static mute state overrides
7469 /// any dynamic mute rules that apply to this finding. The static mute state
7470 /// can be set by a static mute rule or by muting the finding directly.
7471 #[derive(Clone, Default, PartialEq)]
7472 #[non_exhaustive]
7473 pub struct StaticMute {
7474 /// The static mute state. If the value is `MUTED` or `UNMUTED`, then the
7475 /// finding's overall mute state will have the same value.
7476 pub state: crate::model::finding::Mute,
7477
7478 /// When the static mute was applied.
7479 pub apply_time: std::option::Option<wkt::Timestamp>,
7480
7481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7482 }
7483
7484 impl StaticMute {
7485 pub fn new() -> Self {
7486 std::default::Default::default()
7487 }
7488
7489 /// Sets the value of [state][crate::model::finding::mute_info::StaticMute::state].
7490 ///
7491 /// # Example
7492 /// ```ignore,no_run
7493 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7494 /// use google_cloud_securitycenter_v2::model::finding::Mute;
7495 /// let x0 = StaticMute::new().set_state(Mute::Muted);
7496 /// let x1 = StaticMute::new().set_state(Mute::Unmuted);
7497 /// let x2 = StaticMute::new().set_state(Mute::Undefined);
7498 /// ```
7499 pub fn set_state<T: std::convert::Into<crate::model::finding::Mute>>(
7500 mut self,
7501 v: T,
7502 ) -> Self {
7503 self.state = v.into();
7504 self
7505 }
7506
7507 /// Sets the value of [apply_time][crate::model::finding::mute_info::StaticMute::apply_time].
7508 ///
7509 /// # Example
7510 /// ```ignore,no_run
7511 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7512 /// use wkt::Timestamp;
7513 /// let x = StaticMute::new().set_apply_time(Timestamp::default()/* use setters */);
7514 /// ```
7515 pub fn set_apply_time<T>(mut self, v: T) -> Self
7516 where
7517 T: std::convert::Into<wkt::Timestamp>,
7518 {
7519 self.apply_time = std::option::Option::Some(v.into());
7520 self
7521 }
7522
7523 /// Sets or clears the value of [apply_time][crate::model::finding::mute_info::StaticMute::apply_time].
7524 ///
7525 /// # Example
7526 /// ```ignore,no_run
7527 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7528 /// use wkt::Timestamp;
7529 /// let x = StaticMute::new().set_or_clear_apply_time(Some(Timestamp::default()/* use setters */));
7530 /// let x = StaticMute::new().set_or_clear_apply_time(None::<Timestamp>);
7531 /// ```
7532 pub fn set_or_clear_apply_time<T>(mut self, v: std::option::Option<T>) -> Self
7533 where
7534 T: std::convert::Into<wkt::Timestamp>,
7535 {
7536 self.apply_time = v.map(|x| x.into());
7537 self
7538 }
7539 }
7540
7541 impl wkt::message::Message for StaticMute {
7542 fn typename() -> &'static str {
7543 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute"
7544 }
7545 }
7546
7547 /// The record of a dynamic mute rule that matches the finding.
7548 #[derive(Clone, Default, PartialEq)]
7549 #[non_exhaustive]
7550 pub struct DynamicMuteRecord {
7551 /// The relative resource name of the mute rule, represented by a mute
7552 /// config, that created this record, for example
7553 /// `organizations/123/muteConfigs/mymuteconfig` or
7554 /// `organizations/123/locations/global/muteConfigs/mymuteconfig`.
7555 pub mute_config: std::string::String,
7556
7557 /// When the dynamic mute rule first matched the finding.
7558 pub match_time: std::option::Option<wkt::Timestamp>,
7559
7560 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7561 }
7562
7563 impl DynamicMuteRecord {
7564 pub fn new() -> Self {
7565 std::default::Default::default()
7566 }
7567
7568 /// Sets the value of [mute_config][crate::model::finding::mute_info::DynamicMuteRecord::mute_config].
7569 ///
7570 /// # Example
7571 /// ```ignore,no_run
7572 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7573 /// let x = DynamicMuteRecord::new().set_mute_config("example");
7574 /// ```
7575 pub fn set_mute_config<T: std::convert::Into<std::string::String>>(
7576 mut self,
7577 v: T,
7578 ) -> Self {
7579 self.mute_config = v.into();
7580 self
7581 }
7582
7583 /// Sets the value of [match_time][crate::model::finding::mute_info::DynamicMuteRecord::match_time].
7584 ///
7585 /// # Example
7586 /// ```ignore,no_run
7587 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7588 /// use wkt::Timestamp;
7589 /// let x = DynamicMuteRecord::new().set_match_time(Timestamp::default()/* use setters */);
7590 /// ```
7591 pub fn set_match_time<T>(mut self, v: T) -> Self
7592 where
7593 T: std::convert::Into<wkt::Timestamp>,
7594 {
7595 self.match_time = std::option::Option::Some(v.into());
7596 self
7597 }
7598
7599 /// Sets or clears the value of [match_time][crate::model::finding::mute_info::DynamicMuteRecord::match_time].
7600 ///
7601 /// # Example
7602 /// ```ignore,no_run
7603 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7604 /// use wkt::Timestamp;
7605 /// let x = DynamicMuteRecord::new().set_or_clear_match_time(Some(Timestamp::default()/* use setters */));
7606 /// let x = DynamicMuteRecord::new().set_or_clear_match_time(None::<Timestamp>);
7607 /// ```
7608 pub fn set_or_clear_match_time<T>(mut self, v: std::option::Option<T>) -> Self
7609 where
7610 T: std::convert::Into<wkt::Timestamp>,
7611 {
7612 self.match_time = v.map(|x| x.into());
7613 self
7614 }
7615 }
7616
7617 impl wkt::message::Message for DynamicMuteRecord {
7618 fn typename() -> &'static str {
7619 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord"
7620 }
7621 }
7622 }
7623
7624 /// The state of the finding.
7625 ///
7626 /// # Working with unknown values
7627 ///
7628 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7629 /// additional enum variants at any time. Adding new variants is not considered
7630 /// a breaking change. Applications should write their code in anticipation of:
7631 ///
7632 /// - New values appearing in future releases of the client library, **and**
7633 /// - New values received dynamically, without application changes.
7634 ///
7635 /// Please consult the [Working with enums] section in the user guide for some
7636 /// guidelines.
7637 ///
7638 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7639 #[derive(Clone, Debug, PartialEq)]
7640 #[non_exhaustive]
7641 pub enum State {
7642 /// Unspecified state.
7643 Unspecified,
7644 /// The finding requires attention and has not been addressed yet.
7645 Active,
7646 /// The finding has been fixed, triaged as a non-issue or otherwise addressed
7647 /// and is no longer active.
7648 Inactive,
7649 /// If set, the enum was initialized with an unknown value.
7650 ///
7651 /// Applications can examine the value using [State::value] or
7652 /// [State::name].
7653 UnknownValue(state::UnknownValue),
7654 }
7655
7656 #[doc(hidden)]
7657 pub mod state {
7658 #[allow(unused_imports)]
7659 use super::*;
7660 #[derive(Clone, Debug, PartialEq)]
7661 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7662 }
7663
7664 impl State {
7665 /// Gets the enum value.
7666 ///
7667 /// Returns `None` if the enum contains an unknown value deserialized from
7668 /// the string representation of enums.
7669 pub fn value(&self) -> std::option::Option<i32> {
7670 match self {
7671 Self::Unspecified => std::option::Option::Some(0),
7672 Self::Active => std::option::Option::Some(1),
7673 Self::Inactive => std::option::Option::Some(2),
7674 Self::UnknownValue(u) => u.0.value(),
7675 }
7676 }
7677
7678 /// Gets the enum value as a string.
7679 ///
7680 /// Returns `None` if the enum contains an unknown value deserialized from
7681 /// the integer representation of enums.
7682 pub fn name(&self) -> std::option::Option<&str> {
7683 match self {
7684 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7685 Self::Active => std::option::Option::Some("ACTIVE"),
7686 Self::Inactive => std::option::Option::Some("INACTIVE"),
7687 Self::UnknownValue(u) => u.0.name(),
7688 }
7689 }
7690 }
7691
7692 impl std::default::Default for State {
7693 fn default() -> Self {
7694 use std::convert::From;
7695 Self::from(0)
7696 }
7697 }
7698
7699 impl std::fmt::Display for State {
7700 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7701 wkt::internal::display_enum(f, self.name(), self.value())
7702 }
7703 }
7704
7705 impl std::convert::From<i32> for State {
7706 fn from(value: i32) -> Self {
7707 match value {
7708 0 => Self::Unspecified,
7709 1 => Self::Active,
7710 2 => Self::Inactive,
7711 _ => Self::UnknownValue(state::UnknownValue(
7712 wkt::internal::UnknownEnumValue::Integer(value),
7713 )),
7714 }
7715 }
7716 }
7717
7718 impl std::convert::From<&str> for State {
7719 fn from(value: &str) -> Self {
7720 use std::string::ToString;
7721 match value {
7722 "STATE_UNSPECIFIED" => Self::Unspecified,
7723 "ACTIVE" => Self::Active,
7724 "INACTIVE" => Self::Inactive,
7725 _ => Self::UnknownValue(state::UnknownValue(
7726 wkt::internal::UnknownEnumValue::String(value.to_string()),
7727 )),
7728 }
7729 }
7730 }
7731
7732 impl serde::ser::Serialize for State {
7733 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7734 where
7735 S: serde::Serializer,
7736 {
7737 match self {
7738 Self::Unspecified => serializer.serialize_i32(0),
7739 Self::Active => serializer.serialize_i32(1),
7740 Self::Inactive => serializer.serialize_i32(2),
7741 Self::UnknownValue(u) => u.0.serialize(serializer),
7742 }
7743 }
7744 }
7745
7746 impl<'de> serde::de::Deserialize<'de> for State {
7747 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7748 where
7749 D: serde::Deserializer<'de>,
7750 {
7751 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7752 ".google.cloud.securitycenter.v2.Finding.State",
7753 ))
7754 }
7755 }
7756
7757 /// The severity of the finding.
7758 ///
7759 /// # Working with unknown values
7760 ///
7761 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7762 /// additional enum variants at any time. Adding new variants is not considered
7763 /// a breaking change. Applications should write their code in anticipation of:
7764 ///
7765 /// - New values appearing in future releases of the client library, **and**
7766 /// - New values received dynamically, without application changes.
7767 ///
7768 /// Please consult the [Working with enums] section in the user guide for some
7769 /// guidelines.
7770 ///
7771 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7772 #[derive(Clone, Debug, PartialEq)]
7773 #[non_exhaustive]
7774 pub enum Severity {
7775 /// This value is used for findings when a source doesn't write a severity
7776 /// value.
7777 Unspecified,
7778 /// Vulnerability:
7779 /// A critical vulnerability is easily discoverable by an external actor,
7780 /// exploitable, and results in the direct ability to execute arbitrary code,
7781 /// exfiltrate data, and otherwise gain additional access and privileges to
7782 /// cloud resources and workloads. Examples include publicly accessible
7783 /// unprotected user data and public SSH access with weak or no
7784 /// passwords.
7785 ///
7786 /// Threat:
7787 /// Indicates a threat that is able to access, modify, or delete data or
7788 /// execute unauthorized code within existing resources.
7789 Critical,
7790 /// Vulnerability:
7791 /// A high risk vulnerability can be easily discovered and exploited in
7792 /// combination with other vulnerabilities in order to gain direct access and
7793 /// the ability to execute arbitrary code, exfiltrate data, and otherwise
7794 /// gain additional access and privileges to cloud resources and workloads.
7795 /// An example is a database with weak or no passwords that is only
7796 /// accessible internally. This database could easily be compromised by an
7797 /// actor that had access to the internal network.
7798 ///
7799 /// Threat:
7800 /// Indicates a threat that is able to create new computational resources in
7801 /// an environment but not able to access data or execute code in existing
7802 /// resources.
7803 High,
7804 /// Vulnerability:
7805 /// A medium risk vulnerability could be used by an actor to gain access to
7806 /// resources or privileges that enable them to eventually (through multiple
7807 /// steps or a complex exploit) gain access and the ability to execute
7808 /// arbitrary code or exfiltrate data. An example is a service account with
7809 /// access to more projects than it should have. If an actor gains access to
7810 /// the service account, they could potentially use that access to manipulate
7811 /// a project the service account was not intended to.
7812 ///
7813 /// Threat:
7814 /// Indicates a threat that is able to cause operational impact but may not
7815 /// access data or execute unauthorized code.
7816 Medium,
7817 /// Vulnerability:
7818 /// A low risk vulnerability hampers a security organization's ability to
7819 /// detect vulnerabilities or active threats in their deployment, or prevents
7820 /// the root cause investigation of security issues. An example is monitoring
7821 /// and logs being disabled for resource configurations and access.
7822 ///
7823 /// Threat:
7824 /// Indicates a threat that has obtained minimal access to an environment but
7825 /// is not able to access data, execute code, or create resources.
7826 Low,
7827 /// If set, the enum was initialized with an unknown value.
7828 ///
7829 /// Applications can examine the value using [Severity::value] or
7830 /// [Severity::name].
7831 UnknownValue(severity::UnknownValue),
7832 }
7833
7834 #[doc(hidden)]
7835 pub mod severity {
7836 #[allow(unused_imports)]
7837 use super::*;
7838 #[derive(Clone, Debug, PartialEq)]
7839 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7840 }
7841
7842 impl Severity {
7843 /// Gets the enum value.
7844 ///
7845 /// Returns `None` if the enum contains an unknown value deserialized from
7846 /// the string representation of enums.
7847 pub fn value(&self) -> std::option::Option<i32> {
7848 match self {
7849 Self::Unspecified => std::option::Option::Some(0),
7850 Self::Critical => std::option::Option::Some(1),
7851 Self::High => std::option::Option::Some(2),
7852 Self::Medium => std::option::Option::Some(3),
7853 Self::Low => std::option::Option::Some(4),
7854 Self::UnknownValue(u) => u.0.value(),
7855 }
7856 }
7857
7858 /// Gets the enum value as a string.
7859 ///
7860 /// Returns `None` if the enum contains an unknown value deserialized from
7861 /// the integer representation of enums.
7862 pub fn name(&self) -> std::option::Option<&str> {
7863 match self {
7864 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
7865 Self::Critical => std::option::Option::Some("CRITICAL"),
7866 Self::High => std::option::Option::Some("HIGH"),
7867 Self::Medium => std::option::Option::Some("MEDIUM"),
7868 Self::Low => std::option::Option::Some("LOW"),
7869 Self::UnknownValue(u) => u.0.name(),
7870 }
7871 }
7872 }
7873
7874 impl std::default::Default for Severity {
7875 fn default() -> Self {
7876 use std::convert::From;
7877 Self::from(0)
7878 }
7879 }
7880
7881 impl std::fmt::Display for Severity {
7882 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7883 wkt::internal::display_enum(f, self.name(), self.value())
7884 }
7885 }
7886
7887 impl std::convert::From<i32> for Severity {
7888 fn from(value: i32) -> Self {
7889 match value {
7890 0 => Self::Unspecified,
7891 1 => Self::Critical,
7892 2 => Self::High,
7893 3 => Self::Medium,
7894 4 => Self::Low,
7895 _ => Self::UnknownValue(severity::UnknownValue(
7896 wkt::internal::UnknownEnumValue::Integer(value),
7897 )),
7898 }
7899 }
7900 }
7901
7902 impl std::convert::From<&str> for Severity {
7903 fn from(value: &str) -> Self {
7904 use std::string::ToString;
7905 match value {
7906 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
7907 "CRITICAL" => Self::Critical,
7908 "HIGH" => Self::High,
7909 "MEDIUM" => Self::Medium,
7910 "LOW" => Self::Low,
7911 _ => Self::UnknownValue(severity::UnknownValue(
7912 wkt::internal::UnknownEnumValue::String(value.to_string()),
7913 )),
7914 }
7915 }
7916 }
7917
7918 impl serde::ser::Serialize for Severity {
7919 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7920 where
7921 S: serde::Serializer,
7922 {
7923 match self {
7924 Self::Unspecified => serializer.serialize_i32(0),
7925 Self::Critical => serializer.serialize_i32(1),
7926 Self::High => serializer.serialize_i32(2),
7927 Self::Medium => serializer.serialize_i32(3),
7928 Self::Low => serializer.serialize_i32(4),
7929 Self::UnknownValue(u) => u.0.serialize(serializer),
7930 }
7931 }
7932 }
7933
7934 impl<'de> serde::de::Deserialize<'de> for Severity {
7935 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7936 where
7937 D: serde::Deserializer<'de>,
7938 {
7939 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
7940 ".google.cloud.securitycenter.v2.Finding.Severity",
7941 ))
7942 }
7943 }
7944
7945 /// Mute state a finding can be in.
7946 ///
7947 /// # Working with unknown values
7948 ///
7949 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7950 /// additional enum variants at any time. Adding new variants is not considered
7951 /// a breaking change. Applications should write their code in anticipation of:
7952 ///
7953 /// - New values appearing in future releases of the client library, **and**
7954 /// - New values received dynamically, without application changes.
7955 ///
7956 /// Please consult the [Working with enums] section in the user guide for some
7957 /// guidelines.
7958 ///
7959 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7960 #[derive(Clone, Debug, PartialEq)]
7961 #[non_exhaustive]
7962 pub enum Mute {
7963 /// Unspecified.
7964 Unspecified,
7965 /// Finding has been muted.
7966 Muted,
7967 /// Finding has been unmuted.
7968 Unmuted,
7969 /// Finding has never been muted/unmuted.
7970 Undefined,
7971 /// If set, the enum was initialized with an unknown value.
7972 ///
7973 /// Applications can examine the value using [Mute::value] or
7974 /// [Mute::name].
7975 UnknownValue(mute::UnknownValue),
7976 }
7977
7978 #[doc(hidden)]
7979 pub mod mute {
7980 #[allow(unused_imports)]
7981 use super::*;
7982 #[derive(Clone, Debug, PartialEq)]
7983 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7984 }
7985
7986 impl Mute {
7987 /// Gets the enum value.
7988 ///
7989 /// Returns `None` if the enum contains an unknown value deserialized from
7990 /// the string representation of enums.
7991 pub fn value(&self) -> std::option::Option<i32> {
7992 match self {
7993 Self::Unspecified => std::option::Option::Some(0),
7994 Self::Muted => std::option::Option::Some(1),
7995 Self::Unmuted => std::option::Option::Some(2),
7996 Self::Undefined => std::option::Option::Some(3),
7997 Self::UnknownValue(u) => u.0.value(),
7998 }
7999 }
8000
8001 /// Gets the enum value as a string.
8002 ///
8003 /// Returns `None` if the enum contains an unknown value deserialized from
8004 /// the integer representation of enums.
8005 pub fn name(&self) -> std::option::Option<&str> {
8006 match self {
8007 Self::Unspecified => std::option::Option::Some("MUTE_UNSPECIFIED"),
8008 Self::Muted => std::option::Option::Some("MUTED"),
8009 Self::Unmuted => std::option::Option::Some("UNMUTED"),
8010 Self::Undefined => std::option::Option::Some("UNDEFINED"),
8011 Self::UnknownValue(u) => u.0.name(),
8012 }
8013 }
8014 }
8015
8016 impl std::default::Default for Mute {
8017 fn default() -> Self {
8018 use std::convert::From;
8019 Self::from(0)
8020 }
8021 }
8022
8023 impl std::fmt::Display for Mute {
8024 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8025 wkt::internal::display_enum(f, self.name(), self.value())
8026 }
8027 }
8028
8029 impl std::convert::From<i32> for Mute {
8030 fn from(value: i32) -> Self {
8031 match value {
8032 0 => Self::Unspecified,
8033 1 => Self::Muted,
8034 2 => Self::Unmuted,
8035 3 => Self::Undefined,
8036 _ => Self::UnknownValue(mute::UnknownValue(
8037 wkt::internal::UnknownEnumValue::Integer(value),
8038 )),
8039 }
8040 }
8041 }
8042
8043 impl std::convert::From<&str> for Mute {
8044 fn from(value: &str) -> Self {
8045 use std::string::ToString;
8046 match value {
8047 "MUTE_UNSPECIFIED" => Self::Unspecified,
8048 "MUTED" => Self::Muted,
8049 "UNMUTED" => Self::Unmuted,
8050 "UNDEFINED" => Self::Undefined,
8051 _ => Self::UnknownValue(mute::UnknownValue(
8052 wkt::internal::UnknownEnumValue::String(value.to_string()),
8053 )),
8054 }
8055 }
8056 }
8057
8058 impl serde::ser::Serialize for Mute {
8059 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8060 where
8061 S: serde::Serializer,
8062 {
8063 match self {
8064 Self::Unspecified => serializer.serialize_i32(0),
8065 Self::Muted => serializer.serialize_i32(1),
8066 Self::Unmuted => serializer.serialize_i32(2),
8067 Self::Undefined => serializer.serialize_i32(3),
8068 Self::UnknownValue(u) => u.0.serialize(serializer),
8069 }
8070 }
8071 }
8072
8073 impl<'de> serde::de::Deserialize<'de> for Mute {
8074 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8075 where
8076 D: serde::Deserializer<'de>,
8077 {
8078 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mute>::new(
8079 ".google.cloud.securitycenter.v2.Finding.Mute",
8080 ))
8081 }
8082 }
8083
8084 /// Represents what kind of Finding it is.
8085 ///
8086 /// # Working with unknown values
8087 ///
8088 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8089 /// additional enum variants at any time. Adding new variants is not considered
8090 /// a breaking change. Applications should write their code in anticipation of:
8091 ///
8092 /// - New values appearing in future releases of the client library, **and**
8093 /// - New values received dynamically, without application changes.
8094 ///
8095 /// Please consult the [Working with enums] section in the user guide for some
8096 /// guidelines.
8097 ///
8098 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8099 #[derive(Clone, Debug, PartialEq)]
8100 #[non_exhaustive]
8101 pub enum FindingClass {
8102 /// Unspecified finding class.
8103 Unspecified,
8104 /// Describes unwanted or malicious activity.
8105 Threat,
8106 /// Describes a potential weakness in software that increases risk to
8107 /// Confidentiality & Integrity & Availability.
8108 Vulnerability,
8109 /// Describes a potential weakness in cloud resource/asset configuration that
8110 /// increases risk.
8111 Misconfiguration,
8112 /// Describes a security observation that is for informational purposes.
8113 Observation,
8114 /// Describes an error that prevents some SCC functionality.
8115 SccError,
8116 /// Describes a potential security risk due to a change in the security
8117 /// posture.
8118 PostureViolation,
8119 /// Describes a combination of security issues that represent a more severe
8120 /// security problem when taken together.
8121 ToxicCombination,
8122 /// Describes a potential security risk to data assets that contain sensitive
8123 /// data.
8124 SensitiveDataRisk,
8125 /// Describes a resource or resource group where high risk attack paths
8126 /// converge, based on attack path simulations (APS).
8127 Chokepoint,
8128 /// If set, the enum was initialized with an unknown value.
8129 ///
8130 /// Applications can examine the value using [FindingClass::value] or
8131 /// [FindingClass::name].
8132 UnknownValue(finding_class::UnknownValue),
8133 }
8134
8135 #[doc(hidden)]
8136 pub mod finding_class {
8137 #[allow(unused_imports)]
8138 use super::*;
8139 #[derive(Clone, Debug, PartialEq)]
8140 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8141 }
8142
8143 impl FindingClass {
8144 /// Gets the enum value.
8145 ///
8146 /// Returns `None` if the enum contains an unknown value deserialized from
8147 /// the string representation of enums.
8148 pub fn value(&self) -> std::option::Option<i32> {
8149 match self {
8150 Self::Unspecified => std::option::Option::Some(0),
8151 Self::Threat => std::option::Option::Some(1),
8152 Self::Vulnerability => std::option::Option::Some(2),
8153 Self::Misconfiguration => std::option::Option::Some(3),
8154 Self::Observation => std::option::Option::Some(4),
8155 Self::SccError => std::option::Option::Some(5),
8156 Self::PostureViolation => std::option::Option::Some(6),
8157 Self::ToxicCombination => std::option::Option::Some(7),
8158 Self::SensitiveDataRisk => std::option::Option::Some(8),
8159 Self::Chokepoint => std::option::Option::Some(9),
8160 Self::UnknownValue(u) => u.0.value(),
8161 }
8162 }
8163
8164 /// Gets the enum value as a string.
8165 ///
8166 /// Returns `None` if the enum contains an unknown value deserialized from
8167 /// the integer representation of enums.
8168 pub fn name(&self) -> std::option::Option<&str> {
8169 match self {
8170 Self::Unspecified => std::option::Option::Some("FINDING_CLASS_UNSPECIFIED"),
8171 Self::Threat => std::option::Option::Some("THREAT"),
8172 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
8173 Self::Misconfiguration => std::option::Option::Some("MISCONFIGURATION"),
8174 Self::Observation => std::option::Option::Some("OBSERVATION"),
8175 Self::SccError => std::option::Option::Some("SCC_ERROR"),
8176 Self::PostureViolation => std::option::Option::Some("POSTURE_VIOLATION"),
8177 Self::ToxicCombination => std::option::Option::Some("TOXIC_COMBINATION"),
8178 Self::SensitiveDataRisk => std::option::Option::Some("SENSITIVE_DATA_RISK"),
8179 Self::Chokepoint => std::option::Option::Some("CHOKEPOINT"),
8180 Self::UnknownValue(u) => u.0.name(),
8181 }
8182 }
8183 }
8184
8185 impl std::default::Default for FindingClass {
8186 fn default() -> Self {
8187 use std::convert::From;
8188 Self::from(0)
8189 }
8190 }
8191
8192 impl std::fmt::Display for FindingClass {
8193 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8194 wkt::internal::display_enum(f, self.name(), self.value())
8195 }
8196 }
8197
8198 impl std::convert::From<i32> for FindingClass {
8199 fn from(value: i32) -> Self {
8200 match value {
8201 0 => Self::Unspecified,
8202 1 => Self::Threat,
8203 2 => Self::Vulnerability,
8204 3 => Self::Misconfiguration,
8205 4 => Self::Observation,
8206 5 => Self::SccError,
8207 6 => Self::PostureViolation,
8208 7 => Self::ToxicCombination,
8209 8 => Self::SensitiveDataRisk,
8210 9 => Self::Chokepoint,
8211 _ => Self::UnknownValue(finding_class::UnknownValue(
8212 wkt::internal::UnknownEnumValue::Integer(value),
8213 )),
8214 }
8215 }
8216 }
8217
8218 impl std::convert::From<&str> for FindingClass {
8219 fn from(value: &str) -> Self {
8220 use std::string::ToString;
8221 match value {
8222 "FINDING_CLASS_UNSPECIFIED" => Self::Unspecified,
8223 "THREAT" => Self::Threat,
8224 "VULNERABILITY" => Self::Vulnerability,
8225 "MISCONFIGURATION" => Self::Misconfiguration,
8226 "OBSERVATION" => Self::Observation,
8227 "SCC_ERROR" => Self::SccError,
8228 "POSTURE_VIOLATION" => Self::PostureViolation,
8229 "TOXIC_COMBINATION" => Self::ToxicCombination,
8230 "SENSITIVE_DATA_RISK" => Self::SensitiveDataRisk,
8231 "CHOKEPOINT" => Self::Chokepoint,
8232 _ => Self::UnknownValue(finding_class::UnknownValue(
8233 wkt::internal::UnknownEnumValue::String(value.to_string()),
8234 )),
8235 }
8236 }
8237 }
8238
8239 impl serde::ser::Serialize for FindingClass {
8240 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8241 where
8242 S: serde::Serializer,
8243 {
8244 match self {
8245 Self::Unspecified => serializer.serialize_i32(0),
8246 Self::Threat => serializer.serialize_i32(1),
8247 Self::Vulnerability => serializer.serialize_i32(2),
8248 Self::Misconfiguration => serializer.serialize_i32(3),
8249 Self::Observation => serializer.serialize_i32(4),
8250 Self::SccError => serializer.serialize_i32(5),
8251 Self::PostureViolation => serializer.serialize_i32(6),
8252 Self::ToxicCombination => serializer.serialize_i32(7),
8253 Self::SensitiveDataRisk => serializer.serialize_i32(8),
8254 Self::Chokepoint => serializer.serialize_i32(9),
8255 Self::UnknownValue(u) => u.0.serialize(serializer),
8256 }
8257 }
8258 }
8259
8260 impl<'de> serde::de::Deserialize<'de> for FindingClass {
8261 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8262 where
8263 D: serde::Deserializer<'de>,
8264 {
8265 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingClass>::new(
8266 ".google.cloud.securitycenter.v2.Finding.FindingClass",
8267 ))
8268 }
8269 }
8270}
8271
8272/// Message that contains the resource name and display name of a folder
8273/// resource.
8274#[derive(Clone, Default, PartialEq)]
8275#[non_exhaustive]
8276pub struct Folder {
8277 /// Full resource name of this folder. See:
8278 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
8279 pub resource_folder: std::string::String,
8280
8281 /// The user defined display name for this folder.
8282 pub resource_folder_display_name: std::string::String,
8283
8284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8285}
8286
8287impl Folder {
8288 pub fn new() -> Self {
8289 std::default::Default::default()
8290 }
8291
8292 /// Sets the value of [resource_folder][crate::model::Folder::resource_folder].
8293 ///
8294 /// # Example
8295 /// ```ignore,no_run
8296 /// # use google_cloud_securitycenter_v2::model::Folder;
8297 /// let x = Folder::new().set_resource_folder("example");
8298 /// ```
8299 pub fn set_resource_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8300 self.resource_folder = v.into();
8301 self
8302 }
8303
8304 /// Sets the value of [resource_folder_display_name][crate::model::Folder::resource_folder_display_name].
8305 ///
8306 /// # Example
8307 /// ```ignore,no_run
8308 /// # use google_cloud_securitycenter_v2::model::Folder;
8309 /// let x = Folder::new().set_resource_folder_display_name("example");
8310 /// ```
8311 pub fn set_resource_folder_display_name<T: std::convert::Into<std::string::String>>(
8312 mut self,
8313 v: T,
8314 ) -> Self {
8315 self.resource_folder_display_name = v.into();
8316 self
8317 }
8318}
8319
8320impl wkt::message::Message for Folder {
8321 fn typename() -> &'static str {
8322 "type.googleapis.com/google.cloud.securitycenter.v2.Folder"
8323 }
8324}
8325
8326/// Contains details about groups of which this finding is a member. A group is a
8327/// collection of findings that are related in some way.
8328#[derive(Clone, Default, PartialEq)]
8329#[non_exhaustive]
8330pub struct GroupMembership {
8331 /// Type of group.
8332 pub group_type: crate::model::group_membership::GroupType,
8333
8334 /// ID of the group.
8335 pub group_id: std::string::String,
8336
8337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8338}
8339
8340impl GroupMembership {
8341 pub fn new() -> Self {
8342 std::default::Default::default()
8343 }
8344
8345 /// Sets the value of [group_type][crate::model::GroupMembership::group_type].
8346 ///
8347 /// # Example
8348 /// ```ignore,no_run
8349 /// # use google_cloud_securitycenter_v2::model::GroupMembership;
8350 /// use google_cloud_securitycenter_v2::model::group_membership::GroupType;
8351 /// let x0 = GroupMembership::new().set_group_type(GroupType::ToxicCombination);
8352 /// let x1 = GroupMembership::new().set_group_type(GroupType::Chokepoint);
8353 /// ```
8354 pub fn set_group_type<T: std::convert::Into<crate::model::group_membership::GroupType>>(
8355 mut self,
8356 v: T,
8357 ) -> Self {
8358 self.group_type = v.into();
8359 self
8360 }
8361
8362 /// Sets the value of [group_id][crate::model::GroupMembership::group_id].
8363 ///
8364 /// # Example
8365 /// ```ignore,no_run
8366 /// # use google_cloud_securitycenter_v2::model::GroupMembership;
8367 /// let x = GroupMembership::new().set_group_id("example");
8368 /// ```
8369 pub fn set_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8370 self.group_id = v.into();
8371 self
8372 }
8373}
8374
8375impl wkt::message::Message for GroupMembership {
8376 fn typename() -> &'static str {
8377 "type.googleapis.com/google.cloud.securitycenter.v2.GroupMembership"
8378 }
8379}
8380
8381/// Defines additional types related to [GroupMembership].
8382pub mod group_membership {
8383 #[allow(unused_imports)]
8384 use super::*;
8385
8386 /// Possible types of groups.
8387 ///
8388 /// # Working with unknown values
8389 ///
8390 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8391 /// additional enum variants at any time. Adding new variants is not considered
8392 /// a breaking change. Applications should write their code in anticipation of:
8393 ///
8394 /// - New values appearing in future releases of the client library, **and**
8395 /// - New values received dynamically, without application changes.
8396 ///
8397 /// Please consult the [Working with enums] section in the user guide for some
8398 /// guidelines.
8399 ///
8400 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8401 #[derive(Clone, Debug, PartialEq)]
8402 #[non_exhaustive]
8403 pub enum GroupType {
8404 /// Default value.
8405 Unspecified,
8406 /// Group represents a toxic combination.
8407 ToxicCombination,
8408 /// Group represents a chokepoint.
8409 Chokepoint,
8410 /// If set, the enum was initialized with an unknown value.
8411 ///
8412 /// Applications can examine the value using [GroupType::value] or
8413 /// [GroupType::name].
8414 UnknownValue(group_type::UnknownValue),
8415 }
8416
8417 #[doc(hidden)]
8418 pub mod group_type {
8419 #[allow(unused_imports)]
8420 use super::*;
8421 #[derive(Clone, Debug, PartialEq)]
8422 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8423 }
8424
8425 impl GroupType {
8426 /// Gets the enum value.
8427 ///
8428 /// Returns `None` if the enum contains an unknown value deserialized from
8429 /// the string representation of enums.
8430 pub fn value(&self) -> std::option::Option<i32> {
8431 match self {
8432 Self::Unspecified => std::option::Option::Some(0),
8433 Self::ToxicCombination => std::option::Option::Some(1),
8434 Self::Chokepoint => std::option::Option::Some(3),
8435 Self::UnknownValue(u) => u.0.value(),
8436 }
8437 }
8438
8439 /// Gets the enum value as a string.
8440 ///
8441 /// Returns `None` if the enum contains an unknown value deserialized from
8442 /// the integer representation of enums.
8443 pub fn name(&self) -> std::option::Option<&str> {
8444 match self {
8445 Self::Unspecified => std::option::Option::Some("GROUP_TYPE_UNSPECIFIED"),
8446 Self::ToxicCombination => std::option::Option::Some("GROUP_TYPE_TOXIC_COMBINATION"),
8447 Self::Chokepoint => std::option::Option::Some("GROUP_TYPE_CHOKEPOINT"),
8448 Self::UnknownValue(u) => u.0.name(),
8449 }
8450 }
8451 }
8452
8453 impl std::default::Default for GroupType {
8454 fn default() -> Self {
8455 use std::convert::From;
8456 Self::from(0)
8457 }
8458 }
8459
8460 impl std::fmt::Display for GroupType {
8461 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8462 wkt::internal::display_enum(f, self.name(), self.value())
8463 }
8464 }
8465
8466 impl std::convert::From<i32> for GroupType {
8467 fn from(value: i32) -> Self {
8468 match value {
8469 0 => Self::Unspecified,
8470 1 => Self::ToxicCombination,
8471 3 => Self::Chokepoint,
8472 _ => Self::UnknownValue(group_type::UnknownValue(
8473 wkt::internal::UnknownEnumValue::Integer(value),
8474 )),
8475 }
8476 }
8477 }
8478
8479 impl std::convert::From<&str> for GroupType {
8480 fn from(value: &str) -> Self {
8481 use std::string::ToString;
8482 match value {
8483 "GROUP_TYPE_UNSPECIFIED" => Self::Unspecified,
8484 "GROUP_TYPE_TOXIC_COMBINATION" => Self::ToxicCombination,
8485 "GROUP_TYPE_CHOKEPOINT" => Self::Chokepoint,
8486 _ => Self::UnknownValue(group_type::UnknownValue(
8487 wkt::internal::UnknownEnumValue::String(value.to_string()),
8488 )),
8489 }
8490 }
8491 }
8492
8493 impl serde::ser::Serialize for GroupType {
8494 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8495 where
8496 S: serde::Serializer,
8497 {
8498 match self {
8499 Self::Unspecified => serializer.serialize_i32(0),
8500 Self::ToxicCombination => serializer.serialize_i32(1),
8501 Self::Chokepoint => serializer.serialize_i32(3),
8502 Self::UnknownValue(u) => u.0.serialize(serializer),
8503 }
8504 }
8505 }
8506
8507 impl<'de> serde::de::Deserialize<'de> for GroupType {
8508 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8509 where
8510 D: serde::Deserializer<'de>,
8511 {
8512 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GroupType>::new(
8513 ".google.cloud.securitycenter.v2.GroupMembership.GroupType",
8514 ))
8515 }
8516 }
8517}
8518
8519/// Represents a particular IAM binding, which captures a member's role addition,
8520/// removal, or state.
8521#[derive(Clone, Default, PartialEq)]
8522#[non_exhaustive]
8523pub struct IamBinding {
8524 /// The action that was performed on a Binding.
8525 pub action: crate::model::iam_binding::Action,
8526
8527 /// Role that is assigned to "members".
8528 /// For example, "roles/viewer", "roles/editor", or "roles/owner".
8529 pub role: std::string::String,
8530
8531 /// A single identity requesting access for a Cloud Platform resource, for
8532 /// example, "foo@google.com".
8533 pub member: std::string::String,
8534
8535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8536}
8537
8538impl IamBinding {
8539 pub fn new() -> Self {
8540 std::default::Default::default()
8541 }
8542
8543 /// Sets the value of [action][crate::model::IamBinding::action].
8544 ///
8545 /// # Example
8546 /// ```ignore,no_run
8547 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8548 /// use google_cloud_securitycenter_v2::model::iam_binding::Action;
8549 /// let x0 = IamBinding::new().set_action(Action::Add);
8550 /// let x1 = IamBinding::new().set_action(Action::Remove);
8551 /// ```
8552 pub fn set_action<T: std::convert::Into<crate::model::iam_binding::Action>>(
8553 mut self,
8554 v: T,
8555 ) -> Self {
8556 self.action = v.into();
8557 self
8558 }
8559
8560 /// Sets the value of [role][crate::model::IamBinding::role].
8561 ///
8562 /// # Example
8563 /// ```ignore,no_run
8564 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8565 /// let x = IamBinding::new().set_role("example");
8566 /// ```
8567 pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8568 self.role = v.into();
8569 self
8570 }
8571
8572 /// Sets the value of [member][crate::model::IamBinding::member].
8573 ///
8574 /// # Example
8575 /// ```ignore,no_run
8576 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8577 /// let x = IamBinding::new().set_member("example");
8578 /// ```
8579 pub fn set_member<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8580 self.member = v.into();
8581 self
8582 }
8583}
8584
8585impl wkt::message::Message for IamBinding {
8586 fn typename() -> &'static str {
8587 "type.googleapis.com/google.cloud.securitycenter.v2.IamBinding"
8588 }
8589}
8590
8591/// Defines additional types related to [IamBinding].
8592pub mod iam_binding {
8593 #[allow(unused_imports)]
8594 use super::*;
8595
8596 /// The type of action performed on a Binding in a policy.
8597 ///
8598 /// # Working with unknown values
8599 ///
8600 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8601 /// additional enum variants at any time. Adding new variants is not considered
8602 /// a breaking change. Applications should write their code in anticipation of:
8603 ///
8604 /// - New values appearing in future releases of the client library, **and**
8605 /// - New values received dynamically, without application changes.
8606 ///
8607 /// Please consult the [Working with enums] section in the user guide for some
8608 /// guidelines.
8609 ///
8610 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8611 #[derive(Clone, Debug, PartialEq)]
8612 #[non_exhaustive]
8613 pub enum Action {
8614 /// Unspecified.
8615 Unspecified,
8616 /// Addition of a Binding.
8617 Add,
8618 /// Removal of a Binding.
8619 Remove,
8620 /// If set, the enum was initialized with an unknown value.
8621 ///
8622 /// Applications can examine the value using [Action::value] or
8623 /// [Action::name].
8624 UnknownValue(action::UnknownValue),
8625 }
8626
8627 #[doc(hidden)]
8628 pub mod action {
8629 #[allow(unused_imports)]
8630 use super::*;
8631 #[derive(Clone, Debug, PartialEq)]
8632 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8633 }
8634
8635 impl Action {
8636 /// Gets the enum value.
8637 ///
8638 /// Returns `None` if the enum contains an unknown value deserialized from
8639 /// the string representation of enums.
8640 pub fn value(&self) -> std::option::Option<i32> {
8641 match self {
8642 Self::Unspecified => std::option::Option::Some(0),
8643 Self::Add => std::option::Option::Some(1),
8644 Self::Remove => std::option::Option::Some(2),
8645 Self::UnknownValue(u) => u.0.value(),
8646 }
8647 }
8648
8649 /// Gets the enum value as a string.
8650 ///
8651 /// Returns `None` if the enum contains an unknown value deserialized from
8652 /// the integer representation of enums.
8653 pub fn name(&self) -> std::option::Option<&str> {
8654 match self {
8655 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
8656 Self::Add => std::option::Option::Some("ADD"),
8657 Self::Remove => std::option::Option::Some("REMOVE"),
8658 Self::UnknownValue(u) => u.0.name(),
8659 }
8660 }
8661 }
8662
8663 impl std::default::Default for Action {
8664 fn default() -> Self {
8665 use std::convert::From;
8666 Self::from(0)
8667 }
8668 }
8669
8670 impl std::fmt::Display for Action {
8671 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8672 wkt::internal::display_enum(f, self.name(), self.value())
8673 }
8674 }
8675
8676 impl std::convert::From<i32> for Action {
8677 fn from(value: i32) -> Self {
8678 match value {
8679 0 => Self::Unspecified,
8680 1 => Self::Add,
8681 2 => Self::Remove,
8682 _ => Self::UnknownValue(action::UnknownValue(
8683 wkt::internal::UnknownEnumValue::Integer(value),
8684 )),
8685 }
8686 }
8687 }
8688
8689 impl std::convert::From<&str> for Action {
8690 fn from(value: &str) -> Self {
8691 use std::string::ToString;
8692 match value {
8693 "ACTION_UNSPECIFIED" => Self::Unspecified,
8694 "ADD" => Self::Add,
8695 "REMOVE" => Self::Remove,
8696 _ => Self::UnknownValue(action::UnknownValue(
8697 wkt::internal::UnknownEnumValue::String(value.to_string()),
8698 )),
8699 }
8700 }
8701 }
8702
8703 impl serde::ser::Serialize for Action {
8704 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8705 where
8706 S: serde::Serializer,
8707 {
8708 match self {
8709 Self::Unspecified => serializer.serialize_i32(0),
8710 Self::Add => serializer.serialize_i32(1),
8711 Self::Remove => serializer.serialize_i32(2),
8712 Self::UnknownValue(u) => u.0.serialize(serializer),
8713 }
8714 }
8715 }
8716
8717 impl<'de> serde::de::Deserialize<'de> for Action {
8718 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8719 where
8720 D: serde::Deserializer<'de>,
8721 {
8722 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
8723 ".google.cloud.securitycenter.v2.IamBinding.Action",
8724 ))
8725 }
8726 }
8727}
8728
8729/// Represents what's commonly known as an _indicator of compromise_ (IoC) in
8730/// computer forensics. This is an artifact observed on a network or in an
8731/// operating system that, with high confidence, indicates a computer intrusion.
8732/// For more information, see [Indicator of
8733/// compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise).
8734#[derive(Clone, Default, PartialEq)]
8735#[non_exhaustive]
8736pub struct Indicator {
8737 /// The list of IP addresses that are associated with the finding.
8738 pub ip_addresses: std::vec::Vec<std::string::String>,
8739
8740 /// List of domains associated to the Finding.
8741 pub domains: std::vec::Vec<std::string::String>,
8742
8743 /// The list of matched signatures indicating that the given
8744 /// process is present in the environment.
8745 pub signatures: std::vec::Vec<crate::model::indicator::ProcessSignature>,
8746
8747 /// The list of URIs associated to the Findings.
8748 pub uris: std::vec::Vec<std::string::String>,
8749
8750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8751}
8752
8753impl Indicator {
8754 pub fn new() -> Self {
8755 std::default::Default::default()
8756 }
8757
8758 /// Sets the value of [ip_addresses][crate::model::Indicator::ip_addresses].
8759 ///
8760 /// # Example
8761 /// ```ignore,no_run
8762 /// # use google_cloud_securitycenter_v2::model::Indicator;
8763 /// let x = Indicator::new().set_ip_addresses(["a", "b", "c"]);
8764 /// ```
8765 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
8766 where
8767 T: std::iter::IntoIterator<Item = V>,
8768 V: std::convert::Into<std::string::String>,
8769 {
8770 use std::iter::Iterator;
8771 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
8772 self
8773 }
8774
8775 /// Sets the value of [domains][crate::model::Indicator::domains].
8776 ///
8777 /// # Example
8778 /// ```ignore,no_run
8779 /// # use google_cloud_securitycenter_v2::model::Indicator;
8780 /// let x = Indicator::new().set_domains(["a", "b", "c"]);
8781 /// ```
8782 pub fn set_domains<T, V>(mut self, v: T) -> Self
8783 where
8784 T: std::iter::IntoIterator<Item = V>,
8785 V: std::convert::Into<std::string::String>,
8786 {
8787 use std::iter::Iterator;
8788 self.domains = v.into_iter().map(|i| i.into()).collect();
8789 self
8790 }
8791
8792 /// Sets the value of [signatures][crate::model::Indicator::signatures].
8793 ///
8794 /// # Example
8795 /// ```ignore,no_run
8796 /// # use google_cloud_securitycenter_v2::model::Indicator;
8797 /// use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8798 /// let x = Indicator::new()
8799 /// .set_signatures([
8800 /// ProcessSignature::default()/* use setters */,
8801 /// ProcessSignature::default()/* use (different) setters */,
8802 /// ]);
8803 /// ```
8804 pub fn set_signatures<T, V>(mut self, v: T) -> Self
8805 where
8806 T: std::iter::IntoIterator<Item = V>,
8807 V: std::convert::Into<crate::model::indicator::ProcessSignature>,
8808 {
8809 use std::iter::Iterator;
8810 self.signatures = v.into_iter().map(|i| i.into()).collect();
8811 self
8812 }
8813
8814 /// Sets the value of [uris][crate::model::Indicator::uris].
8815 ///
8816 /// # Example
8817 /// ```ignore,no_run
8818 /// # use google_cloud_securitycenter_v2::model::Indicator;
8819 /// let x = Indicator::new().set_uris(["a", "b", "c"]);
8820 /// ```
8821 pub fn set_uris<T, V>(mut self, v: T) -> Self
8822 where
8823 T: std::iter::IntoIterator<Item = V>,
8824 V: std::convert::Into<std::string::String>,
8825 {
8826 use std::iter::Iterator;
8827 self.uris = v.into_iter().map(|i| i.into()).collect();
8828 self
8829 }
8830}
8831
8832impl wkt::message::Message for Indicator {
8833 fn typename() -> &'static str {
8834 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator"
8835 }
8836}
8837
8838/// Defines additional types related to [Indicator].
8839pub mod indicator {
8840 #[allow(unused_imports)]
8841 use super::*;
8842
8843 /// Indicates what signature matched this process.
8844 #[derive(Clone, Default, PartialEq)]
8845 #[non_exhaustive]
8846 pub struct ProcessSignature {
8847 /// Describes the type of resource associated with the signature.
8848 pub signature_type: crate::model::indicator::process_signature::SignatureType,
8849
8850 /// The signature.
8851 pub signature: std::option::Option<crate::model::indicator::process_signature::Signature>,
8852
8853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8854 }
8855
8856 impl ProcessSignature {
8857 pub fn new() -> Self {
8858 std::default::Default::default()
8859 }
8860
8861 /// Sets the value of [signature_type][crate::model::indicator::ProcessSignature::signature_type].
8862 ///
8863 /// # Example
8864 /// ```ignore,no_run
8865 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8866 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::SignatureType;
8867 /// let x0 = ProcessSignature::new().set_signature_type(SignatureType::Process);
8868 /// let x1 = ProcessSignature::new().set_signature_type(SignatureType::File);
8869 /// ```
8870 pub fn set_signature_type<
8871 T: std::convert::Into<crate::model::indicator::process_signature::SignatureType>,
8872 >(
8873 mut self,
8874 v: T,
8875 ) -> Self {
8876 self.signature_type = v.into();
8877 self
8878 }
8879
8880 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature].
8881 ///
8882 /// Note that all the setters affecting `signature` are mutually
8883 /// exclusive.
8884 ///
8885 /// # Example
8886 /// ```ignore,no_run
8887 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8888 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
8889 /// let x = ProcessSignature::new().set_signature(Some(
8890 /// google_cloud_securitycenter_v2::model::indicator::process_signature::Signature::MemoryHashSignature(MemoryHashSignature::default().into())));
8891 /// ```
8892 pub fn set_signature<
8893 T: std::convert::Into<
8894 std::option::Option<crate::model::indicator::process_signature::Signature>,
8895 >,
8896 >(
8897 mut self,
8898 v: T,
8899 ) -> Self {
8900 self.signature = v.into();
8901 self
8902 }
8903
8904 /// The value of [signature][crate::model::indicator::ProcessSignature::signature]
8905 /// if it holds a `MemoryHashSignature`, `None` if the field is not set or
8906 /// holds a different branch.
8907 pub fn memory_hash_signature(
8908 &self,
8909 ) -> std::option::Option<
8910 &std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
8911 > {
8912 #[allow(unreachable_patterns)]
8913 self.signature.as_ref().and_then(|v| match v {
8914 crate::model::indicator::process_signature::Signature::MemoryHashSignature(v) => {
8915 std::option::Option::Some(v)
8916 }
8917 _ => std::option::Option::None,
8918 })
8919 }
8920
8921 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature]
8922 /// to hold a `MemoryHashSignature`.
8923 ///
8924 /// Note that all the setters affecting `signature` are
8925 /// mutually exclusive.
8926 ///
8927 /// # Example
8928 /// ```ignore,no_run
8929 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8930 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
8931 /// let x = ProcessSignature::new().set_memory_hash_signature(MemoryHashSignature::default()/* use setters */);
8932 /// assert!(x.memory_hash_signature().is_some());
8933 /// assert!(x.yara_rule_signature().is_none());
8934 /// ```
8935 pub fn set_memory_hash_signature<
8936 T: std::convert::Into<
8937 std::boxed::Box<
8938 crate::model::indicator::process_signature::MemoryHashSignature,
8939 >,
8940 >,
8941 >(
8942 mut self,
8943 v: T,
8944 ) -> Self {
8945 self.signature = std::option::Option::Some(
8946 crate::model::indicator::process_signature::Signature::MemoryHashSignature(
8947 v.into(),
8948 ),
8949 );
8950 self
8951 }
8952
8953 /// The value of [signature][crate::model::indicator::ProcessSignature::signature]
8954 /// if it holds a `YaraRuleSignature`, `None` if the field is not set or
8955 /// holds a different branch.
8956 pub fn yara_rule_signature(
8957 &self,
8958 ) -> std::option::Option<
8959 &std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
8960 > {
8961 #[allow(unreachable_patterns)]
8962 self.signature.as_ref().and_then(|v| match v {
8963 crate::model::indicator::process_signature::Signature::YaraRuleSignature(v) => {
8964 std::option::Option::Some(v)
8965 }
8966 _ => std::option::Option::None,
8967 })
8968 }
8969
8970 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature]
8971 /// to hold a `YaraRuleSignature`.
8972 ///
8973 /// Note that all the setters affecting `signature` are
8974 /// mutually exclusive.
8975 ///
8976 /// # Example
8977 /// ```ignore,no_run
8978 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8979 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::YaraRuleSignature;
8980 /// let x = ProcessSignature::new().set_yara_rule_signature(YaraRuleSignature::default()/* use setters */);
8981 /// assert!(x.yara_rule_signature().is_some());
8982 /// assert!(x.memory_hash_signature().is_none());
8983 /// ```
8984 pub fn set_yara_rule_signature<
8985 T: std::convert::Into<
8986 std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
8987 >,
8988 >(
8989 mut self,
8990 v: T,
8991 ) -> Self {
8992 self.signature = std::option::Option::Some(
8993 crate::model::indicator::process_signature::Signature::YaraRuleSignature(v.into()),
8994 );
8995 self
8996 }
8997 }
8998
8999 impl wkt::message::Message for ProcessSignature {
9000 fn typename() -> &'static str {
9001 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature"
9002 }
9003 }
9004
9005 /// Defines additional types related to [ProcessSignature].
9006 pub mod process_signature {
9007 #[allow(unused_imports)]
9008 use super::*;
9009
9010 /// A signature corresponding to memory page hashes.
9011 #[derive(Clone, Default, PartialEq)]
9012 #[non_exhaustive]
9013 pub struct MemoryHashSignature {
9014 /// The binary family.
9015 pub binary_family: std::string::String,
9016
9017 /// The list of memory hash detections contributing to the binary family
9018 /// match.
9019 pub detections: std::vec::Vec<
9020 crate::model::indicator::process_signature::memory_hash_signature::Detection,
9021 >,
9022
9023 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9024 }
9025
9026 impl MemoryHashSignature {
9027 pub fn new() -> Self {
9028 std::default::Default::default()
9029 }
9030
9031 /// Sets the value of [binary_family][crate::model::indicator::process_signature::MemoryHashSignature::binary_family].
9032 ///
9033 /// # Example
9034 /// ```ignore,no_run
9035 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
9036 /// let x = MemoryHashSignature::new().set_binary_family("example");
9037 /// ```
9038 pub fn set_binary_family<T: std::convert::Into<std::string::String>>(
9039 mut self,
9040 v: T,
9041 ) -> Self {
9042 self.binary_family = v.into();
9043 self
9044 }
9045
9046 /// Sets the value of [detections][crate::model::indicator::process_signature::MemoryHashSignature::detections].
9047 ///
9048 /// # Example
9049 /// ```ignore,no_run
9050 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
9051 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9052 /// let x = MemoryHashSignature::new()
9053 /// .set_detections([
9054 /// Detection::default()/* use setters */,
9055 /// Detection::default()/* use (different) setters */,
9056 /// ]);
9057 /// ```
9058 pub fn set_detections<T, V>(mut self, v: T) -> Self
9059 where
9060 T: std::iter::IntoIterator<Item = V>,
9061 V: std::convert::Into<crate::model::indicator::process_signature::memory_hash_signature::Detection>
9062 {
9063 use std::iter::Iterator;
9064 self.detections = v.into_iter().map(|i| i.into()).collect();
9065 self
9066 }
9067 }
9068
9069 impl wkt::message::Message for MemoryHashSignature {
9070 fn typename() -> &'static str {
9071 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature"
9072 }
9073 }
9074
9075 /// Defines additional types related to [MemoryHashSignature].
9076 pub mod memory_hash_signature {
9077 #[allow(unused_imports)]
9078 use super::*;
9079
9080 /// Memory hash detection contributing to the binary family match.
9081 #[derive(Clone, Default, PartialEq)]
9082 #[non_exhaustive]
9083 pub struct Detection {
9084 /// The name of the binary associated with the memory hash
9085 /// signature detection.
9086 pub binary: std::string::String,
9087
9088 /// The percentage of memory page hashes in the signature
9089 /// that were matched.
9090 pub percent_pages_matched: f64,
9091
9092 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9093 }
9094
9095 impl Detection {
9096 pub fn new() -> Self {
9097 std::default::Default::default()
9098 }
9099
9100 /// Sets the value of [binary][crate::model::indicator::process_signature::memory_hash_signature::Detection::binary].
9101 ///
9102 /// # Example
9103 /// ```ignore,no_run
9104 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9105 /// let x = Detection::new().set_binary("example");
9106 /// ```
9107 pub fn set_binary<T: std::convert::Into<std::string::String>>(
9108 mut self,
9109 v: T,
9110 ) -> Self {
9111 self.binary = v.into();
9112 self
9113 }
9114
9115 /// Sets the value of [percent_pages_matched][crate::model::indicator::process_signature::memory_hash_signature::Detection::percent_pages_matched].
9116 ///
9117 /// # Example
9118 /// ```ignore,no_run
9119 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9120 /// let x = Detection::new().set_percent_pages_matched(42.0);
9121 /// ```
9122 pub fn set_percent_pages_matched<T: std::convert::Into<f64>>(
9123 mut self,
9124 v: T,
9125 ) -> Self {
9126 self.percent_pages_matched = v.into();
9127 self
9128 }
9129 }
9130
9131 impl wkt::message::Message for Detection {
9132 fn typename() -> &'static str {
9133 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection"
9134 }
9135 }
9136 }
9137
9138 /// A signature corresponding to a YARA rule.
9139 #[derive(Clone, Default, PartialEq)]
9140 #[non_exhaustive]
9141 pub struct YaraRuleSignature {
9142 /// The name of the YARA rule.
9143 pub yara_rule: std::string::String,
9144
9145 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9146 }
9147
9148 impl YaraRuleSignature {
9149 pub fn new() -> Self {
9150 std::default::Default::default()
9151 }
9152
9153 /// Sets the value of [yara_rule][crate::model::indicator::process_signature::YaraRuleSignature::yara_rule].
9154 ///
9155 /// # Example
9156 /// ```ignore,no_run
9157 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::YaraRuleSignature;
9158 /// let x = YaraRuleSignature::new().set_yara_rule("example");
9159 /// ```
9160 pub fn set_yara_rule<T: std::convert::Into<std::string::String>>(
9161 mut self,
9162 v: T,
9163 ) -> Self {
9164 self.yara_rule = v.into();
9165 self
9166 }
9167 }
9168
9169 impl wkt::message::Message for YaraRuleSignature {
9170 fn typename() -> &'static str {
9171 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature"
9172 }
9173 }
9174
9175 /// Possible resource types to be associated with a signature.
9176 ///
9177 /// # Working with unknown values
9178 ///
9179 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9180 /// additional enum variants at any time. Adding new variants is not considered
9181 /// a breaking change. Applications should write their code in anticipation of:
9182 ///
9183 /// - New values appearing in future releases of the client library, **and**
9184 /// - New values received dynamically, without application changes.
9185 ///
9186 /// Please consult the [Working with enums] section in the user guide for some
9187 /// guidelines.
9188 ///
9189 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9190 #[derive(Clone, Debug, PartialEq)]
9191 #[non_exhaustive]
9192 pub enum SignatureType {
9193 /// The default signature type.
9194 Unspecified,
9195 /// Used for signatures concerning processes.
9196 Process,
9197 /// Used for signatures concerning disks.
9198 File,
9199 /// If set, the enum was initialized with an unknown value.
9200 ///
9201 /// Applications can examine the value using [SignatureType::value] or
9202 /// [SignatureType::name].
9203 UnknownValue(signature_type::UnknownValue),
9204 }
9205
9206 #[doc(hidden)]
9207 pub mod signature_type {
9208 #[allow(unused_imports)]
9209 use super::*;
9210 #[derive(Clone, Debug, PartialEq)]
9211 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9212 }
9213
9214 impl SignatureType {
9215 /// Gets the enum value.
9216 ///
9217 /// Returns `None` if the enum contains an unknown value deserialized from
9218 /// the string representation of enums.
9219 pub fn value(&self) -> std::option::Option<i32> {
9220 match self {
9221 Self::Unspecified => std::option::Option::Some(0),
9222 Self::Process => std::option::Option::Some(1),
9223 Self::File => std::option::Option::Some(2),
9224 Self::UnknownValue(u) => u.0.value(),
9225 }
9226 }
9227
9228 /// Gets the enum value as a string.
9229 ///
9230 /// Returns `None` if the enum contains an unknown value deserialized from
9231 /// the integer representation of enums.
9232 pub fn name(&self) -> std::option::Option<&str> {
9233 match self {
9234 Self::Unspecified => std::option::Option::Some("SIGNATURE_TYPE_UNSPECIFIED"),
9235 Self::Process => std::option::Option::Some("SIGNATURE_TYPE_PROCESS"),
9236 Self::File => std::option::Option::Some("SIGNATURE_TYPE_FILE"),
9237 Self::UnknownValue(u) => u.0.name(),
9238 }
9239 }
9240 }
9241
9242 impl std::default::Default for SignatureType {
9243 fn default() -> Self {
9244 use std::convert::From;
9245 Self::from(0)
9246 }
9247 }
9248
9249 impl std::fmt::Display for SignatureType {
9250 fn fmt(
9251 &self,
9252 f: &mut std::fmt::Formatter<'_>,
9253 ) -> std::result::Result<(), std::fmt::Error> {
9254 wkt::internal::display_enum(f, self.name(), self.value())
9255 }
9256 }
9257
9258 impl std::convert::From<i32> for SignatureType {
9259 fn from(value: i32) -> Self {
9260 match value {
9261 0 => Self::Unspecified,
9262 1 => Self::Process,
9263 2 => Self::File,
9264 _ => Self::UnknownValue(signature_type::UnknownValue(
9265 wkt::internal::UnknownEnumValue::Integer(value),
9266 )),
9267 }
9268 }
9269 }
9270
9271 impl std::convert::From<&str> for SignatureType {
9272 fn from(value: &str) -> Self {
9273 use std::string::ToString;
9274 match value {
9275 "SIGNATURE_TYPE_UNSPECIFIED" => Self::Unspecified,
9276 "SIGNATURE_TYPE_PROCESS" => Self::Process,
9277 "SIGNATURE_TYPE_FILE" => Self::File,
9278 _ => Self::UnknownValue(signature_type::UnknownValue(
9279 wkt::internal::UnknownEnumValue::String(value.to_string()),
9280 )),
9281 }
9282 }
9283 }
9284
9285 impl serde::ser::Serialize for SignatureType {
9286 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9287 where
9288 S: serde::Serializer,
9289 {
9290 match self {
9291 Self::Unspecified => serializer.serialize_i32(0),
9292 Self::Process => serializer.serialize_i32(1),
9293 Self::File => serializer.serialize_i32(2),
9294 Self::UnknownValue(u) => u.0.serialize(serializer),
9295 }
9296 }
9297 }
9298
9299 impl<'de> serde::de::Deserialize<'de> for SignatureType {
9300 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9301 where
9302 D: serde::Deserializer<'de>,
9303 {
9304 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignatureType>::new(
9305 ".google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType",
9306 ))
9307 }
9308 }
9309
9310 /// The signature.
9311 #[derive(Clone, Debug, PartialEq)]
9312 #[non_exhaustive]
9313 pub enum Signature {
9314 /// Signature indicating that a binary family was matched.
9315 MemoryHashSignature(
9316 std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
9317 ),
9318 /// Signature indicating that a YARA rule was matched.
9319 YaraRuleSignature(
9320 std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
9321 ),
9322 }
9323 }
9324}
9325
9326/// IP rules associated with the finding.
9327#[derive(Clone, Default, PartialEq)]
9328#[non_exhaustive]
9329pub struct IpRules {
9330 /// The direction that the rule is applicable to, one of ingress or egress.
9331 pub direction: crate::model::ip_rules::Direction,
9332
9333 /// If source IP ranges are specified, the firewall rule applies only to
9334 /// traffic that has a source IP address in these ranges. These ranges must be
9335 /// expressed in CIDR format. Only supports IPv4.
9336 pub source_ip_ranges: std::vec::Vec<std::string::String>,
9337
9338 /// If destination IP ranges are specified, the firewall rule applies only to
9339 /// traffic that has a destination IP address in these ranges. These ranges
9340 /// must be expressed in CIDR format. Only supports IPv4.
9341 pub destination_ip_ranges: std::vec::Vec<std::string::String>,
9342
9343 /// Name of the network protocol service, such as FTP, that is exposed by the
9344 /// open port. Follows the naming convention available at:
9345 /// <https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml>.
9346 pub exposed_services: std::vec::Vec<std::string::String>,
9347
9348 /// The list of allow rules specified by this firewall. Each rule specifies a
9349 /// protocol and port-range tuple that describes a permitted connection.
9350 pub rules: std::option::Option<crate::model::ip_rules::Rules>,
9351
9352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9353}
9354
9355impl IpRules {
9356 pub fn new() -> Self {
9357 std::default::Default::default()
9358 }
9359
9360 /// Sets the value of [direction][crate::model::IpRules::direction].
9361 ///
9362 /// # Example
9363 /// ```ignore,no_run
9364 /// # use google_cloud_securitycenter_v2::model::IpRules;
9365 /// use google_cloud_securitycenter_v2::model::ip_rules::Direction;
9366 /// let x0 = IpRules::new().set_direction(Direction::Ingress);
9367 /// let x1 = IpRules::new().set_direction(Direction::Egress);
9368 /// ```
9369 pub fn set_direction<T: std::convert::Into<crate::model::ip_rules::Direction>>(
9370 mut self,
9371 v: T,
9372 ) -> Self {
9373 self.direction = v.into();
9374 self
9375 }
9376
9377 /// Sets the value of [source_ip_ranges][crate::model::IpRules::source_ip_ranges].
9378 ///
9379 /// # Example
9380 /// ```ignore,no_run
9381 /// # use google_cloud_securitycenter_v2::model::IpRules;
9382 /// let x = IpRules::new().set_source_ip_ranges(["a", "b", "c"]);
9383 /// ```
9384 pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
9385 where
9386 T: std::iter::IntoIterator<Item = V>,
9387 V: std::convert::Into<std::string::String>,
9388 {
9389 use std::iter::Iterator;
9390 self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
9391 self
9392 }
9393
9394 /// Sets the value of [destination_ip_ranges][crate::model::IpRules::destination_ip_ranges].
9395 ///
9396 /// # Example
9397 /// ```ignore,no_run
9398 /// # use google_cloud_securitycenter_v2::model::IpRules;
9399 /// let x = IpRules::new().set_destination_ip_ranges(["a", "b", "c"]);
9400 /// ```
9401 pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
9402 where
9403 T: std::iter::IntoIterator<Item = V>,
9404 V: std::convert::Into<std::string::String>,
9405 {
9406 use std::iter::Iterator;
9407 self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
9408 self
9409 }
9410
9411 /// Sets the value of [exposed_services][crate::model::IpRules::exposed_services].
9412 ///
9413 /// # Example
9414 /// ```ignore,no_run
9415 /// # use google_cloud_securitycenter_v2::model::IpRules;
9416 /// let x = IpRules::new().set_exposed_services(["a", "b", "c"]);
9417 /// ```
9418 pub fn set_exposed_services<T, V>(mut self, v: T) -> Self
9419 where
9420 T: std::iter::IntoIterator<Item = V>,
9421 V: std::convert::Into<std::string::String>,
9422 {
9423 use std::iter::Iterator;
9424 self.exposed_services = v.into_iter().map(|i| i.into()).collect();
9425 self
9426 }
9427
9428 /// Sets the value of [rules][crate::model::IpRules::rules].
9429 ///
9430 /// Note that all the setters affecting `rules` are mutually
9431 /// exclusive.
9432 ///
9433 /// # Example
9434 /// ```ignore,no_run
9435 /// # use google_cloud_securitycenter_v2::model::IpRules;
9436 /// use google_cloud_securitycenter_v2::model::Allowed;
9437 /// let x = IpRules::new().set_rules(Some(
9438 /// google_cloud_securitycenter_v2::model::ip_rules::Rules::Allowed(Allowed::default().into())));
9439 /// ```
9440 pub fn set_rules<T: std::convert::Into<std::option::Option<crate::model::ip_rules::Rules>>>(
9441 mut self,
9442 v: T,
9443 ) -> Self {
9444 self.rules = v.into();
9445 self
9446 }
9447
9448 /// The value of [rules][crate::model::IpRules::rules]
9449 /// if it holds a `Allowed`, `None` if the field is not set or
9450 /// holds a different branch.
9451 pub fn allowed(&self) -> std::option::Option<&std::boxed::Box<crate::model::Allowed>> {
9452 #[allow(unreachable_patterns)]
9453 self.rules.as_ref().and_then(|v| match v {
9454 crate::model::ip_rules::Rules::Allowed(v) => std::option::Option::Some(v),
9455 _ => std::option::Option::None,
9456 })
9457 }
9458
9459 /// Sets the value of [rules][crate::model::IpRules::rules]
9460 /// to hold a `Allowed`.
9461 ///
9462 /// Note that all the setters affecting `rules` are
9463 /// mutually exclusive.
9464 ///
9465 /// # Example
9466 /// ```ignore,no_run
9467 /// # use google_cloud_securitycenter_v2::model::IpRules;
9468 /// use google_cloud_securitycenter_v2::model::Allowed;
9469 /// let x = IpRules::new().set_allowed(Allowed::default()/* use setters */);
9470 /// assert!(x.allowed().is_some());
9471 /// assert!(x.denied().is_none());
9472 /// ```
9473 pub fn set_allowed<T: std::convert::Into<std::boxed::Box<crate::model::Allowed>>>(
9474 mut self,
9475 v: T,
9476 ) -> Self {
9477 self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Allowed(v.into()));
9478 self
9479 }
9480
9481 /// The value of [rules][crate::model::IpRules::rules]
9482 /// if it holds a `Denied`, `None` if the field is not set or
9483 /// holds a different branch.
9484 pub fn denied(&self) -> std::option::Option<&std::boxed::Box<crate::model::Denied>> {
9485 #[allow(unreachable_patterns)]
9486 self.rules.as_ref().and_then(|v| match v {
9487 crate::model::ip_rules::Rules::Denied(v) => std::option::Option::Some(v),
9488 _ => std::option::Option::None,
9489 })
9490 }
9491
9492 /// Sets the value of [rules][crate::model::IpRules::rules]
9493 /// to hold a `Denied`.
9494 ///
9495 /// Note that all the setters affecting `rules` are
9496 /// mutually exclusive.
9497 ///
9498 /// # Example
9499 /// ```ignore,no_run
9500 /// # use google_cloud_securitycenter_v2::model::IpRules;
9501 /// use google_cloud_securitycenter_v2::model::Denied;
9502 /// let x = IpRules::new().set_denied(Denied::default()/* use setters */);
9503 /// assert!(x.denied().is_some());
9504 /// assert!(x.allowed().is_none());
9505 /// ```
9506 pub fn set_denied<T: std::convert::Into<std::boxed::Box<crate::model::Denied>>>(
9507 mut self,
9508 v: T,
9509 ) -> Self {
9510 self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Denied(v.into()));
9511 self
9512 }
9513}
9514
9515impl wkt::message::Message for IpRules {
9516 fn typename() -> &'static str {
9517 "type.googleapis.com/google.cloud.securitycenter.v2.IpRules"
9518 }
9519}
9520
9521/// Defines additional types related to [IpRules].
9522pub mod ip_rules {
9523 #[allow(unused_imports)]
9524 use super::*;
9525
9526 /// The type of direction that the rule is applicable to, one of ingress or
9527 /// egress. Not applicable to OPEN_X_PORT findings.
9528 ///
9529 /// # Working with unknown values
9530 ///
9531 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9532 /// additional enum variants at any time. Adding new variants is not considered
9533 /// a breaking change. Applications should write their code in anticipation of:
9534 ///
9535 /// - New values appearing in future releases of the client library, **and**
9536 /// - New values received dynamically, without application changes.
9537 ///
9538 /// Please consult the [Working with enums] section in the user guide for some
9539 /// guidelines.
9540 ///
9541 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9542 #[derive(Clone, Debug, PartialEq)]
9543 #[non_exhaustive]
9544 pub enum Direction {
9545 /// Unspecified direction value.
9546 Unspecified,
9547 /// Ingress direction value.
9548 Ingress,
9549 /// Egress direction value.
9550 Egress,
9551 /// If set, the enum was initialized with an unknown value.
9552 ///
9553 /// Applications can examine the value using [Direction::value] or
9554 /// [Direction::name].
9555 UnknownValue(direction::UnknownValue),
9556 }
9557
9558 #[doc(hidden)]
9559 pub mod direction {
9560 #[allow(unused_imports)]
9561 use super::*;
9562 #[derive(Clone, Debug, PartialEq)]
9563 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9564 }
9565
9566 impl Direction {
9567 /// Gets the enum value.
9568 ///
9569 /// Returns `None` if the enum contains an unknown value deserialized from
9570 /// the string representation of enums.
9571 pub fn value(&self) -> std::option::Option<i32> {
9572 match self {
9573 Self::Unspecified => std::option::Option::Some(0),
9574 Self::Ingress => std::option::Option::Some(1),
9575 Self::Egress => std::option::Option::Some(2),
9576 Self::UnknownValue(u) => u.0.value(),
9577 }
9578 }
9579
9580 /// Gets the enum value as a string.
9581 ///
9582 /// Returns `None` if the enum contains an unknown value deserialized from
9583 /// the integer representation of enums.
9584 pub fn name(&self) -> std::option::Option<&str> {
9585 match self {
9586 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
9587 Self::Ingress => std::option::Option::Some("INGRESS"),
9588 Self::Egress => std::option::Option::Some("EGRESS"),
9589 Self::UnknownValue(u) => u.0.name(),
9590 }
9591 }
9592 }
9593
9594 impl std::default::Default for Direction {
9595 fn default() -> Self {
9596 use std::convert::From;
9597 Self::from(0)
9598 }
9599 }
9600
9601 impl std::fmt::Display for Direction {
9602 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9603 wkt::internal::display_enum(f, self.name(), self.value())
9604 }
9605 }
9606
9607 impl std::convert::From<i32> for Direction {
9608 fn from(value: i32) -> Self {
9609 match value {
9610 0 => Self::Unspecified,
9611 1 => Self::Ingress,
9612 2 => Self::Egress,
9613 _ => Self::UnknownValue(direction::UnknownValue(
9614 wkt::internal::UnknownEnumValue::Integer(value),
9615 )),
9616 }
9617 }
9618 }
9619
9620 impl std::convert::From<&str> for Direction {
9621 fn from(value: &str) -> Self {
9622 use std::string::ToString;
9623 match value {
9624 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
9625 "INGRESS" => Self::Ingress,
9626 "EGRESS" => Self::Egress,
9627 _ => Self::UnknownValue(direction::UnknownValue(
9628 wkt::internal::UnknownEnumValue::String(value.to_string()),
9629 )),
9630 }
9631 }
9632 }
9633
9634 impl serde::ser::Serialize for Direction {
9635 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9636 where
9637 S: serde::Serializer,
9638 {
9639 match self {
9640 Self::Unspecified => serializer.serialize_i32(0),
9641 Self::Ingress => serializer.serialize_i32(1),
9642 Self::Egress => serializer.serialize_i32(2),
9643 Self::UnknownValue(u) => u.0.serialize(serializer),
9644 }
9645 }
9646 }
9647
9648 impl<'de> serde::de::Deserialize<'de> for Direction {
9649 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9650 where
9651 D: serde::Deserializer<'de>,
9652 {
9653 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
9654 ".google.cloud.securitycenter.v2.IpRules.Direction",
9655 ))
9656 }
9657 }
9658
9659 /// The list of allow rules specified by this firewall. Each rule specifies a
9660 /// protocol and port-range tuple that describes a permitted connection.
9661 #[derive(Clone, Debug, PartialEq)]
9662 #[non_exhaustive]
9663 pub enum Rules {
9664 /// Tuple with allowed rules.
9665 Allowed(std::boxed::Box<crate::model::Allowed>),
9666 /// Tuple with denied rules.
9667 Denied(std::boxed::Box<crate::model::Denied>),
9668 }
9669}
9670
9671/// IP rule information.
9672#[derive(Clone, Default, PartialEq)]
9673#[non_exhaustive]
9674pub struct IpRule {
9675 /// The IP protocol this rule applies to. This value can either be one of the
9676 /// following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,
9677 /// SCTP) or a string representation of the integer value.
9678 pub protocol: std::string::String,
9679
9680 /// Optional. An optional list of ports to which this rule applies. This field
9681 /// is only applicable for the UDP or (S)TCP protocols. Each entry must be
9682 /// either an integer or a range including a min and max port number.
9683 pub port_ranges: std::vec::Vec<crate::model::ip_rule::PortRange>,
9684
9685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9686}
9687
9688impl IpRule {
9689 pub fn new() -> Self {
9690 std::default::Default::default()
9691 }
9692
9693 /// Sets the value of [protocol][crate::model::IpRule::protocol].
9694 ///
9695 /// # Example
9696 /// ```ignore,no_run
9697 /// # use google_cloud_securitycenter_v2::model::IpRule;
9698 /// let x = IpRule::new().set_protocol("example");
9699 /// ```
9700 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9701 self.protocol = v.into();
9702 self
9703 }
9704
9705 /// Sets the value of [port_ranges][crate::model::IpRule::port_ranges].
9706 ///
9707 /// # Example
9708 /// ```ignore,no_run
9709 /// # use google_cloud_securitycenter_v2::model::IpRule;
9710 /// use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9711 /// let x = IpRule::new()
9712 /// .set_port_ranges([
9713 /// PortRange::default()/* use setters */,
9714 /// PortRange::default()/* use (different) setters */,
9715 /// ]);
9716 /// ```
9717 pub fn set_port_ranges<T, V>(mut self, v: T) -> Self
9718 where
9719 T: std::iter::IntoIterator<Item = V>,
9720 V: std::convert::Into<crate::model::ip_rule::PortRange>,
9721 {
9722 use std::iter::Iterator;
9723 self.port_ranges = v.into_iter().map(|i| i.into()).collect();
9724 self
9725 }
9726}
9727
9728impl wkt::message::Message for IpRule {
9729 fn typename() -> &'static str {
9730 "type.googleapis.com/google.cloud.securitycenter.v2.IpRule"
9731 }
9732}
9733
9734/// Defines additional types related to [IpRule].
9735pub mod ip_rule {
9736 #[allow(unused_imports)]
9737 use super::*;
9738
9739 /// A port range which is inclusive of the min and max values.
9740 /// Values are between 0 and 2^16-1. The max can be equal / must be not smaller
9741 /// than the min value. If min and max are equal this indicates that it is a
9742 /// single port.
9743 #[derive(Clone, Default, PartialEq)]
9744 #[non_exhaustive]
9745 pub struct PortRange {
9746 /// Minimum port value.
9747 pub min: i64,
9748
9749 /// Maximum port value.
9750 pub max: i64,
9751
9752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9753 }
9754
9755 impl PortRange {
9756 pub fn new() -> Self {
9757 std::default::Default::default()
9758 }
9759
9760 /// Sets the value of [min][crate::model::ip_rule::PortRange::min].
9761 ///
9762 /// # Example
9763 /// ```ignore,no_run
9764 /// # use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9765 /// let x = PortRange::new().set_min(42);
9766 /// ```
9767 pub fn set_min<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9768 self.min = v.into();
9769 self
9770 }
9771
9772 /// Sets the value of [max][crate::model::ip_rule::PortRange::max].
9773 ///
9774 /// # Example
9775 /// ```ignore,no_run
9776 /// # use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9777 /// let x = PortRange::new().set_max(42);
9778 /// ```
9779 pub fn set_max<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9780 self.max = v.into();
9781 self
9782 }
9783 }
9784
9785 impl wkt::message::Message for PortRange {
9786 fn typename() -> &'static str {
9787 "type.googleapis.com/google.cloud.securitycenter.v2.IpRule.PortRange"
9788 }
9789 }
9790}
9791
9792/// Allowed IP rule.
9793#[derive(Clone, Default, PartialEq)]
9794#[non_exhaustive]
9795pub struct Allowed {
9796 /// Optional. Optional list of allowed IP rules.
9797 pub ip_rules: std::vec::Vec<crate::model::IpRule>,
9798
9799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9800}
9801
9802impl Allowed {
9803 pub fn new() -> Self {
9804 std::default::Default::default()
9805 }
9806
9807 /// Sets the value of [ip_rules][crate::model::Allowed::ip_rules].
9808 ///
9809 /// # Example
9810 /// ```ignore,no_run
9811 /// # use google_cloud_securitycenter_v2::model::Allowed;
9812 /// use google_cloud_securitycenter_v2::model::IpRule;
9813 /// let x = Allowed::new()
9814 /// .set_ip_rules([
9815 /// IpRule::default()/* use setters */,
9816 /// IpRule::default()/* use (different) setters */,
9817 /// ]);
9818 /// ```
9819 pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
9820 where
9821 T: std::iter::IntoIterator<Item = V>,
9822 V: std::convert::Into<crate::model::IpRule>,
9823 {
9824 use std::iter::Iterator;
9825 self.ip_rules = v.into_iter().map(|i| i.into()).collect();
9826 self
9827 }
9828}
9829
9830impl wkt::message::Message for Allowed {
9831 fn typename() -> &'static str {
9832 "type.googleapis.com/google.cloud.securitycenter.v2.Allowed"
9833 }
9834}
9835
9836/// Denied IP rule.
9837#[derive(Clone, Default, PartialEq)]
9838#[non_exhaustive]
9839pub struct Denied {
9840 /// Optional. Optional list of denied IP rules.
9841 pub ip_rules: std::vec::Vec<crate::model::IpRule>,
9842
9843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9844}
9845
9846impl Denied {
9847 pub fn new() -> Self {
9848 std::default::Default::default()
9849 }
9850
9851 /// Sets the value of [ip_rules][crate::model::Denied::ip_rules].
9852 ///
9853 /// # Example
9854 /// ```ignore,no_run
9855 /// # use google_cloud_securitycenter_v2::model::Denied;
9856 /// use google_cloud_securitycenter_v2::model::IpRule;
9857 /// let x = Denied::new()
9858 /// .set_ip_rules([
9859 /// IpRule::default()/* use setters */,
9860 /// IpRule::default()/* use (different) setters */,
9861 /// ]);
9862 /// ```
9863 pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
9864 where
9865 T: std::iter::IntoIterator<Item = V>,
9866 V: std::convert::Into<crate::model::IpRule>,
9867 {
9868 use std::iter::Iterator;
9869 self.ip_rules = v.into_iter().map(|i| i.into()).collect();
9870 self
9871 }
9872}
9873
9874impl wkt::message::Message for Denied {
9875 fn typename() -> &'static str {
9876 "type.googleapis.com/google.cloud.securitycenter.v2.Denied"
9877 }
9878}
9879
9880/// Describes a job
9881#[derive(Clone, Default, PartialEq)]
9882#[non_exhaustive]
9883pub struct Job {
9884 /// The fully-qualified name for a job.
9885 /// e.g. `projects/<project_id>/jobs/<job_id>`
9886 pub name: std::string::String,
9887
9888 /// Output only. State of the job, such as `RUNNING` or `PENDING`.
9889 pub state: crate::model::JobState,
9890
9891 /// Optional. If the job did not complete successfully, this field describes
9892 /// why.
9893 pub error_code: i32,
9894
9895 /// Optional. Gives the location where the job ran, such as `US` or
9896 /// `europe-west1`
9897 pub location: std::string::String,
9898
9899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9900}
9901
9902impl Job {
9903 pub fn new() -> Self {
9904 std::default::Default::default()
9905 }
9906
9907 /// Sets the value of [name][crate::model::Job::name].
9908 ///
9909 /// # Example
9910 /// ```ignore,no_run
9911 /// # use google_cloud_securitycenter_v2::model::Job;
9912 /// let x = Job::new().set_name("example");
9913 /// ```
9914 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9915 self.name = v.into();
9916 self
9917 }
9918
9919 /// Sets the value of [state][crate::model::Job::state].
9920 ///
9921 /// # Example
9922 /// ```ignore,no_run
9923 /// # use google_cloud_securitycenter_v2::model::Job;
9924 /// use google_cloud_securitycenter_v2::model::JobState;
9925 /// let x0 = Job::new().set_state(JobState::Pending);
9926 /// let x1 = Job::new().set_state(JobState::Running);
9927 /// let x2 = Job::new().set_state(JobState::Succeeded);
9928 /// ```
9929 pub fn set_state<T: std::convert::Into<crate::model::JobState>>(mut self, v: T) -> Self {
9930 self.state = v.into();
9931 self
9932 }
9933
9934 /// Sets the value of [error_code][crate::model::Job::error_code].
9935 ///
9936 /// # Example
9937 /// ```ignore,no_run
9938 /// # use google_cloud_securitycenter_v2::model::Job;
9939 /// let x = Job::new().set_error_code(42);
9940 /// ```
9941 pub fn set_error_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9942 self.error_code = v.into();
9943 self
9944 }
9945
9946 /// Sets the value of [location][crate::model::Job::location].
9947 ///
9948 /// # Example
9949 /// ```ignore,no_run
9950 /// # use google_cloud_securitycenter_v2::model::Job;
9951 /// let x = Job::new().set_location("example");
9952 /// ```
9953 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9954 self.location = v.into();
9955 self
9956 }
9957}
9958
9959impl wkt::message::Message for Job {
9960 fn typename() -> &'static str {
9961 "type.googleapis.com/google.cloud.securitycenter.v2.Job"
9962 }
9963}
9964
9965/// Kernel mode rootkit signatures.
9966#[derive(Clone, Default, PartialEq)]
9967#[non_exhaustive]
9968pub struct KernelRootkit {
9969 /// Rootkit name, when available.
9970 pub name: std::string::String,
9971
9972 /// True if unexpected modifications of kernel code memory are present.
9973 pub unexpected_code_modification: bool,
9974
9975 /// True if unexpected modifications of kernel read-only data memory are
9976 /// present.
9977 pub unexpected_read_only_data_modification: bool,
9978
9979 /// True if `ftrace` points are present with callbacks pointing to regions
9980 /// that are not in the expected kernel or module code range.
9981 pub unexpected_ftrace_handler: bool,
9982
9983 /// True if `kprobe` points are present with callbacks pointing to regions
9984 /// that are not in the expected kernel or module code range.
9985 pub unexpected_kprobe_handler: bool,
9986
9987 /// True if kernel code pages that are not in the expected kernel or module
9988 /// code regions are present.
9989 pub unexpected_kernel_code_pages: bool,
9990
9991 /// True if system call handlers that are are not in the expected kernel or
9992 /// module code regions are present.
9993 pub unexpected_system_call_handler: bool,
9994
9995 /// True if interrupt handlers that are are not in the expected kernel or
9996 /// module code regions are present.
9997 pub unexpected_interrupt_handler: bool,
9998
9999 /// True if unexpected processes in the scheduler run queue are present. Such
10000 /// processes are in the run queue, but not in the process task list.
10001 pub unexpected_processes_in_runqueue: bool,
10002
10003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10004}
10005
10006impl KernelRootkit {
10007 pub fn new() -> Self {
10008 std::default::Default::default()
10009 }
10010
10011 /// Sets the value of [name][crate::model::KernelRootkit::name].
10012 ///
10013 /// # Example
10014 /// ```ignore,no_run
10015 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10016 /// let x = KernelRootkit::new().set_name("example");
10017 /// ```
10018 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10019 self.name = v.into();
10020 self
10021 }
10022
10023 /// Sets the value of [unexpected_code_modification][crate::model::KernelRootkit::unexpected_code_modification].
10024 ///
10025 /// # Example
10026 /// ```ignore,no_run
10027 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10028 /// let x = KernelRootkit::new().set_unexpected_code_modification(true);
10029 /// ```
10030 pub fn set_unexpected_code_modification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10031 self.unexpected_code_modification = v.into();
10032 self
10033 }
10034
10035 /// Sets the value of [unexpected_read_only_data_modification][crate::model::KernelRootkit::unexpected_read_only_data_modification].
10036 ///
10037 /// # Example
10038 /// ```ignore,no_run
10039 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10040 /// let x = KernelRootkit::new().set_unexpected_read_only_data_modification(true);
10041 /// ```
10042 pub fn set_unexpected_read_only_data_modification<T: std::convert::Into<bool>>(
10043 mut self,
10044 v: T,
10045 ) -> Self {
10046 self.unexpected_read_only_data_modification = v.into();
10047 self
10048 }
10049
10050 /// Sets the value of [unexpected_ftrace_handler][crate::model::KernelRootkit::unexpected_ftrace_handler].
10051 ///
10052 /// # Example
10053 /// ```ignore,no_run
10054 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10055 /// let x = KernelRootkit::new().set_unexpected_ftrace_handler(true);
10056 /// ```
10057 pub fn set_unexpected_ftrace_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10058 self.unexpected_ftrace_handler = v.into();
10059 self
10060 }
10061
10062 /// Sets the value of [unexpected_kprobe_handler][crate::model::KernelRootkit::unexpected_kprobe_handler].
10063 ///
10064 /// # Example
10065 /// ```ignore,no_run
10066 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10067 /// let x = KernelRootkit::new().set_unexpected_kprobe_handler(true);
10068 /// ```
10069 pub fn set_unexpected_kprobe_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10070 self.unexpected_kprobe_handler = v.into();
10071 self
10072 }
10073
10074 /// Sets the value of [unexpected_kernel_code_pages][crate::model::KernelRootkit::unexpected_kernel_code_pages].
10075 ///
10076 /// # Example
10077 /// ```ignore,no_run
10078 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10079 /// let x = KernelRootkit::new().set_unexpected_kernel_code_pages(true);
10080 /// ```
10081 pub fn set_unexpected_kernel_code_pages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10082 self.unexpected_kernel_code_pages = v.into();
10083 self
10084 }
10085
10086 /// Sets the value of [unexpected_system_call_handler][crate::model::KernelRootkit::unexpected_system_call_handler].
10087 ///
10088 /// # Example
10089 /// ```ignore,no_run
10090 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10091 /// let x = KernelRootkit::new().set_unexpected_system_call_handler(true);
10092 /// ```
10093 pub fn set_unexpected_system_call_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10094 self.unexpected_system_call_handler = v.into();
10095 self
10096 }
10097
10098 /// Sets the value of [unexpected_interrupt_handler][crate::model::KernelRootkit::unexpected_interrupt_handler].
10099 ///
10100 /// # Example
10101 /// ```ignore,no_run
10102 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10103 /// let x = KernelRootkit::new().set_unexpected_interrupt_handler(true);
10104 /// ```
10105 pub fn set_unexpected_interrupt_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10106 self.unexpected_interrupt_handler = v.into();
10107 self
10108 }
10109
10110 /// Sets the value of [unexpected_processes_in_runqueue][crate::model::KernelRootkit::unexpected_processes_in_runqueue].
10111 ///
10112 /// # Example
10113 /// ```ignore,no_run
10114 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10115 /// let x = KernelRootkit::new().set_unexpected_processes_in_runqueue(true);
10116 /// ```
10117 pub fn set_unexpected_processes_in_runqueue<T: std::convert::Into<bool>>(
10118 mut self,
10119 v: T,
10120 ) -> Self {
10121 self.unexpected_processes_in_runqueue = v.into();
10122 self
10123 }
10124}
10125
10126impl wkt::message::Message for KernelRootkit {
10127 fn typename() -> &'static str {
10128 "type.googleapis.com/google.cloud.securitycenter.v2.KernelRootkit"
10129 }
10130}
10131
10132/// Kubernetes-related attributes.
10133#[derive(Clone, Default, PartialEq)]
10134#[non_exhaustive]
10135pub struct Kubernetes {
10136 /// Kubernetes
10137 /// [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
10138 /// associated with the finding. This field contains Pod records for each
10139 /// container that is owned by a Pod.
10140 pub pods: std::vec::Vec<crate::model::kubernetes::Pod>,
10141
10142 /// Provides Kubernetes
10143 /// [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes)
10144 /// information.
10145 pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
10146
10147 /// GKE [node
10148 /// pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools)
10149 /// associated with the finding. This field contains node pool information for
10150 /// each node, when it is available.
10151 pub node_pools: std::vec::Vec<crate::model::kubernetes::NodePool>,
10152
10153 /// Provides Kubernetes role information for findings that involve [Roles or
10154 /// ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control).
10155 pub roles: std::vec::Vec<crate::model::kubernetes::Role>,
10156
10157 /// Provides Kubernetes role binding information for findings that involve
10158 /// [RoleBindings or
10159 /// ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control).
10160 pub bindings: std::vec::Vec<crate::model::kubernetes::Binding>,
10161
10162 /// Provides information on any Kubernetes access reviews (privilege checks)
10163 /// relevant to the finding.
10164 pub access_reviews: std::vec::Vec<crate::model::kubernetes::AccessReview>,
10165
10166 /// Kubernetes objects related to the finding.
10167 pub objects: std::vec::Vec<crate::model::kubernetes::Object>,
10168
10169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10170}
10171
10172impl Kubernetes {
10173 pub fn new() -> Self {
10174 std::default::Default::default()
10175 }
10176
10177 /// Sets the value of [pods][crate::model::Kubernetes::pods].
10178 ///
10179 /// # Example
10180 /// ```ignore,no_run
10181 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10182 /// use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10183 /// let x = Kubernetes::new()
10184 /// .set_pods([
10185 /// Pod::default()/* use setters */,
10186 /// Pod::default()/* use (different) setters */,
10187 /// ]);
10188 /// ```
10189 pub fn set_pods<T, V>(mut self, v: T) -> Self
10190 where
10191 T: std::iter::IntoIterator<Item = V>,
10192 V: std::convert::Into<crate::model::kubernetes::Pod>,
10193 {
10194 use std::iter::Iterator;
10195 self.pods = v.into_iter().map(|i| i.into()).collect();
10196 self
10197 }
10198
10199 /// Sets the value of [nodes][crate::model::Kubernetes::nodes].
10200 ///
10201 /// # Example
10202 /// ```ignore,no_run
10203 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10204 /// use google_cloud_securitycenter_v2::model::kubernetes::Node;
10205 /// let x = Kubernetes::new()
10206 /// .set_nodes([
10207 /// Node::default()/* use setters */,
10208 /// Node::default()/* use (different) setters */,
10209 /// ]);
10210 /// ```
10211 pub fn set_nodes<T, V>(mut self, v: T) -> Self
10212 where
10213 T: std::iter::IntoIterator<Item = V>,
10214 V: std::convert::Into<crate::model::kubernetes::Node>,
10215 {
10216 use std::iter::Iterator;
10217 self.nodes = v.into_iter().map(|i| i.into()).collect();
10218 self
10219 }
10220
10221 /// Sets the value of [node_pools][crate::model::Kubernetes::node_pools].
10222 ///
10223 /// # Example
10224 /// ```ignore,no_run
10225 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10226 /// use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10227 /// let x = Kubernetes::new()
10228 /// .set_node_pools([
10229 /// NodePool::default()/* use setters */,
10230 /// NodePool::default()/* use (different) setters */,
10231 /// ]);
10232 /// ```
10233 pub fn set_node_pools<T, V>(mut self, v: T) -> Self
10234 where
10235 T: std::iter::IntoIterator<Item = V>,
10236 V: std::convert::Into<crate::model::kubernetes::NodePool>,
10237 {
10238 use std::iter::Iterator;
10239 self.node_pools = v.into_iter().map(|i| i.into()).collect();
10240 self
10241 }
10242
10243 /// Sets the value of [roles][crate::model::Kubernetes::roles].
10244 ///
10245 /// # Example
10246 /// ```ignore,no_run
10247 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10248 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10249 /// let x = Kubernetes::new()
10250 /// .set_roles([
10251 /// Role::default()/* use setters */,
10252 /// Role::default()/* use (different) setters */,
10253 /// ]);
10254 /// ```
10255 pub fn set_roles<T, V>(mut self, v: T) -> Self
10256 where
10257 T: std::iter::IntoIterator<Item = V>,
10258 V: std::convert::Into<crate::model::kubernetes::Role>,
10259 {
10260 use std::iter::Iterator;
10261 self.roles = v.into_iter().map(|i| i.into()).collect();
10262 self
10263 }
10264
10265 /// Sets the value of [bindings][crate::model::Kubernetes::bindings].
10266 ///
10267 /// # Example
10268 /// ```ignore,no_run
10269 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10270 /// use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10271 /// let x = Kubernetes::new()
10272 /// .set_bindings([
10273 /// Binding::default()/* use setters */,
10274 /// Binding::default()/* use (different) setters */,
10275 /// ]);
10276 /// ```
10277 pub fn set_bindings<T, V>(mut self, v: T) -> Self
10278 where
10279 T: std::iter::IntoIterator<Item = V>,
10280 V: std::convert::Into<crate::model::kubernetes::Binding>,
10281 {
10282 use std::iter::Iterator;
10283 self.bindings = v.into_iter().map(|i| i.into()).collect();
10284 self
10285 }
10286
10287 /// Sets the value of [access_reviews][crate::model::Kubernetes::access_reviews].
10288 ///
10289 /// # Example
10290 /// ```ignore,no_run
10291 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10292 /// use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
10293 /// let x = Kubernetes::new()
10294 /// .set_access_reviews([
10295 /// AccessReview::default()/* use setters */,
10296 /// AccessReview::default()/* use (different) setters */,
10297 /// ]);
10298 /// ```
10299 pub fn set_access_reviews<T, V>(mut self, v: T) -> Self
10300 where
10301 T: std::iter::IntoIterator<Item = V>,
10302 V: std::convert::Into<crate::model::kubernetes::AccessReview>,
10303 {
10304 use std::iter::Iterator;
10305 self.access_reviews = v.into_iter().map(|i| i.into()).collect();
10306 self
10307 }
10308
10309 /// Sets the value of [objects][crate::model::Kubernetes::objects].
10310 ///
10311 /// # Example
10312 /// ```ignore,no_run
10313 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10314 /// use google_cloud_securitycenter_v2::model::kubernetes::Object;
10315 /// let x = Kubernetes::new()
10316 /// .set_objects([
10317 /// Object::default()/* use setters */,
10318 /// Object::default()/* use (different) setters */,
10319 /// ]);
10320 /// ```
10321 pub fn set_objects<T, V>(mut self, v: T) -> Self
10322 where
10323 T: std::iter::IntoIterator<Item = V>,
10324 V: std::convert::Into<crate::model::kubernetes::Object>,
10325 {
10326 use std::iter::Iterator;
10327 self.objects = v.into_iter().map(|i| i.into()).collect();
10328 self
10329 }
10330}
10331
10332impl wkt::message::Message for Kubernetes {
10333 fn typename() -> &'static str {
10334 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes"
10335 }
10336}
10337
10338/// Defines additional types related to [Kubernetes].
10339pub mod kubernetes {
10340 #[allow(unused_imports)]
10341 use super::*;
10342
10343 /// A Kubernetes Pod.
10344 #[derive(Clone, Default, PartialEq)]
10345 #[non_exhaustive]
10346 pub struct Pod {
10347 /// Kubernetes Pod namespace.
10348 pub ns: std::string::String,
10349
10350 /// Kubernetes Pod name.
10351 pub name: std::string::String,
10352
10353 /// Pod labels. For Kubernetes containers, these are applied to the
10354 /// container.
10355 pub labels: std::vec::Vec<crate::model::Label>,
10356
10357 /// Pod containers associated with this finding, if any.
10358 pub containers: std::vec::Vec<crate::model::Container>,
10359
10360 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10361 }
10362
10363 impl Pod {
10364 pub fn new() -> Self {
10365 std::default::Default::default()
10366 }
10367
10368 /// Sets the value of [ns][crate::model::kubernetes::Pod::ns].
10369 ///
10370 /// # Example
10371 /// ```ignore,no_run
10372 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10373 /// let x = Pod::new().set_ns("example");
10374 /// ```
10375 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10376 self.ns = v.into();
10377 self
10378 }
10379
10380 /// Sets the value of [name][crate::model::kubernetes::Pod::name].
10381 ///
10382 /// # Example
10383 /// ```ignore,no_run
10384 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10385 /// let x = Pod::new().set_name("example");
10386 /// ```
10387 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10388 self.name = v.into();
10389 self
10390 }
10391
10392 /// Sets the value of [labels][crate::model::kubernetes::Pod::labels].
10393 ///
10394 /// # Example
10395 /// ```ignore,no_run
10396 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10397 /// use google_cloud_securitycenter_v2::model::Label;
10398 /// let x = Pod::new()
10399 /// .set_labels([
10400 /// Label::default()/* use setters */,
10401 /// Label::default()/* use (different) setters */,
10402 /// ]);
10403 /// ```
10404 pub fn set_labels<T, V>(mut self, v: T) -> Self
10405 where
10406 T: std::iter::IntoIterator<Item = V>,
10407 V: std::convert::Into<crate::model::Label>,
10408 {
10409 use std::iter::Iterator;
10410 self.labels = v.into_iter().map(|i| i.into()).collect();
10411 self
10412 }
10413
10414 /// Sets the value of [containers][crate::model::kubernetes::Pod::containers].
10415 ///
10416 /// # Example
10417 /// ```ignore,no_run
10418 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10419 /// use google_cloud_securitycenter_v2::model::Container;
10420 /// let x = Pod::new()
10421 /// .set_containers([
10422 /// Container::default()/* use setters */,
10423 /// Container::default()/* use (different) setters */,
10424 /// ]);
10425 /// ```
10426 pub fn set_containers<T, V>(mut self, v: T) -> Self
10427 where
10428 T: std::iter::IntoIterator<Item = V>,
10429 V: std::convert::Into<crate::model::Container>,
10430 {
10431 use std::iter::Iterator;
10432 self.containers = v.into_iter().map(|i| i.into()).collect();
10433 self
10434 }
10435 }
10436
10437 impl wkt::message::Message for Pod {
10438 fn typename() -> &'static str {
10439 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Pod"
10440 }
10441 }
10442
10443 /// Kubernetes nodes associated with the finding.
10444 #[derive(Clone, Default, PartialEq)]
10445 #[non_exhaustive]
10446 pub struct Node {
10447 /// [Full resource name](https://google.aip.dev/122#full-resource-names) of
10448 /// the Compute Engine VM running the cluster node.
10449 pub name: std::string::String,
10450
10451 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10452 }
10453
10454 impl Node {
10455 pub fn new() -> Self {
10456 std::default::Default::default()
10457 }
10458
10459 /// Sets the value of [name][crate::model::kubernetes::Node::name].
10460 ///
10461 /// # Example
10462 /// ```ignore,no_run
10463 /// # use google_cloud_securitycenter_v2::model::kubernetes::Node;
10464 /// let x = Node::new().set_name("example");
10465 /// ```
10466 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10467 self.name = v.into();
10468 self
10469 }
10470 }
10471
10472 impl wkt::message::Message for Node {
10473 fn typename() -> &'static str {
10474 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Node"
10475 }
10476 }
10477
10478 /// Provides GKE node pool information.
10479 #[derive(Clone, Default, PartialEq)]
10480 #[non_exhaustive]
10481 pub struct NodePool {
10482 /// Kubernetes node pool name.
10483 pub name: std::string::String,
10484
10485 /// Nodes associated with the finding.
10486 pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
10487
10488 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10489 }
10490
10491 impl NodePool {
10492 pub fn new() -> Self {
10493 std::default::Default::default()
10494 }
10495
10496 /// Sets the value of [name][crate::model::kubernetes::NodePool::name].
10497 ///
10498 /// # Example
10499 /// ```ignore,no_run
10500 /// # use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10501 /// let x = NodePool::new().set_name("example");
10502 /// ```
10503 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10504 self.name = v.into();
10505 self
10506 }
10507
10508 /// Sets the value of [nodes][crate::model::kubernetes::NodePool::nodes].
10509 ///
10510 /// # Example
10511 /// ```ignore,no_run
10512 /// # use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10513 /// use google_cloud_securitycenter_v2::model::kubernetes::Node;
10514 /// let x = NodePool::new()
10515 /// .set_nodes([
10516 /// Node::default()/* use setters */,
10517 /// Node::default()/* use (different) setters */,
10518 /// ]);
10519 /// ```
10520 pub fn set_nodes<T, V>(mut self, v: T) -> Self
10521 where
10522 T: std::iter::IntoIterator<Item = V>,
10523 V: std::convert::Into<crate::model::kubernetes::Node>,
10524 {
10525 use std::iter::Iterator;
10526 self.nodes = v.into_iter().map(|i| i.into()).collect();
10527 self
10528 }
10529 }
10530
10531 impl wkt::message::Message for NodePool {
10532 fn typename() -> &'static str {
10533 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.NodePool"
10534 }
10535 }
10536
10537 /// Kubernetes Role or ClusterRole.
10538 #[derive(Clone, Default, PartialEq)]
10539 #[non_exhaustive]
10540 pub struct Role {
10541 /// Role type.
10542 pub kind: crate::model::kubernetes::role::Kind,
10543
10544 /// Role namespace.
10545 pub ns: std::string::String,
10546
10547 /// Role name.
10548 pub name: std::string::String,
10549
10550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10551 }
10552
10553 impl Role {
10554 pub fn new() -> Self {
10555 std::default::Default::default()
10556 }
10557
10558 /// Sets the value of [kind][crate::model::kubernetes::Role::kind].
10559 ///
10560 /// # Example
10561 /// ```ignore,no_run
10562 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10563 /// use google_cloud_securitycenter_v2::model::kubernetes::role::Kind;
10564 /// let x0 = Role::new().set_kind(Kind::Role);
10565 /// let x1 = Role::new().set_kind(Kind::ClusterRole);
10566 /// ```
10567 pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::role::Kind>>(
10568 mut self,
10569 v: T,
10570 ) -> Self {
10571 self.kind = v.into();
10572 self
10573 }
10574
10575 /// Sets the value of [ns][crate::model::kubernetes::Role::ns].
10576 ///
10577 /// # Example
10578 /// ```ignore,no_run
10579 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10580 /// let x = Role::new().set_ns("example");
10581 /// ```
10582 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10583 self.ns = v.into();
10584 self
10585 }
10586
10587 /// Sets the value of [name][crate::model::kubernetes::Role::name].
10588 ///
10589 /// # Example
10590 /// ```ignore,no_run
10591 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10592 /// let x = Role::new().set_name("example");
10593 /// ```
10594 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10595 self.name = v.into();
10596 self
10597 }
10598 }
10599
10600 impl wkt::message::Message for Role {
10601 fn typename() -> &'static str {
10602 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Role"
10603 }
10604 }
10605
10606 /// Defines additional types related to [Role].
10607 pub mod role {
10608 #[allow(unused_imports)]
10609 use super::*;
10610
10611 /// Types of Kubernetes roles.
10612 ///
10613 /// # Working with unknown values
10614 ///
10615 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10616 /// additional enum variants at any time. Adding new variants is not considered
10617 /// a breaking change. Applications should write their code in anticipation of:
10618 ///
10619 /// - New values appearing in future releases of the client library, **and**
10620 /// - New values received dynamically, without application changes.
10621 ///
10622 /// Please consult the [Working with enums] section in the user guide for some
10623 /// guidelines.
10624 ///
10625 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10626 #[derive(Clone, Debug, PartialEq)]
10627 #[non_exhaustive]
10628 pub enum Kind {
10629 /// Role type is not specified.
10630 Unspecified,
10631 /// Kubernetes Role.
10632 Role,
10633 /// Kubernetes ClusterRole.
10634 ClusterRole,
10635 /// If set, the enum was initialized with an unknown value.
10636 ///
10637 /// Applications can examine the value using [Kind::value] or
10638 /// [Kind::name].
10639 UnknownValue(kind::UnknownValue),
10640 }
10641
10642 #[doc(hidden)]
10643 pub mod kind {
10644 #[allow(unused_imports)]
10645 use super::*;
10646 #[derive(Clone, Debug, PartialEq)]
10647 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10648 }
10649
10650 impl Kind {
10651 /// Gets the enum value.
10652 ///
10653 /// Returns `None` if the enum contains an unknown value deserialized from
10654 /// the string representation of enums.
10655 pub fn value(&self) -> std::option::Option<i32> {
10656 match self {
10657 Self::Unspecified => std::option::Option::Some(0),
10658 Self::Role => std::option::Option::Some(1),
10659 Self::ClusterRole => std::option::Option::Some(2),
10660 Self::UnknownValue(u) => u.0.value(),
10661 }
10662 }
10663
10664 /// Gets the enum value as a string.
10665 ///
10666 /// Returns `None` if the enum contains an unknown value deserialized from
10667 /// the integer representation of enums.
10668 pub fn name(&self) -> std::option::Option<&str> {
10669 match self {
10670 Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
10671 Self::Role => std::option::Option::Some("ROLE"),
10672 Self::ClusterRole => std::option::Option::Some("CLUSTER_ROLE"),
10673 Self::UnknownValue(u) => u.0.name(),
10674 }
10675 }
10676 }
10677
10678 impl std::default::Default for Kind {
10679 fn default() -> Self {
10680 use std::convert::From;
10681 Self::from(0)
10682 }
10683 }
10684
10685 impl std::fmt::Display for Kind {
10686 fn fmt(
10687 &self,
10688 f: &mut std::fmt::Formatter<'_>,
10689 ) -> std::result::Result<(), std::fmt::Error> {
10690 wkt::internal::display_enum(f, self.name(), self.value())
10691 }
10692 }
10693
10694 impl std::convert::From<i32> for Kind {
10695 fn from(value: i32) -> Self {
10696 match value {
10697 0 => Self::Unspecified,
10698 1 => Self::Role,
10699 2 => Self::ClusterRole,
10700 _ => Self::UnknownValue(kind::UnknownValue(
10701 wkt::internal::UnknownEnumValue::Integer(value),
10702 )),
10703 }
10704 }
10705 }
10706
10707 impl std::convert::From<&str> for Kind {
10708 fn from(value: &str) -> Self {
10709 use std::string::ToString;
10710 match value {
10711 "KIND_UNSPECIFIED" => Self::Unspecified,
10712 "ROLE" => Self::Role,
10713 "CLUSTER_ROLE" => Self::ClusterRole,
10714 _ => Self::UnknownValue(kind::UnknownValue(
10715 wkt::internal::UnknownEnumValue::String(value.to_string()),
10716 )),
10717 }
10718 }
10719 }
10720
10721 impl serde::ser::Serialize for Kind {
10722 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10723 where
10724 S: serde::Serializer,
10725 {
10726 match self {
10727 Self::Unspecified => serializer.serialize_i32(0),
10728 Self::Role => serializer.serialize_i32(1),
10729 Self::ClusterRole => serializer.serialize_i32(2),
10730 Self::UnknownValue(u) => u.0.serialize(serializer),
10731 }
10732 }
10733 }
10734
10735 impl<'de> serde::de::Deserialize<'de> for Kind {
10736 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10737 where
10738 D: serde::Deserializer<'de>,
10739 {
10740 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
10741 ".google.cloud.securitycenter.v2.Kubernetes.Role.Kind",
10742 ))
10743 }
10744 }
10745 }
10746
10747 /// Represents a Kubernetes RoleBinding or ClusterRoleBinding.
10748 #[derive(Clone, Default, PartialEq)]
10749 #[non_exhaustive]
10750 pub struct Binding {
10751 /// Namespace for the binding.
10752 pub ns: std::string::String,
10753
10754 /// Name for the binding.
10755 pub name: std::string::String,
10756
10757 /// The Role or ClusterRole referenced by the binding.
10758 pub role: std::option::Option<crate::model::kubernetes::Role>,
10759
10760 /// Represents one or more subjects that are bound to the role. Not always
10761 /// available for PATCH requests.
10762 pub subjects: std::vec::Vec<crate::model::kubernetes::Subject>,
10763
10764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10765 }
10766
10767 impl Binding {
10768 pub fn new() -> Self {
10769 std::default::Default::default()
10770 }
10771
10772 /// Sets the value of [ns][crate::model::kubernetes::Binding::ns].
10773 ///
10774 /// # Example
10775 /// ```ignore,no_run
10776 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10777 /// let x = Binding::new().set_ns("example");
10778 /// ```
10779 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10780 self.ns = v.into();
10781 self
10782 }
10783
10784 /// Sets the value of [name][crate::model::kubernetes::Binding::name].
10785 ///
10786 /// # Example
10787 /// ```ignore,no_run
10788 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10789 /// let x = Binding::new().set_name("example");
10790 /// ```
10791 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10792 self.name = v.into();
10793 self
10794 }
10795
10796 /// Sets the value of [role][crate::model::kubernetes::Binding::role].
10797 ///
10798 /// # Example
10799 /// ```ignore,no_run
10800 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10801 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10802 /// let x = Binding::new().set_role(Role::default()/* use setters */);
10803 /// ```
10804 pub fn set_role<T>(mut self, v: T) -> Self
10805 where
10806 T: std::convert::Into<crate::model::kubernetes::Role>,
10807 {
10808 self.role = std::option::Option::Some(v.into());
10809 self
10810 }
10811
10812 /// Sets or clears the value of [role][crate::model::kubernetes::Binding::role].
10813 ///
10814 /// # Example
10815 /// ```ignore,no_run
10816 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10817 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10818 /// let x = Binding::new().set_or_clear_role(Some(Role::default()/* use setters */));
10819 /// let x = Binding::new().set_or_clear_role(None::<Role>);
10820 /// ```
10821 pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
10822 where
10823 T: std::convert::Into<crate::model::kubernetes::Role>,
10824 {
10825 self.role = v.map(|x| x.into());
10826 self
10827 }
10828
10829 /// Sets the value of [subjects][crate::model::kubernetes::Binding::subjects].
10830 ///
10831 /// # Example
10832 /// ```ignore,no_run
10833 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10834 /// use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10835 /// let x = Binding::new()
10836 /// .set_subjects([
10837 /// Subject::default()/* use setters */,
10838 /// Subject::default()/* use (different) setters */,
10839 /// ]);
10840 /// ```
10841 pub fn set_subjects<T, V>(mut self, v: T) -> Self
10842 where
10843 T: std::iter::IntoIterator<Item = V>,
10844 V: std::convert::Into<crate::model::kubernetes::Subject>,
10845 {
10846 use std::iter::Iterator;
10847 self.subjects = v.into_iter().map(|i| i.into()).collect();
10848 self
10849 }
10850 }
10851
10852 impl wkt::message::Message for Binding {
10853 fn typename() -> &'static str {
10854 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Binding"
10855 }
10856 }
10857
10858 /// Represents a Kubernetes subject.
10859 #[derive(Clone, Default, PartialEq)]
10860 #[non_exhaustive]
10861 pub struct Subject {
10862 /// Authentication type for the subject.
10863 pub kind: crate::model::kubernetes::subject::AuthType,
10864
10865 /// Namespace for the subject.
10866 pub ns: std::string::String,
10867
10868 /// Name for the subject.
10869 pub name: std::string::String,
10870
10871 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10872 }
10873
10874 impl Subject {
10875 pub fn new() -> Self {
10876 std::default::Default::default()
10877 }
10878
10879 /// Sets the value of [kind][crate::model::kubernetes::Subject::kind].
10880 ///
10881 /// # Example
10882 /// ```ignore,no_run
10883 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10884 /// use google_cloud_securitycenter_v2::model::kubernetes::subject::AuthType;
10885 /// let x0 = Subject::new().set_kind(AuthType::User);
10886 /// let x1 = Subject::new().set_kind(AuthType::Serviceaccount);
10887 /// let x2 = Subject::new().set_kind(AuthType::Group);
10888 /// ```
10889 pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::subject::AuthType>>(
10890 mut self,
10891 v: T,
10892 ) -> Self {
10893 self.kind = v.into();
10894 self
10895 }
10896
10897 /// Sets the value of [ns][crate::model::kubernetes::Subject::ns].
10898 ///
10899 /// # Example
10900 /// ```ignore,no_run
10901 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10902 /// let x = Subject::new().set_ns("example");
10903 /// ```
10904 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10905 self.ns = v.into();
10906 self
10907 }
10908
10909 /// Sets the value of [name][crate::model::kubernetes::Subject::name].
10910 ///
10911 /// # Example
10912 /// ```ignore,no_run
10913 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10914 /// let x = Subject::new().set_name("example");
10915 /// ```
10916 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10917 self.name = v.into();
10918 self
10919 }
10920 }
10921
10922 impl wkt::message::Message for Subject {
10923 fn typename() -> &'static str {
10924 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Subject"
10925 }
10926 }
10927
10928 /// Defines additional types related to [Subject].
10929 pub mod subject {
10930 #[allow(unused_imports)]
10931 use super::*;
10932
10933 /// Auth types that can be used for the subject's kind field.
10934 ///
10935 /// # Working with unknown values
10936 ///
10937 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10938 /// additional enum variants at any time. Adding new variants is not considered
10939 /// a breaking change. Applications should write their code in anticipation of:
10940 ///
10941 /// - New values appearing in future releases of the client library, **and**
10942 /// - New values received dynamically, without application changes.
10943 ///
10944 /// Please consult the [Working with enums] section in the user guide for some
10945 /// guidelines.
10946 ///
10947 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10948 #[derive(Clone, Debug, PartialEq)]
10949 #[non_exhaustive]
10950 pub enum AuthType {
10951 /// Authentication is not specified.
10952 Unspecified,
10953 /// User with valid certificate.
10954 User,
10955 /// Users managed by Kubernetes API with credentials stored as secrets.
10956 Serviceaccount,
10957 /// Collection of users.
10958 Group,
10959 /// If set, the enum was initialized with an unknown value.
10960 ///
10961 /// Applications can examine the value using [AuthType::value] or
10962 /// [AuthType::name].
10963 UnknownValue(auth_type::UnknownValue),
10964 }
10965
10966 #[doc(hidden)]
10967 pub mod auth_type {
10968 #[allow(unused_imports)]
10969 use super::*;
10970 #[derive(Clone, Debug, PartialEq)]
10971 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10972 }
10973
10974 impl AuthType {
10975 /// Gets the enum value.
10976 ///
10977 /// Returns `None` if the enum contains an unknown value deserialized from
10978 /// the string representation of enums.
10979 pub fn value(&self) -> std::option::Option<i32> {
10980 match self {
10981 Self::Unspecified => std::option::Option::Some(0),
10982 Self::User => std::option::Option::Some(1),
10983 Self::Serviceaccount => std::option::Option::Some(2),
10984 Self::Group => std::option::Option::Some(3),
10985 Self::UnknownValue(u) => u.0.value(),
10986 }
10987 }
10988
10989 /// Gets the enum value as a string.
10990 ///
10991 /// Returns `None` if the enum contains an unknown value deserialized from
10992 /// the integer representation of enums.
10993 pub fn name(&self) -> std::option::Option<&str> {
10994 match self {
10995 Self::Unspecified => std::option::Option::Some("AUTH_TYPE_UNSPECIFIED"),
10996 Self::User => std::option::Option::Some("USER"),
10997 Self::Serviceaccount => std::option::Option::Some("SERVICEACCOUNT"),
10998 Self::Group => std::option::Option::Some("GROUP"),
10999 Self::UnknownValue(u) => u.0.name(),
11000 }
11001 }
11002 }
11003
11004 impl std::default::Default for AuthType {
11005 fn default() -> Self {
11006 use std::convert::From;
11007 Self::from(0)
11008 }
11009 }
11010
11011 impl std::fmt::Display for AuthType {
11012 fn fmt(
11013 &self,
11014 f: &mut std::fmt::Formatter<'_>,
11015 ) -> std::result::Result<(), std::fmt::Error> {
11016 wkt::internal::display_enum(f, self.name(), self.value())
11017 }
11018 }
11019
11020 impl std::convert::From<i32> for AuthType {
11021 fn from(value: i32) -> Self {
11022 match value {
11023 0 => Self::Unspecified,
11024 1 => Self::User,
11025 2 => Self::Serviceaccount,
11026 3 => Self::Group,
11027 _ => Self::UnknownValue(auth_type::UnknownValue(
11028 wkt::internal::UnknownEnumValue::Integer(value),
11029 )),
11030 }
11031 }
11032 }
11033
11034 impl std::convert::From<&str> for AuthType {
11035 fn from(value: &str) -> Self {
11036 use std::string::ToString;
11037 match value {
11038 "AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
11039 "USER" => Self::User,
11040 "SERVICEACCOUNT" => Self::Serviceaccount,
11041 "GROUP" => Self::Group,
11042 _ => Self::UnknownValue(auth_type::UnknownValue(
11043 wkt::internal::UnknownEnumValue::String(value.to_string()),
11044 )),
11045 }
11046 }
11047 }
11048
11049 impl serde::ser::Serialize for AuthType {
11050 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11051 where
11052 S: serde::Serializer,
11053 {
11054 match self {
11055 Self::Unspecified => serializer.serialize_i32(0),
11056 Self::User => serializer.serialize_i32(1),
11057 Self::Serviceaccount => serializer.serialize_i32(2),
11058 Self::Group => serializer.serialize_i32(3),
11059 Self::UnknownValue(u) => u.0.serialize(serializer),
11060 }
11061 }
11062 }
11063
11064 impl<'de> serde::de::Deserialize<'de> for AuthType {
11065 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11066 where
11067 D: serde::Deserializer<'de>,
11068 {
11069 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
11070 ".google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType",
11071 ))
11072 }
11073 }
11074 }
11075
11076 /// Conveys information about a Kubernetes access review (such as one returned
11077 /// by a [`kubectl auth
11078 /// can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access)
11079 /// command) that was involved in a finding.
11080 #[derive(Clone, Default, PartialEq)]
11081 #[non_exhaustive]
11082 pub struct AccessReview {
11083 /// The API group of the resource. "*" means all.
11084 pub group: std::string::String,
11085
11086 /// Namespace of the action being requested. Currently, there is no
11087 /// distinction between no namespace and all namespaces. Both
11088 /// are represented by "" (empty).
11089 pub ns: std::string::String,
11090
11091 /// The name of the resource being requested. Empty means all.
11092 pub name: std::string::String,
11093
11094 /// The optional resource type requested. "*" means all.
11095 pub resource: std::string::String,
11096
11097 /// The optional subresource type.
11098 pub subresource: std::string::String,
11099
11100 /// A Kubernetes resource API verb, like get, list, watch, create, update,
11101 /// delete, proxy. "*" means all.
11102 pub verb: std::string::String,
11103
11104 /// The API version of the resource. "*" means all.
11105 pub version: std::string::String,
11106
11107 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11108 }
11109
11110 impl AccessReview {
11111 pub fn new() -> Self {
11112 std::default::Default::default()
11113 }
11114
11115 /// Sets the value of [group][crate::model::kubernetes::AccessReview::group].
11116 ///
11117 /// # Example
11118 /// ```ignore,no_run
11119 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11120 /// let x = AccessReview::new().set_group("example");
11121 /// ```
11122 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11123 self.group = v.into();
11124 self
11125 }
11126
11127 /// Sets the value of [ns][crate::model::kubernetes::AccessReview::ns].
11128 ///
11129 /// # Example
11130 /// ```ignore,no_run
11131 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11132 /// let x = AccessReview::new().set_ns("example");
11133 /// ```
11134 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11135 self.ns = v.into();
11136 self
11137 }
11138
11139 /// Sets the value of [name][crate::model::kubernetes::AccessReview::name].
11140 ///
11141 /// # Example
11142 /// ```ignore,no_run
11143 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11144 /// let x = AccessReview::new().set_name("example");
11145 /// ```
11146 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11147 self.name = v.into();
11148 self
11149 }
11150
11151 /// Sets the value of [resource][crate::model::kubernetes::AccessReview::resource].
11152 ///
11153 /// # Example
11154 /// ```ignore,no_run
11155 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11156 /// let x = AccessReview::new().set_resource("example");
11157 /// ```
11158 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11159 self.resource = v.into();
11160 self
11161 }
11162
11163 /// Sets the value of [subresource][crate::model::kubernetes::AccessReview::subresource].
11164 ///
11165 /// # Example
11166 /// ```ignore,no_run
11167 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11168 /// let x = AccessReview::new().set_subresource("example");
11169 /// ```
11170 pub fn set_subresource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11171 self.subresource = v.into();
11172 self
11173 }
11174
11175 /// Sets the value of [verb][crate::model::kubernetes::AccessReview::verb].
11176 ///
11177 /// # Example
11178 /// ```ignore,no_run
11179 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11180 /// let x = AccessReview::new().set_verb("example");
11181 /// ```
11182 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11183 self.verb = v.into();
11184 self
11185 }
11186
11187 /// Sets the value of [version][crate::model::kubernetes::AccessReview::version].
11188 ///
11189 /// # Example
11190 /// ```ignore,no_run
11191 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11192 /// let x = AccessReview::new().set_version("example");
11193 /// ```
11194 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11195 self.version = v.into();
11196 self
11197 }
11198 }
11199
11200 impl wkt::message::Message for AccessReview {
11201 fn typename() -> &'static str {
11202 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.AccessReview"
11203 }
11204 }
11205
11206 /// Kubernetes object related to the finding, uniquely identified by GKNN.
11207 /// Used if the object Kind is not one of Pod, Node, NodePool, Binding, or
11208 /// AccessReview.
11209 #[derive(Clone, Default, PartialEq)]
11210 #[non_exhaustive]
11211 pub struct Object {
11212 /// Kubernetes object group, such as "policy.k8s.io/v1".
11213 pub group: std::string::String,
11214
11215 /// Kubernetes object kind, such as "Namespace".
11216 pub kind: std::string::String,
11217
11218 /// Kubernetes object namespace. Must be a valid DNS label. Named
11219 /// "ns" to avoid collision with C++ namespace keyword. For details see
11220 /// <https://kubernetes.io/docs/tasks/administer-cluster/namespaces/>.
11221 pub ns: std::string::String,
11222
11223 /// Kubernetes object name. For details see
11224 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/>.
11225 pub name: std::string::String,
11226
11227 /// Pod containers associated with this finding, if any.
11228 pub containers: std::vec::Vec<crate::model::Container>,
11229
11230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11231 }
11232
11233 impl Object {
11234 pub fn new() -> Self {
11235 std::default::Default::default()
11236 }
11237
11238 /// Sets the value of [group][crate::model::kubernetes::Object::group].
11239 ///
11240 /// # Example
11241 /// ```ignore,no_run
11242 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11243 /// let x = Object::new().set_group("example");
11244 /// ```
11245 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11246 self.group = v.into();
11247 self
11248 }
11249
11250 /// Sets the value of [kind][crate::model::kubernetes::Object::kind].
11251 ///
11252 /// # Example
11253 /// ```ignore,no_run
11254 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11255 /// let x = Object::new().set_kind("example");
11256 /// ```
11257 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11258 self.kind = v.into();
11259 self
11260 }
11261
11262 /// Sets the value of [ns][crate::model::kubernetes::Object::ns].
11263 ///
11264 /// # Example
11265 /// ```ignore,no_run
11266 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11267 /// let x = Object::new().set_ns("example");
11268 /// ```
11269 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11270 self.ns = v.into();
11271 self
11272 }
11273
11274 /// Sets the value of [name][crate::model::kubernetes::Object::name].
11275 ///
11276 /// # Example
11277 /// ```ignore,no_run
11278 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11279 /// let x = Object::new().set_name("example");
11280 /// ```
11281 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11282 self.name = v.into();
11283 self
11284 }
11285
11286 /// Sets the value of [containers][crate::model::kubernetes::Object::containers].
11287 ///
11288 /// # Example
11289 /// ```ignore,no_run
11290 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11291 /// use google_cloud_securitycenter_v2::model::Container;
11292 /// let x = Object::new()
11293 /// .set_containers([
11294 /// Container::default()/* use setters */,
11295 /// Container::default()/* use (different) setters */,
11296 /// ]);
11297 /// ```
11298 pub fn set_containers<T, V>(mut self, v: T) -> Self
11299 where
11300 T: std::iter::IntoIterator<Item = V>,
11301 V: std::convert::Into<crate::model::Container>,
11302 {
11303 use std::iter::Iterator;
11304 self.containers = v.into_iter().map(|i| i.into()).collect();
11305 self
11306 }
11307 }
11308
11309 impl wkt::message::Message for Object {
11310 fn typename() -> &'static str {
11311 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Object"
11312 }
11313 }
11314}
11315
11316/// Represents a generic name-value label. A label has separate name and value
11317/// fields to support filtering with the `contains()` function. For more
11318/// information, see [Filtering on array-type
11319/// fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering).
11320#[derive(Clone, Default, PartialEq)]
11321#[non_exhaustive]
11322pub struct Label {
11323 /// Name of the label.
11324 pub name: std::string::String,
11325
11326 /// Value that corresponds to the label's name.
11327 pub value: std::string::String,
11328
11329 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11330}
11331
11332impl Label {
11333 pub fn new() -> Self {
11334 std::default::Default::default()
11335 }
11336
11337 /// Sets the value of [name][crate::model::Label::name].
11338 ///
11339 /// # Example
11340 /// ```ignore,no_run
11341 /// # use google_cloud_securitycenter_v2::model::Label;
11342 /// let x = Label::new().set_name("example");
11343 /// ```
11344 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11345 self.name = v.into();
11346 self
11347 }
11348
11349 /// Sets the value of [value][crate::model::Label::value].
11350 ///
11351 /// # Example
11352 /// ```ignore,no_run
11353 /// # use google_cloud_securitycenter_v2::model::Label;
11354 /// let x = Label::new().set_value("example");
11355 /// ```
11356 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11357 self.value = v.into();
11358 self
11359 }
11360}
11361
11362impl wkt::message::Message for Label {
11363 fn typename() -> &'static str {
11364 "type.googleapis.com/google.cloud.securitycenter.v2.Label"
11365 }
11366}
11367
11368/// Contains information related to the load balancer associated with the
11369/// finding.
11370#[derive(Clone, Default, PartialEq)]
11371#[non_exhaustive]
11372pub struct LoadBalancer {
11373 /// The name of the load balancer associated with the finding.
11374 pub name: std::string::String,
11375
11376 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11377}
11378
11379impl LoadBalancer {
11380 pub fn new() -> Self {
11381 std::default::Default::default()
11382 }
11383
11384 /// Sets the value of [name][crate::model::LoadBalancer::name].
11385 ///
11386 /// # Example
11387 /// ```ignore,no_run
11388 /// # use google_cloud_securitycenter_v2::model::LoadBalancer;
11389 /// let x = LoadBalancer::new().set_name("example");
11390 /// ```
11391 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11392 self.name = v.into();
11393 self
11394 }
11395}
11396
11397impl wkt::message::Message for LoadBalancer {
11398 fn typename() -> &'static str {
11399 "type.googleapis.com/google.cloud.securitycenter.v2.LoadBalancer"
11400 }
11401}
11402
11403/// An individual entry in a log.
11404#[derive(Clone, Default, PartialEq)]
11405#[non_exhaustive]
11406pub struct LogEntry {
11407 /// The log entry.
11408 pub log_entry: std::option::Option<crate::model::log_entry::LogEntry>,
11409
11410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11411}
11412
11413impl LogEntry {
11414 pub fn new() -> Self {
11415 std::default::Default::default()
11416 }
11417
11418 /// Sets the value of [log_entry][crate::model::LogEntry::log_entry].
11419 ///
11420 /// Note that all the setters affecting `log_entry` are mutually
11421 /// exclusive.
11422 ///
11423 /// # Example
11424 /// ```ignore,no_run
11425 /// # use google_cloud_securitycenter_v2::model::LogEntry;
11426 /// use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11427 /// let x = LogEntry::new().set_log_entry(Some(
11428 /// google_cloud_securitycenter_v2::model::log_entry::LogEntry::CloudLoggingEntry(CloudLoggingEntry::default().into())));
11429 /// ```
11430 pub fn set_log_entry<
11431 T: std::convert::Into<std::option::Option<crate::model::log_entry::LogEntry>>,
11432 >(
11433 mut self,
11434 v: T,
11435 ) -> Self {
11436 self.log_entry = v.into();
11437 self
11438 }
11439
11440 /// The value of [log_entry][crate::model::LogEntry::log_entry]
11441 /// if it holds a `CloudLoggingEntry`, `None` if the field is not set or
11442 /// holds a different branch.
11443 pub fn cloud_logging_entry(
11444 &self,
11445 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudLoggingEntry>> {
11446 #[allow(unreachable_patterns)]
11447 self.log_entry.as_ref().and_then(|v| match v {
11448 crate::model::log_entry::LogEntry::CloudLoggingEntry(v) => std::option::Option::Some(v),
11449 _ => std::option::Option::None,
11450 })
11451 }
11452
11453 /// Sets the value of [log_entry][crate::model::LogEntry::log_entry]
11454 /// to hold a `CloudLoggingEntry`.
11455 ///
11456 /// Note that all the setters affecting `log_entry` are
11457 /// mutually exclusive.
11458 ///
11459 /// # Example
11460 /// ```ignore,no_run
11461 /// # use google_cloud_securitycenter_v2::model::LogEntry;
11462 /// use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11463 /// let x = LogEntry::new().set_cloud_logging_entry(CloudLoggingEntry::default()/* use setters */);
11464 /// assert!(x.cloud_logging_entry().is_some());
11465 /// ```
11466 pub fn set_cloud_logging_entry<
11467 T: std::convert::Into<std::boxed::Box<crate::model::CloudLoggingEntry>>,
11468 >(
11469 mut self,
11470 v: T,
11471 ) -> Self {
11472 self.log_entry = std::option::Option::Some(
11473 crate::model::log_entry::LogEntry::CloudLoggingEntry(v.into()),
11474 );
11475 self
11476 }
11477}
11478
11479impl wkt::message::Message for LogEntry {
11480 fn typename() -> &'static str {
11481 "type.googleapis.com/google.cloud.securitycenter.v2.LogEntry"
11482 }
11483}
11484
11485/// Defines additional types related to [LogEntry].
11486pub mod log_entry {
11487 #[allow(unused_imports)]
11488 use super::*;
11489
11490 /// The log entry.
11491 #[derive(Clone, Debug, PartialEq)]
11492 #[non_exhaustive]
11493 pub enum LogEntry {
11494 /// An individual entry in a log stored in Cloud Logging.
11495 CloudLoggingEntry(std::boxed::Box<crate::model::CloudLoggingEntry>),
11496 }
11497}
11498
11499/// Metadata taken from a [Cloud Logging
11500/// LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry)
11501#[derive(Clone, Default, PartialEq)]
11502#[non_exhaustive]
11503pub struct CloudLoggingEntry {
11504 /// A unique identifier for the log entry.
11505 pub insert_id: std::string::String,
11506
11507 /// The type of the log (part of `log_name`. `log_name` is the resource name of
11508 /// the log to which this log entry belongs). For example:
11509 /// `cloudresourcemanager.googleapis.com/activity` Note that this field is not
11510 /// URL-encoded, unlike in `LogEntry`.
11511 pub log_id: std::string::String,
11512
11513 /// The organization, folder, or project of the monitored resource that
11514 /// produced this log entry.
11515 pub resource_container: std::string::String,
11516
11517 /// The time the event described by the log entry occurred.
11518 pub timestamp: std::option::Option<wkt::Timestamp>,
11519
11520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11521}
11522
11523impl CloudLoggingEntry {
11524 pub fn new() -> Self {
11525 std::default::Default::default()
11526 }
11527
11528 /// Sets the value of [insert_id][crate::model::CloudLoggingEntry::insert_id].
11529 ///
11530 /// # Example
11531 /// ```ignore,no_run
11532 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11533 /// let x = CloudLoggingEntry::new().set_insert_id("example");
11534 /// ```
11535 pub fn set_insert_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11536 self.insert_id = v.into();
11537 self
11538 }
11539
11540 /// Sets the value of [log_id][crate::model::CloudLoggingEntry::log_id].
11541 ///
11542 /// # Example
11543 /// ```ignore,no_run
11544 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11545 /// let x = CloudLoggingEntry::new().set_log_id("example");
11546 /// ```
11547 pub fn set_log_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11548 self.log_id = v.into();
11549 self
11550 }
11551
11552 /// Sets the value of [resource_container][crate::model::CloudLoggingEntry::resource_container].
11553 ///
11554 /// # Example
11555 /// ```ignore,no_run
11556 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11557 /// let x = CloudLoggingEntry::new().set_resource_container("example");
11558 /// ```
11559 pub fn set_resource_container<T: std::convert::Into<std::string::String>>(
11560 mut self,
11561 v: T,
11562 ) -> Self {
11563 self.resource_container = v.into();
11564 self
11565 }
11566
11567 /// Sets the value of [timestamp][crate::model::CloudLoggingEntry::timestamp].
11568 ///
11569 /// # Example
11570 /// ```ignore,no_run
11571 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11572 /// use wkt::Timestamp;
11573 /// let x = CloudLoggingEntry::new().set_timestamp(Timestamp::default()/* use setters */);
11574 /// ```
11575 pub fn set_timestamp<T>(mut self, v: T) -> Self
11576 where
11577 T: std::convert::Into<wkt::Timestamp>,
11578 {
11579 self.timestamp = std::option::Option::Some(v.into());
11580 self
11581 }
11582
11583 /// Sets or clears the value of [timestamp][crate::model::CloudLoggingEntry::timestamp].
11584 ///
11585 /// # Example
11586 /// ```ignore,no_run
11587 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11588 /// use wkt::Timestamp;
11589 /// let x = CloudLoggingEntry::new().set_or_clear_timestamp(Some(Timestamp::default()/* use setters */));
11590 /// let x = CloudLoggingEntry::new().set_or_clear_timestamp(None::<Timestamp>);
11591 /// ```
11592 pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
11593 where
11594 T: std::convert::Into<wkt::Timestamp>,
11595 {
11596 self.timestamp = v.map(|x| x.into());
11597 self
11598 }
11599}
11600
11601impl wkt::message::Message for CloudLoggingEntry {
11602 fn typename() -> &'static str {
11603 "type.googleapis.com/google.cloud.securitycenter.v2.CloudLoggingEntry"
11604 }
11605}
11606
11607/// MITRE ATT&CK tactics and techniques related to this finding.
11608/// See: <https://attack.mitre.org>
11609#[derive(Clone, Default, PartialEq)]
11610#[non_exhaustive]
11611pub struct MitreAttack {
11612 /// The MITRE ATT&CK tactic most closely represented by this finding, if any.
11613 pub primary_tactic: crate::model::mitre_attack::Tactic,
11614
11615 /// The MITRE ATT&CK technique most closely represented by this finding, if
11616 /// any. primary_techniques is a repeated field because there are multiple
11617 /// levels of MITRE ATT&CK techniques. If the technique most closely
11618 /// represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`),
11619 /// both the sub-technique and its parent technique(s) will be listed (e.g.
11620 /// `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`).
11621 pub primary_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
11622
11623 /// Additional MITRE ATT&CK tactics related to this finding, if any.
11624 pub additional_tactics: std::vec::Vec<crate::model::mitre_attack::Tactic>,
11625
11626 /// Additional MITRE ATT&CK techniques related to this finding, if any, along
11627 /// with any of their respective parent techniques.
11628 pub additional_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
11629
11630 /// The MITRE ATT&CK version referenced by the above fields. E.g. "8".
11631 pub version: std::string::String,
11632
11633 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11634}
11635
11636impl MitreAttack {
11637 pub fn new() -> Self {
11638 std::default::Default::default()
11639 }
11640
11641 /// Sets the value of [primary_tactic][crate::model::MitreAttack::primary_tactic].
11642 ///
11643 /// # Example
11644 /// ```ignore,no_run
11645 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11646 /// use google_cloud_securitycenter_v2::model::mitre_attack::Tactic;
11647 /// let x0 = MitreAttack::new().set_primary_tactic(Tactic::Reconnaissance);
11648 /// let x1 = MitreAttack::new().set_primary_tactic(Tactic::ResourceDevelopment);
11649 /// let x2 = MitreAttack::new().set_primary_tactic(Tactic::InitialAccess);
11650 /// ```
11651 pub fn set_primary_tactic<T: std::convert::Into<crate::model::mitre_attack::Tactic>>(
11652 mut self,
11653 v: T,
11654 ) -> Self {
11655 self.primary_tactic = v.into();
11656 self
11657 }
11658
11659 /// Sets the value of [primary_techniques][crate::model::MitreAttack::primary_techniques].
11660 ///
11661 /// # Example
11662 /// ```ignore,no_run
11663 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11664 /// use google_cloud_securitycenter_v2::model::mitre_attack::Technique;
11665 /// let x = MitreAttack::new().set_primary_techniques([
11666 /// Technique::DataObfuscation,
11667 /// Technique::DataObfuscationSteganography,
11668 /// Technique::OsCredentialDumping,
11669 /// ]);
11670 /// ```
11671 pub fn set_primary_techniques<T, V>(mut self, v: T) -> Self
11672 where
11673 T: std::iter::IntoIterator<Item = V>,
11674 V: std::convert::Into<crate::model::mitre_attack::Technique>,
11675 {
11676 use std::iter::Iterator;
11677 self.primary_techniques = v.into_iter().map(|i| i.into()).collect();
11678 self
11679 }
11680
11681 /// Sets the value of [additional_tactics][crate::model::MitreAttack::additional_tactics].
11682 ///
11683 /// # Example
11684 /// ```ignore,no_run
11685 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11686 /// use google_cloud_securitycenter_v2::model::mitre_attack::Tactic;
11687 /// let x = MitreAttack::new().set_additional_tactics([
11688 /// Tactic::Reconnaissance,
11689 /// Tactic::ResourceDevelopment,
11690 /// Tactic::InitialAccess,
11691 /// ]);
11692 /// ```
11693 pub fn set_additional_tactics<T, V>(mut self, v: T) -> Self
11694 where
11695 T: std::iter::IntoIterator<Item = V>,
11696 V: std::convert::Into<crate::model::mitre_attack::Tactic>,
11697 {
11698 use std::iter::Iterator;
11699 self.additional_tactics = v.into_iter().map(|i| i.into()).collect();
11700 self
11701 }
11702
11703 /// Sets the value of [additional_techniques][crate::model::MitreAttack::additional_techniques].
11704 ///
11705 /// # Example
11706 /// ```ignore,no_run
11707 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11708 /// use google_cloud_securitycenter_v2::model::mitre_attack::Technique;
11709 /// let x = MitreAttack::new().set_additional_techniques([
11710 /// Technique::DataObfuscation,
11711 /// Technique::DataObfuscationSteganography,
11712 /// Technique::OsCredentialDumping,
11713 /// ]);
11714 /// ```
11715 pub fn set_additional_techniques<T, V>(mut self, v: T) -> Self
11716 where
11717 T: std::iter::IntoIterator<Item = V>,
11718 V: std::convert::Into<crate::model::mitre_attack::Technique>,
11719 {
11720 use std::iter::Iterator;
11721 self.additional_techniques = v.into_iter().map(|i| i.into()).collect();
11722 self
11723 }
11724
11725 /// Sets the value of [version][crate::model::MitreAttack::version].
11726 ///
11727 /// # Example
11728 /// ```ignore,no_run
11729 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11730 /// let x = MitreAttack::new().set_version("example");
11731 /// ```
11732 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11733 self.version = v.into();
11734 self
11735 }
11736}
11737
11738impl wkt::message::Message for MitreAttack {
11739 fn typename() -> &'static str {
11740 "type.googleapis.com/google.cloud.securitycenter.v2.MitreAttack"
11741 }
11742}
11743
11744/// Defines additional types related to [MitreAttack].
11745pub mod mitre_attack {
11746 #[allow(unused_imports)]
11747 use super::*;
11748
11749 /// MITRE ATT&CK tactics that can be referenced by SCC findings.
11750 /// See: <https://attack.mitre.org/tactics/enterprise/>
11751 ///
11752 /// # Working with unknown values
11753 ///
11754 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11755 /// additional enum variants at any time. Adding new variants is not considered
11756 /// a breaking change. Applications should write their code in anticipation of:
11757 ///
11758 /// - New values appearing in future releases of the client library, **and**
11759 /// - New values received dynamically, without application changes.
11760 ///
11761 /// Please consult the [Working with enums] section in the user guide for some
11762 /// guidelines.
11763 ///
11764 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11765 #[derive(Clone, Debug, PartialEq)]
11766 #[non_exhaustive]
11767 pub enum Tactic {
11768 /// Unspecified value.
11769 Unspecified,
11770 /// TA0043
11771 Reconnaissance,
11772 /// TA0042
11773 ResourceDevelopment,
11774 /// TA0001
11775 InitialAccess,
11776 /// TA0002
11777 Execution,
11778 /// TA0003
11779 Persistence,
11780 /// TA0004
11781 PrivilegeEscalation,
11782 /// TA0005
11783 DefenseEvasion,
11784 /// TA0006
11785 CredentialAccess,
11786 /// TA0007
11787 Discovery,
11788 /// TA0008
11789 LateralMovement,
11790 /// TA0009
11791 Collection,
11792 /// TA0011
11793 CommandAndControl,
11794 /// TA0010
11795 Exfiltration,
11796 /// TA0040
11797 Impact,
11798 /// If set, the enum was initialized with an unknown value.
11799 ///
11800 /// Applications can examine the value using [Tactic::value] or
11801 /// [Tactic::name].
11802 UnknownValue(tactic::UnknownValue),
11803 }
11804
11805 #[doc(hidden)]
11806 pub mod tactic {
11807 #[allow(unused_imports)]
11808 use super::*;
11809 #[derive(Clone, Debug, PartialEq)]
11810 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11811 }
11812
11813 impl Tactic {
11814 /// Gets the enum value.
11815 ///
11816 /// Returns `None` if the enum contains an unknown value deserialized from
11817 /// the string representation of enums.
11818 pub fn value(&self) -> std::option::Option<i32> {
11819 match self {
11820 Self::Unspecified => std::option::Option::Some(0),
11821 Self::Reconnaissance => std::option::Option::Some(1),
11822 Self::ResourceDevelopment => std::option::Option::Some(2),
11823 Self::InitialAccess => std::option::Option::Some(5),
11824 Self::Execution => std::option::Option::Some(3),
11825 Self::Persistence => std::option::Option::Some(6),
11826 Self::PrivilegeEscalation => std::option::Option::Some(8),
11827 Self::DefenseEvasion => std::option::Option::Some(7),
11828 Self::CredentialAccess => std::option::Option::Some(9),
11829 Self::Discovery => std::option::Option::Some(10),
11830 Self::LateralMovement => std::option::Option::Some(11),
11831 Self::Collection => std::option::Option::Some(12),
11832 Self::CommandAndControl => std::option::Option::Some(4),
11833 Self::Exfiltration => std::option::Option::Some(13),
11834 Self::Impact => std::option::Option::Some(14),
11835 Self::UnknownValue(u) => u.0.value(),
11836 }
11837 }
11838
11839 /// Gets the enum value as a string.
11840 ///
11841 /// Returns `None` if the enum contains an unknown value deserialized from
11842 /// the integer representation of enums.
11843 pub fn name(&self) -> std::option::Option<&str> {
11844 match self {
11845 Self::Unspecified => std::option::Option::Some("TACTIC_UNSPECIFIED"),
11846 Self::Reconnaissance => std::option::Option::Some("RECONNAISSANCE"),
11847 Self::ResourceDevelopment => std::option::Option::Some("RESOURCE_DEVELOPMENT"),
11848 Self::InitialAccess => std::option::Option::Some("INITIAL_ACCESS"),
11849 Self::Execution => std::option::Option::Some("EXECUTION"),
11850 Self::Persistence => std::option::Option::Some("PERSISTENCE"),
11851 Self::PrivilegeEscalation => std::option::Option::Some("PRIVILEGE_ESCALATION"),
11852 Self::DefenseEvasion => std::option::Option::Some("DEFENSE_EVASION"),
11853 Self::CredentialAccess => std::option::Option::Some("CREDENTIAL_ACCESS"),
11854 Self::Discovery => std::option::Option::Some("DISCOVERY"),
11855 Self::LateralMovement => std::option::Option::Some("LATERAL_MOVEMENT"),
11856 Self::Collection => std::option::Option::Some("COLLECTION"),
11857 Self::CommandAndControl => std::option::Option::Some("COMMAND_AND_CONTROL"),
11858 Self::Exfiltration => std::option::Option::Some("EXFILTRATION"),
11859 Self::Impact => std::option::Option::Some("IMPACT"),
11860 Self::UnknownValue(u) => u.0.name(),
11861 }
11862 }
11863 }
11864
11865 impl std::default::Default for Tactic {
11866 fn default() -> Self {
11867 use std::convert::From;
11868 Self::from(0)
11869 }
11870 }
11871
11872 impl std::fmt::Display for Tactic {
11873 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11874 wkt::internal::display_enum(f, self.name(), self.value())
11875 }
11876 }
11877
11878 impl std::convert::From<i32> for Tactic {
11879 fn from(value: i32) -> Self {
11880 match value {
11881 0 => Self::Unspecified,
11882 1 => Self::Reconnaissance,
11883 2 => Self::ResourceDevelopment,
11884 3 => Self::Execution,
11885 4 => Self::CommandAndControl,
11886 5 => Self::InitialAccess,
11887 6 => Self::Persistence,
11888 7 => Self::DefenseEvasion,
11889 8 => Self::PrivilegeEscalation,
11890 9 => Self::CredentialAccess,
11891 10 => Self::Discovery,
11892 11 => Self::LateralMovement,
11893 12 => Self::Collection,
11894 13 => Self::Exfiltration,
11895 14 => Self::Impact,
11896 _ => Self::UnknownValue(tactic::UnknownValue(
11897 wkt::internal::UnknownEnumValue::Integer(value),
11898 )),
11899 }
11900 }
11901 }
11902
11903 impl std::convert::From<&str> for Tactic {
11904 fn from(value: &str) -> Self {
11905 use std::string::ToString;
11906 match value {
11907 "TACTIC_UNSPECIFIED" => Self::Unspecified,
11908 "RECONNAISSANCE" => Self::Reconnaissance,
11909 "RESOURCE_DEVELOPMENT" => Self::ResourceDevelopment,
11910 "INITIAL_ACCESS" => Self::InitialAccess,
11911 "EXECUTION" => Self::Execution,
11912 "PERSISTENCE" => Self::Persistence,
11913 "PRIVILEGE_ESCALATION" => Self::PrivilegeEscalation,
11914 "DEFENSE_EVASION" => Self::DefenseEvasion,
11915 "CREDENTIAL_ACCESS" => Self::CredentialAccess,
11916 "DISCOVERY" => Self::Discovery,
11917 "LATERAL_MOVEMENT" => Self::LateralMovement,
11918 "COLLECTION" => Self::Collection,
11919 "COMMAND_AND_CONTROL" => Self::CommandAndControl,
11920 "EXFILTRATION" => Self::Exfiltration,
11921 "IMPACT" => Self::Impact,
11922 _ => Self::UnknownValue(tactic::UnknownValue(
11923 wkt::internal::UnknownEnumValue::String(value.to_string()),
11924 )),
11925 }
11926 }
11927 }
11928
11929 impl serde::ser::Serialize for Tactic {
11930 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11931 where
11932 S: serde::Serializer,
11933 {
11934 match self {
11935 Self::Unspecified => serializer.serialize_i32(0),
11936 Self::Reconnaissance => serializer.serialize_i32(1),
11937 Self::ResourceDevelopment => serializer.serialize_i32(2),
11938 Self::InitialAccess => serializer.serialize_i32(5),
11939 Self::Execution => serializer.serialize_i32(3),
11940 Self::Persistence => serializer.serialize_i32(6),
11941 Self::PrivilegeEscalation => serializer.serialize_i32(8),
11942 Self::DefenseEvasion => serializer.serialize_i32(7),
11943 Self::CredentialAccess => serializer.serialize_i32(9),
11944 Self::Discovery => serializer.serialize_i32(10),
11945 Self::LateralMovement => serializer.serialize_i32(11),
11946 Self::Collection => serializer.serialize_i32(12),
11947 Self::CommandAndControl => serializer.serialize_i32(4),
11948 Self::Exfiltration => serializer.serialize_i32(13),
11949 Self::Impact => serializer.serialize_i32(14),
11950 Self::UnknownValue(u) => u.0.serialize(serializer),
11951 }
11952 }
11953 }
11954
11955 impl<'de> serde::de::Deserialize<'de> for Tactic {
11956 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11957 where
11958 D: serde::Deserializer<'de>,
11959 {
11960 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tactic>::new(
11961 ".google.cloud.securitycenter.v2.MitreAttack.Tactic",
11962 ))
11963 }
11964 }
11965
11966 /// MITRE ATT&CK techniques that can be referenced by Security Command Center
11967 /// findings. See: <https://attack.mitre.org/techniques/enterprise/>
11968 ///
11969 /// # Working with unknown values
11970 ///
11971 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11972 /// additional enum variants at any time. Adding new variants is not considered
11973 /// a breaking change. Applications should write their code in anticipation of:
11974 ///
11975 /// - New values appearing in future releases of the client library, **and**
11976 /// - New values received dynamically, without application changes.
11977 ///
11978 /// Please consult the [Working with enums] section in the user guide for some
11979 /// guidelines.
11980 ///
11981 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11982 #[derive(Clone, Debug, PartialEq)]
11983 #[non_exhaustive]
11984 pub enum Technique {
11985 /// Unspecified value.
11986 Unspecified,
11987 /// T1001
11988 DataObfuscation,
11989 /// T1001.002
11990 DataObfuscationSteganography,
11991 /// T1003
11992 OsCredentialDumping,
11993 /// T1003.007
11994 OsCredentialDumpingProcFilesystem,
11995 /// T1003.008
11996 OsCredentialDumpingEtcPasswordAndEtcShadow,
11997 /// T1005
11998 DataFromLocalSystem,
11999 /// T1020
12000 AutomatedExfiltration,
12001 /// T1027
12002 ObfuscatedFilesOrInfo,
12003 /// T1027.003
12004 Steganography,
12005 /// T1027.004
12006 CompileAfterDelivery,
12007 /// T1027.010
12008 CommandObfuscation,
12009 /// T1029
12010 ScheduledTransfer,
12011 /// T1033
12012 SystemOwnerUserDiscovery,
12013 /// T1036
12014 Masquerading,
12015 /// T1036.005
12016 MatchLegitimateNameOrLocation,
12017 /// T1037
12018 BootOrLogonInitializationScripts,
12019 /// T1037.005
12020 StartupItems,
12021 /// T1046
12022 NetworkServiceDiscovery,
12023 /// T1053
12024 ScheduledTaskJob,
12025 /// T1053.003
12026 ScheduledTaskJobCron,
12027 /// T1053.007
12028 ContainerOrchestrationJob,
12029 /// T1055
12030 ProcessInjection,
12031 /// T1056
12032 InputCapture,
12033 /// T1056.001
12034 InputCaptureKeylogging,
12035 /// T1057
12036 ProcessDiscovery,
12037 /// T1059
12038 CommandAndScriptingInterpreter,
12039 /// T1059.004
12040 UnixShell,
12041 /// T1059.006
12042 Python,
12043 /// T1068
12044 ExploitationForPrivilegeEscalation,
12045 /// T1069
12046 PermissionGroupsDiscovery,
12047 /// T1069.003
12048 CloudGroups,
12049 /// T1070
12050 IndicatorRemoval,
12051 /// T1070.002
12052 IndicatorRemovalClearLinuxOrMacSystemLogs,
12053 /// T1070.003
12054 IndicatorRemovalClearCommandHistory,
12055 /// T1070.004
12056 IndicatorRemovalFileDeletion,
12057 /// T1070.006
12058 IndicatorRemovalTimestomp,
12059 /// T1070.008
12060 IndicatorRemovalClearMailboxData,
12061 /// T1071
12062 ApplicationLayerProtocol,
12063 /// T1071.004
12064 Dns,
12065 /// T1072
12066 SoftwareDeploymentTools,
12067 /// T1078
12068 ValidAccounts,
12069 /// T1078.001
12070 DefaultAccounts,
12071 /// T1078.003
12072 LocalAccounts,
12073 /// T1078.004
12074 CloudAccounts,
12075 /// T1083
12076 FileAndDirectoryDiscovery,
12077 /// T1087.001
12078 AccountDiscoveryLocalAccount,
12079 /// T1090
12080 Proxy,
12081 /// T1090.002
12082 ExternalProxy,
12083 /// T1090.003
12084 MultiHopProxy,
12085 /// T1098
12086 AccountManipulation,
12087 /// T1098.001
12088 AdditionalCloudCredentials,
12089 /// T1098.003
12090 AdditionalCloudRoles,
12091 /// T1098.004
12092 SshAuthorizedKeys,
12093 /// T1098.006
12094 AdditionalContainerClusterRoles,
12095 /// T1104
12096 MultiStageChannels,
12097 /// T1105
12098 IngressToolTransfer,
12099 /// T1106
12100 NativeApi,
12101 /// T1110
12102 BruteForce,
12103 /// T1119
12104 AutomatedCollection,
12105 /// T1129
12106 SharedModules,
12107 /// T1132
12108 DataEncoding,
12109 /// T1132.001
12110 StandardEncoding,
12111 /// T1134
12112 AccessTokenManipulation,
12113 /// T1134.001
12114 TokenImpersonationOrTheft,
12115 /// T1136
12116 CreateAccount,
12117 /// T1136.001
12118 LocalAccount,
12119 /// T1140
12120 DeobfuscateDecodeFilesOrInfo,
12121 /// T1190
12122 ExploitPublicFacingApplication,
12123 /// T1195
12124 SupplyChainCompromise,
12125 /// T1195.001
12126 CompromiseSoftwareDependenciesAndDevelopmentTools,
12127 /// T1203
12128 ExploitationForClientExecution,
12129 /// T1204
12130 UserExecution,
12131 /// T1222.002
12132 LinuxAndMacFileAndDirectoryPermissionsModification,
12133 /// T1484
12134 DomainPolicyModification,
12135 /// T1485
12136 DataDestruction,
12137 /// T1486
12138 DataEncryptedForImpact,
12139 /// T1489
12140 ServiceStop,
12141 /// T1490
12142 InhibitSystemRecovery,
12143 /// T1495
12144 FirmwareCorruption,
12145 /// T1496
12146 ResourceHijacking,
12147 /// T1498
12148 NetworkDenialOfService,
12149 /// T1526
12150 CloudServiceDiscovery,
12151 /// T1528
12152 StealApplicationAccessToken,
12153 /// T1531
12154 AccountAccessRemoval,
12155 /// T1537
12156 TransferDataToCloudAccount,
12157 /// T1539
12158 StealWebSessionCookie,
12159 /// T1543
12160 CreateOrModifySystemProcess,
12161 /// T1546
12162 EventTriggeredExecution,
12163 /// T1547
12164 BootOrLogonAutostartExecution,
12165 /// T1547.006
12166 KernelModulesAndExtensions,
12167 /// T1547.009
12168 ShortcutModification,
12169 /// T1548
12170 AbuseElevationControlMechanism,
12171 /// T1548.001
12172 AbuseElevationControlMechanismSetuidAndSetgid,
12173 /// T1548.003
12174 AbuseElevationControlMechanismSudoAndSudoCaching,
12175 /// T1552
12176 UnsecuredCredentials,
12177 /// T1552.001
12178 CredentialsInFiles,
12179 /// T1552.003
12180 BashHistory,
12181 /// T1552.004
12182 PrivateKeys,
12183 /// T1553
12184 SubvertTrustControl,
12185 /// T1553.004
12186 InstallRootCertificate,
12187 /// T1554
12188 CompromiseHostSoftwareBinary,
12189 /// T1555
12190 CredentialsFromPasswordStores,
12191 /// T1556
12192 ModifyAuthenticationProcess,
12193 /// T1556.003
12194 PluggableAuthenticationModules,
12195 /// T1556.006
12196 MultiFactorAuthentication,
12197 /// T1562
12198 ImpairDefenses,
12199 /// T1562.001
12200 DisableOrModifyTools,
12201 /// T1562.006
12202 IndicatorBlocking,
12203 /// T1562.012
12204 DisableOrModifyLinuxAuditSystem,
12205 /// T1564
12206 HideArtifacts,
12207 /// T1564.001
12208 HiddenFilesAndDirectories,
12209 /// T1564.002
12210 HiddenUsers,
12211 /// T1567
12212 ExfiltrationOverWebService,
12213 /// T1567.002
12214 ExfiltrationToCloudStorage,
12215 /// T1568
12216 DynamicResolution,
12217 /// T1570
12218 LateralToolTransfer,
12219 /// T1574
12220 HijackExecutionFlow,
12221 /// T1574.006
12222 HijackExecutionFlowDynamicLinkerHijacking,
12223 /// T1578
12224 ModifyCloudComputeInfrastructure,
12225 /// T1578.001
12226 CreateSnapshot,
12227 /// T1580
12228 CloudInfrastructureDiscovery,
12229 /// T1587
12230 DevelopCapabilities,
12231 /// T1587.001
12232 DevelopCapabilitiesMalware,
12233 /// T1588
12234 ObtainCapabilities,
12235 /// T1588.001
12236 ObtainCapabilitiesMalware,
12237 /// T1588.006
12238 ObtainCapabilitiesVulnerabilities,
12239 /// T1595
12240 ActiveScanning,
12241 /// T1595.001
12242 ScanningIpBlocks,
12243 /// T1608
12244 StageCapabilities,
12245 /// T1608.001
12246 UploadMalware,
12247 /// T1609
12248 ContainerAdministrationCommand,
12249 /// T1610
12250 DeployContainer,
12251 /// T1611
12252 EscapeToHost,
12253 /// T1613
12254 ContainerAndResourceDiscovery,
12255 /// T1620
12256 ReflectiveCodeLoading,
12257 /// T1649
12258 StealOrForgeAuthenticationCertificates,
12259 /// T1657
12260 FinancialTheft,
12261 /// If set, the enum was initialized with an unknown value.
12262 ///
12263 /// Applications can examine the value using [Technique::value] or
12264 /// [Technique::name].
12265 UnknownValue(technique::UnknownValue),
12266 }
12267
12268 #[doc(hidden)]
12269 pub mod technique {
12270 #[allow(unused_imports)]
12271 use super::*;
12272 #[derive(Clone, Debug, PartialEq)]
12273 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12274 }
12275
12276 impl Technique {
12277 /// Gets the enum value.
12278 ///
12279 /// Returns `None` if the enum contains an unknown value deserialized from
12280 /// the string representation of enums.
12281 pub fn value(&self) -> std::option::Option<i32> {
12282 match self {
12283 Self::Unspecified => std::option::Option::Some(0),
12284 Self::DataObfuscation => std::option::Option::Some(70),
12285 Self::DataObfuscationSteganography => std::option::Option::Some(71),
12286 Self::OsCredentialDumping => std::option::Option::Some(114),
12287 Self::OsCredentialDumpingProcFilesystem => std::option::Option::Some(115),
12288 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => std::option::Option::Some(122),
12289 Self::DataFromLocalSystem => std::option::Option::Some(117),
12290 Self::AutomatedExfiltration => std::option::Option::Some(68),
12291 Self::ObfuscatedFilesOrInfo => std::option::Option::Some(72),
12292 Self::Steganography => std::option::Option::Some(73),
12293 Self::CompileAfterDelivery => std::option::Option::Some(74),
12294 Self::CommandObfuscation => std::option::Option::Some(75),
12295 Self::ScheduledTransfer => std::option::Option::Some(120),
12296 Self::SystemOwnerUserDiscovery => std::option::Option::Some(118),
12297 Self::Masquerading => std::option::Option::Some(49),
12298 Self::MatchLegitimateNameOrLocation => std::option::Option::Some(50),
12299 Self::BootOrLogonInitializationScripts => std::option::Option::Some(37),
12300 Self::StartupItems => std::option::Option::Some(38),
12301 Self::NetworkServiceDiscovery => std::option::Option::Some(32),
12302 Self::ScheduledTaskJob => std::option::Option::Some(89),
12303 Self::ScheduledTaskJobCron => std::option::Option::Some(119),
12304 Self::ContainerOrchestrationJob => std::option::Option::Some(90),
12305 Self::ProcessInjection => std::option::Option::Some(93),
12306 Self::InputCapture => std::option::Option::Some(103),
12307 Self::InputCaptureKeylogging => std::option::Option::Some(104),
12308 Self::ProcessDiscovery => std::option::Option::Some(56),
12309 Self::CommandAndScriptingInterpreter => std::option::Option::Some(6),
12310 Self::UnixShell => std::option::Option::Some(7),
12311 Self::Python => std::option::Option::Some(59),
12312 Self::ExploitationForPrivilegeEscalation => std::option::Option::Some(63),
12313 Self::PermissionGroupsDiscovery => std::option::Option::Some(18),
12314 Self::CloudGroups => std::option::Option::Some(19),
12315 Self::IndicatorRemoval => std::option::Option::Some(123),
12316 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => std::option::Option::Some(124),
12317 Self::IndicatorRemovalClearCommandHistory => std::option::Option::Some(125),
12318 Self::IndicatorRemovalFileDeletion => std::option::Option::Some(64),
12319 Self::IndicatorRemovalTimestomp => std::option::Option::Some(128),
12320 Self::IndicatorRemovalClearMailboxData => std::option::Option::Some(126),
12321 Self::ApplicationLayerProtocol => std::option::Option::Some(45),
12322 Self::Dns => std::option::Option::Some(46),
12323 Self::SoftwareDeploymentTools => std::option::Option::Some(47),
12324 Self::ValidAccounts => std::option::Option::Some(14),
12325 Self::DefaultAccounts => std::option::Option::Some(35),
12326 Self::LocalAccounts => std::option::Option::Some(15),
12327 Self::CloudAccounts => std::option::Option::Some(16),
12328 Self::FileAndDirectoryDiscovery => std::option::Option::Some(121),
12329 Self::AccountDiscoveryLocalAccount => std::option::Option::Some(116),
12330 Self::Proxy => std::option::Option::Some(9),
12331 Self::ExternalProxy => std::option::Option::Some(10),
12332 Self::MultiHopProxy => std::option::Option::Some(11),
12333 Self::AccountManipulation => std::option::Option::Some(22),
12334 Self::AdditionalCloudCredentials => std::option::Option::Some(40),
12335 Self::AdditionalCloudRoles => std::option::Option::Some(67),
12336 Self::SshAuthorizedKeys => std::option::Option::Some(23),
12337 Self::AdditionalContainerClusterRoles => std::option::Option::Some(58),
12338 Self::MultiStageChannels => std::option::Option::Some(76),
12339 Self::IngressToolTransfer => std::option::Option::Some(3),
12340 Self::NativeApi => std::option::Option::Some(4),
12341 Self::BruteForce => std::option::Option::Some(44),
12342 Self::AutomatedCollection => std::option::Option::Some(94),
12343 Self::SharedModules => std::option::Option::Some(5),
12344 Self::DataEncoding => std::option::Option::Some(77),
12345 Self::StandardEncoding => std::option::Option::Some(78),
12346 Self::AccessTokenManipulation => std::option::Option::Some(33),
12347 Self::TokenImpersonationOrTheft => std::option::Option::Some(39),
12348 Self::CreateAccount => std::option::Option::Some(79),
12349 Self::LocalAccount => std::option::Option::Some(80),
12350 Self::DeobfuscateDecodeFilesOrInfo => std::option::Option::Some(95),
12351 Self::ExploitPublicFacingApplication => std::option::Option::Some(27),
12352 Self::SupplyChainCompromise => std::option::Option::Some(129),
12353 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
12354 std::option::Option::Some(130)
12355 }
12356 Self::ExploitationForClientExecution => std::option::Option::Some(134),
12357 Self::UserExecution => std::option::Option::Some(69),
12358 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
12359 std::option::Option::Some(135)
12360 }
12361 Self::DomainPolicyModification => std::option::Option::Some(30),
12362 Self::DataDestruction => std::option::Option::Some(29),
12363 Self::DataEncryptedForImpact => std::option::Option::Some(132),
12364 Self::ServiceStop => std::option::Option::Some(52),
12365 Self::InhibitSystemRecovery => std::option::Option::Some(36),
12366 Self::FirmwareCorruption => std::option::Option::Some(81),
12367 Self::ResourceHijacking => std::option::Option::Some(8),
12368 Self::NetworkDenialOfService => std::option::Option::Some(17),
12369 Self::CloudServiceDiscovery => std::option::Option::Some(48),
12370 Self::StealApplicationAccessToken => std::option::Option::Some(42),
12371 Self::AccountAccessRemoval => std::option::Option::Some(51),
12372 Self::TransferDataToCloudAccount => std::option::Option::Some(91),
12373 Self::StealWebSessionCookie => std::option::Option::Some(25),
12374 Self::CreateOrModifySystemProcess => std::option::Option::Some(24),
12375 Self::EventTriggeredExecution => std::option::Option::Some(65),
12376 Self::BootOrLogonAutostartExecution => std::option::Option::Some(82),
12377 Self::KernelModulesAndExtensions => std::option::Option::Some(83),
12378 Self::ShortcutModification => std::option::Option::Some(127),
12379 Self::AbuseElevationControlMechanism => std::option::Option::Some(34),
12380 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
12381 std::option::Option::Some(136)
12382 }
12383 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
12384 std::option::Option::Some(109)
12385 }
12386 Self::UnsecuredCredentials => std::option::Option::Some(13),
12387 Self::CredentialsInFiles => std::option::Option::Some(105),
12388 Self::BashHistory => std::option::Option::Some(96),
12389 Self::PrivateKeys => std::option::Option::Some(97),
12390 Self::SubvertTrustControl => std::option::Option::Some(106),
12391 Self::InstallRootCertificate => std::option::Option::Some(107),
12392 Self::CompromiseHostSoftwareBinary => std::option::Option::Some(84),
12393 Self::CredentialsFromPasswordStores => std::option::Option::Some(98),
12394 Self::ModifyAuthenticationProcess => std::option::Option::Some(28),
12395 Self::PluggableAuthenticationModules => std::option::Option::Some(108),
12396 Self::MultiFactorAuthentication => std::option::Option::Some(137),
12397 Self::ImpairDefenses => std::option::Option::Some(31),
12398 Self::DisableOrModifyTools => std::option::Option::Some(55),
12399 Self::IndicatorBlocking => std::option::Option::Some(110),
12400 Self::DisableOrModifyLinuxAuditSystem => std::option::Option::Some(111),
12401 Self::HideArtifacts => std::option::Option::Some(85),
12402 Self::HiddenFilesAndDirectories => std::option::Option::Some(86),
12403 Self::HiddenUsers => std::option::Option::Some(87),
12404 Self::ExfiltrationOverWebService => std::option::Option::Some(20),
12405 Self::ExfiltrationToCloudStorage => std::option::Option::Some(21),
12406 Self::DynamicResolution => std::option::Option::Some(12),
12407 Self::LateralToolTransfer => std::option::Option::Some(41),
12408 Self::HijackExecutionFlow => std::option::Option::Some(112),
12409 Self::HijackExecutionFlowDynamicLinkerHijacking => std::option::Option::Some(113),
12410 Self::ModifyCloudComputeInfrastructure => std::option::Option::Some(26),
12411 Self::CreateSnapshot => std::option::Option::Some(54),
12412 Self::CloudInfrastructureDiscovery => std::option::Option::Some(53),
12413 Self::DevelopCapabilities => std::option::Option::Some(99),
12414 Self::DevelopCapabilitiesMalware => std::option::Option::Some(100),
12415 Self::ObtainCapabilities => std::option::Option::Some(43),
12416 Self::ObtainCapabilitiesMalware => std::option::Option::Some(101),
12417 Self::ObtainCapabilitiesVulnerabilities => std::option::Option::Some(133),
12418 Self::ActiveScanning => std::option::Option::Some(1),
12419 Self::ScanningIpBlocks => std::option::Option::Some(2),
12420 Self::StageCapabilities => std::option::Option::Some(88),
12421 Self::UploadMalware => std::option::Option::Some(102),
12422 Self::ContainerAdministrationCommand => std::option::Option::Some(60),
12423 Self::DeployContainer => std::option::Option::Some(66),
12424 Self::EscapeToHost => std::option::Option::Some(61),
12425 Self::ContainerAndResourceDiscovery => std::option::Option::Some(57),
12426 Self::ReflectiveCodeLoading => std::option::Option::Some(92),
12427 Self::StealOrForgeAuthenticationCertificates => std::option::Option::Some(62),
12428 Self::FinancialTheft => std::option::Option::Some(131),
12429 Self::UnknownValue(u) => u.0.value(),
12430 }
12431 }
12432
12433 /// Gets the enum value as a string.
12434 ///
12435 /// Returns `None` if the enum contains an unknown value deserialized from
12436 /// the integer representation of enums.
12437 pub fn name(&self) -> std::option::Option<&str> {
12438 match self {
12439 Self::Unspecified => std::option::Option::Some("TECHNIQUE_UNSPECIFIED"),
12440 Self::DataObfuscation => std::option::Option::Some("DATA_OBFUSCATION"),
12441 Self::DataObfuscationSteganography => {
12442 std::option::Option::Some("DATA_OBFUSCATION_STEGANOGRAPHY")
12443 }
12444 Self::OsCredentialDumping => std::option::Option::Some("OS_CREDENTIAL_DUMPING"),
12445 Self::OsCredentialDumpingProcFilesystem => {
12446 std::option::Option::Some("OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM")
12447 }
12448 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => {
12449 std::option::Option::Some("OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW")
12450 }
12451 Self::DataFromLocalSystem => std::option::Option::Some("DATA_FROM_LOCAL_SYSTEM"),
12452 Self::AutomatedExfiltration => std::option::Option::Some("AUTOMATED_EXFILTRATION"),
12453 Self::ObfuscatedFilesOrInfo => {
12454 std::option::Option::Some("OBFUSCATED_FILES_OR_INFO")
12455 }
12456 Self::Steganography => std::option::Option::Some("STEGANOGRAPHY"),
12457 Self::CompileAfterDelivery => std::option::Option::Some("COMPILE_AFTER_DELIVERY"),
12458 Self::CommandObfuscation => std::option::Option::Some("COMMAND_OBFUSCATION"),
12459 Self::ScheduledTransfer => std::option::Option::Some("SCHEDULED_TRANSFER"),
12460 Self::SystemOwnerUserDiscovery => {
12461 std::option::Option::Some("SYSTEM_OWNER_USER_DISCOVERY")
12462 }
12463 Self::Masquerading => std::option::Option::Some("MASQUERADING"),
12464 Self::MatchLegitimateNameOrLocation => {
12465 std::option::Option::Some("MATCH_LEGITIMATE_NAME_OR_LOCATION")
12466 }
12467 Self::BootOrLogonInitializationScripts => {
12468 std::option::Option::Some("BOOT_OR_LOGON_INITIALIZATION_SCRIPTS")
12469 }
12470 Self::StartupItems => std::option::Option::Some("STARTUP_ITEMS"),
12471 Self::NetworkServiceDiscovery => {
12472 std::option::Option::Some("NETWORK_SERVICE_DISCOVERY")
12473 }
12474 Self::ScheduledTaskJob => std::option::Option::Some("SCHEDULED_TASK_JOB"),
12475 Self::ScheduledTaskJobCron => std::option::Option::Some("SCHEDULED_TASK_JOB_CRON"),
12476 Self::ContainerOrchestrationJob => {
12477 std::option::Option::Some("CONTAINER_ORCHESTRATION_JOB")
12478 }
12479 Self::ProcessInjection => std::option::Option::Some("PROCESS_INJECTION"),
12480 Self::InputCapture => std::option::Option::Some("INPUT_CAPTURE"),
12481 Self::InputCaptureKeylogging => {
12482 std::option::Option::Some("INPUT_CAPTURE_KEYLOGGING")
12483 }
12484 Self::ProcessDiscovery => std::option::Option::Some("PROCESS_DISCOVERY"),
12485 Self::CommandAndScriptingInterpreter => {
12486 std::option::Option::Some("COMMAND_AND_SCRIPTING_INTERPRETER")
12487 }
12488 Self::UnixShell => std::option::Option::Some("UNIX_SHELL"),
12489 Self::Python => std::option::Option::Some("PYTHON"),
12490 Self::ExploitationForPrivilegeEscalation => {
12491 std::option::Option::Some("EXPLOITATION_FOR_PRIVILEGE_ESCALATION")
12492 }
12493 Self::PermissionGroupsDiscovery => {
12494 std::option::Option::Some("PERMISSION_GROUPS_DISCOVERY")
12495 }
12496 Self::CloudGroups => std::option::Option::Some("CLOUD_GROUPS"),
12497 Self::IndicatorRemoval => std::option::Option::Some("INDICATOR_REMOVAL"),
12498 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => {
12499 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS")
12500 }
12501 Self::IndicatorRemovalClearCommandHistory => {
12502 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY")
12503 }
12504 Self::IndicatorRemovalFileDeletion => {
12505 std::option::Option::Some("INDICATOR_REMOVAL_FILE_DELETION")
12506 }
12507 Self::IndicatorRemovalTimestomp => {
12508 std::option::Option::Some("INDICATOR_REMOVAL_TIMESTOMP")
12509 }
12510 Self::IndicatorRemovalClearMailboxData => {
12511 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA")
12512 }
12513 Self::ApplicationLayerProtocol => {
12514 std::option::Option::Some("APPLICATION_LAYER_PROTOCOL")
12515 }
12516 Self::Dns => std::option::Option::Some("DNS"),
12517 Self::SoftwareDeploymentTools => {
12518 std::option::Option::Some("SOFTWARE_DEPLOYMENT_TOOLS")
12519 }
12520 Self::ValidAccounts => std::option::Option::Some("VALID_ACCOUNTS"),
12521 Self::DefaultAccounts => std::option::Option::Some("DEFAULT_ACCOUNTS"),
12522 Self::LocalAccounts => std::option::Option::Some("LOCAL_ACCOUNTS"),
12523 Self::CloudAccounts => std::option::Option::Some("CLOUD_ACCOUNTS"),
12524 Self::FileAndDirectoryDiscovery => {
12525 std::option::Option::Some("FILE_AND_DIRECTORY_DISCOVERY")
12526 }
12527 Self::AccountDiscoveryLocalAccount => {
12528 std::option::Option::Some("ACCOUNT_DISCOVERY_LOCAL_ACCOUNT")
12529 }
12530 Self::Proxy => std::option::Option::Some("PROXY"),
12531 Self::ExternalProxy => std::option::Option::Some("EXTERNAL_PROXY"),
12532 Self::MultiHopProxy => std::option::Option::Some("MULTI_HOP_PROXY"),
12533 Self::AccountManipulation => std::option::Option::Some("ACCOUNT_MANIPULATION"),
12534 Self::AdditionalCloudCredentials => {
12535 std::option::Option::Some("ADDITIONAL_CLOUD_CREDENTIALS")
12536 }
12537 Self::AdditionalCloudRoles => std::option::Option::Some("ADDITIONAL_CLOUD_ROLES"),
12538 Self::SshAuthorizedKeys => std::option::Option::Some("SSH_AUTHORIZED_KEYS"),
12539 Self::AdditionalContainerClusterRoles => {
12540 std::option::Option::Some("ADDITIONAL_CONTAINER_CLUSTER_ROLES")
12541 }
12542 Self::MultiStageChannels => std::option::Option::Some("MULTI_STAGE_CHANNELS"),
12543 Self::IngressToolTransfer => std::option::Option::Some("INGRESS_TOOL_TRANSFER"),
12544 Self::NativeApi => std::option::Option::Some("NATIVE_API"),
12545 Self::BruteForce => std::option::Option::Some("BRUTE_FORCE"),
12546 Self::AutomatedCollection => std::option::Option::Some("AUTOMATED_COLLECTION"),
12547 Self::SharedModules => std::option::Option::Some("SHARED_MODULES"),
12548 Self::DataEncoding => std::option::Option::Some("DATA_ENCODING"),
12549 Self::StandardEncoding => std::option::Option::Some("STANDARD_ENCODING"),
12550 Self::AccessTokenManipulation => {
12551 std::option::Option::Some("ACCESS_TOKEN_MANIPULATION")
12552 }
12553 Self::TokenImpersonationOrTheft => {
12554 std::option::Option::Some("TOKEN_IMPERSONATION_OR_THEFT")
12555 }
12556 Self::CreateAccount => std::option::Option::Some("CREATE_ACCOUNT"),
12557 Self::LocalAccount => std::option::Option::Some("LOCAL_ACCOUNT"),
12558 Self::DeobfuscateDecodeFilesOrInfo => {
12559 std::option::Option::Some("DEOBFUSCATE_DECODE_FILES_OR_INFO")
12560 }
12561 Self::ExploitPublicFacingApplication => {
12562 std::option::Option::Some("EXPLOIT_PUBLIC_FACING_APPLICATION")
12563 }
12564 Self::SupplyChainCompromise => std::option::Option::Some("SUPPLY_CHAIN_COMPROMISE"),
12565 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
12566 std::option::Option::Some(
12567 "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS",
12568 )
12569 }
12570 Self::ExploitationForClientExecution => {
12571 std::option::Option::Some("EXPLOITATION_FOR_CLIENT_EXECUTION")
12572 }
12573 Self::UserExecution => std::option::Option::Some("USER_EXECUTION"),
12574 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
12575 std::option::Option::Some(
12576 "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION",
12577 )
12578 }
12579 Self::DomainPolicyModification => {
12580 std::option::Option::Some("DOMAIN_POLICY_MODIFICATION")
12581 }
12582 Self::DataDestruction => std::option::Option::Some("DATA_DESTRUCTION"),
12583 Self::DataEncryptedForImpact => {
12584 std::option::Option::Some("DATA_ENCRYPTED_FOR_IMPACT")
12585 }
12586 Self::ServiceStop => std::option::Option::Some("SERVICE_STOP"),
12587 Self::InhibitSystemRecovery => std::option::Option::Some("INHIBIT_SYSTEM_RECOVERY"),
12588 Self::FirmwareCorruption => std::option::Option::Some("FIRMWARE_CORRUPTION"),
12589 Self::ResourceHijacking => std::option::Option::Some("RESOURCE_HIJACKING"),
12590 Self::NetworkDenialOfService => {
12591 std::option::Option::Some("NETWORK_DENIAL_OF_SERVICE")
12592 }
12593 Self::CloudServiceDiscovery => std::option::Option::Some("CLOUD_SERVICE_DISCOVERY"),
12594 Self::StealApplicationAccessToken => {
12595 std::option::Option::Some("STEAL_APPLICATION_ACCESS_TOKEN")
12596 }
12597 Self::AccountAccessRemoval => std::option::Option::Some("ACCOUNT_ACCESS_REMOVAL"),
12598 Self::TransferDataToCloudAccount => {
12599 std::option::Option::Some("TRANSFER_DATA_TO_CLOUD_ACCOUNT")
12600 }
12601 Self::StealWebSessionCookie => {
12602 std::option::Option::Some("STEAL_WEB_SESSION_COOKIE")
12603 }
12604 Self::CreateOrModifySystemProcess => {
12605 std::option::Option::Some("CREATE_OR_MODIFY_SYSTEM_PROCESS")
12606 }
12607 Self::EventTriggeredExecution => {
12608 std::option::Option::Some("EVENT_TRIGGERED_EXECUTION")
12609 }
12610 Self::BootOrLogonAutostartExecution => {
12611 std::option::Option::Some("BOOT_OR_LOGON_AUTOSTART_EXECUTION")
12612 }
12613 Self::KernelModulesAndExtensions => {
12614 std::option::Option::Some("KERNEL_MODULES_AND_EXTENSIONS")
12615 }
12616 Self::ShortcutModification => std::option::Option::Some("SHORTCUT_MODIFICATION"),
12617 Self::AbuseElevationControlMechanism => {
12618 std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM")
12619 }
12620 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
12621 std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID")
12622 }
12623 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
12624 std::option::Option::Some(
12625 "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING",
12626 )
12627 }
12628 Self::UnsecuredCredentials => std::option::Option::Some("UNSECURED_CREDENTIALS"),
12629 Self::CredentialsInFiles => std::option::Option::Some("CREDENTIALS_IN_FILES"),
12630 Self::BashHistory => std::option::Option::Some("BASH_HISTORY"),
12631 Self::PrivateKeys => std::option::Option::Some("PRIVATE_KEYS"),
12632 Self::SubvertTrustControl => std::option::Option::Some("SUBVERT_TRUST_CONTROL"),
12633 Self::InstallRootCertificate => {
12634 std::option::Option::Some("INSTALL_ROOT_CERTIFICATE")
12635 }
12636 Self::CompromiseHostSoftwareBinary => {
12637 std::option::Option::Some("COMPROMISE_HOST_SOFTWARE_BINARY")
12638 }
12639 Self::CredentialsFromPasswordStores => {
12640 std::option::Option::Some("CREDENTIALS_FROM_PASSWORD_STORES")
12641 }
12642 Self::ModifyAuthenticationProcess => {
12643 std::option::Option::Some("MODIFY_AUTHENTICATION_PROCESS")
12644 }
12645 Self::PluggableAuthenticationModules => {
12646 std::option::Option::Some("PLUGGABLE_AUTHENTICATION_MODULES")
12647 }
12648 Self::MultiFactorAuthentication => {
12649 std::option::Option::Some("MULTI_FACTOR_AUTHENTICATION")
12650 }
12651 Self::ImpairDefenses => std::option::Option::Some("IMPAIR_DEFENSES"),
12652 Self::DisableOrModifyTools => std::option::Option::Some("DISABLE_OR_MODIFY_TOOLS"),
12653 Self::IndicatorBlocking => std::option::Option::Some("INDICATOR_BLOCKING"),
12654 Self::DisableOrModifyLinuxAuditSystem => {
12655 std::option::Option::Some("DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM")
12656 }
12657 Self::HideArtifacts => std::option::Option::Some("HIDE_ARTIFACTS"),
12658 Self::HiddenFilesAndDirectories => {
12659 std::option::Option::Some("HIDDEN_FILES_AND_DIRECTORIES")
12660 }
12661 Self::HiddenUsers => std::option::Option::Some("HIDDEN_USERS"),
12662 Self::ExfiltrationOverWebService => {
12663 std::option::Option::Some("EXFILTRATION_OVER_WEB_SERVICE")
12664 }
12665 Self::ExfiltrationToCloudStorage => {
12666 std::option::Option::Some("EXFILTRATION_TO_CLOUD_STORAGE")
12667 }
12668 Self::DynamicResolution => std::option::Option::Some("DYNAMIC_RESOLUTION"),
12669 Self::LateralToolTransfer => std::option::Option::Some("LATERAL_TOOL_TRANSFER"),
12670 Self::HijackExecutionFlow => std::option::Option::Some("HIJACK_EXECUTION_FLOW"),
12671 Self::HijackExecutionFlowDynamicLinkerHijacking => {
12672 std::option::Option::Some("HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING")
12673 }
12674 Self::ModifyCloudComputeInfrastructure => {
12675 std::option::Option::Some("MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE")
12676 }
12677 Self::CreateSnapshot => std::option::Option::Some("CREATE_SNAPSHOT"),
12678 Self::CloudInfrastructureDiscovery => {
12679 std::option::Option::Some("CLOUD_INFRASTRUCTURE_DISCOVERY")
12680 }
12681 Self::DevelopCapabilities => std::option::Option::Some("DEVELOP_CAPABILITIES"),
12682 Self::DevelopCapabilitiesMalware => {
12683 std::option::Option::Some("DEVELOP_CAPABILITIES_MALWARE")
12684 }
12685 Self::ObtainCapabilities => std::option::Option::Some("OBTAIN_CAPABILITIES"),
12686 Self::ObtainCapabilitiesMalware => {
12687 std::option::Option::Some("OBTAIN_CAPABILITIES_MALWARE")
12688 }
12689 Self::ObtainCapabilitiesVulnerabilities => {
12690 std::option::Option::Some("OBTAIN_CAPABILITIES_VULNERABILITIES")
12691 }
12692 Self::ActiveScanning => std::option::Option::Some("ACTIVE_SCANNING"),
12693 Self::ScanningIpBlocks => std::option::Option::Some("SCANNING_IP_BLOCKS"),
12694 Self::StageCapabilities => std::option::Option::Some("STAGE_CAPABILITIES"),
12695 Self::UploadMalware => std::option::Option::Some("UPLOAD_MALWARE"),
12696 Self::ContainerAdministrationCommand => {
12697 std::option::Option::Some("CONTAINER_ADMINISTRATION_COMMAND")
12698 }
12699 Self::DeployContainer => std::option::Option::Some("DEPLOY_CONTAINER"),
12700 Self::EscapeToHost => std::option::Option::Some("ESCAPE_TO_HOST"),
12701 Self::ContainerAndResourceDiscovery => {
12702 std::option::Option::Some("CONTAINER_AND_RESOURCE_DISCOVERY")
12703 }
12704 Self::ReflectiveCodeLoading => std::option::Option::Some("REFLECTIVE_CODE_LOADING"),
12705 Self::StealOrForgeAuthenticationCertificates => {
12706 std::option::Option::Some("STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES")
12707 }
12708 Self::FinancialTheft => std::option::Option::Some("FINANCIAL_THEFT"),
12709 Self::UnknownValue(u) => u.0.name(),
12710 }
12711 }
12712 }
12713
12714 impl std::default::Default for Technique {
12715 fn default() -> Self {
12716 use std::convert::From;
12717 Self::from(0)
12718 }
12719 }
12720
12721 impl std::fmt::Display for Technique {
12722 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12723 wkt::internal::display_enum(f, self.name(), self.value())
12724 }
12725 }
12726
12727 impl std::convert::From<i32> for Technique {
12728 fn from(value: i32) -> Self {
12729 match value {
12730 0 => Self::Unspecified,
12731 1 => Self::ActiveScanning,
12732 2 => Self::ScanningIpBlocks,
12733 3 => Self::IngressToolTransfer,
12734 4 => Self::NativeApi,
12735 5 => Self::SharedModules,
12736 6 => Self::CommandAndScriptingInterpreter,
12737 7 => Self::UnixShell,
12738 8 => Self::ResourceHijacking,
12739 9 => Self::Proxy,
12740 10 => Self::ExternalProxy,
12741 11 => Self::MultiHopProxy,
12742 12 => Self::DynamicResolution,
12743 13 => Self::UnsecuredCredentials,
12744 14 => Self::ValidAccounts,
12745 15 => Self::LocalAccounts,
12746 16 => Self::CloudAccounts,
12747 17 => Self::NetworkDenialOfService,
12748 18 => Self::PermissionGroupsDiscovery,
12749 19 => Self::CloudGroups,
12750 20 => Self::ExfiltrationOverWebService,
12751 21 => Self::ExfiltrationToCloudStorage,
12752 22 => Self::AccountManipulation,
12753 23 => Self::SshAuthorizedKeys,
12754 24 => Self::CreateOrModifySystemProcess,
12755 25 => Self::StealWebSessionCookie,
12756 26 => Self::ModifyCloudComputeInfrastructure,
12757 27 => Self::ExploitPublicFacingApplication,
12758 28 => Self::ModifyAuthenticationProcess,
12759 29 => Self::DataDestruction,
12760 30 => Self::DomainPolicyModification,
12761 31 => Self::ImpairDefenses,
12762 32 => Self::NetworkServiceDiscovery,
12763 33 => Self::AccessTokenManipulation,
12764 34 => Self::AbuseElevationControlMechanism,
12765 35 => Self::DefaultAccounts,
12766 36 => Self::InhibitSystemRecovery,
12767 37 => Self::BootOrLogonInitializationScripts,
12768 38 => Self::StartupItems,
12769 39 => Self::TokenImpersonationOrTheft,
12770 40 => Self::AdditionalCloudCredentials,
12771 41 => Self::LateralToolTransfer,
12772 42 => Self::StealApplicationAccessToken,
12773 43 => Self::ObtainCapabilities,
12774 44 => Self::BruteForce,
12775 45 => Self::ApplicationLayerProtocol,
12776 46 => Self::Dns,
12777 47 => Self::SoftwareDeploymentTools,
12778 48 => Self::CloudServiceDiscovery,
12779 49 => Self::Masquerading,
12780 50 => Self::MatchLegitimateNameOrLocation,
12781 51 => Self::AccountAccessRemoval,
12782 52 => Self::ServiceStop,
12783 53 => Self::CloudInfrastructureDiscovery,
12784 54 => Self::CreateSnapshot,
12785 55 => Self::DisableOrModifyTools,
12786 56 => Self::ProcessDiscovery,
12787 57 => Self::ContainerAndResourceDiscovery,
12788 58 => Self::AdditionalContainerClusterRoles,
12789 59 => Self::Python,
12790 60 => Self::ContainerAdministrationCommand,
12791 61 => Self::EscapeToHost,
12792 62 => Self::StealOrForgeAuthenticationCertificates,
12793 63 => Self::ExploitationForPrivilegeEscalation,
12794 64 => Self::IndicatorRemovalFileDeletion,
12795 65 => Self::EventTriggeredExecution,
12796 66 => Self::DeployContainer,
12797 67 => Self::AdditionalCloudRoles,
12798 68 => Self::AutomatedExfiltration,
12799 69 => Self::UserExecution,
12800 70 => Self::DataObfuscation,
12801 71 => Self::DataObfuscationSteganography,
12802 72 => Self::ObfuscatedFilesOrInfo,
12803 73 => Self::Steganography,
12804 74 => Self::CompileAfterDelivery,
12805 75 => Self::CommandObfuscation,
12806 76 => Self::MultiStageChannels,
12807 77 => Self::DataEncoding,
12808 78 => Self::StandardEncoding,
12809 79 => Self::CreateAccount,
12810 80 => Self::LocalAccount,
12811 81 => Self::FirmwareCorruption,
12812 82 => Self::BootOrLogonAutostartExecution,
12813 83 => Self::KernelModulesAndExtensions,
12814 84 => Self::CompromiseHostSoftwareBinary,
12815 85 => Self::HideArtifacts,
12816 86 => Self::HiddenFilesAndDirectories,
12817 87 => Self::HiddenUsers,
12818 88 => Self::StageCapabilities,
12819 89 => Self::ScheduledTaskJob,
12820 90 => Self::ContainerOrchestrationJob,
12821 91 => Self::TransferDataToCloudAccount,
12822 92 => Self::ReflectiveCodeLoading,
12823 93 => Self::ProcessInjection,
12824 94 => Self::AutomatedCollection,
12825 95 => Self::DeobfuscateDecodeFilesOrInfo,
12826 96 => Self::BashHistory,
12827 97 => Self::PrivateKeys,
12828 98 => Self::CredentialsFromPasswordStores,
12829 99 => Self::DevelopCapabilities,
12830 100 => Self::DevelopCapabilitiesMalware,
12831 101 => Self::ObtainCapabilitiesMalware,
12832 102 => Self::UploadMalware,
12833 103 => Self::InputCapture,
12834 104 => Self::InputCaptureKeylogging,
12835 105 => Self::CredentialsInFiles,
12836 106 => Self::SubvertTrustControl,
12837 107 => Self::InstallRootCertificate,
12838 108 => Self::PluggableAuthenticationModules,
12839 109 => Self::AbuseElevationControlMechanismSudoAndSudoCaching,
12840 110 => Self::IndicatorBlocking,
12841 111 => Self::DisableOrModifyLinuxAuditSystem,
12842 112 => Self::HijackExecutionFlow,
12843 113 => Self::HijackExecutionFlowDynamicLinkerHijacking,
12844 114 => Self::OsCredentialDumping,
12845 115 => Self::OsCredentialDumpingProcFilesystem,
12846 116 => Self::AccountDiscoveryLocalAccount,
12847 117 => Self::DataFromLocalSystem,
12848 118 => Self::SystemOwnerUserDiscovery,
12849 119 => Self::ScheduledTaskJobCron,
12850 120 => Self::ScheduledTransfer,
12851 121 => Self::FileAndDirectoryDiscovery,
12852 122 => Self::OsCredentialDumpingEtcPasswordAndEtcShadow,
12853 123 => Self::IndicatorRemoval,
12854 124 => Self::IndicatorRemovalClearLinuxOrMacSystemLogs,
12855 125 => Self::IndicatorRemovalClearCommandHistory,
12856 126 => Self::IndicatorRemovalClearMailboxData,
12857 127 => Self::ShortcutModification,
12858 128 => Self::IndicatorRemovalTimestomp,
12859 129 => Self::SupplyChainCompromise,
12860 130 => Self::CompromiseSoftwareDependenciesAndDevelopmentTools,
12861 131 => Self::FinancialTheft,
12862 132 => Self::DataEncryptedForImpact,
12863 133 => Self::ObtainCapabilitiesVulnerabilities,
12864 134 => Self::ExploitationForClientExecution,
12865 135 => Self::LinuxAndMacFileAndDirectoryPermissionsModification,
12866 136 => Self::AbuseElevationControlMechanismSetuidAndSetgid,
12867 137 => Self::MultiFactorAuthentication,
12868 _ => Self::UnknownValue(technique::UnknownValue(
12869 wkt::internal::UnknownEnumValue::Integer(value),
12870 )),
12871 }
12872 }
12873 }
12874
12875 impl std::convert::From<&str> for Technique {
12876 fn from(value: &str) -> Self {
12877 use std::string::ToString;
12878 match value {
12879 "TECHNIQUE_UNSPECIFIED" => Self::Unspecified,
12880 "DATA_OBFUSCATION" => Self::DataObfuscation,
12881 "DATA_OBFUSCATION_STEGANOGRAPHY" => Self::DataObfuscationSteganography,
12882 "OS_CREDENTIAL_DUMPING" => Self::OsCredentialDumping,
12883 "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM" => Self::OsCredentialDumpingProcFilesystem,
12884 "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW" => {
12885 Self::OsCredentialDumpingEtcPasswordAndEtcShadow
12886 }
12887 "DATA_FROM_LOCAL_SYSTEM" => Self::DataFromLocalSystem,
12888 "AUTOMATED_EXFILTRATION" => Self::AutomatedExfiltration,
12889 "OBFUSCATED_FILES_OR_INFO" => Self::ObfuscatedFilesOrInfo,
12890 "STEGANOGRAPHY" => Self::Steganography,
12891 "COMPILE_AFTER_DELIVERY" => Self::CompileAfterDelivery,
12892 "COMMAND_OBFUSCATION" => Self::CommandObfuscation,
12893 "SCHEDULED_TRANSFER" => Self::ScheduledTransfer,
12894 "SYSTEM_OWNER_USER_DISCOVERY" => Self::SystemOwnerUserDiscovery,
12895 "MASQUERADING" => Self::Masquerading,
12896 "MATCH_LEGITIMATE_NAME_OR_LOCATION" => Self::MatchLegitimateNameOrLocation,
12897 "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS" => Self::BootOrLogonInitializationScripts,
12898 "STARTUP_ITEMS" => Self::StartupItems,
12899 "NETWORK_SERVICE_DISCOVERY" => Self::NetworkServiceDiscovery,
12900 "SCHEDULED_TASK_JOB" => Self::ScheduledTaskJob,
12901 "SCHEDULED_TASK_JOB_CRON" => Self::ScheduledTaskJobCron,
12902 "CONTAINER_ORCHESTRATION_JOB" => Self::ContainerOrchestrationJob,
12903 "PROCESS_INJECTION" => Self::ProcessInjection,
12904 "INPUT_CAPTURE" => Self::InputCapture,
12905 "INPUT_CAPTURE_KEYLOGGING" => Self::InputCaptureKeylogging,
12906 "PROCESS_DISCOVERY" => Self::ProcessDiscovery,
12907 "COMMAND_AND_SCRIPTING_INTERPRETER" => Self::CommandAndScriptingInterpreter,
12908 "UNIX_SHELL" => Self::UnixShell,
12909 "PYTHON" => Self::Python,
12910 "EXPLOITATION_FOR_PRIVILEGE_ESCALATION" => Self::ExploitationForPrivilegeEscalation,
12911 "PERMISSION_GROUPS_DISCOVERY" => Self::PermissionGroupsDiscovery,
12912 "CLOUD_GROUPS" => Self::CloudGroups,
12913 "INDICATOR_REMOVAL" => Self::IndicatorRemoval,
12914 "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS" => {
12915 Self::IndicatorRemovalClearLinuxOrMacSystemLogs
12916 }
12917 "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY" => {
12918 Self::IndicatorRemovalClearCommandHistory
12919 }
12920 "INDICATOR_REMOVAL_FILE_DELETION" => Self::IndicatorRemovalFileDeletion,
12921 "INDICATOR_REMOVAL_TIMESTOMP" => Self::IndicatorRemovalTimestomp,
12922 "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA" => Self::IndicatorRemovalClearMailboxData,
12923 "APPLICATION_LAYER_PROTOCOL" => Self::ApplicationLayerProtocol,
12924 "DNS" => Self::Dns,
12925 "SOFTWARE_DEPLOYMENT_TOOLS" => Self::SoftwareDeploymentTools,
12926 "VALID_ACCOUNTS" => Self::ValidAccounts,
12927 "DEFAULT_ACCOUNTS" => Self::DefaultAccounts,
12928 "LOCAL_ACCOUNTS" => Self::LocalAccounts,
12929 "CLOUD_ACCOUNTS" => Self::CloudAccounts,
12930 "FILE_AND_DIRECTORY_DISCOVERY" => Self::FileAndDirectoryDiscovery,
12931 "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT" => Self::AccountDiscoveryLocalAccount,
12932 "PROXY" => Self::Proxy,
12933 "EXTERNAL_PROXY" => Self::ExternalProxy,
12934 "MULTI_HOP_PROXY" => Self::MultiHopProxy,
12935 "ACCOUNT_MANIPULATION" => Self::AccountManipulation,
12936 "ADDITIONAL_CLOUD_CREDENTIALS" => Self::AdditionalCloudCredentials,
12937 "ADDITIONAL_CLOUD_ROLES" => Self::AdditionalCloudRoles,
12938 "SSH_AUTHORIZED_KEYS" => Self::SshAuthorizedKeys,
12939 "ADDITIONAL_CONTAINER_CLUSTER_ROLES" => Self::AdditionalContainerClusterRoles,
12940 "MULTI_STAGE_CHANNELS" => Self::MultiStageChannels,
12941 "INGRESS_TOOL_TRANSFER" => Self::IngressToolTransfer,
12942 "NATIVE_API" => Self::NativeApi,
12943 "BRUTE_FORCE" => Self::BruteForce,
12944 "AUTOMATED_COLLECTION" => Self::AutomatedCollection,
12945 "SHARED_MODULES" => Self::SharedModules,
12946 "DATA_ENCODING" => Self::DataEncoding,
12947 "STANDARD_ENCODING" => Self::StandardEncoding,
12948 "ACCESS_TOKEN_MANIPULATION" => Self::AccessTokenManipulation,
12949 "TOKEN_IMPERSONATION_OR_THEFT" => Self::TokenImpersonationOrTheft,
12950 "CREATE_ACCOUNT" => Self::CreateAccount,
12951 "LOCAL_ACCOUNT" => Self::LocalAccount,
12952 "DEOBFUSCATE_DECODE_FILES_OR_INFO" => Self::DeobfuscateDecodeFilesOrInfo,
12953 "EXPLOIT_PUBLIC_FACING_APPLICATION" => Self::ExploitPublicFacingApplication,
12954 "SUPPLY_CHAIN_COMPROMISE" => Self::SupplyChainCompromise,
12955 "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS" => {
12956 Self::CompromiseSoftwareDependenciesAndDevelopmentTools
12957 }
12958 "EXPLOITATION_FOR_CLIENT_EXECUTION" => Self::ExploitationForClientExecution,
12959 "USER_EXECUTION" => Self::UserExecution,
12960 "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION" => {
12961 Self::LinuxAndMacFileAndDirectoryPermissionsModification
12962 }
12963 "DOMAIN_POLICY_MODIFICATION" => Self::DomainPolicyModification,
12964 "DATA_DESTRUCTION" => Self::DataDestruction,
12965 "DATA_ENCRYPTED_FOR_IMPACT" => Self::DataEncryptedForImpact,
12966 "SERVICE_STOP" => Self::ServiceStop,
12967 "INHIBIT_SYSTEM_RECOVERY" => Self::InhibitSystemRecovery,
12968 "FIRMWARE_CORRUPTION" => Self::FirmwareCorruption,
12969 "RESOURCE_HIJACKING" => Self::ResourceHijacking,
12970 "NETWORK_DENIAL_OF_SERVICE" => Self::NetworkDenialOfService,
12971 "CLOUD_SERVICE_DISCOVERY" => Self::CloudServiceDiscovery,
12972 "STEAL_APPLICATION_ACCESS_TOKEN" => Self::StealApplicationAccessToken,
12973 "ACCOUNT_ACCESS_REMOVAL" => Self::AccountAccessRemoval,
12974 "TRANSFER_DATA_TO_CLOUD_ACCOUNT" => Self::TransferDataToCloudAccount,
12975 "STEAL_WEB_SESSION_COOKIE" => Self::StealWebSessionCookie,
12976 "CREATE_OR_MODIFY_SYSTEM_PROCESS" => Self::CreateOrModifySystemProcess,
12977 "EVENT_TRIGGERED_EXECUTION" => Self::EventTriggeredExecution,
12978 "BOOT_OR_LOGON_AUTOSTART_EXECUTION" => Self::BootOrLogonAutostartExecution,
12979 "KERNEL_MODULES_AND_EXTENSIONS" => Self::KernelModulesAndExtensions,
12980 "SHORTCUT_MODIFICATION" => Self::ShortcutModification,
12981 "ABUSE_ELEVATION_CONTROL_MECHANISM" => Self::AbuseElevationControlMechanism,
12982 "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID" => {
12983 Self::AbuseElevationControlMechanismSetuidAndSetgid
12984 }
12985 "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING" => {
12986 Self::AbuseElevationControlMechanismSudoAndSudoCaching
12987 }
12988 "UNSECURED_CREDENTIALS" => Self::UnsecuredCredentials,
12989 "CREDENTIALS_IN_FILES" => Self::CredentialsInFiles,
12990 "BASH_HISTORY" => Self::BashHistory,
12991 "PRIVATE_KEYS" => Self::PrivateKeys,
12992 "SUBVERT_TRUST_CONTROL" => Self::SubvertTrustControl,
12993 "INSTALL_ROOT_CERTIFICATE" => Self::InstallRootCertificate,
12994 "COMPROMISE_HOST_SOFTWARE_BINARY" => Self::CompromiseHostSoftwareBinary,
12995 "CREDENTIALS_FROM_PASSWORD_STORES" => Self::CredentialsFromPasswordStores,
12996 "MODIFY_AUTHENTICATION_PROCESS" => Self::ModifyAuthenticationProcess,
12997 "PLUGGABLE_AUTHENTICATION_MODULES" => Self::PluggableAuthenticationModules,
12998 "MULTI_FACTOR_AUTHENTICATION" => Self::MultiFactorAuthentication,
12999 "IMPAIR_DEFENSES" => Self::ImpairDefenses,
13000 "DISABLE_OR_MODIFY_TOOLS" => Self::DisableOrModifyTools,
13001 "INDICATOR_BLOCKING" => Self::IndicatorBlocking,
13002 "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM" => Self::DisableOrModifyLinuxAuditSystem,
13003 "HIDE_ARTIFACTS" => Self::HideArtifacts,
13004 "HIDDEN_FILES_AND_DIRECTORIES" => Self::HiddenFilesAndDirectories,
13005 "HIDDEN_USERS" => Self::HiddenUsers,
13006 "EXFILTRATION_OVER_WEB_SERVICE" => Self::ExfiltrationOverWebService,
13007 "EXFILTRATION_TO_CLOUD_STORAGE" => Self::ExfiltrationToCloudStorage,
13008 "DYNAMIC_RESOLUTION" => Self::DynamicResolution,
13009 "LATERAL_TOOL_TRANSFER" => Self::LateralToolTransfer,
13010 "HIJACK_EXECUTION_FLOW" => Self::HijackExecutionFlow,
13011 "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING" => {
13012 Self::HijackExecutionFlowDynamicLinkerHijacking
13013 }
13014 "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE" => Self::ModifyCloudComputeInfrastructure,
13015 "CREATE_SNAPSHOT" => Self::CreateSnapshot,
13016 "CLOUD_INFRASTRUCTURE_DISCOVERY" => Self::CloudInfrastructureDiscovery,
13017 "DEVELOP_CAPABILITIES" => Self::DevelopCapabilities,
13018 "DEVELOP_CAPABILITIES_MALWARE" => Self::DevelopCapabilitiesMalware,
13019 "OBTAIN_CAPABILITIES" => Self::ObtainCapabilities,
13020 "OBTAIN_CAPABILITIES_MALWARE" => Self::ObtainCapabilitiesMalware,
13021 "OBTAIN_CAPABILITIES_VULNERABILITIES" => Self::ObtainCapabilitiesVulnerabilities,
13022 "ACTIVE_SCANNING" => Self::ActiveScanning,
13023 "SCANNING_IP_BLOCKS" => Self::ScanningIpBlocks,
13024 "STAGE_CAPABILITIES" => Self::StageCapabilities,
13025 "UPLOAD_MALWARE" => Self::UploadMalware,
13026 "CONTAINER_ADMINISTRATION_COMMAND" => Self::ContainerAdministrationCommand,
13027 "DEPLOY_CONTAINER" => Self::DeployContainer,
13028 "ESCAPE_TO_HOST" => Self::EscapeToHost,
13029 "CONTAINER_AND_RESOURCE_DISCOVERY" => Self::ContainerAndResourceDiscovery,
13030 "REFLECTIVE_CODE_LOADING" => Self::ReflectiveCodeLoading,
13031 "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES" => {
13032 Self::StealOrForgeAuthenticationCertificates
13033 }
13034 "FINANCIAL_THEFT" => Self::FinancialTheft,
13035 _ => Self::UnknownValue(technique::UnknownValue(
13036 wkt::internal::UnknownEnumValue::String(value.to_string()),
13037 )),
13038 }
13039 }
13040 }
13041
13042 impl serde::ser::Serialize for Technique {
13043 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13044 where
13045 S: serde::Serializer,
13046 {
13047 match self {
13048 Self::Unspecified => serializer.serialize_i32(0),
13049 Self::DataObfuscation => serializer.serialize_i32(70),
13050 Self::DataObfuscationSteganography => serializer.serialize_i32(71),
13051 Self::OsCredentialDumping => serializer.serialize_i32(114),
13052 Self::OsCredentialDumpingProcFilesystem => serializer.serialize_i32(115),
13053 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => serializer.serialize_i32(122),
13054 Self::DataFromLocalSystem => serializer.serialize_i32(117),
13055 Self::AutomatedExfiltration => serializer.serialize_i32(68),
13056 Self::ObfuscatedFilesOrInfo => serializer.serialize_i32(72),
13057 Self::Steganography => serializer.serialize_i32(73),
13058 Self::CompileAfterDelivery => serializer.serialize_i32(74),
13059 Self::CommandObfuscation => serializer.serialize_i32(75),
13060 Self::ScheduledTransfer => serializer.serialize_i32(120),
13061 Self::SystemOwnerUserDiscovery => serializer.serialize_i32(118),
13062 Self::Masquerading => serializer.serialize_i32(49),
13063 Self::MatchLegitimateNameOrLocation => serializer.serialize_i32(50),
13064 Self::BootOrLogonInitializationScripts => serializer.serialize_i32(37),
13065 Self::StartupItems => serializer.serialize_i32(38),
13066 Self::NetworkServiceDiscovery => serializer.serialize_i32(32),
13067 Self::ScheduledTaskJob => serializer.serialize_i32(89),
13068 Self::ScheduledTaskJobCron => serializer.serialize_i32(119),
13069 Self::ContainerOrchestrationJob => serializer.serialize_i32(90),
13070 Self::ProcessInjection => serializer.serialize_i32(93),
13071 Self::InputCapture => serializer.serialize_i32(103),
13072 Self::InputCaptureKeylogging => serializer.serialize_i32(104),
13073 Self::ProcessDiscovery => serializer.serialize_i32(56),
13074 Self::CommandAndScriptingInterpreter => serializer.serialize_i32(6),
13075 Self::UnixShell => serializer.serialize_i32(7),
13076 Self::Python => serializer.serialize_i32(59),
13077 Self::ExploitationForPrivilegeEscalation => serializer.serialize_i32(63),
13078 Self::PermissionGroupsDiscovery => serializer.serialize_i32(18),
13079 Self::CloudGroups => serializer.serialize_i32(19),
13080 Self::IndicatorRemoval => serializer.serialize_i32(123),
13081 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => serializer.serialize_i32(124),
13082 Self::IndicatorRemovalClearCommandHistory => serializer.serialize_i32(125),
13083 Self::IndicatorRemovalFileDeletion => serializer.serialize_i32(64),
13084 Self::IndicatorRemovalTimestomp => serializer.serialize_i32(128),
13085 Self::IndicatorRemovalClearMailboxData => serializer.serialize_i32(126),
13086 Self::ApplicationLayerProtocol => serializer.serialize_i32(45),
13087 Self::Dns => serializer.serialize_i32(46),
13088 Self::SoftwareDeploymentTools => serializer.serialize_i32(47),
13089 Self::ValidAccounts => serializer.serialize_i32(14),
13090 Self::DefaultAccounts => serializer.serialize_i32(35),
13091 Self::LocalAccounts => serializer.serialize_i32(15),
13092 Self::CloudAccounts => serializer.serialize_i32(16),
13093 Self::FileAndDirectoryDiscovery => serializer.serialize_i32(121),
13094 Self::AccountDiscoveryLocalAccount => serializer.serialize_i32(116),
13095 Self::Proxy => serializer.serialize_i32(9),
13096 Self::ExternalProxy => serializer.serialize_i32(10),
13097 Self::MultiHopProxy => serializer.serialize_i32(11),
13098 Self::AccountManipulation => serializer.serialize_i32(22),
13099 Self::AdditionalCloudCredentials => serializer.serialize_i32(40),
13100 Self::AdditionalCloudRoles => serializer.serialize_i32(67),
13101 Self::SshAuthorizedKeys => serializer.serialize_i32(23),
13102 Self::AdditionalContainerClusterRoles => serializer.serialize_i32(58),
13103 Self::MultiStageChannels => serializer.serialize_i32(76),
13104 Self::IngressToolTransfer => serializer.serialize_i32(3),
13105 Self::NativeApi => serializer.serialize_i32(4),
13106 Self::BruteForce => serializer.serialize_i32(44),
13107 Self::AutomatedCollection => serializer.serialize_i32(94),
13108 Self::SharedModules => serializer.serialize_i32(5),
13109 Self::DataEncoding => serializer.serialize_i32(77),
13110 Self::StandardEncoding => serializer.serialize_i32(78),
13111 Self::AccessTokenManipulation => serializer.serialize_i32(33),
13112 Self::TokenImpersonationOrTheft => serializer.serialize_i32(39),
13113 Self::CreateAccount => serializer.serialize_i32(79),
13114 Self::LocalAccount => serializer.serialize_i32(80),
13115 Self::DeobfuscateDecodeFilesOrInfo => serializer.serialize_i32(95),
13116 Self::ExploitPublicFacingApplication => serializer.serialize_i32(27),
13117 Self::SupplyChainCompromise => serializer.serialize_i32(129),
13118 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
13119 serializer.serialize_i32(130)
13120 }
13121 Self::ExploitationForClientExecution => serializer.serialize_i32(134),
13122 Self::UserExecution => serializer.serialize_i32(69),
13123 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
13124 serializer.serialize_i32(135)
13125 }
13126 Self::DomainPolicyModification => serializer.serialize_i32(30),
13127 Self::DataDestruction => serializer.serialize_i32(29),
13128 Self::DataEncryptedForImpact => serializer.serialize_i32(132),
13129 Self::ServiceStop => serializer.serialize_i32(52),
13130 Self::InhibitSystemRecovery => serializer.serialize_i32(36),
13131 Self::FirmwareCorruption => serializer.serialize_i32(81),
13132 Self::ResourceHijacking => serializer.serialize_i32(8),
13133 Self::NetworkDenialOfService => serializer.serialize_i32(17),
13134 Self::CloudServiceDiscovery => serializer.serialize_i32(48),
13135 Self::StealApplicationAccessToken => serializer.serialize_i32(42),
13136 Self::AccountAccessRemoval => serializer.serialize_i32(51),
13137 Self::TransferDataToCloudAccount => serializer.serialize_i32(91),
13138 Self::StealWebSessionCookie => serializer.serialize_i32(25),
13139 Self::CreateOrModifySystemProcess => serializer.serialize_i32(24),
13140 Self::EventTriggeredExecution => serializer.serialize_i32(65),
13141 Self::BootOrLogonAutostartExecution => serializer.serialize_i32(82),
13142 Self::KernelModulesAndExtensions => serializer.serialize_i32(83),
13143 Self::ShortcutModification => serializer.serialize_i32(127),
13144 Self::AbuseElevationControlMechanism => serializer.serialize_i32(34),
13145 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
13146 serializer.serialize_i32(136)
13147 }
13148 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
13149 serializer.serialize_i32(109)
13150 }
13151 Self::UnsecuredCredentials => serializer.serialize_i32(13),
13152 Self::CredentialsInFiles => serializer.serialize_i32(105),
13153 Self::BashHistory => serializer.serialize_i32(96),
13154 Self::PrivateKeys => serializer.serialize_i32(97),
13155 Self::SubvertTrustControl => serializer.serialize_i32(106),
13156 Self::InstallRootCertificate => serializer.serialize_i32(107),
13157 Self::CompromiseHostSoftwareBinary => serializer.serialize_i32(84),
13158 Self::CredentialsFromPasswordStores => serializer.serialize_i32(98),
13159 Self::ModifyAuthenticationProcess => serializer.serialize_i32(28),
13160 Self::PluggableAuthenticationModules => serializer.serialize_i32(108),
13161 Self::MultiFactorAuthentication => serializer.serialize_i32(137),
13162 Self::ImpairDefenses => serializer.serialize_i32(31),
13163 Self::DisableOrModifyTools => serializer.serialize_i32(55),
13164 Self::IndicatorBlocking => serializer.serialize_i32(110),
13165 Self::DisableOrModifyLinuxAuditSystem => serializer.serialize_i32(111),
13166 Self::HideArtifacts => serializer.serialize_i32(85),
13167 Self::HiddenFilesAndDirectories => serializer.serialize_i32(86),
13168 Self::HiddenUsers => serializer.serialize_i32(87),
13169 Self::ExfiltrationOverWebService => serializer.serialize_i32(20),
13170 Self::ExfiltrationToCloudStorage => serializer.serialize_i32(21),
13171 Self::DynamicResolution => serializer.serialize_i32(12),
13172 Self::LateralToolTransfer => serializer.serialize_i32(41),
13173 Self::HijackExecutionFlow => serializer.serialize_i32(112),
13174 Self::HijackExecutionFlowDynamicLinkerHijacking => serializer.serialize_i32(113),
13175 Self::ModifyCloudComputeInfrastructure => serializer.serialize_i32(26),
13176 Self::CreateSnapshot => serializer.serialize_i32(54),
13177 Self::CloudInfrastructureDiscovery => serializer.serialize_i32(53),
13178 Self::DevelopCapabilities => serializer.serialize_i32(99),
13179 Self::DevelopCapabilitiesMalware => serializer.serialize_i32(100),
13180 Self::ObtainCapabilities => serializer.serialize_i32(43),
13181 Self::ObtainCapabilitiesMalware => serializer.serialize_i32(101),
13182 Self::ObtainCapabilitiesVulnerabilities => serializer.serialize_i32(133),
13183 Self::ActiveScanning => serializer.serialize_i32(1),
13184 Self::ScanningIpBlocks => serializer.serialize_i32(2),
13185 Self::StageCapabilities => serializer.serialize_i32(88),
13186 Self::UploadMalware => serializer.serialize_i32(102),
13187 Self::ContainerAdministrationCommand => serializer.serialize_i32(60),
13188 Self::DeployContainer => serializer.serialize_i32(66),
13189 Self::EscapeToHost => serializer.serialize_i32(61),
13190 Self::ContainerAndResourceDiscovery => serializer.serialize_i32(57),
13191 Self::ReflectiveCodeLoading => serializer.serialize_i32(92),
13192 Self::StealOrForgeAuthenticationCertificates => serializer.serialize_i32(62),
13193 Self::FinancialTheft => serializer.serialize_i32(131),
13194 Self::UnknownValue(u) => u.0.serialize(serializer),
13195 }
13196 }
13197 }
13198
13199 impl<'de> serde::de::Deserialize<'de> for Technique {
13200 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13201 where
13202 D: serde::Deserializer<'de>,
13203 {
13204 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Technique>::new(
13205 ".google.cloud.securitycenter.v2.MitreAttack.Technique",
13206 ))
13207 }
13208 }
13209}
13210
13211/// A mute config is a Cloud SCC resource that contains the configuration
13212/// to mute create/update events of findings.
13213#[derive(Clone, Default, PartialEq)]
13214#[non_exhaustive]
13215pub struct MuteConfig {
13216 /// Identifier. This field will be ignored if provided on config creation. The
13217 /// following list shows some examples of the format:
13218 ///
13219 /// + `organizations/{organization}/muteConfigs/{mute_config}`
13220 ///
13221 /// `organizations/{organization}locations/{location}//muteConfigs/{mute_config}`
13222 ///
13223 /// + `folders/{folder}/muteConfigs/{mute_config}`
13224 /// + `folders/{folder}/locations/{location}/muteConfigs/{mute_config}`
13225 /// + `projects/{project}/muteConfigs/{mute_config}`
13226 /// + `projects/{project}/locations/{location}/muteConfigs/{mute_config}`
13227 pub name: std::string::String,
13228
13229 /// A description of the mute config.
13230 pub description: std::string::String,
13231
13232 /// Required. An expression that defines the filter to apply across
13233 /// create/update events of findings. While creating a filter string, be
13234 /// mindful of the scope in which the mute configuration is being created.
13235 /// E.g., If a filter contains project = X but is created under the project = Y
13236 /// scope, it might not match any findings.
13237 ///
13238 /// The following field and operator combinations are supported:
13239 ///
13240 /// * severity: `=`, `:`
13241 /// * category: `=`, `:`
13242 /// * resource.name: `=`, `:`
13243 /// * resource.project_name: `=`, `:`
13244 /// * resource.project_display_name: `=`, `:`
13245 /// * resource.folders.resource_folder: `=`, `:`
13246 /// * resource.parent_name: `=`, `:`
13247 /// * resource.parent_display_name: `=`, `:`
13248 /// * resource.type: `=`, `:`
13249 /// * finding_class: `=`, `:`
13250 /// * indicator.ip_addresses: `=`, `:`
13251 /// * indicator.domains: `=`, `:`
13252 pub filter: std::string::String,
13253
13254 /// Output only. The time at which the mute config was created.
13255 /// This field is set by the server and will be ignored if provided on config
13256 /// creation.
13257 pub create_time: std::option::Option<wkt::Timestamp>,
13258
13259 /// Output only. The most recent time at which the mute config was updated.
13260 /// This field is set by the server and will be ignored if provided on config
13261 /// creation or update.
13262 pub update_time: std::option::Option<wkt::Timestamp>,
13263
13264 /// Output only. Email address of the user who last edited the mute config.
13265 /// This field is set by the server and will be ignored if provided on config
13266 /// creation or update.
13267 pub most_recent_editor: std::string::String,
13268
13269 /// Required. The type of the mute config, which determines what type of mute
13270 /// state the config affects. Immutable after creation.
13271 pub r#type: crate::model::mute_config::MuteConfigType,
13272
13273 /// Optional. The expiry of the mute config. Only applicable for dynamic
13274 /// configs. If the expiry is set, when the config expires, it is removed from
13275 /// all findings.
13276 pub expiry_time: std::option::Option<wkt::Timestamp>,
13277
13278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13279}
13280
13281impl MuteConfig {
13282 pub fn new() -> Self {
13283 std::default::Default::default()
13284 }
13285
13286 /// Sets the value of [name][crate::model::MuteConfig::name].
13287 ///
13288 /// # Example
13289 /// ```ignore,no_run
13290 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13291 /// let x = MuteConfig::new().set_name("example");
13292 /// ```
13293 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13294 self.name = v.into();
13295 self
13296 }
13297
13298 /// Sets the value of [description][crate::model::MuteConfig::description].
13299 ///
13300 /// # Example
13301 /// ```ignore,no_run
13302 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13303 /// let x = MuteConfig::new().set_description("example");
13304 /// ```
13305 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13306 self.description = v.into();
13307 self
13308 }
13309
13310 /// Sets the value of [filter][crate::model::MuteConfig::filter].
13311 ///
13312 /// # Example
13313 /// ```ignore,no_run
13314 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13315 /// let x = MuteConfig::new().set_filter("example");
13316 /// ```
13317 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13318 self.filter = v.into();
13319 self
13320 }
13321
13322 /// Sets the value of [create_time][crate::model::MuteConfig::create_time].
13323 ///
13324 /// # Example
13325 /// ```ignore,no_run
13326 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13327 /// use wkt::Timestamp;
13328 /// let x = MuteConfig::new().set_create_time(Timestamp::default()/* use setters */);
13329 /// ```
13330 pub fn set_create_time<T>(mut self, v: T) -> Self
13331 where
13332 T: std::convert::Into<wkt::Timestamp>,
13333 {
13334 self.create_time = std::option::Option::Some(v.into());
13335 self
13336 }
13337
13338 /// Sets or clears the value of [create_time][crate::model::MuteConfig::create_time].
13339 ///
13340 /// # Example
13341 /// ```ignore,no_run
13342 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13343 /// use wkt::Timestamp;
13344 /// let x = MuteConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13345 /// let x = MuteConfig::new().set_or_clear_create_time(None::<Timestamp>);
13346 /// ```
13347 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13348 where
13349 T: std::convert::Into<wkt::Timestamp>,
13350 {
13351 self.create_time = v.map(|x| x.into());
13352 self
13353 }
13354
13355 /// Sets the value of [update_time][crate::model::MuteConfig::update_time].
13356 ///
13357 /// # Example
13358 /// ```ignore,no_run
13359 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13360 /// use wkt::Timestamp;
13361 /// let x = MuteConfig::new().set_update_time(Timestamp::default()/* use setters */);
13362 /// ```
13363 pub fn set_update_time<T>(mut self, v: T) -> Self
13364 where
13365 T: std::convert::Into<wkt::Timestamp>,
13366 {
13367 self.update_time = std::option::Option::Some(v.into());
13368 self
13369 }
13370
13371 /// Sets or clears the value of [update_time][crate::model::MuteConfig::update_time].
13372 ///
13373 /// # Example
13374 /// ```ignore,no_run
13375 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13376 /// use wkt::Timestamp;
13377 /// let x = MuteConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13378 /// let x = MuteConfig::new().set_or_clear_update_time(None::<Timestamp>);
13379 /// ```
13380 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13381 where
13382 T: std::convert::Into<wkt::Timestamp>,
13383 {
13384 self.update_time = v.map(|x| x.into());
13385 self
13386 }
13387
13388 /// Sets the value of [most_recent_editor][crate::model::MuteConfig::most_recent_editor].
13389 ///
13390 /// # Example
13391 /// ```ignore,no_run
13392 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13393 /// let x = MuteConfig::new().set_most_recent_editor("example");
13394 /// ```
13395 pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
13396 mut self,
13397 v: T,
13398 ) -> Self {
13399 self.most_recent_editor = v.into();
13400 self
13401 }
13402
13403 /// Sets the value of [r#type][crate::model::MuteConfig::type].
13404 ///
13405 /// # Example
13406 /// ```ignore,no_run
13407 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13408 /// use google_cloud_securitycenter_v2::model::mute_config::MuteConfigType;
13409 /// let x0 = MuteConfig::new().set_type(MuteConfigType::Static);
13410 /// let x1 = MuteConfig::new().set_type(MuteConfigType::Dynamic);
13411 /// ```
13412 pub fn set_type<T: std::convert::Into<crate::model::mute_config::MuteConfigType>>(
13413 mut self,
13414 v: T,
13415 ) -> Self {
13416 self.r#type = v.into();
13417 self
13418 }
13419
13420 /// Sets the value of [expiry_time][crate::model::MuteConfig::expiry_time].
13421 ///
13422 /// # Example
13423 /// ```ignore,no_run
13424 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13425 /// use wkt::Timestamp;
13426 /// let x = MuteConfig::new().set_expiry_time(Timestamp::default()/* use setters */);
13427 /// ```
13428 pub fn set_expiry_time<T>(mut self, v: T) -> Self
13429 where
13430 T: std::convert::Into<wkt::Timestamp>,
13431 {
13432 self.expiry_time = std::option::Option::Some(v.into());
13433 self
13434 }
13435
13436 /// Sets or clears the value of [expiry_time][crate::model::MuteConfig::expiry_time].
13437 ///
13438 /// # Example
13439 /// ```ignore,no_run
13440 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13441 /// use wkt::Timestamp;
13442 /// let x = MuteConfig::new().set_or_clear_expiry_time(Some(Timestamp::default()/* use setters */));
13443 /// let x = MuteConfig::new().set_or_clear_expiry_time(None::<Timestamp>);
13444 /// ```
13445 pub fn set_or_clear_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
13446 where
13447 T: std::convert::Into<wkt::Timestamp>,
13448 {
13449 self.expiry_time = v.map(|x| x.into());
13450 self
13451 }
13452}
13453
13454impl wkt::message::Message for MuteConfig {
13455 fn typename() -> &'static str {
13456 "type.googleapis.com/google.cloud.securitycenter.v2.MuteConfig"
13457 }
13458}
13459
13460/// Defines additional types related to [MuteConfig].
13461pub mod mute_config {
13462 #[allow(unused_imports)]
13463 use super::*;
13464
13465 /// The type of MuteConfig.
13466 ///
13467 /// # Working with unknown values
13468 ///
13469 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13470 /// additional enum variants at any time. Adding new variants is not considered
13471 /// a breaking change. Applications should write their code in anticipation of:
13472 ///
13473 /// - New values appearing in future releases of the client library, **and**
13474 /// - New values received dynamically, without application changes.
13475 ///
13476 /// Please consult the [Working with enums] section in the user guide for some
13477 /// guidelines.
13478 ///
13479 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13480 #[derive(Clone, Debug, PartialEq)]
13481 #[non_exhaustive]
13482 pub enum MuteConfigType {
13483 /// Unused.
13484 Unspecified,
13485 /// A static mute config, which sets the static mute state of future matching
13486 /// findings to muted. Once the static mute state has been set, finding or
13487 /// config modifications will not affect the state.
13488 Static,
13489 /// A dynamic mute config, which is applied to existing and future matching
13490 /// findings, setting their dynamic mute state to "muted". If the config is
13491 /// updated or deleted, or a matching finding is updated, such that the
13492 /// finding doesn't match the config, the config will be removed from the
13493 /// finding, and the finding's dynamic mute state may become "unmuted"
13494 /// (unless other configs still match).
13495 Dynamic,
13496 /// If set, the enum was initialized with an unknown value.
13497 ///
13498 /// Applications can examine the value using [MuteConfigType::value] or
13499 /// [MuteConfigType::name].
13500 UnknownValue(mute_config_type::UnknownValue),
13501 }
13502
13503 #[doc(hidden)]
13504 pub mod mute_config_type {
13505 #[allow(unused_imports)]
13506 use super::*;
13507 #[derive(Clone, Debug, PartialEq)]
13508 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13509 }
13510
13511 impl MuteConfigType {
13512 /// Gets the enum value.
13513 ///
13514 /// Returns `None` if the enum contains an unknown value deserialized from
13515 /// the string representation of enums.
13516 pub fn value(&self) -> std::option::Option<i32> {
13517 match self {
13518 Self::Unspecified => std::option::Option::Some(0),
13519 Self::Static => std::option::Option::Some(1),
13520 Self::Dynamic => std::option::Option::Some(2),
13521 Self::UnknownValue(u) => u.0.value(),
13522 }
13523 }
13524
13525 /// Gets the enum value as a string.
13526 ///
13527 /// Returns `None` if the enum contains an unknown value deserialized from
13528 /// the integer representation of enums.
13529 pub fn name(&self) -> std::option::Option<&str> {
13530 match self {
13531 Self::Unspecified => std::option::Option::Some("MUTE_CONFIG_TYPE_UNSPECIFIED"),
13532 Self::Static => std::option::Option::Some("STATIC"),
13533 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
13534 Self::UnknownValue(u) => u.0.name(),
13535 }
13536 }
13537 }
13538
13539 impl std::default::Default for MuteConfigType {
13540 fn default() -> Self {
13541 use std::convert::From;
13542 Self::from(0)
13543 }
13544 }
13545
13546 impl std::fmt::Display for MuteConfigType {
13547 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13548 wkt::internal::display_enum(f, self.name(), self.value())
13549 }
13550 }
13551
13552 impl std::convert::From<i32> for MuteConfigType {
13553 fn from(value: i32) -> Self {
13554 match value {
13555 0 => Self::Unspecified,
13556 1 => Self::Static,
13557 2 => Self::Dynamic,
13558 _ => Self::UnknownValue(mute_config_type::UnknownValue(
13559 wkt::internal::UnknownEnumValue::Integer(value),
13560 )),
13561 }
13562 }
13563 }
13564
13565 impl std::convert::From<&str> for MuteConfigType {
13566 fn from(value: &str) -> Self {
13567 use std::string::ToString;
13568 match value {
13569 "MUTE_CONFIG_TYPE_UNSPECIFIED" => Self::Unspecified,
13570 "STATIC" => Self::Static,
13571 "DYNAMIC" => Self::Dynamic,
13572 _ => Self::UnknownValue(mute_config_type::UnknownValue(
13573 wkt::internal::UnknownEnumValue::String(value.to_string()),
13574 )),
13575 }
13576 }
13577 }
13578
13579 impl serde::ser::Serialize for MuteConfigType {
13580 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13581 where
13582 S: serde::Serializer,
13583 {
13584 match self {
13585 Self::Unspecified => serializer.serialize_i32(0),
13586 Self::Static => serializer.serialize_i32(1),
13587 Self::Dynamic => serializer.serialize_i32(2),
13588 Self::UnknownValue(u) => u.0.serialize(serializer),
13589 }
13590 }
13591 }
13592
13593 impl<'de> serde::de::Deserialize<'de> for MuteConfigType {
13594 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13595 where
13596 D: serde::Deserializer<'de>,
13597 {
13598 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteConfigType>::new(
13599 ".google.cloud.securitycenter.v2.MuteConfig.MuteConfigType",
13600 ))
13601 }
13602 }
13603}
13604
13605/// Contains information about a VPC network associated with the finding.
13606#[derive(Clone, Default, PartialEq)]
13607#[non_exhaustive]
13608pub struct Network {
13609 /// The name of the VPC network resource, for example,
13610 /// `//compute.googleapis.com/projects/my-project/global/networks/my-network`.
13611 pub name: std::string::String,
13612
13613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13614}
13615
13616impl Network {
13617 pub fn new() -> Self {
13618 std::default::Default::default()
13619 }
13620
13621 /// Sets the value of [name][crate::model::Network::name].
13622 ///
13623 /// # Example
13624 /// ```ignore,no_run
13625 /// # use google_cloud_securitycenter_v2::model::Network;
13626 /// let x = Network::new().set_name("example");
13627 /// ```
13628 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13629 self.name = v.into();
13630 self
13631 }
13632}
13633
13634impl wkt::message::Message for Network {
13635 fn typename() -> &'static str {
13636 "type.googleapis.com/google.cloud.securitycenter.v2.Network"
13637 }
13638}
13639
13640/// Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise
13641/// notebook](https://cloud.google.com/colab/docs/introduction) file, that is
13642/// associated with a finding.
13643#[derive(Clone, Default, PartialEq)]
13644#[non_exhaustive]
13645pub struct Notebook {
13646 /// The name of the notebook.
13647 pub name: std::string::String,
13648
13649 /// The source notebook service, for example, "Colab Enterprise".
13650 pub service: std::string::String,
13651
13652 /// The user ID of the latest author to modify the notebook.
13653 pub last_author: std::string::String,
13654
13655 /// The most recent time the notebook was updated.
13656 pub notebook_update_time: std::option::Option<wkt::Timestamp>,
13657
13658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13659}
13660
13661impl Notebook {
13662 pub fn new() -> Self {
13663 std::default::Default::default()
13664 }
13665
13666 /// Sets the value of [name][crate::model::Notebook::name].
13667 ///
13668 /// # Example
13669 /// ```ignore,no_run
13670 /// # use google_cloud_securitycenter_v2::model::Notebook;
13671 /// let x = Notebook::new().set_name("example");
13672 /// ```
13673 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13674 self.name = v.into();
13675 self
13676 }
13677
13678 /// Sets the value of [service][crate::model::Notebook::service].
13679 ///
13680 /// # Example
13681 /// ```ignore,no_run
13682 /// # use google_cloud_securitycenter_v2::model::Notebook;
13683 /// let x = Notebook::new().set_service("example");
13684 /// ```
13685 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13686 self.service = v.into();
13687 self
13688 }
13689
13690 /// Sets the value of [last_author][crate::model::Notebook::last_author].
13691 ///
13692 /// # Example
13693 /// ```ignore,no_run
13694 /// # use google_cloud_securitycenter_v2::model::Notebook;
13695 /// let x = Notebook::new().set_last_author("example");
13696 /// ```
13697 pub fn set_last_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13698 self.last_author = v.into();
13699 self
13700 }
13701
13702 /// Sets the value of [notebook_update_time][crate::model::Notebook::notebook_update_time].
13703 ///
13704 /// # Example
13705 /// ```ignore,no_run
13706 /// # use google_cloud_securitycenter_v2::model::Notebook;
13707 /// use wkt::Timestamp;
13708 /// let x = Notebook::new().set_notebook_update_time(Timestamp::default()/* use setters */);
13709 /// ```
13710 pub fn set_notebook_update_time<T>(mut self, v: T) -> Self
13711 where
13712 T: std::convert::Into<wkt::Timestamp>,
13713 {
13714 self.notebook_update_time = std::option::Option::Some(v.into());
13715 self
13716 }
13717
13718 /// Sets or clears the value of [notebook_update_time][crate::model::Notebook::notebook_update_time].
13719 ///
13720 /// # Example
13721 /// ```ignore,no_run
13722 /// # use google_cloud_securitycenter_v2::model::Notebook;
13723 /// use wkt::Timestamp;
13724 /// let x = Notebook::new().set_or_clear_notebook_update_time(Some(Timestamp::default()/* use setters */));
13725 /// let x = Notebook::new().set_or_clear_notebook_update_time(None::<Timestamp>);
13726 /// ```
13727 pub fn set_or_clear_notebook_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13728 where
13729 T: std::convert::Into<wkt::Timestamp>,
13730 {
13731 self.notebook_update_time = v.map(|x| x.into());
13732 self
13733 }
13734}
13735
13736impl wkt::message::Message for Notebook {
13737 fn typename() -> &'static str {
13738 "type.googleapis.com/google.cloud.securitycenter.v2.Notebook"
13739 }
13740}
13741
13742/// Cloud Security Command Center (Cloud SCC) notification configs.
13743///
13744/// A notification config is a Cloud SCC resource that contains the configuration
13745/// to send notifications for create/update events of findings, assets and etc.
13746#[derive(Clone, Default, PartialEq)]
13747#[non_exhaustive]
13748pub struct NotificationConfig {
13749 /// Identifier. The relative resource name of this notification config. See:
13750 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
13751 /// The following list shows some examples:
13752 /// +
13753 /// `organizations/{organization_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13754 /// +
13755 /// `folders/{folder_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13756 /// +
13757 /// `projects/{project_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13758 pub name: std::string::String,
13759
13760 /// The description of the notification config (max of 1024 characters).
13761 pub description: std::string::String,
13762
13763 /// The Pub/Sub topic to send notifications to. Its format is
13764 /// "projects/[project_id]/topics/[topic]".
13765 pub pubsub_topic: std::string::String,
13766
13767 /// Output only. The service account that needs "pubsub.topics.publish"
13768 /// permission to publish to the Pub/Sub topic.
13769 pub service_account: std::string::String,
13770
13771 /// Output only. The timestamp of when the notification config was last
13772 /// updated.
13773 pub update_time: std::option::Option<wkt::Timestamp>,
13774
13775 /// The config for triggering notifications.
13776 pub notify_config: std::option::Option<crate::model::notification_config::NotifyConfig>,
13777
13778 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13779}
13780
13781impl NotificationConfig {
13782 pub fn new() -> Self {
13783 std::default::Default::default()
13784 }
13785
13786 /// Sets the value of [name][crate::model::NotificationConfig::name].
13787 ///
13788 /// # Example
13789 /// ```ignore,no_run
13790 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13791 /// let x = NotificationConfig::new().set_name("example");
13792 /// ```
13793 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13794 self.name = v.into();
13795 self
13796 }
13797
13798 /// Sets the value of [description][crate::model::NotificationConfig::description].
13799 ///
13800 /// # Example
13801 /// ```ignore,no_run
13802 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13803 /// let x = NotificationConfig::new().set_description("example");
13804 /// ```
13805 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13806 self.description = v.into();
13807 self
13808 }
13809
13810 /// Sets the value of [pubsub_topic][crate::model::NotificationConfig::pubsub_topic].
13811 ///
13812 /// # Example
13813 /// ```ignore,no_run
13814 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13815 /// let x = NotificationConfig::new().set_pubsub_topic("example");
13816 /// ```
13817 pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13818 self.pubsub_topic = v.into();
13819 self
13820 }
13821
13822 /// Sets the value of [service_account][crate::model::NotificationConfig::service_account].
13823 ///
13824 /// # Example
13825 /// ```ignore,no_run
13826 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13827 /// let x = NotificationConfig::new().set_service_account("example");
13828 /// ```
13829 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13830 self.service_account = v.into();
13831 self
13832 }
13833
13834 /// Sets the value of [update_time][crate::model::NotificationConfig::update_time].
13835 ///
13836 /// # Example
13837 /// ```ignore,no_run
13838 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13839 /// use wkt::Timestamp;
13840 /// let x = NotificationConfig::new().set_update_time(Timestamp::default()/* use setters */);
13841 /// ```
13842 pub fn set_update_time<T>(mut self, v: T) -> Self
13843 where
13844 T: std::convert::Into<wkt::Timestamp>,
13845 {
13846 self.update_time = std::option::Option::Some(v.into());
13847 self
13848 }
13849
13850 /// Sets or clears the value of [update_time][crate::model::NotificationConfig::update_time].
13851 ///
13852 /// # Example
13853 /// ```ignore,no_run
13854 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13855 /// use wkt::Timestamp;
13856 /// let x = NotificationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13857 /// let x = NotificationConfig::new().set_or_clear_update_time(None::<Timestamp>);
13858 /// ```
13859 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13860 where
13861 T: std::convert::Into<wkt::Timestamp>,
13862 {
13863 self.update_time = v.map(|x| x.into());
13864 self
13865 }
13866
13867 /// Sets the value of [notify_config][crate::model::NotificationConfig::notify_config].
13868 ///
13869 /// Note that all the setters affecting `notify_config` are mutually
13870 /// exclusive.
13871 ///
13872 /// # Example
13873 /// ```ignore,no_run
13874 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13875 /// use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
13876 /// let x = NotificationConfig::new().set_notify_config(Some(
13877 /// google_cloud_securitycenter_v2::model::notification_config::NotifyConfig::StreamingConfig(StreamingConfig::default().into())));
13878 /// ```
13879 pub fn set_notify_config<
13880 T: std::convert::Into<std::option::Option<crate::model::notification_config::NotifyConfig>>,
13881 >(
13882 mut self,
13883 v: T,
13884 ) -> Self {
13885 self.notify_config = v.into();
13886 self
13887 }
13888
13889 /// The value of [notify_config][crate::model::NotificationConfig::notify_config]
13890 /// if it holds a `StreamingConfig`, `None` if the field is not set or
13891 /// holds a different branch.
13892 pub fn streaming_config(
13893 &self,
13894 ) -> std::option::Option<&std::boxed::Box<crate::model::notification_config::StreamingConfig>>
13895 {
13896 #[allow(unreachable_patterns)]
13897 self.notify_config.as_ref().and_then(|v| match v {
13898 crate::model::notification_config::NotifyConfig::StreamingConfig(v) => {
13899 std::option::Option::Some(v)
13900 }
13901 _ => std::option::Option::None,
13902 })
13903 }
13904
13905 /// Sets the value of [notify_config][crate::model::NotificationConfig::notify_config]
13906 /// to hold a `StreamingConfig`.
13907 ///
13908 /// Note that all the setters affecting `notify_config` are
13909 /// mutually exclusive.
13910 ///
13911 /// # Example
13912 /// ```ignore,no_run
13913 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13914 /// use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
13915 /// let x = NotificationConfig::new().set_streaming_config(StreamingConfig::default()/* use setters */);
13916 /// assert!(x.streaming_config().is_some());
13917 /// ```
13918 pub fn set_streaming_config<
13919 T: std::convert::Into<std::boxed::Box<crate::model::notification_config::StreamingConfig>>,
13920 >(
13921 mut self,
13922 v: T,
13923 ) -> Self {
13924 self.notify_config = std::option::Option::Some(
13925 crate::model::notification_config::NotifyConfig::StreamingConfig(v.into()),
13926 );
13927 self
13928 }
13929}
13930
13931impl wkt::message::Message for NotificationConfig {
13932 fn typename() -> &'static str {
13933 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig"
13934 }
13935}
13936
13937/// Defines additional types related to [NotificationConfig].
13938pub mod notification_config {
13939 #[allow(unused_imports)]
13940 use super::*;
13941
13942 /// The config for streaming-based notifications, which send each event as soon
13943 /// as it is detected.
13944 #[derive(Clone, Default, PartialEq)]
13945 #[non_exhaustive]
13946 pub struct StreamingConfig {
13947 /// Expression that defines the filter to apply across create/update events
13948 /// of assets or findings as specified by the event type. The expression is a
13949 /// list of zero or more restrictions combined via logical operators `AND`
13950 /// and `OR`. Parentheses are supported, and `OR` has higher precedence than
13951 /// `AND`.
13952 ///
13953 /// Restrictions have the form `<field> <operator> <value>` and may have a
13954 /// `-` character in front of them to indicate negation. The fields map to
13955 /// those defined in the corresponding resource.
13956 ///
13957 /// The supported operators are:
13958 ///
13959 /// * `=` for all value types.
13960 /// * `>`, `<`, `>=`, `<=` for integer values.
13961 /// * `:`, meaning substring matching, for strings.
13962 ///
13963 /// The supported value types are:
13964 ///
13965 /// * string literals in quotes.
13966 /// * integer literals without quotes.
13967 /// * boolean literals `true` and `false` without quotes.
13968 pub filter: std::string::String,
13969
13970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13971 }
13972
13973 impl StreamingConfig {
13974 pub fn new() -> Self {
13975 std::default::Default::default()
13976 }
13977
13978 /// Sets the value of [filter][crate::model::notification_config::StreamingConfig::filter].
13979 ///
13980 /// # Example
13981 /// ```ignore,no_run
13982 /// # use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
13983 /// let x = StreamingConfig::new().set_filter("example");
13984 /// ```
13985 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13986 self.filter = v.into();
13987 self
13988 }
13989 }
13990
13991 impl wkt::message::Message for StreamingConfig {
13992 fn typename() -> &'static str {
13993 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig"
13994 }
13995 }
13996
13997 /// The config for triggering notifications.
13998 #[derive(Clone, Debug, PartialEq)]
13999 #[non_exhaustive]
14000 pub enum NotifyConfig {
14001 /// The config for triggering streaming-based notifications.
14002 StreamingConfig(std::boxed::Box<crate::model::notification_config::StreamingConfig>),
14003 }
14004}
14005
14006/// Cloud SCC's Notification
14007#[derive(Clone, Default, PartialEq)]
14008#[non_exhaustive]
14009pub struct NotificationMessage {
14010 /// Name of the notification config that generated current notification.
14011 pub notification_config_name: std::string::String,
14012
14013 /// The Cloud resource tied to this notification's Finding.
14014 pub resource: std::option::Option<crate::model::Resource>,
14015
14016 /// Notification Event.
14017 pub event: std::option::Option<crate::model::notification_message::Event>,
14018
14019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14020}
14021
14022impl NotificationMessage {
14023 pub fn new() -> Self {
14024 std::default::Default::default()
14025 }
14026
14027 /// Sets the value of [notification_config_name][crate::model::NotificationMessage::notification_config_name].
14028 ///
14029 /// # Example
14030 /// ```ignore,no_run
14031 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14032 /// let x = NotificationMessage::new().set_notification_config_name("example");
14033 /// ```
14034 pub fn set_notification_config_name<T: std::convert::Into<std::string::String>>(
14035 mut self,
14036 v: T,
14037 ) -> Self {
14038 self.notification_config_name = v.into();
14039 self
14040 }
14041
14042 /// Sets the value of [resource][crate::model::NotificationMessage::resource].
14043 ///
14044 /// # Example
14045 /// ```ignore,no_run
14046 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14047 /// use google_cloud_securitycenter_v2::model::Resource;
14048 /// let x = NotificationMessage::new().set_resource(Resource::default()/* use setters */);
14049 /// ```
14050 pub fn set_resource<T>(mut self, v: T) -> Self
14051 where
14052 T: std::convert::Into<crate::model::Resource>,
14053 {
14054 self.resource = std::option::Option::Some(v.into());
14055 self
14056 }
14057
14058 /// Sets or clears the value of [resource][crate::model::NotificationMessage::resource].
14059 ///
14060 /// # Example
14061 /// ```ignore,no_run
14062 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14063 /// use google_cloud_securitycenter_v2::model::Resource;
14064 /// let x = NotificationMessage::new().set_or_clear_resource(Some(Resource::default()/* use setters */));
14065 /// let x = NotificationMessage::new().set_or_clear_resource(None::<Resource>);
14066 /// ```
14067 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
14068 where
14069 T: std::convert::Into<crate::model::Resource>,
14070 {
14071 self.resource = v.map(|x| x.into());
14072 self
14073 }
14074
14075 /// Sets the value of [event][crate::model::NotificationMessage::event].
14076 ///
14077 /// Note that all the setters affecting `event` are mutually
14078 /// exclusive.
14079 ///
14080 /// # Example
14081 /// ```ignore,no_run
14082 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14083 /// use google_cloud_securitycenter_v2::model::Finding;
14084 /// let x = NotificationMessage::new().set_event(Some(
14085 /// google_cloud_securitycenter_v2::model::notification_message::Event::Finding(Finding::default().into())));
14086 /// ```
14087 pub fn set_event<
14088 T: std::convert::Into<std::option::Option<crate::model::notification_message::Event>>,
14089 >(
14090 mut self,
14091 v: T,
14092 ) -> Self {
14093 self.event = v.into();
14094 self
14095 }
14096
14097 /// The value of [event][crate::model::NotificationMessage::event]
14098 /// if it holds a `Finding`, `None` if the field is not set or
14099 /// holds a different branch.
14100 pub fn finding(&self) -> std::option::Option<&std::boxed::Box<crate::model::Finding>> {
14101 #[allow(unreachable_patterns)]
14102 self.event.as_ref().and_then(|v| match v {
14103 crate::model::notification_message::Event::Finding(v) => std::option::Option::Some(v),
14104 _ => std::option::Option::None,
14105 })
14106 }
14107
14108 /// Sets the value of [event][crate::model::NotificationMessage::event]
14109 /// to hold a `Finding`.
14110 ///
14111 /// Note that all the setters affecting `event` are
14112 /// mutually exclusive.
14113 ///
14114 /// # Example
14115 /// ```ignore,no_run
14116 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14117 /// use google_cloud_securitycenter_v2::model::Finding;
14118 /// let x = NotificationMessage::new().set_finding(Finding::default()/* use setters */);
14119 /// assert!(x.finding().is_some());
14120 /// ```
14121 pub fn set_finding<T: std::convert::Into<std::boxed::Box<crate::model::Finding>>>(
14122 mut self,
14123 v: T,
14124 ) -> Self {
14125 self.event =
14126 std::option::Option::Some(crate::model::notification_message::Event::Finding(v.into()));
14127 self
14128 }
14129}
14130
14131impl wkt::message::Message for NotificationMessage {
14132 fn typename() -> &'static str {
14133 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationMessage"
14134 }
14135}
14136
14137/// Defines additional types related to [NotificationMessage].
14138pub mod notification_message {
14139 #[allow(unused_imports)]
14140 use super::*;
14141
14142 /// Notification Event.
14143 #[derive(Clone, Debug, PartialEq)]
14144 #[non_exhaustive]
14145 pub enum Event {
14146 /// If it's a Finding based notification config, this field will be
14147 /// populated.
14148 Finding(std::boxed::Box<crate::model::Finding>),
14149 }
14150}
14151
14152/// Contains information about the org policies associated with the finding.
14153#[derive(Clone, Default, PartialEq)]
14154#[non_exhaustive]
14155pub struct OrgPolicy {
14156 /// Identifier. The resource name of the org policy.
14157 /// Example:
14158 /// "organizations/{organization_id}/policies/{constraint_name}"
14159 pub name: std::string::String,
14160
14161 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14162}
14163
14164impl OrgPolicy {
14165 pub fn new() -> Self {
14166 std::default::Default::default()
14167 }
14168
14169 /// Sets the value of [name][crate::model::OrgPolicy::name].
14170 ///
14171 /// # Example
14172 /// ```ignore,no_run
14173 /// # use google_cloud_securitycenter_v2::model::OrgPolicy;
14174 /// let x = OrgPolicy::new().set_name("example");
14175 /// ```
14176 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14177 self.name = v.into();
14178 self
14179 }
14180}
14181
14182impl wkt::message::Message for OrgPolicy {
14183 fn typename() -> &'static str {
14184 "type.googleapis.com/google.cloud.securitycenter.v2.OrgPolicy"
14185 }
14186}
14187
14188/// Represents an operating system process.
14189#[derive(Clone, Default, PartialEq)]
14190#[non_exhaustive]
14191pub struct Process {
14192 /// The process name, as displayed in utilities like `top` and `ps`. This name
14193 /// can be accessed through `/proc/[pid]/comm` and changed with
14194 /// `prctl(PR_SET_NAME)`.
14195 pub name: std::string::String,
14196
14197 /// File information for the process executable.
14198 pub binary: std::option::Option<crate::model::File>,
14199
14200 /// File information for libraries loaded by the process.
14201 pub libraries: std::vec::Vec<crate::model::File>,
14202
14203 /// When the process represents the invocation of a script, `binary` provides
14204 /// information about the interpreter, while `script` provides information
14205 /// about the script file provided to the interpreter.
14206 pub script: std::option::Option<crate::model::File>,
14207
14208 /// Process arguments as JSON encoded strings.
14209 pub args: std::vec::Vec<std::string::String>,
14210
14211 /// True if `args` is incomplete.
14212 pub arguments_truncated: bool,
14213
14214 /// Process environment variables.
14215 pub env_variables: std::vec::Vec<crate::model::EnvironmentVariable>,
14216
14217 /// True if `env_variables` is incomplete.
14218 pub env_variables_truncated: bool,
14219
14220 /// The process ID.
14221 pub pid: i64,
14222
14223 /// The parent process ID.
14224 pub parent_pid: i64,
14225
14226 /// The ID of the user that executed the process. E.g. If this is the root user
14227 /// this will always be 0.
14228 pub user_id: i64,
14229
14230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14231}
14232
14233impl Process {
14234 pub fn new() -> Self {
14235 std::default::Default::default()
14236 }
14237
14238 /// Sets the value of [name][crate::model::Process::name].
14239 ///
14240 /// # Example
14241 /// ```ignore,no_run
14242 /// # use google_cloud_securitycenter_v2::model::Process;
14243 /// let x = Process::new().set_name("example");
14244 /// ```
14245 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14246 self.name = v.into();
14247 self
14248 }
14249
14250 /// Sets the value of [binary][crate::model::Process::binary].
14251 ///
14252 /// # Example
14253 /// ```ignore,no_run
14254 /// # use google_cloud_securitycenter_v2::model::Process;
14255 /// use google_cloud_securitycenter_v2::model::File;
14256 /// let x = Process::new().set_binary(File::default()/* use setters */);
14257 /// ```
14258 pub fn set_binary<T>(mut self, v: T) -> Self
14259 where
14260 T: std::convert::Into<crate::model::File>,
14261 {
14262 self.binary = std::option::Option::Some(v.into());
14263 self
14264 }
14265
14266 /// Sets or clears the value of [binary][crate::model::Process::binary].
14267 ///
14268 /// # Example
14269 /// ```ignore,no_run
14270 /// # use google_cloud_securitycenter_v2::model::Process;
14271 /// use google_cloud_securitycenter_v2::model::File;
14272 /// let x = Process::new().set_or_clear_binary(Some(File::default()/* use setters */));
14273 /// let x = Process::new().set_or_clear_binary(None::<File>);
14274 /// ```
14275 pub fn set_or_clear_binary<T>(mut self, v: std::option::Option<T>) -> Self
14276 where
14277 T: std::convert::Into<crate::model::File>,
14278 {
14279 self.binary = v.map(|x| x.into());
14280 self
14281 }
14282
14283 /// Sets the value of [libraries][crate::model::Process::libraries].
14284 ///
14285 /// # Example
14286 /// ```ignore,no_run
14287 /// # use google_cloud_securitycenter_v2::model::Process;
14288 /// use google_cloud_securitycenter_v2::model::File;
14289 /// let x = Process::new()
14290 /// .set_libraries([
14291 /// File::default()/* use setters */,
14292 /// File::default()/* use (different) setters */,
14293 /// ]);
14294 /// ```
14295 pub fn set_libraries<T, V>(mut self, v: T) -> Self
14296 where
14297 T: std::iter::IntoIterator<Item = V>,
14298 V: std::convert::Into<crate::model::File>,
14299 {
14300 use std::iter::Iterator;
14301 self.libraries = v.into_iter().map(|i| i.into()).collect();
14302 self
14303 }
14304
14305 /// Sets the value of [script][crate::model::Process::script].
14306 ///
14307 /// # Example
14308 /// ```ignore,no_run
14309 /// # use google_cloud_securitycenter_v2::model::Process;
14310 /// use google_cloud_securitycenter_v2::model::File;
14311 /// let x = Process::new().set_script(File::default()/* use setters */);
14312 /// ```
14313 pub fn set_script<T>(mut self, v: T) -> Self
14314 where
14315 T: std::convert::Into<crate::model::File>,
14316 {
14317 self.script = std::option::Option::Some(v.into());
14318 self
14319 }
14320
14321 /// Sets or clears the value of [script][crate::model::Process::script].
14322 ///
14323 /// # Example
14324 /// ```ignore,no_run
14325 /// # use google_cloud_securitycenter_v2::model::Process;
14326 /// use google_cloud_securitycenter_v2::model::File;
14327 /// let x = Process::new().set_or_clear_script(Some(File::default()/* use setters */));
14328 /// let x = Process::new().set_or_clear_script(None::<File>);
14329 /// ```
14330 pub fn set_or_clear_script<T>(mut self, v: std::option::Option<T>) -> Self
14331 where
14332 T: std::convert::Into<crate::model::File>,
14333 {
14334 self.script = v.map(|x| x.into());
14335 self
14336 }
14337
14338 /// Sets the value of [args][crate::model::Process::args].
14339 ///
14340 /// # Example
14341 /// ```ignore,no_run
14342 /// # use google_cloud_securitycenter_v2::model::Process;
14343 /// let x = Process::new().set_args(["a", "b", "c"]);
14344 /// ```
14345 pub fn set_args<T, V>(mut self, v: T) -> Self
14346 where
14347 T: std::iter::IntoIterator<Item = V>,
14348 V: std::convert::Into<std::string::String>,
14349 {
14350 use std::iter::Iterator;
14351 self.args = v.into_iter().map(|i| i.into()).collect();
14352 self
14353 }
14354
14355 /// Sets the value of [arguments_truncated][crate::model::Process::arguments_truncated].
14356 ///
14357 /// # Example
14358 /// ```ignore,no_run
14359 /// # use google_cloud_securitycenter_v2::model::Process;
14360 /// let x = Process::new().set_arguments_truncated(true);
14361 /// ```
14362 pub fn set_arguments_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14363 self.arguments_truncated = v.into();
14364 self
14365 }
14366
14367 /// Sets the value of [env_variables][crate::model::Process::env_variables].
14368 ///
14369 /// # Example
14370 /// ```ignore,no_run
14371 /// # use google_cloud_securitycenter_v2::model::Process;
14372 /// use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14373 /// let x = Process::new()
14374 /// .set_env_variables([
14375 /// EnvironmentVariable::default()/* use setters */,
14376 /// EnvironmentVariable::default()/* use (different) setters */,
14377 /// ]);
14378 /// ```
14379 pub fn set_env_variables<T, V>(mut self, v: T) -> Self
14380 where
14381 T: std::iter::IntoIterator<Item = V>,
14382 V: std::convert::Into<crate::model::EnvironmentVariable>,
14383 {
14384 use std::iter::Iterator;
14385 self.env_variables = v.into_iter().map(|i| i.into()).collect();
14386 self
14387 }
14388
14389 /// Sets the value of [env_variables_truncated][crate::model::Process::env_variables_truncated].
14390 ///
14391 /// # Example
14392 /// ```ignore,no_run
14393 /// # use google_cloud_securitycenter_v2::model::Process;
14394 /// let x = Process::new().set_env_variables_truncated(true);
14395 /// ```
14396 pub fn set_env_variables_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14397 self.env_variables_truncated = v.into();
14398 self
14399 }
14400
14401 /// Sets the value of [pid][crate::model::Process::pid].
14402 ///
14403 /// # Example
14404 /// ```ignore,no_run
14405 /// # use google_cloud_securitycenter_v2::model::Process;
14406 /// let x = Process::new().set_pid(42);
14407 /// ```
14408 pub fn set_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14409 self.pid = v.into();
14410 self
14411 }
14412
14413 /// Sets the value of [parent_pid][crate::model::Process::parent_pid].
14414 ///
14415 /// # Example
14416 /// ```ignore,no_run
14417 /// # use google_cloud_securitycenter_v2::model::Process;
14418 /// let x = Process::new().set_parent_pid(42);
14419 /// ```
14420 pub fn set_parent_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14421 self.parent_pid = v.into();
14422 self
14423 }
14424
14425 /// Sets the value of [user_id][crate::model::Process::user_id].
14426 ///
14427 /// # Example
14428 /// ```ignore,no_run
14429 /// # use google_cloud_securitycenter_v2::model::Process;
14430 /// let x = Process::new().set_user_id(42);
14431 /// ```
14432 pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14433 self.user_id = v.into();
14434 self
14435 }
14436}
14437
14438impl wkt::message::Message for Process {
14439 fn typename() -> &'static str {
14440 "type.googleapis.com/google.cloud.securitycenter.v2.Process"
14441 }
14442}
14443
14444/// A name-value pair representing an environment variable used in an operating
14445/// system process.
14446#[derive(Clone, Default, PartialEq)]
14447#[non_exhaustive]
14448pub struct EnvironmentVariable {
14449 /// Environment variable name as a JSON encoded string.
14450 pub name: std::string::String,
14451
14452 /// Environment variable value as a JSON encoded string.
14453 pub val: std::string::String,
14454
14455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14456}
14457
14458impl EnvironmentVariable {
14459 pub fn new() -> Self {
14460 std::default::Default::default()
14461 }
14462
14463 /// Sets the value of [name][crate::model::EnvironmentVariable::name].
14464 ///
14465 /// # Example
14466 /// ```ignore,no_run
14467 /// # use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14468 /// let x = EnvironmentVariable::new().set_name("example");
14469 /// ```
14470 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14471 self.name = v.into();
14472 self
14473 }
14474
14475 /// Sets the value of [val][crate::model::EnvironmentVariable::val].
14476 ///
14477 /// # Example
14478 /// ```ignore,no_run
14479 /// # use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14480 /// let x = EnvironmentVariable::new().set_val("example");
14481 /// ```
14482 pub fn set_val<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14483 self.val = v.into();
14484 self
14485 }
14486}
14487
14488impl wkt::message::Message for EnvironmentVariable {
14489 fn typename() -> &'static str {
14490 "type.googleapis.com/google.cloud.securitycenter.v2.EnvironmentVariable"
14491 }
14492}
14493
14494/// Information related to the Google Cloud resource.
14495#[derive(Clone, Default, PartialEq)]
14496#[non_exhaustive]
14497pub struct Resource {
14498 /// The full resource name of the resource. See:
14499 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
14500 pub name: std::string::String,
14501
14502 /// The human readable name of the resource.
14503 pub display_name: std::string::String,
14504
14505 /// The full resource type of the resource.
14506 pub r#type: std::string::String,
14507
14508 /// Indicates which cloud provider the finding is from.
14509 pub cloud_provider: crate::model::CloudProvider,
14510
14511 /// The service or resource provider associated with the resource.
14512 pub service: std::string::String,
14513
14514 /// The region or location of the service (if applicable).
14515 pub location: std::string::String,
14516
14517 /// Provides the path to the resource within the resource hierarchy.
14518 pub resource_path: std::option::Option<crate::model::ResourcePath>,
14519
14520 /// A string representation of the resource path.
14521 /// For Google Cloud, it has the format of
14522 /// `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}`
14523 /// where there can be any number of folders.
14524 /// For AWS, it has the format of
14525 /// `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}`
14526 /// where there can be any number of organizational units.
14527 /// For Azure, it has the format of
14528 /// `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}`
14529 /// where there can be any number of management groups.
14530 pub resource_path_string: std::string::String,
14531
14532 /// The metadata associated with the cloud provider.
14533 pub cloud_provider_metadata: std::option::Option<crate::model::resource::CloudProviderMetadata>,
14534
14535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14536}
14537
14538impl Resource {
14539 pub fn new() -> Self {
14540 std::default::Default::default()
14541 }
14542
14543 /// Sets the value of [name][crate::model::Resource::name].
14544 ///
14545 /// # Example
14546 /// ```ignore,no_run
14547 /// # use google_cloud_securitycenter_v2::model::Resource;
14548 /// let x = Resource::new().set_name("example");
14549 /// ```
14550 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14551 self.name = v.into();
14552 self
14553 }
14554
14555 /// Sets the value of [display_name][crate::model::Resource::display_name].
14556 ///
14557 /// # Example
14558 /// ```ignore,no_run
14559 /// # use google_cloud_securitycenter_v2::model::Resource;
14560 /// let x = Resource::new().set_display_name("example");
14561 /// ```
14562 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14563 self.display_name = v.into();
14564 self
14565 }
14566
14567 /// Sets the value of [r#type][crate::model::Resource::type].
14568 ///
14569 /// # Example
14570 /// ```ignore,no_run
14571 /// # use google_cloud_securitycenter_v2::model::Resource;
14572 /// let x = Resource::new().set_type("example");
14573 /// ```
14574 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14575 self.r#type = v.into();
14576 self
14577 }
14578
14579 /// Sets the value of [cloud_provider][crate::model::Resource::cloud_provider].
14580 ///
14581 /// # Example
14582 /// ```ignore,no_run
14583 /// # use google_cloud_securitycenter_v2::model::Resource;
14584 /// use google_cloud_securitycenter_v2::model::CloudProvider;
14585 /// let x0 = Resource::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
14586 /// let x1 = Resource::new().set_cloud_provider(CloudProvider::AmazonWebServices);
14587 /// let x2 = Resource::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
14588 /// ```
14589 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
14590 mut self,
14591 v: T,
14592 ) -> Self {
14593 self.cloud_provider = v.into();
14594 self
14595 }
14596
14597 /// Sets the value of [service][crate::model::Resource::service].
14598 ///
14599 /// # Example
14600 /// ```ignore,no_run
14601 /// # use google_cloud_securitycenter_v2::model::Resource;
14602 /// let x = Resource::new().set_service("example");
14603 /// ```
14604 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14605 self.service = v.into();
14606 self
14607 }
14608
14609 /// Sets the value of [location][crate::model::Resource::location].
14610 ///
14611 /// # Example
14612 /// ```ignore,no_run
14613 /// # use google_cloud_securitycenter_v2::model::Resource;
14614 /// let x = Resource::new().set_location("example");
14615 /// ```
14616 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14617 self.location = v.into();
14618 self
14619 }
14620
14621 /// Sets the value of [resource_path][crate::model::Resource::resource_path].
14622 ///
14623 /// # Example
14624 /// ```ignore,no_run
14625 /// # use google_cloud_securitycenter_v2::model::Resource;
14626 /// use google_cloud_securitycenter_v2::model::ResourcePath;
14627 /// let x = Resource::new().set_resource_path(ResourcePath::default()/* use setters */);
14628 /// ```
14629 pub fn set_resource_path<T>(mut self, v: T) -> Self
14630 where
14631 T: std::convert::Into<crate::model::ResourcePath>,
14632 {
14633 self.resource_path = std::option::Option::Some(v.into());
14634 self
14635 }
14636
14637 /// Sets or clears the value of [resource_path][crate::model::Resource::resource_path].
14638 ///
14639 /// # Example
14640 /// ```ignore,no_run
14641 /// # use google_cloud_securitycenter_v2::model::Resource;
14642 /// use google_cloud_securitycenter_v2::model::ResourcePath;
14643 /// let x = Resource::new().set_or_clear_resource_path(Some(ResourcePath::default()/* use setters */));
14644 /// let x = Resource::new().set_or_clear_resource_path(None::<ResourcePath>);
14645 /// ```
14646 pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
14647 where
14648 T: std::convert::Into<crate::model::ResourcePath>,
14649 {
14650 self.resource_path = v.map(|x| x.into());
14651 self
14652 }
14653
14654 /// Sets the value of [resource_path_string][crate::model::Resource::resource_path_string].
14655 ///
14656 /// # Example
14657 /// ```ignore,no_run
14658 /// # use google_cloud_securitycenter_v2::model::Resource;
14659 /// let x = Resource::new().set_resource_path_string("example");
14660 /// ```
14661 pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
14662 mut self,
14663 v: T,
14664 ) -> Self {
14665 self.resource_path_string = v.into();
14666 self
14667 }
14668
14669 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata].
14670 ///
14671 /// Note that all the setters affecting `cloud_provider_metadata` are mutually
14672 /// exclusive.
14673 ///
14674 /// # Example
14675 /// ```ignore,no_run
14676 /// # use google_cloud_securitycenter_v2::model::Resource;
14677 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
14678 /// let x = Resource::new().set_cloud_provider_metadata(Some(
14679 /// google_cloud_securitycenter_v2::model::resource::CloudProviderMetadata::GcpMetadata(GcpMetadata::default().into())));
14680 /// ```
14681 pub fn set_cloud_provider_metadata<
14682 T: std::convert::Into<std::option::Option<crate::model::resource::CloudProviderMetadata>>,
14683 >(
14684 mut self,
14685 v: T,
14686 ) -> Self {
14687 self.cloud_provider_metadata = v.into();
14688 self
14689 }
14690
14691 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14692 /// if it holds a `GcpMetadata`, `None` if the field is not set or
14693 /// holds a different branch.
14694 pub fn gcp_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
14695 #[allow(unreachable_patterns)]
14696 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14697 crate::model::resource::CloudProviderMetadata::GcpMetadata(v) => {
14698 std::option::Option::Some(v)
14699 }
14700 _ => std::option::Option::None,
14701 })
14702 }
14703
14704 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14705 /// to hold a `GcpMetadata`.
14706 ///
14707 /// Note that all the setters affecting `cloud_provider_metadata` are
14708 /// mutually exclusive.
14709 ///
14710 /// # Example
14711 /// ```ignore,no_run
14712 /// # use google_cloud_securitycenter_v2::model::Resource;
14713 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
14714 /// let x = Resource::new().set_gcp_metadata(GcpMetadata::default()/* use setters */);
14715 /// assert!(x.gcp_metadata().is_some());
14716 /// assert!(x.aws_metadata().is_none());
14717 /// assert!(x.azure_metadata().is_none());
14718 /// ```
14719 pub fn set_gcp_metadata<T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>>(
14720 mut self,
14721 v: T,
14722 ) -> Self {
14723 self.cloud_provider_metadata = std::option::Option::Some(
14724 crate::model::resource::CloudProviderMetadata::GcpMetadata(v.into()),
14725 );
14726 self
14727 }
14728
14729 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14730 /// if it holds a `AwsMetadata`, `None` if the field is not set or
14731 /// holds a different branch.
14732 pub fn aws_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
14733 #[allow(unreachable_patterns)]
14734 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14735 crate::model::resource::CloudProviderMetadata::AwsMetadata(v) => {
14736 std::option::Option::Some(v)
14737 }
14738 _ => std::option::Option::None,
14739 })
14740 }
14741
14742 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14743 /// to hold a `AwsMetadata`.
14744 ///
14745 /// Note that all the setters affecting `cloud_provider_metadata` are
14746 /// mutually exclusive.
14747 ///
14748 /// # Example
14749 /// ```ignore,no_run
14750 /// # use google_cloud_securitycenter_v2::model::Resource;
14751 /// use google_cloud_securitycenter_v2::model::AwsMetadata;
14752 /// let x = Resource::new().set_aws_metadata(AwsMetadata::default()/* use setters */);
14753 /// assert!(x.aws_metadata().is_some());
14754 /// assert!(x.gcp_metadata().is_none());
14755 /// assert!(x.azure_metadata().is_none());
14756 /// ```
14757 pub fn set_aws_metadata<T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>>(
14758 mut self,
14759 v: T,
14760 ) -> Self {
14761 self.cloud_provider_metadata = std::option::Option::Some(
14762 crate::model::resource::CloudProviderMetadata::AwsMetadata(v.into()),
14763 );
14764 self
14765 }
14766
14767 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14768 /// if it holds a `AzureMetadata`, `None` if the field is not set or
14769 /// holds a different branch.
14770 pub fn azure_metadata(
14771 &self,
14772 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
14773 #[allow(unreachable_patterns)]
14774 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14775 crate::model::resource::CloudProviderMetadata::AzureMetadata(v) => {
14776 std::option::Option::Some(v)
14777 }
14778 _ => std::option::Option::None,
14779 })
14780 }
14781
14782 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14783 /// to hold a `AzureMetadata`.
14784 ///
14785 /// Note that all the setters affecting `cloud_provider_metadata` are
14786 /// mutually exclusive.
14787 ///
14788 /// # Example
14789 /// ```ignore,no_run
14790 /// # use google_cloud_securitycenter_v2::model::Resource;
14791 /// use google_cloud_securitycenter_v2::model::AzureMetadata;
14792 /// let x = Resource::new().set_azure_metadata(AzureMetadata::default()/* use setters */);
14793 /// assert!(x.azure_metadata().is_some());
14794 /// assert!(x.gcp_metadata().is_none());
14795 /// assert!(x.aws_metadata().is_none());
14796 /// ```
14797 pub fn set_azure_metadata<
14798 T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
14799 >(
14800 mut self,
14801 v: T,
14802 ) -> Self {
14803 self.cloud_provider_metadata = std::option::Option::Some(
14804 crate::model::resource::CloudProviderMetadata::AzureMetadata(v.into()),
14805 );
14806 self
14807 }
14808}
14809
14810impl wkt::message::Message for Resource {
14811 fn typename() -> &'static str {
14812 "type.googleapis.com/google.cloud.securitycenter.v2.Resource"
14813 }
14814}
14815
14816/// Defines additional types related to [Resource].
14817pub mod resource {
14818 #[allow(unused_imports)]
14819 use super::*;
14820
14821 /// The metadata associated with the cloud provider.
14822 #[derive(Clone, Debug, PartialEq)]
14823 #[non_exhaustive]
14824 pub enum CloudProviderMetadata {
14825 /// The GCP metadata associated with the finding.
14826 GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
14827 /// The AWS metadata associated with the finding.
14828 AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
14829 /// The Azure metadata associated with the finding.
14830 AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
14831 }
14832}
14833
14834/// Google Cloud metadata associated with the resource. Only applicable if the
14835/// finding's cloud provider is Google Cloud.
14836#[derive(Clone, Default, PartialEq)]
14837#[non_exhaustive]
14838pub struct GcpMetadata {
14839 /// The full resource name of project that the resource belongs to.
14840 pub project: std::string::String,
14841
14842 /// The project ID that the resource belongs to.
14843 pub project_display_name: std::string::String,
14844
14845 /// The full resource name of resource's parent.
14846 pub parent: std::string::String,
14847
14848 /// The human readable name of resource's parent.
14849 pub parent_display_name: std::string::String,
14850
14851 /// Output only. Contains a Folder message for each folder in the assets
14852 /// ancestry. The first folder is the deepest nested folder, and the last
14853 /// folder is the folder directly under the Organization.
14854 pub folders: std::vec::Vec<crate::model::Folder>,
14855
14856 /// The name of the organization that the resource belongs to.
14857 pub organization: std::string::String,
14858
14859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14860}
14861
14862impl GcpMetadata {
14863 pub fn new() -> Self {
14864 std::default::Default::default()
14865 }
14866
14867 /// Sets the value of [project][crate::model::GcpMetadata::project].
14868 ///
14869 /// # Example
14870 /// ```ignore,no_run
14871 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14872 /// let x = GcpMetadata::new().set_project("example");
14873 /// ```
14874 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14875 self.project = v.into();
14876 self
14877 }
14878
14879 /// Sets the value of [project_display_name][crate::model::GcpMetadata::project_display_name].
14880 ///
14881 /// # Example
14882 /// ```ignore,no_run
14883 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14884 /// let x = GcpMetadata::new().set_project_display_name("example");
14885 /// ```
14886 pub fn set_project_display_name<T: std::convert::Into<std::string::String>>(
14887 mut self,
14888 v: T,
14889 ) -> Self {
14890 self.project_display_name = v.into();
14891 self
14892 }
14893
14894 /// Sets the value of [parent][crate::model::GcpMetadata::parent].
14895 ///
14896 /// # Example
14897 /// ```ignore,no_run
14898 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14899 /// let x = GcpMetadata::new().set_parent("example");
14900 /// ```
14901 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14902 self.parent = v.into();
14903 self
14904 }
14905
14906 /// Sets the value of [parent_display_name][crate::model::GcpMetadata::parent_display_name].
14907 ///
14908 /// # Example
14909 /// ```ignore,no_run
14910 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14911 /// let x = GcpMetadata::new().set_parent_display_name("example");
14912 /// ```
14913 pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
14914 mut self,
14915 v: T,
14916 ) -> Self {
14917 self.parent_display_name = v.into();
14918 self
14919 }
14920
14921 /// Sets the value of [folders][crate::model::GcpMetadata::folders].
14922 ///
14923 /// # Example
14924 /// ```ignore,no_run
14925 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14926 /// use google_cloud_securitycenter_v2::model::Folder;
14927 /// let x = GcpMetadata::new()
14928 /// .set_folders([
14929 /// Folder::default()/* use setters */,
14930 /// Folder::default()/* use (different) setters */,
14931 /// ]);
14932 /// ```
14933 pub fn set_folders<T, V>(mut self, v: T) -> Self
14934 where
14935 T: std::iter::IntoIterator<Item = V>,
14936 V: std::convert::Into<crate::model::Folder>,
14937 {
14938 use std::iter::Iterator;
14939 self.folders = v.into_iter().map(|i| i.into()).collect();
14940 self
14941 }
14942
14943 /// Sets the value of [organization][crate::model::GcpMetadata::organization].
14944 ///
14945 /// # Example
14946 /// ```ignore,no_run
14947 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14948 /// let x = GcpMetadata::new().set_organization("example");
14949 /// ```
14950 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14951 self.organization = v.into();
14952 self
14953 }
14954}
14955
14956impl wkt::message::Message for GcpMetadata {
14957 fn typename() -> &'static str {
14958 "type.googleapis.com/google.cloud.securitycenter.v2.GcpMetadata"
14959 }
14960}
14961
14962/// AWS metadata associated with the resource, only applicable if the finding's
14963/// cloud provider is Amazon Web Services.
14964#[derive(Clone, Default, PartialEq)]
14965#[non_exhaustive]
14966pub struct AwsMetadata {
14967 /// The AWS organization associated with the resource.
14968 pub organization: std::option::Option<crate::model::aws_metadata::AwsOrganization>,
14969
14970 /// A list of AWS organizational units associated with the resource, ordered
14971 /// from lowest level (closest to the account) to highest level.
14972 pub organizational_units: std::vec::Vec<crate::model::aws_metadata::AwsOrganizationalUnit>,
14973
14974 /// The AWS account associated with the resource.
14975 pub account: std::option::Option<crate::model::aws_metadata::AwsAccount>,
14976
14977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14978}
14979
14980impl AwsMetadata {
14981 pub fn new() -> Self {
14982 std::default::Default::default()
14983 }
14984
14985 /// Sets the value of [organization][crate::model::AwsMetadata::organization].
14986 ///
14987 /// # Example
14988 /// ```ignore,no_run
14989 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
14990 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
14991 /// let x = AwsMetadata::new().set_organization(AwsOrganization::default()/* use setters */);
14992 /// ```
14993 pub fn set_organization<T>(mut self, v: T) -> Self
14994 where
14995 T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
14996 {
14997 self.organization = std::option::Option::Some(v.into());
14998 self
14999 }
15000
15001 /// Sets or clears the value of [organization][crate::model::AwsMetadata::organization].
15002 ///
15003 /// # Example
15004 /// ```ignore,no_run
15005 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15006 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15007 /// let x = AwsMetadata::new().set_or_clear_organization(Some(AwsOrganization::default()/* use setters */));
15008 /// let x = AwsMetadata::new().set_or_clear_organization(None::<AwsOrganization>);
15009 /// ```
15010 pub fn set_or_clear_organization<T>(mut self, v: std::option::Option<T>) -> Self
15011 where
15012 T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
15013 {
15014 self.organization = v.map(|x| x.into());
15015 self
15016 }
15017
15018 /// Sets the value of [organizational_units][crate::model::AwsMetadata::organizational_units].
15019 ///
15020 /// # Example
15021 /// ```ignore,no_run
15022 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15023 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15024 /// let x = AwsMetadata::new()
15025 /// .set_organizational_units([
15026 /// AwsOrganizationalUnit::default()/* use setters */,
15027 /// AwsOrganizationalUnit::default()/* use (different) setters */,
15028 /// ]);
15029 /// ```
15030 pub fn set_organizational_units<T, V>(mut self, v: T) -> Self
15031 where
15032 T: std::iter::IntoIterator<Item = V>,
15033 V: std::convert::Into<crate::model::aws_metadata::AwsOrganizationalUnit>,
15034 {
15035 use std::iter::Iterator;
15036 self.organizational_units = v.into_iter().map(|i| i.into()).collect();
15037 self
15038 }
15039
15040 /// Sets the value of [account][crate::model::AwsMetadata::account].
15041 ///
15042 /// # Example
15043 /// ```ignore,no_run
15044 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15045 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15046 /// let x = AwsMetadata::new().set_account(AwsAccount::default()/* use setters */);
15047 /// ```
15048 pub fn set_account<T>(mut self, v: T) -> Self
15049 where
15050 T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
15051 {
15052 self.account = std::option::Option::Some(v.into());
15053 self
15054 }
15055
15056 /// Sets or clears the value of [account][crate::model::AwsMetadata::account].
15057 ///
15058 /// # Example
15059 /// ```ignore,no_run
15060 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15061 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15062 /// let x = AwsMetadata::new().set_or_clear_account(Some(AwsAccount::default()/* use setters */));
15063 /// let x = AwsMetadata::new().set_or_clear_account(None::<AwsAccount>);
15064 /// ```
15065 pub fn set_or_clear_account<T>(mut self, v: std::option::Option<T>) -> Self
15066 where
15067 T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
15068 {
15069 self.account = v.map(|x| x.into());
15070 self
15071 }
15072}
15073
15074impl wkt::message::Message for AwsMetadata {
15075 fn typename() -> &'static str {
15076 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata"
15077 }
15078}
15079
15080/// Defines additional types related to [AwsMetadata].
15081pub mod aws_metadata {
15082 #[allow(unused_imports)]
15083 use super::*;
15084
15085 /// An organization is a collection of accounts that are centrally managed
15086 /// together using consolidated billing, organized hierarchically with
15087 /// organizational units (OUs), and controlled with policies.
15088 #[derive(Clone, Default, PartialEq)]
15089 #[non_exhaustive]
15090 pub struct AwsOrganization {
15091 /// The unique identifier (ID) for the organization. The regex pattern for an
15092 /// organization ID string requires "o-" followed by from 10 to 32 lowercase
15093 /// letters or digits.
15094 pub id: std::string::String,
15095
15096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15097 }
15098
15099 impl AwsOrganization {
15100 pub fn new() -> Self {
15101 std::default::Default::default()
15102 }
15103
15104 /// Sets the value of [id][crate::model::aws_metadata::AwsOrganization::id].
15105 ///
15106 /// # Example
15107 /// ```ignore,no_run
15108 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15109 /// let x = AwsOrganization::new().set_id("example");
15110 /// ```
15111 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15112 self.id = v.into();
15113 self
15114 }
15115 }
15116
15117 impl wkt::message::Message for AwsOrganization {
15118 fn typename() -> &'static str {
15119 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization"
15120 }
15121 }
15122
15123 /// An Organizational Unit (OU) is a container of AWS accounts within a root of
15124 /// an organization. Policies that are attached to an OU apply to all accounts
15125 /// contained in that OU and in any child OUs.
15126 #[derive(Clone, Default, PartialEq)]
15127 #[non_exhaustive]
15128 pub struct AwsOrganizationalUnit {
15129 /// The unique identifier (ID) associated with this OU. The regex pattern for
15130 /// an organizational unit ID string requires "ou-" followed by from 4 to 32
15131 /// lowercase letters or digits (the ID of the root that contains the OU).
15132 /// This string is followed by a second "-" dash and from 8 to 32 additional
15133 /// lowercase letters or digits. For example, "ou-ab12-cd34ef56".
15134 pub id: std::string::String,
15135
15136 /// The friendly name of the OU.
15137 pub name: std::string::String,
15138
15139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15140 }
15141
15142 impl AwsOrganizationalUnit {
15143 pub fn new() -> Self {
15144 std::default::Default::default()
15145 }
15146
15147 /// Sets the value of [id][crate::model::aws_metadata::AwsOrganizationalUnit::id].
15148 ///
15149 /// # Example
15150 /// ```ignore,no_run
15151 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15152 /// let x = AwsOrganizationalUnit::new().set_id("example");
15153 /// ```
15154 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15155 self.id = v.into();
15156 self
15157 }
15158
15159 /// Sets the value of [name][crate::model::aws_metadata::AwsOrganizationalUnit::name].
15160 ///
15161 /// # Example
15162 /// ```ignore,no_run
15163 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15164 /// let x = AwsOrganizationalUnit::new().set_name("example");
15165 /// ```
15166 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15167 self.name = v.into();
15168 self
15169 }
15170 }
15171
15172 impl wkt::message::Message for AwsOrganizationalUnit {
15173 fn typename() -> &'static str {
15174 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit"
15175 }
15176 }
15177
15178 /// An AWS account that is a member of an organization.
15179 #[derive(Clone, Default, PartialEq)]
15180 #[non_exhaustive]
15181 pub struct AwsAccount {
15182 /// The unique identifier (ID) of the account, containing exactly 12 digits.
15183 pub id: std::string::String,
15184
15185 /// The friendly name of this account.
15186 pub name: std::string::String,
15187
15188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15189 }
15190
15191 impl AwsAccount {
15192 pub fn new() -> Self {
15193 std::default::Default::default()
15194 }
15195
15196 /// Sets the value of [id][crate::model::aws_metadata::AwsAccount::id].
15197 ///
15198 /// # Example
15199 /// ```ignore,no_run
15200 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15201 /// let x = AwsAccount::new().set_id("example");
15202 /// ```
15203 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15204 self.id = v.into();
15205 self
15206 }
15207
15208 /// Sets the value of [name][crate::model::aws_metadata::AwsAccount::name].
15209 ///
15210 /// # Example
15211 /// ```ignore,no_run
15212 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15213 /// let x = AwsAccount::new().set_name("example");
15214 /// ```
15215 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15216 self.name = v.into();
15217 self
15218 }
15219 }
15220
15221 impl wkt::message::Message for AwsAccount {
15222 fn typename() -> &'static str {
15223 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsAccount"
15224 }
15225 }
15226}
15227
15228/// Azure metadata associated with the resource, only applicable if the finding's
15229/// cloud provider is Microsoft Azure.
15230#[derive(Clone, Default, PartialEq)]
15231#[non_exhaustive]
15232pub struct AzureMetadata {
15233 /// A list of Azure management groups associated with the resource, ordered
15234 /// from lowest level (closest to the subscription) to highest level.
15235 pub management_groups: std::vec::Vec<crate::model::azure_metadata::AzureManagementGroup>,
15236
15237 /// The Azure subscription associated with the resource.
15238 pub subscription: std::option::Option<crate::model::azure_metadata::AzureSubscription>,
15239
15240 /// The Azure resource group associated with the resource.
15241 pub resource_group: std::option::Option<crate::model::azure_metadata::AzureResourceGroup>,
15242
15243 /// The Azure Entra tenant associated with the resource.
15244 pub tenant: std::option::Option<crate::model::azure_metadata::AzureTenant>,
15245
15246 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15247}
15248
15249impl AzureMetadata {
15250 pub fn new() -> Self {
15251 std::default::Default::default()
15252 }
15253
15254 /// Sets the value of [management_groups][crate::model::AzureMetadata::management_groups].
15255 ///
15256 /// # Example
15257 /// ```ignore,no_run
15258 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15259 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15260 /// let x = AzureMetadata::new()
15261 /// .set_management_groups([
15262 /// AzureManagementGroup::default()/* use setters */,
15263 /// AzureManagementGroup::default()/* use (different) setters */,
15264 /// ]);
15265 /// ```
15266 pub fn set_management_groups<T, V>(mut self, v: T) -> Self
15267 where
15268 T: std::iter::IntoIterator<Item = V>,
15269 V: std::convert::Into<crate::model::azure_metadata::AzureManagementGroup>,
15270 {
15271 use std::iter::Iterator;
15272 self.management_groups = v.into_iter().map(|i| i.into()).collect();
15273 self
15274 }
15275
15276 /// Sets the value of [subscription][crate::model::AzureMetadata::subscription].
15277 ///
15278 /// # Example
15279 /// ```ignore,no_run
15280 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15281 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15282 /// let x = AzureMetadata::new().set_subscription(AzureSubscription::default()/* use setters */);
15283 /// ```
15284 pub fn set_subscription<T>(mut self, v: T) -> Self
15285 where
15286 T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
15287 {
15288 self.subscription = std::option::Option::Some(v.into());
15289 self
15290 }
15291
15292 /// Sets or clears the value of [subscription][crate::model::AzureMetadata::subscription].
15293 ///
15294 /// # Example
15295 /// ```ignore,no_run
15296 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15297 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15298 /// let x = AzureMetadata::new().set_or_clear_subscription(Some(AzureSubscription::default()/* use setters */));
15299 /// let x = AzureMetadata::new().set_or_clear_subscription(None::<AzureSubscription>);
15300 /// ```
15301 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
15302 where
15303 T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
15304 {
15305 self.subscription = v.map(|x| x.into());
15306 self
15307 }
15308
15309 /// Sets the value of [resource_group][crate::model::AzureMetadata::resource_group].
15310 ///
15311 /// # Example
15312 /// ```ignore,no_run
15313 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15314 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15315 /// let x = AzureMetadata::new().set_resource_group(AzureResourceGroup::default()/* use setters */);
15316 /// ```
15317 pub fn set_resource_group<T>(mut self, v: T) -> Self
15318 where
15319 T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
15320 {
15321 self.resource_group = std::option::Option::Some(v.into());
15322 self
15323 }
15324
15325 /// Sets or clears the value of [resource_group][crate::model::AzureMetadata::resource_group].
15326 ///
15327 /// # Example
15328 /// ```ignore,no_run
15329 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15330 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15331 /// let x = AzureMetadata::new().set_or_clear_resource_group(Some(AzureResourceGroup::default()/* use setters */));
15332 /// let x = AzureMetadata::new().set_or_clear_resource_group(None::<AzureResourceGroup>);
15333 /// ```
15334 pub fn set_or_clear_resource_group<T>(mut self, v: std::option::Option<T>) -> Self
15335 where
15336 T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
15337 {
15338 self.resource_group = v.map(|x| x.into());
15339 self
15340 }
15341
15342 /// Sets the value of [tenant][crate::model::AzureMetadata::tenant].
15343 ///
15344 /// # Example
15345 /// ```ignore,no_run
15346 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15347 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15348 /// let x = AzureMetadata::new().set_tenant(AzureTenant::default()/* use setters */);
15349 /// ```
15350 pub fn set_tenant<T>(mut self, v: T) -> Self
15351 where
15352 T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
15353 {
15354 self.tenant = std::option::Option::Some(v.into());
15355 self
15356 }
15357
15358 /// Sets or clears the value of [tenant][crate::model::AzureMetadata::tenant].
15359 ///
15360 /// # Example
15361 /// ```ignore,no_run
15362 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15363 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15364 /// let x = AzureMetadata::new().set_or_clear_tenant(Some(AzureTenant::default()/* use setters */));
15365 /// let x = AzureMetadata::new().set_or_clear_tenant(None::<AzureTenant>);
15366 /// ```
15367 pub fn set_or_clear_tenant<T>(mut self, v: std::option::Option<T>) -> Self
15368 where
15369 T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
15370 {
15371 self.tenant = v.map(|x| x.into());
15372 self
15373 }
15374}
15375
15376impl wkt::message::Message for AzureMetadata {
15377 fn typename() -> &'static str {
15378 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata"
15379 }
15380}
15381
15382/// Defines additional types related to [AzureMetadata].
15383pub mod azure_metadata {
15384 #[allow(unused_imports)]
15385 use super::*;
15386
15387 /// Represents an Azure management group.
15388 #[derive(Clone, Default, PartialEq)]
15389 #[non_exhaustive]
15390 pub struct AzureManagementGroup {
15391 /// The UUID of the Azure management group, for example,
15392 /// `20000000-0001-0000-0000-000000000000`.
15393 pub id: std::string::String,
15394
15395 /// The display name of the Azure management group.
15396 pub display_name: std::string::String,
15397
15398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15399 }
15400
15401 impl AzureManagementGroup {
15402 pub fn new() -> Self {
15403 std::default::Default::default()
15404 }
15405
15406 /// Sets the value of [id][crate::model::azure_metadata::AzureManagementGroup::id].
15407 ///
15408 /// # Example
15409 /// ```ignore,no_run
15410 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15411 /// let x = AzureManagementGroup::new().set_id("example");
15412 /// ```
15413 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15414 self.id = v.into();
15415 self
15416 }
15417
15418 /// Sets the value of [display_name][crate::model::azure_metadata::AzureManagementGroup::display_name].
15419 ///
15420 /// # Example
15421 /// ```ignore,no_run
15422 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15423 /// let x = AzureManagementGroup::new().set_display_name("example");
15424 /// ```
15425 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15426 mut self,
15427 v: T,
15428 ) -> Self {
15429 self.display_name = v.into();
15430 self
15431 }
15432 }
15433
15434 impl wkt::message::Message for AzureManagementGroup {
15435 fn typename() -> &'static str {
15436 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup"
15437 }
15438 }
15439
15440 /// Represents an Azure subscription.
15441 #[derive(Clone, Default, PartialEq)]
15442 #[non_exhaustive]
15443 pub struct AzureSubscription {
15444 /// The UUID of the Azure subscription, for example,
15445 /// `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`.
15446 pub id: std::string::String,
15447
15448 /// The display name of the Azure subscription.
15449 pub display_name: std::string::String,
15450
15451 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15452 }
15453
15454 impl AzureSubscription {
15455 pub fn new() -> Self {
15456 std::default::Default::default()
15457 }
15458
15459 /// Sets the value of [id][crate::model::azure_metadata::AzureSubscription::id].
15460 ///
15461 /// # Example
15462 /// ```ignore,no_run
15463 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15464 /// let x = AzureSubscription::new().set_id("example");
15465 /// ```
15466 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15467 self.id = v.into();
15468 self
15469 }
15470
15471 /// Sets the value of [display_name][crate::model::azure_metadata::AzureSubscription::display_name].
15472 ///
15473 /// # Example
15474 /// ```ignore,no_run
15475 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15476 /// let x = AzureSubscription::new().set_display_name("example");
15477 /// ```
15478 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15479 mut self,
15480 v: T,
15481 ) -> Self {
15482 self.display_name = v.into();
15483 self
15484 }
15485 }
15486
15487 impl wkt::message::Message for AzureSubscription {
15488 fn typename() -> &'static str {
15489 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription"
15490 }
15491 }
15492
15493 /// Represents an Azure resource group.
15494 #[derive(Clone, Default, PartialEq)]
15495 #[non_exhaustive]
15496 pub struct AzureResourceGroup {
15497 /// The ID of the Azure resource group.
15498 pub id: std::string::String,
15499
15500 /// The name of the Azure resource group. This is not a UUID.
15501 pub name: std::string::String,
15502
15503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15504 }
15505
15506 impl AzureResourceGroup {
15507 pub fn new() -> Self {
15508 std::default::Default::default()
15509 }
15510
15511 /// Sets the value of [id][crate::model::azure_metadata::AzureResourceGroup::id].
15512 ///
15513 /// # Example
15514 /// ```ignore,no_run
15515 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15516 /// let x = AzureResourceGroup::new().set_id("example");
15517 /// ```
15518 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15519 self.id = v.into();
15520 self
15521 }
15522
15523 /// Sets the value of [name][crate::model::azure_metadata::AzureResourceGroup::name].
15524 ///
15525 /// # Example
15526 /// ```ignore,no_run
15527 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15528 /// let x = AzureResourceGroup::new().set_name("example");
15529 /// ```
15530 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15531 self.name = v.into();
15532 self
15533 }
15534 }
15535
15536 impl wkt::message::Message for AzureResourceGroup {
15537 fn typename() -> &'static str {
15538 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup"
15539 }
15540 }
15541
15542 /// Represents a Microsoft Entra tenant.
15543 #[derive(Clone, Default, PartialEq)]
15544 #[non_exhaustive]
15545 pub struct AzureTenant {
15546 /// The ID of the Microsoft Entra tenant, for example,
15547 /// "a11aaa11-aa11-1aa1-11aa-1aaa11a".
15548 pub id: std::string::String,
15549
15550 /// The display name of the Azure tenant.
15551 pub display_name: std::string::String,
15552
15553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15554 }
15555
15556 impl AzureTenant {
15557 pub fn new() -> Self {
15558 std::default::Default::default()
15559 }
15560
15561 /// Sets the value of [id][crate::model::azure_metadata::AzureTenant::id].
15562 ///
15563 /// # Example
15564 /// ```ignore,no_run
15565 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15566 /// let x = AzureTenant::new().set_id("example");
15567 /// ```
15568 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15569 self.id = v.into();
15570 self
15571 }
15572
15573 /// Sets the value of [display_name][crate::model::azure_metadata::AzureTenant::display_name].
15574 ///
15575 /// # Example
15576 /// ```ignore,no_run
15577 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15578 /// let x = AzureTenant::new().set_display_name("example");
15579 /// ```
15580 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15581 mut self,
15582 v: T,
15583 ) -> Self {
15584 self.display_name = v.into();
15585 self
15586 }
15587 }
15588
15589 impl wkt::message::Message for AzureTenant {
15590 fn typename() -> &'static str {
15591 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureTenant"
15592 }
15593 }
15594}
15595
15596/// Represents the path of resources leading up to the resource this finding is
15597/// about.
15598#[derive(Clone, Default, PartialEq)]
15599#[non_exhaustive]
15600pub struct ResourcePath {
15601 /// The list of nodes that make the up resource path, ordered from lowest
15602 /// level to highest level.
15603 pub nodes: std::vec::Vec<crate::model::resource_path::ResourcePathNode>,
15604
15605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15606}
15607
15608impl ResourcePath {
15609 pub fn new() -> Self {
15610 std::default::Default::default()
15611 }
15612
15613 /// Sets the value of [nodes][crate::model::ResourcePath::nodes].
15614 ///
15615 /// # Example
15616 /// ```ignore,no_run
15617 /// # use google_cloud_securitycenter_v2::model::ResourcePath;
15618 /// use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15619 /// let x = ResourcePath::new()
15620 /// .set_nodes([
15621 /// ResourcePathNode::default()/* use setters */,
15622 /// ResourcePathNode::default()/* use (different) setters */,
15623 /// ]);
15624 /// ```
15625 pub fn set_nodes<T, V>(mut self, v: T) -> Self
15626 where
15627 T: std::iter::IntoIterator<Item = V>,
15628 V: std::convert::Into<crate::model::resource_path::ResourcePathNode>,
15629 {
15630 use std::iter::Iterator;
15631 self.nodes = v.into_iter().map(|i| i.into()).collect();
15632 self
15633 }
15634}
15635
15636impl wkt::message::Message for ResourcePath {
15637 fn typename() -> &'static str {
15638 "type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath"
15639 }
15640}
15641
15642/// Defines additional types related to [ResourcePath].
15643pub mod resource_path {
15644 #[allow(unused_imports)]
15645 use super::*;
15646
15647 /// A node within the resource path. Each node represents a resource within the
15648 /// resource hierarchy.
15649 #[derive(Clone, Default, PartialEq)]
15650 #[non_exhaustive]
15651 pub struct ResourcePathNode {
15652 /// The type of resource this node represents.
15653 pub node_type: crate::model::resource_path::ResourcePathNodeType,
15654
15655 /// The ID of the resource this node represents.
15656 pub id: std::string::String,
15657
15658 /// The display name of the resource this node represents.
15659 pub display_name: std::string::String,
15660
15661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15662 }
15663
15664 impl ResourcePathNode {
15665 pub fn new() -> Self {
15666 std::default::Default::default()
15667 }
15668
15669 /// Sets the value of [node_type][crate::model::resource_path::ResourcePathNode::node_type].
15670 ///
15671 /// # Example
15672 /// ```ignore,no_run
15673 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15674 /// use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNodeType;
15675 /// let x0 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpOrganization);
15676 /// let x1 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpFolder);
15677 /// let x2 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpProject);
15678 /// ```
15679 pub fn set_node_type<
15680 T: std::convert::Into<crate::model::resource_path::ResourcePathNodeType>,
15681 >(
15682 mut self,
15683 v: T,
15684 ) -> Self {
15685 self.node_type = v.into();
15686 self
15687 }
15688
15689 /// Sets the value of [id][crate::model::resource_path::ResourcePathNode::id].
15690 ///
15691 /// # Example
15692 /// ```ignore,no_run
15693 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15694 /// let x = ResourcePathNode::new().set_id("example");
15695 /// ```
15696 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15697 self.id = v.into();
15698 self
15699 }
15700
15701 /// Sets the value of [display_name][crate::model::resource_path::ResourcePathNode::display_name].
15702 ///
15703 /// # Example
15704 /// ```ignore,no_run
15705 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15706 /// let x = ResourcePathNode::new().set_display_name("example");
15707 /// ```
15708 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15709 mut self,
15710 v: T,
15711 ) -> Self {
15712 self.display_name = v.into();
15713 self
15714 }
15715 }
15716
15717 impl wkt::message::Message for ResourcePathNode {
15718 fn typename() -> &'static str {
15719 "type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode"
15720 }
15721 }
15722
15723 /// The type of resource the node represents.
15724 ///
15725 /// # Working with unknown values
15726 ///
15727 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15728 /// additional enum variants at any time. Adding new variants is not considered
15729 /// a breaking change. Applications should write their code in anticipation of:
15730 ///
15731 /// - New values appearing in future releases of the client library, **and**
15732 /// - New values received dynamically, without application changes.
15733 ///
15734 /// Please consult the [Working with enums] section in the user guide for some
15735 /// guidelines.
15736 ///
15737 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15738 #[derive(Clone, Debug, PartialEq)]
15739 #[non_exhaustive]
15740 pub enum ResourcePathNodeType {
15741 /// Node type is unspecified.
15742 Unspecified,
15743 /// The node represents a Google Cloud organization.
15744 GcpOrganization,
15745 /// The node represents a Google Cloud folder.
15746 GcpFolder,
15747 /// The node represents a Google Cloud project.
15748 GcpProject,
15749 /// The node represents an AWS organization.
15750 AwsOrganization,
15751 /// The node represents an AWS organizational unit.
15752 AwsOrganizationalUnit,
15753 /// The node represents an AWS account.
15754 AwsAccount,
15755 /// The node represents an Azure management group.
15756 AzureManagementGroup,
15757 /// The node represents an Azure subscription.
15758 AzureSubscription,
15759 /// The node represents an Azure resource group.
15760 AzureResourceGroup,
15761 /// If set, the enum was initialized with an unknown value.
15762 ///
15763 /// Applications can examine the value using [ResourcePathNodeType::value] or
15764 /// [ResourcePathNodeType::name].
15765 UnknownValue(resource_path_node_type::UnknownValue),
15766 }
15767
15768 #[doc(hidden)]
15769 pub mod resource_path_node_type {
15770 #[allow(unused_imports)]
15771 use super::*;
15772 #[derive(Clone, Debug, PartialEq)]
15773 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15774 }
15775
15776 impl ResourcePathNodeType {
15777 /// Gets the enum value.
15778 ///
15779 /// Returns `None` if the enum contains an unknown value deserialized from
15780 /// the string representation of enums.
15781 pub fn value(&self) -> std::option::Option<i32> {
15782 match self {
15783 Self::Unspecified => std::option::Option::Some(0),
15784 Self::GcpOrganization => std::option::Option::Some(1),
15785 Self::GcpFolder => std::option::Option::Some(2),
15786 Self::GcpProject => std::option::Option::Some(3),
15787 Self::AwsOrganization => std::option::Option::Some(4),
15788 Self::AwsOrganizationalUnit => std::option::Option::Some(5),
15789 Self::AwsAccount => std::option::Option::Some(6),
15790 Self::AzureManagementGroup => std::option::Option::Some(7),
15791 Self::AzureSubscription => std::option::Option::Some(8),
15792 Self::AzureResourceGroup => std::option::Option::Some(9),
15793 Self::UnknownValue(u) => u.0.value(),
15794 }
15795 }
15796
15797 /// Gets the enum value as a string.
15798 ///
15799 /// Returns `None` if the enum contains an unknown value deserialized from
15800 /// the integer representation of enums.
15801 pub fn name(&self) -> std::option::Option<&str> {
15802 match self {
15803 Self::Unspecified => {
15804 std::option::Option::Some("RESOURCE_PATH_NODE_TYPE_UNSPECIFIED")
15805 }
15806 Self::GcpOrganization => std::option::Option::Some("GCP_ORGANIZATION"),
15807 Self::GcpFolder => std::option::Option::Some("GCP_FOLDER"),
15808 Self::GcpProject => std::option::Option::Some("GCP_PROJECT"),
15809 Self::AwsOrganization => std::option::Option::Some("AWS_ORGANIZATION"),
15810 Self::AwsOrganizationalUnit => std::option::Option::Some("AWS_ORGANIZATIONAL_UNIT"),
15811 Self::AwsAccount => std::option::Option::Some("AWS_ACCOUNT"),
15812 Self::AzureManagementGroup => std::option::Option::Some("AZURE_MANAGEMENT_GROUP"),
15813 Self::AzureSubscription => std::option::Option::Some("AZURE_SUBSCRIPTION"),
15814 Self::AzureResourceGroup => std::option::Option::Some("AZURE_RESOURCE_GROUP"),
15815 Self::UnknownValue(u) => u.0.name(),
15816 }
15817 }
15818 }
15819
15820 impl std::default::Default for ResourcePathNodeType {
15821 fn default() -> Self {
15822 use std::convert::From;
15823 Self::from(0)
15824 }
15825 }
15826
15827 impl std::fmt::Display for ResourcePathNodeType {
15828 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15829 wkt::internal::display_enum(f, self.name(), self.value())
15830 }
15831 }
15832
15833 impl std::convert::From<i32> for ResourcePathNodeType {
15834 fn from(value: i32) -> Self {
15835 match value {
15836 0 => Self::Unspecified,
15837 1 => Self::GcpOrganization,
15838 2 => Self::GcpFolder,
15839 3 => Self::GcpProject,
15840 4 => Self::AwsOrganization,
15841 5 => Self::AwsOrganizationalUnit,
15842 6 => Self::AwsAccount,
15843 7 => Self::AzureManagementGroup,
15844 8 => Self::AzureSubscription,
15845 9 => Self::AzureResourceGroup,
15846 _ => Self::UnknownValue(resource_path_node_type::UnknownValue(
15847 wkt::internal::UnknownEnumValue::Integer(value),
15848 )),
15849 }
15850 }
15851 }
15852
15853 impl std::convert::From<&str> for ResourcePathNodeType {
15854 fn from(value: &str) -> Self {
15855 use std::string::ToString;
15856 match value {
15857 "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
15858 "GCP_ORGANIZATION" => Self::GcpOrganization,
15859 "GCP_FOLDER" => Self::GcpFolder,
15860 "GCP_PROJECT" => Self::GcpProject,
15861 "AWS_ORGANIZATION" => Self::AwsOrganization,
15862 "AWS_ORGANIZATIONAL_UNIT" => Self::AwsOrganizationalUnit,
15863 "AWS_ACCOUNT" => Self::AwsAccount,
15864 "AZURE_MANAGEMENT_GROUP" => Self::AzureManagementGroup,
15865 "AZURE_SUBSCRIPTION" => Self::AzureSubscription,
15866 "AZURE_RESOURCE_GROUP" => Self::AzureResourceGroup,
15867 _ => Self::UnknownValue(resource_path_node_type::UnknownValue(
15868 wkt::internal::UnknownEnumValue::String(value.to_string()),
15869 )),
15870 }
15871 }
15872 }
15873
15874 impl serde::ser::Serialize for ResourcePathNodeType {
15875 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15876 where
15877 S: serde::Serializer,
15878 {
15879 match self {
15880 Self::Unspecified => serializer.serialize_i32(0),
15881 Self::GcpOrganization => serializer.serialize_i32(1),
15882 Self::GcpFolder => serializer.serialize_i32(2),
15883 Self::GcpProject => serializer.serialize_i32(3),
15884 Self::AwsOrganization => serializer.serialize_i32(4),
15885 Self::AwsOrganizationalUnit => serializer.serialize_i32(5),
15886 Self::AwsAccount => serializer.serialize_i32(6),
15887 Self::AzureManagementGroup => serializer.serialize_i32(7),
15888 Self::AzureSubscription => serializer.serialize_i32(8),
15889 Self::AzureResourceGroup => serializer.serialize_i32(9),
15890 Self::UnknownValue(u) => u.0.serialize(serializer),
15891 }
15892 }
15893 }
15894
15895 impl<'de> serde::de::Deserialize<'de> for ResourcePathNodeType {
15896 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15897 where
15898 D: serde::Deserializer<'de>,
15899 {
15900 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourcePathNodeType>::new(
15901 ".google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType",
15902 ))
15903 }
15904 }
15905}
15906
15907/// A resource value configuration (RVC) is a mapping configuration of user's
15908/// resources to resource values. Used in Attack path simulations.
15909#[derive(Clone, Default, PartialEq)]
15910#[non_exhaustive]
15911pub struct ResourceValueConfig {
15912 /// Identifier. Name for the resource value configuration
15913 pub name: std::string::String,
15914
15915 /// Resource value level this expression represents
15916 /// Only required when there is no Sensitive Data Protection mapping in the
15917 /// request
15918 pub resource_value: crate::model::ResourceValue,
15919
15920 /// Tag values combined with `AND` to check against.
15921 /// For Google Cloud resources, they are tag value IDs in the form of
15922 /// "tagValues/123". Example: `[ "tagValues/123", "tagValues/456",
15923 /// "tagValues/789" ]`
15924 /// <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing>
15925 pub tag_values: std::vec::Vec<std::string::String>,
15926
15927 /// Apply resource_value only to resources that match resource_type.
15928 /// resource_type will be checked with `AND` of other resources.
15929 /// For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
15930 /// will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
15931 pub resource_type: std::string::String,
15932
15933 /// Project or folder to scope this configuration to.
15934 /// For example, "project/456" would apply this configuration only to resources
15935 /// in "project/456" scope and will be checked with `AND` of other resources.
15936 pub scope: std::string::String,
15937
15938 /// List of resource labels to search for, evaluated with `AND`.
15939 /// For example, "resource_labels_selector": {"key": "value", "env": "prod"}
15940 /// will match resources with labels "key": "value" `AND` "env":
15941 /// "prod"
15942 /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
15943 pub resource_labels_selector:
15944 std::collections::HashMap<std::string::String, std::string::String>,
15945
15946 /// Description of the resource value configuration.
15947 pub description: std::string::String,
15948
15949 /// Output only. Timestamp this resource value configuration was created.
15950 pub create_time: std::option::Option<wkt::Timestamp>,
15951
15952 /// Output only. Timestamp this resource value configuration was last updated.
15953 pub update_time: std::option::Option<wkt::Timestamp>,
15954
15955 /// Cloud provider this configuration applies to
15956 pub cloud_provider: crate::model::CloudProvider,
15957
15958 /// A mapping of the sensitivity on Sensitive Data Protection finding to
15959 /// resource values. This mapping can only be used in combination with a
15960 /// resource_type that is related to BigQuery, e.g.
15961 /// "bigquery.googleapis.com/Dataset".
15962 pub sensitive_data_protection_mapping:
15963 std::option::Option<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
15964
15965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15966}
15967
15968impl ResourceValueConfig {
15969 pub fn new() -> Self {
15970 std::default::Default::default()
15971 }
15972
15973 /// Sets the value of [name][crate::model::ResourceValueConfig::name].
15974 ///
15975 /// # Example
15976 /// ```ignore,no_run
15977 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
15978 /// let x = ResourceValueConfig::new().set_name("example");
15979 /// ```
15980 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15981 self.name = v.into();
15982 self
15983 }
15984
15985 /// Sets the value of [resource_value][crate::model::ResourceValueConfig::resource_value].
15986 ///
15987 /// # Example
15988 /// ```ignore,no_run
15989 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
15990 /// use google_cloud_securitycenter_v2::model::ResourceValue;
15991 /// let x0 = ResourceValueConfig::new().set_resource_value(ResourceValue::High);
15992 /// let x1 = ResourceValueConfig::new().set_resource_value(ResourceValue::Medium);
15993 /// let x2 = ResourceValueConfig::new().set_resource_value(ResourceValue::Low);
15994 /// ```
15995 pub fn set_resource_value<T: std::convert::Into<crate::model::ResourceValue>>(
15996 mut self,
15997 v: T,
15998 ) -> Self {
15999 self.resource_value = v.into();
16000 self
16001 }
16002
16003 /// Sets the value of [tag_values][crate::model::ResourceValueConfig::tag_values].
16004 ///
16005 /// # Example
16006 /// ```ignore,no_run
16007 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16008 /// let x = ResourceValueConfig::new().set_tag_values(["a", "b", "c"]);
16009 /// ```
16010 pub fn set_tag_values<T, V>(mut self, v: T) -> Self
16011 where
16012 T: std::iter::IntoIterator<Item = V>,
16013 V: std::convert::Into<std::string::String>,
16014 {
16015 use std::iter::Iterator;
16016 self.tag_values = v.into_iter().map(|i| i.into()).collect();
16017 self
16018 }
16019
16020 /// Sets the value of [resource_type][crate::model::ResourceValueConfig::resource_type].
16021 ///
16022 /// # Example
16023 /// ```ignore,no_run
16024 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16025 /// let x = ResourceValueConfig::new().set_resource_type("example");
16026 /// ```
16027 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16028 self.resource_type = v.into();
16029 self
16030 }
16031
16032 /// Sets the value of [scope][crate::model::ResourceValueConfig::scope].
16033 ///
16034 /// # Example
16035 /// ```ignore,no_run
16036 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16037 /// let x = ResourceValueConfig::new().set_scope("example");
16038 /// ```
16039 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16040 self.scope = v.into();
16041 self
16042 }
16043
16044 /// Sets the value of [resource_labels_selector][crate::model::ResourceValueConfig::resource_labels_selector].
16045 ///
16046 /// # Example
16047 /// ```ignore,no_run
16048 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16049 /// let x = ResourceValueConfig::new().set_resource_labels_selector([
16050 /// ("key0", "abc"),
16051 /// ("key1", "xyz"),
16052 /// ]);
16053 /// ```
16054 pub fn set_resource_labels_selector<T, K, V>(mut self, v: T) -> Self
16055 where
16056 T: std::iter::IntoIterator<Item = (K, V)>,
16057 K: std::convert::Into<std::string::String>,
16058 V: std::convert::Into<std::string::String>,
16059 {
16060 use std::iter::Iterator;
16061 self.resource_labels_selector = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16062 self
16063 }
16064
16065 /// Sets the value of [description][crate::model::ResourceValueConfig::description].
16066 ///
16067 /// # Example
16068 /// ```ignore,no_run
16069 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16070 /// let x = ResourceValueConfig::new().set_description("example");
16071 /// ```
16072 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16073 self.description = v.into();
16074 self
16075 }
16076
16077 /// Sets the value of [create_time][crate::model::ResourceValueConfig::create_time].
16078 ///
16079 /// # Example
16080 /// ```ignore,no_run
16081 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16082 /// use wkt::Timestamp;
16083 /// let x = ResourceValueConfig::new().set_create_time(Timestamp::default()/* use setters */);
16084 /// ```
16085 pub fn set_create_time<T>(mut self, v: T) -> Self
16086 where
16087 T: std::convert::Into<wkt::Timestamp>,
16088 {
16089 self.create_time = std::option::Option::Some(v.into());
16090 self
16091 }
16092
16093 /// Sets or clears the value of [create_time][crate::model::ResourceValueConfig::create_time].
16094 ///
16095 /// # Example
16096 /// ```ignore,no_run
16097 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16098 /// use wkt::Timestamp;
16099 /// let x = ResourceValueConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16100 /// let x = ResourceValueConfig::new().set_or_clear_create_time(None::<Timestamp>);
16101 /// ```
16102 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16103 where
16104 T: std::convert::Into<wkt::Timestamp>,
16105 {
16106 self.create_time = v.map(|x| x.into());
16107 self
16108 }
16109
16110 /// Sets the value of [update_time][crate::model::ResourceValueConfig::update_time].
16111 ///
16112 /// # Example
16113 /// ```ignore,no_run
16114 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16115 /// use wkt::Timestamp;
16116 /// let x = ResourceValueConfig::new().set_update_time(Timestamp::default()/* use setters */);
16117 /// ```
16118 pub fn set_update_time<T>(mut self, v: T) -> Self
16119 where
16120 T: std::convert::Into<wkt::Timestamp>,
16121 {
16122 self.update_time = std::option::Option::Some(v.into());
16123 self
16124 }
16125
16126 /// Sets or clears the value of [update_time][crate::model::ResourceValueConfig::update_time].
16127 ///
16128 /// # Example
16129 /// ```ignore,no_run
16130 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16131 /// use wkt::Timestamp;
16132 /// let x = ResourceValueConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16133 /// let x = ResourceValueConfig::new().set_or_clear_update_time(None::<Timestamp>);
16134 /// ```
16135 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16136 where
16137 T: std::convert::Into<wkt::Timestamp>,
16138 {
16139 self.update_time = v.map(|x| x.into());
16140 self
16141 }
16142
16143 /// Sets the value of [cloud_provider][crate::model::ResourceValueConfig::cloud_provider].
16144 ///
16145 /// # Example
16146 /// ```ignore,no_run
16147 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16148 /// use google_cloud_securitycenter_v2::model::CloudProvider;
16149 /// let x0 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
16150 /// let x1 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::AmazonWebServices);
16151 /// let x2 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
16152 /// ```
16153 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
16154 mut self,
16155 v: T,
16156 ) -> Self {
16157 self.cloud_provider = v.into();
16158 self
16159 }
16160
16161 /// Sets the value of [sensitive_data_protection_mapping][crate::model::ResourceValueConfig::sensitive_data_protection_mapping].
16162 ///
16163 /// # Example
16164 /// ```ignore,no_run
16165 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16166 /// use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16167 /// let x = ResourceValueConfig::new().set_sensitive_data_protection_mapping(SensitiveDataProtectionMapping::default()/* use setters */);
16168 /// ```
16169 pub fn set_sensitive_data_protection_mapping<T>(mut self, v: T) -> Self
16170 where
16171 T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16172 {
16173 self.sensitive_data_protection_mapping = std::option::Option::Some(v.into());
16174 self
16175 }
16176
16177 /// Sets or clears the value of [sensitive_data_protection_mapping][crate::model::ResourceValueConfig::sensitive_data_protection_mapping].
16178 ///
16179 /// # Example
16180 /// ```ignore,no_run
16181 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16182 /// use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16183 /// let x = ResourceValueConfig::new().set_or_clear_sensitive_data_protection_mapping(Some(SensitiveDataProtectionMapping::default()/* use setters */));
16184 /// let x = ResourceValueConfig::new().set_or_clear_sensitive_data_protection_mapping(None::<SensitiveDataProtectionMapping>);
16185 /// ```
16186 pub fn set_or_clear_sensitive_data_protection_mapping<T>(
16187 mut self,
16188 v: std::option::Option<T>,
16189 ) -> Self
16190 where
16191 T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16192 {
16193 self.sensitive_data_protection_mapping = v.map(|x| x.into());
16194 self
16195 }
16196}
16197
16198impl wkt::message::Message for ResourceValueConfig {
16199 fn typename() -> &'static str {
16200 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig"
16201 }
16202}
16203
16204/// Defines additional types related to [ResourceValueConfig].
16205pub mod resource_value_config {
16206 #[allow(unused_imports)]
16207 use super::*;
16208
16209 /// Resource value mapping for Sensitive Data Protection findings
16210 /// If any of these mappings have a resource value that is not unspecified,
16211 /// the resource_value field will be ignored when reading this configuration.
16212 #[derive(Clone, Default, PartialEq)]
16213 #[non_exhaustive]
16214 pub struct SensitiveDataProtectionMapping {
16215 /// Resource value mapping for high-sensitivity Sensitive Data Protection
16216 /// findings
16217 pub high_sensitivity_mapping: crate::model::ResourceValue,
16218
16219 /// Resource value mapping for medium-sensitivity Sensitive Data Protection
16220 /// findings
16221 pub medium_sensitivity_mapping: crate::model::ResourceValue,
16222
16223 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16224 }
16225
16226 impl SensitiveDataProtectionMapping {
16227 pub fn new() -> Self {
16228 std::default::Default::default()
16229 }
16230
16231 /// Sets the value of [high_sensitivity_mapping][crate::model::resource_value_config::SensitiveDataProtectionMapping::high_sensitivity_mapping].
16232 ///
16233 /// # Example
16234 /// ```ignore,no_run
16235 /// # use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16236 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16237 /// let x0 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::High);
16238 /// let x1 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::Medium);
16239 /// let x2 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::Low);
16240 /// ```
16241 pub fn set_high_sensitivity_mapping<T: std::convert::Into<crate::model::ResourceValue>>(
16242 mut self,
16243 v: T,
16244 ) -> Self {
16245 self.high_sensitivity_mapping = v.into();
16246 self
16247 }
16248
16249 /// Sets the value of [medium_sensitivity_mapping][crate::model::resource_value_config::SensitiveDataProtectionMapping::medium_sensitivity_mapping].
16250 ///
16251 /// # Example
16252 /// ```ignore,no_run
16253 /// # use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16254 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16255 /// let x0 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::High);
16256 /// let x1 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::Medium);
16257 /// let x2 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::Low);
16258 /// ```
16259 pub fn set_medium_sensitivity_mapping<
16260 T: std::convert::Into<crate::model::ResourceValue>,
16261 >(
16262 mut self,
16263 v: T,
16264 ) -> Self {
16265 self.medium_sensitivity_mapping = v.into();
16266 self
16267 }
16268 }
16269
16270 impl wkt::message::Message for SensitiveDataProtectionMapping {
16271 fn typename() -> &'static str {
16272 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping"
16273 }
16274 }
16275}
16276
16277/// User specified security marks that are attached to the parent Security
16278/// Command Center resource. Security marks are scoped within a Security Command
16279/// Center organization -- they can be modified and viewed by all users who have
16280/// proper permissions on the organization.
16281#[derive(Clone, Default, PartialEq)]
16282#[non_exhaustive]
16283pub struct SecurityMarks {
16284 /// The relative resource name of the SecurityMarks. See:
16285 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
16286 /// The following list shows some examples:
16287 ///
16288 /// + `organizations/{organization_id}/assets/{asset_id}/securityMarks`
16289 ///
16290 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16291 /// +
16292 /// `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16293 pub name: std::string::String,
16294
16295 /// Mutable user specified security marks belonging to the parent resource.
16296 /// Constraints are as follows:
16297 ///
16298 /// * Keys and values are treated as case insensitive
16299 /// * Keys must be between 1 - 256 characters (inclusive)
16300 /// * Keys must be letters, numbers, underscores, or dashes
16301 /// * Values have leading and trailing whitespace trimmed, remaining
16302 /// characters must be between 1 - 4096 characters (inclusive)
16303 pub marks: std::collections::HashMap<std::string::String, std::string::String>,
16304
16305 /// The canonical name of the marks. The following list shows some examples:
16306 ///
16307 /// + `organizations/{organization_id}/assets/{asset_id}/securityMarks`
16308 ///
16309 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16310 /// +
16311 /// `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16312 ///
16313 /// + `folders/{folder_id}/assets/{asset_id}/securityMarks`
16314 ///
16315 /// `folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16316 /// +
16317 /// `folders/{folder_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16318 ///
16319 /// + `projects/{project_number}/assets/{asset_id}/securityMarks`
16320 ///
16321 /// `projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks`
16322 /// +
16323 /// `projects/{project_number}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16324 pub canonical_name: std::string::String,
16325
16326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16327}
16328
16329impl SecurityMarks {
16330 pub fn new() -> Self {
16331 std::default::Default::default()
16332 }
16333
16334 /// Sets the value of [name][crate::model::SecurityMarks::name].
16335 ///
16336 /// # Example
16337 /// ```ignore,no_run
16338 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16339 /// let x = SecurityMarks::new().set_name("example");
16340 /// ```
16341 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16342 self.name = v.into();
16343 self
16344 }
16345
16346 /// Sets the value of [marks][crate::model::SecurityMarks::marks].
16347 ///
16348 /// # Example
16349 /// ```ignore,no_run
16350 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16351 /// let x = SecurityMarks::new().set_marks([
16352 /// ("key0", "abc"),
16353 /// ("key1", "xyz"),
16354 /// ]);
16355 /// ```
16356 pub fn set_marks<T, K, V>(mut self, v: T) -> Self
16357 where
16358 T: std::iter::IntoIterator<Item = (K, V)>,
16359 K: std::convert::Into<std::string::String>,
16360 V: std::convert::Into<std::string::String>,
16361 {
16362 use std::iter::Iterator;
16363 self.marks = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16364 self
16365 }
16366
16367 /// Sets the value of [canonical_name][crate::model::SecurityMarks::canonical_name].
16368 ///
16369 /// # Example
16370 /// ```ignore,no_run
16371 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16372 /// let x = SecurityMarks::new().set_canonical_name("example");
16373 /// ```
16374 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16375 self.canonical_name = v.into();
16376 self
16377 }
16378}
16379
16380impl wkt::message::Message for SecurityMarks {
16381 fn typename() -> &'static str {
16382 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityMarks"
16383 }
16384}
16385
16386/// Represents a posture that is deployed on Google Cloud by the
16387/// Security Command Center Posture Management service.
16388/// A posture contains one or more policy sets. A policy set is a
16389/// group of policies that enforce a set of security rules on Google
16390/// Cloud.
16391#[derive(Clone, Default, PartialEq)]
16392#[non_exhaustive]
16393pub struct SecurityPosture {
16394 /// Name of the posture, for example, `CIS-Posture`.
16395 pub name: std::string::String,
16396
16397 /// The version of the posture, for example, `c7cfa2a8`.
16398 pub revision_id: std::string::String,
16399
16400 /// The project, folder, or organization on which the posture is deployed,
16401 /// for example, `projects/{project_number}`.
16402 pub posture_deployment_resource: std::string::String,
16403
16404 /// The name of the posture deployment, for example,
16405 /// `organizations/{org_id}/posturedeployments/{posture_deployment_id}`.
16406 pub posture_deployment: std::string::String,
16407
16408 /// The name of the updated policy, for example,
16409 /// `projects/{project_id}/policies/{constraint_name}`.
16410 pub changed_policy: std::string::String,
16411
16412 /// The name of the updated policy set, for example, `cis-policyset`.
16413 pub policy_set: std::string::String,
16414
16415 /// The ID of the updated policy, for example, `compute-policy-1`.
16416 pub policy: std::string::String,
16417
16418 /// The details about a change in an updated policy that violates the deployed
16419 /// posture.
16420 pub policy_drift_details: std::vec::Vec<crate::model::security_posture::PolicyDriftDetails>,
16421
16422 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16423}
16424
16425impl SecurityPosture {
16426 pub fn new() -> Self {
16427 std::default::Default::default()
16428 }
16429
16430 /// Sets the value of [name][crate::model::SecurityPosture::name].
16431 ///
16432 /// # Example
16433 /// ```ignore,no_run
16434 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16435 /// let x = SecurityPosture::new().set_name("example");
16436 /// ```
16437 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16438 self.name = v.into();
16439 self
16440 }
16441
16442 /// Sets the value of [revision_id][crate::model::SecurityPosture::revision_id].
16443 ///
16444 /// # Example
16445 /// ```ignore,no_run
16446 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16447 /// let x = SecurityPosture::new().set_revision_id("example");
16448 /// ```
16449 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16450 self.revision_id = v.into();
16451 self
16452 }
16453
16454 /// Sets the value of [posture_deployment_resource][crate::model::SecurityPosture::posture_deployment_resource].
16455 ///
16456 /// # Example
16457 /// ```ignore,no_run
16458 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16459 /// let x = SecurityPosture::new().set_posture_deployment_resource("example");
16460 /// ```
16461 pub fn set_posture_deployment_resource<T: std::convert::Into<std::string::String>>(
16462 mut self,
16463 v: T,
16464 ) -> Self {
16465 self.posture_deployment_resource = v.into();
16466 self
16467 }
16468
16469 /// Sets the value of [posture_deployment][crate::model::SecurityPosture::posture_deployment].
16470 ///
16471 /// # Example
16472 /// ```ignore,no_run
16473 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16474 /// let x = SecurityPosture::new().set_posture_deployment("example");
16475 /// ```
16476 pub fn set_posture_deployment<T: std::convert::Into<std::string::String>>(
16477 mut self,
16478 v: T,
16479 ) -> Self {
16480 self.posture_deployment = v.into();
16481 self
16482 }
16483
16484 /// Sets the value of [changed_policy][crate::model::SecurityPosture::changed_policy].
16485 ///
16486 /// # Example
16487 /// ```ignore,no_run
16488 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16489 /// let x = SecurityPosture::new().set_changed_policy("example");
16490 /// ```
16491 pub fn set_changed_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16492 self.changed_policy = v.into();
16493 self
16494 }
16495
16496 /// Sets the value of [policy_set][crate::model::SecurityPosture::policy_set].
16497 ///
16498 /// # Example
16499 /// ```ignore,no_run
16500 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16501 /// let x = SecurityPosture::new().set_policy_set("example");
16502 /// ```
16503 pub fn set_policy_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16504 self.policy_set = v.into();
16505 self
16506 }
16507
16508 /// Sets the value of [policy][crate::model::SecurityPosture::policy].
16509 ///
16510 /// # Example
16511 /// ```ignore,no_run
16512 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16513 /// let x = SecurityPosture::new().set_policy("example");
16514 /// ```
16515 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16516 self.policy = v.into();
16517 self
16518 }
16519
16520 /// Sets the value of [policy_drift_details][crate::model::SecurityPosture::policy_drift_details].
16521 ///
16522 /// # Example
16523 /// ```ignore,no_run
16524 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16525 /// use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16526 /// let x = SecurityPosture::new()
16527 /// .set_policy_drift_details([
16528 /// PolicyDriftDetails::default()/* use setters */,
16529 /// PolicyDriftDetails::default()/* use (different) setters */,
16530 /// ]);
16531 /// ```
16532 pub fn set_policy_drift_details<T, V>(mut self, v: T) -> Self
16533 where
16534 T: std::iter::IntoIterator<Item = V>,
16535 V: std::convert::Into<crate::model::security_posture::PolicyDriftDetails>,
16536 {
16537 use std::iter::Iterator;
16538 self.policy_drift_details = v.into_iter().map(|i| i.into()).collect();
16539 self
16540 }
16541}
16542
16543impl wkt::message::Message for SecurityPosture {
16544 fn typename() -> &'static str {
16545 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture"
16546 }
16547}
16548
16549/// Defines additional types related to [SecurityPosture].
16550pub mod security_posture {
16551 #[allow(unused_imports)]
16552 use super::*;
16553
16554 /// The policy field that violates the deployed posture and its expected and
16555 /// detected values.
16556 #[derive(Clone, Default, PartialEq)]
16557 #[non_exhaustive]
16558 pub struct PolicyDriftDetails {
16559 /// The name of the updated field, for example
16560 /// constraint.implementation.policy_rules[0].enforce
16561 pub field: std::string::String,
16562
16563 /// The value of this field that was configured in a posture, for example,
16564 /// `true` or `allowed_values={"projects/29831892"}`.
16565 pub expected_value: std::string::String,
16566
16567 /// The detected value that violates the deployed posture, for example,
16568 /// `false` or `allowed_values={"projects/22831892"}`.
16569 pub detected_value: std::string::String,
16570
16571 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16572 }
16573
16574 impl PolicyDriftDetails {
16575 pub fn new() -> Self {
16576 std::default::Default::default()
16577 }
16578
16579 /// Sets the value of [field][crate::model::security_posture::PolicyDriftDetails::field].
16580 ///
16581 /// # Example
16582 /// ```ignore,no_run
16583 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16584 /// let x = PolicyDriftDetails::new().set_field("example");
16585 /// ```
16586 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16587 self.field = v.into();
16588 self
16589 }
16590
16591 /// Sets the value of [expected_value][crate::model::security_posture::PolicyDriftDetails::expected_value].
16592 ///
16593 /// # Example
16594 /// ```ignore,no_run
16595 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16596 /// let x = PolicyDriftDetails::new().set_expected_value("example");
16597 /// ```
16598 pub fn set_expected_value<T: std::convert::Into<std::string::String>>(
16599 mut self,
16600 v: T,
16601 ) -> Self {
16602 self.expected_value = v.into();
16603 self
16604 }
16605
16606 /// Sets the value of [detected_value][crate::model::security_posture::PolicyDriftDetails::detected_value].
16607 ///
16608 /// # Example
16609 /// ```ignore,no_run
16610 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16611 /// let x = PolicyDriftDetails::new().set_detected_value("example");
16612 /// ```
16613 pub fn set_detected_value<T: std::convert::Into<std::string::String>>(
16614 mut self,
16615 v: T,
16616 ) -> Self {
16617 self.detected_value = v.into();
16618 self
16619 }
16620 }
16621
16622 impl wkt::message::Message for PolicyDriftDetails {
16623 fn typename() -> &'static str {
16624 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails"
16625 }
16626 }
16627}
16628
16629/// Request message to create multiple resource value configs
16630#[derive(Clone, Default, PartialEq)]
16631#[non_exhaustive]
16632pub struct BatchCreateResourceValueConfigsRequest {
16633 /// Required. Resource name of the new ResourceValueConfig's parent.
16634 /// The parent field in the CreateResourceValueConfigRequest
16635 /// messages must either be empty or match this field.
16636 pub parent: std::string::String,
16637
16638 /// Required. The resource value configs to be created.
16639 pub requests: std::vec::Vec<crate::model::CreateResourceValueConfigRequest>,
16640
16641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16642}
16643
16644impl BatchCreateResourceValueConfigsRequest {
16645 pub fn new() -> Self {
16646 std::default::Default::default()
16647 }
16648
16649 /// Sets the value of [parent][crate::model::BatchCreateResourceValueConfigsRequest::parent].
16650 ///
16651 /// # Example
16652 /// ```ignore,no_run
16653 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsRequest;
16654 /// let x = BatchCreateResourceValueConfigsRequest::new().set_parent("example");
16655 /// ```
16656 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16657 self.parent = v.into();
16658 self
16659 }
16660
16661 /// Sets the value of [requests][crate::model::BatchCreateResourceValueConfigsRequest::requests].
16662 ///
16663 /// # Example
16664 /// ```ignore,no_run
16665 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsRequest;
16666 /// use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
16667 /// let x = BatchCreateResourceValueConfigsRequest::new()
16668 /// .set_requests([
16669 /// CreateResourceValueConfigRequest::default()/* use setters */,
16670 /// CreateResourceValueConfigRequest::default()/* use (different) setters */,
16671 /// ]);
16672 /// ```
16673 pub fn set_requests<T, V>(mut self, v: T) -> Self
16674 where
16675 T: std::iter::IntoIterator<Item = V>,
16676 V: std::convert::Into<crate::model::CreateResourceValueConfigRequest>,
16677 {
16678 use std::iter::Iterator;
16679 self.requests = v.into_iter().map(|i| i.into()).collect();
16680 self
16681 }
16682}
16683
16684impl wkt::message::Message for BatchCreateResourceValueConfigsRequest {
16685 fn typename() -> &'static str {
16686 "type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest"
16687 }
16688}
16689
16690/// Response message for BatchCreateResourceValueConfigs
16691#[derive(Clone, Default, PartialEq)]
16692#[non_exhaustive]
16693pub struct BatchCreateResourceValueConfigsResponse {
16694 /// The resource value configs created
16695 pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
16696
16697 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16698}
16699
16700impl BatchCreateResourceValueConfigsResponse {
16701 pub fn new() -> Self {
16702 std::default::Default::default()
16703 }
16704
16705 /// Sets the value of [resource_value_configs][crate::model::BatchCreateResourceValueConfigsResponse::resource_value_configs].
16706 ///
16707 /// # Example
16708 /// ```ignore,no_run
16709 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsResponse;
16710 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16711 /// let x = BatchCreateResourceValueConfigsResponse::new()
16712 /// .set_resource_value_configs([
16713 /// ResourceValueConfig::default()/* use setters */,
16714 /// ResourceValueConfig::default()/* use (different) setters */,
16715 /// ]);
16716 /// ```
16717 pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
16718 where
16719 T: std::iter::IntoIterator<Item = V>,
16720 V: std::convert::Into<crate::model::ResourceValueConfig>,
16721 {
16722 use std::iter::Iterator;
16723 self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
16724 self
16725 }
16726}
16727
16728impl wkt::message::Message for BatchCreateResourceValueConfigsResponse {
16729 fn typename() -> &'static str {
16730 "type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse"
16731 }
16732}
16733
16734/// Request message for bulk findings update.
16735///
16736/// Note:
16737///
16738/// 1. If multiple bulk update requests match the same resource, the order in
16739/// which they get executed is not defined.
16740/// 1. Once a bulk operation is started, there is no way to stop it.
16741#[derive(Clone, Default, PartialEq)]
16742#[non_exhaustive]
16743pub struct BulkMuteFindingsRequest {
16744 /// Required. The parent, at which bulk action needs to be applied. If no
16745 /// location is specified, findings are updated in global. The following list
16746 /// shows some examples:
16747 ///
16748 /// + `organizations/[organization_id]`
16749 /// + `organizations/[organization_id]/locations/[location_id]`
16750 /// + `folders/[folder_id]`
16751 /// + `folders/[folder_id]/locations/[location_id]`
16752 /// + `projects/[project_id]`
16753 /// + `projects/[project_id]/locations/[location_id]`
16754 pub parent: std::string::String,
16755
16756 /// Expression that identifies findings that should be updated.
16757 /// The expression is a list of zero or more restrictions combined
16758 /// via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
16759 /// has higher precedence than `AND`.
16760 ///
16761 /// Restrictions have the form `<field> <operator> <value>` and may have a
16762 /// `-` character in front of them to indicate negation. The fields map to
16763 /// those defined in the corresponding resource.
16764 ///
16765 /// The supported operators are:
16766 ///
16767 /// * `=` for all value types.
16768 /// * `>`, `<`, `>=`, `<=` for integer values.
16769 /// * `:`, meaning substring matching, for strings.
16770 ///
16771 /// The supported value types are:
16772 ///
16773 /// * string literals in quotes.
16774 /// * integer literals without quotes.
16775 /// * boolean literals `true` and `false` without quotes.
16776 pub filter: std::string::String,
16777
16778 /// Optional. All findings matching the given filter will have their mute state
16779 /// set to this value. The default value is `MUTED`. Setting this to
16780 /// `UNDEFINED` will clear the mute state on all matching findings.
16781 pub mute_state: crate::model::bulk_mute_findings_request::MuteState,
16782
16783 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16784}
16785
16786impl BulkMuteFindingsRequest {
16787 pub fn new() -> Self {
16788 std::default::Default::default()
16789 }
16790
16791 /// Sets the value of [parent][crate::model::BulkMuteFindingsRequest::parent].
16792 ///
16793 /// # Example
16794 /// ```ignore,no_run
16795 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16796 /// let x = BulkMuteFindingsRequest::new().set_parent("example");
16797 /// ```
16798 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16799 self.parent = v.into();
16800 self
16801 }
16802
16803 /// Sets the value of [filter][crate::model::BulkMuteFindingsRequest::filter].
16804 ///
16805 /// # Example
16806 /// ```ignore,no_run
16807 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16808 /// let x = BulkMuteFindingsRequest::new().set_filter("example");
16809 /// ```
16810 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16811 self.filter = v.into();
16812 self
16813 }
16814
16815 /// Sets the value of [mute_state][crate::model::BulkMuteFindingsRequest::mute_state].
16816 ///
16817 /// # Example
16818 /// ```ignore,no_run
16819 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16820 /// use google_cloud_securitycenter_v2::model::bulk_mute_findings_request::MuteState;
16821 /// let x0 = BulkMuteFindingsRequest::new().set_mute_state(MuteState::Muted);
16822 /// let x1 = BulkMuteFindingsRequest::new().set_mute_state(MuteState::Undefined);
16823 /// ```
16824 pub fn set_mute_state<
16825 T: std::convert::Into<crate::model::bulk_mute_findings_request::MuteState>,
16826 >(
16827 mut self,
16828 v: T,
16829 ) -> Self {
16830 self.mute_state = v.into();
16831 self
16832 }
16833}
16834
16835impl wkt::message::Message for BulkMuteFindingsRequest {
16836 fn typename() -> &'static str {
16837 "type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsRequest"
16838 }
16839}
16840
16841/// Defines additional types related to [BulkMuteFindingsRequest].
16842pub mod bulk_mute_findings_request {
16843 #[allow(unused_imports)]
16844 use super::*;
16845
16846 /// The mute state.
16847 ///
16848 /// # Working with unknown values
16849 ///
16850 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16851 /// additional enum variants at any time. Adding new variants is not considered
16852 /// a breaking change. Applications should write their code in anticipation of:
16853 ///
16854 /// - New values appearing in future releases of the client library, **and**
16855 /// - New values received dynamically, without application changes.
16856 ///
16857 /// Please consult the [Working with enums] section in the user guide for some
16858 /// guidelines.
16859 ///
16860 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16861 #[derive(Clone, Debug, PartialEq)]
16862 #[non_exhaustive]
16863 pub enum MuteState {
16864 /// Unused.
16865 Unspecified,
16866 /// Matching findings will be muted (default).
16867 Muted,
16868 /// Matching findings will have their mute state cleared.
16869 Undefined,
16870 /// If set, the enum was initialized with an unknown value.
16871 ///
16872 /// Applications can examine the value using [MuteState::value] or
16873 /// [MuteState::name].
16874 UnknownValue(mute_state::UnknownValue),
16875 }
16876
16877 #[doc(hidden)]
16878 pub mod mute_state {
16879 #[allow(unused_imports)]
16880 use super::*;
16881 #[derive(Clone, Debug, PartialEq)]
16882 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16883 }
16884
16885 impl MuteState {
16886 /// Gets the enum value.
16887 ///
16888 /// Returns `None` if the enum contains an unknown value deserialized from
16889 /// the string representation of enums.
16890 pub fn value(&self) -> std::option::Option<i32> {
16891 match self {
16892 Self::Unspecified => std::option::Option::Some(0),
16893 Self::Muted => std::option::Option::Some(1),
16894 Self::Undefined => std::option::Option::Some(2),
16895 Self::UnknownValue(u) => u.0.value(),
16896 }
16897 }
16898
16899 /// Gets the enum value as a string.
16900 ///
16901 /// Returns `None` if the enum contains an unknown value deserialized from
16902 /// the integer representation of enums.
16903 pub fn name(&self) -> std::option::Option<&str> {
16904 match self {
16905 Self::Unspecified => std::option::Option::Some("MUTE_STATE_UNSPECIFIED"),
16906 Self::Muted => std::option::Option::Some("MUTED"),
16907 Self::Undefined => std::option::Option::Some("UNDEFINED"),
16908 Self::UnknownValue(u) => u.0.name(),
16909 }
16910 }
16911 }
16912
16913 impl std::default::Default for MuteState {
16914 fn default() -> Self {
16915 use std::convert::From;
16916 Self::from(0)
16917 }
16918 }
16919
16920 impl std::fmt::Display for MuteState {
16921 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16922 wkt::internal::display_enum(f, self.name(), self.value())
16923 }
16924 }
16925
16926 impl std::convert::From<i32> for MuteState {
16927 fn from(value: i32) -> Self {
16928 match value {
16929 0 => Self::Unspecified,
16930 1 => Self::Muted,
16931 2 => Self::Undefined,
16932 _ => Self::UnknownValue(mute_state::UnknownValue(
16933 wkt::internal::UnknownEnumValue::Integer(value),
16934 )),
16935 }
16936 }
16937 }
16938
16939 impl std::convert::From<&str> for MuteState {
16940 fn from(value: &str) -> Self {
16941 use std::string::ToString;
16942 match value {
16943 "MUTE_STATE_UNSPECIFIED" => Self::Unspecified,
16944 "MUTED" => Self::Muted,
16945 "UNDEFINED" => Self::Undefined,
16946 _ => Self::UnknownValue(mute_state::UnknownValue(
16947 wkt::internal::UnknownEnumValue::String(value.to_string()),
16948 )),
16949 }
16950 }
16951 }
16952
16953 impl serde::ser::Serialize for MuteState {
16954 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16955 where
16956 S: serde::Serializer,
16957 {
16958 match self {
16959 Self::Unspecified => serializer.serialize_i32(0),
16960 Self::Muted => serializer.serialize_i32(1),
16961 Self::Undefined => serializer.serialize_i32(2),
16962 Self::UnknownValue(u) => u.0.serialize(serializer),
16963 }
16964 }
16965 }
16966
16967 impl<'de> serde::de::Deserialize<'de> for MuteState {
16968 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16969 where
16970 D: serde::Deserializer<'de>,
16971 {
16972 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteState>::new(
16973 ".google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState",
16974 ))
16975 }
16976 }
16977}
16978
16979/// The response to a BulkMute request. Contains the LRO information.
16980#[derive(Clone, Default, PartialEq)]
16981#[non_exhaustive]
16982pub struct BulkMuteFindingsResponse {
16983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16984}
16985
16986impl BulkMuteFindingsResponse {
16987 pub fn new() -> Self {
16988 std::default::Default::default()
16989 }
16990}
16991
16992impl wkt::message::Message for BulkMuteFindingsResponse {
16993 fn typename() -> &'static str {
16994 "type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsResponse"
16995 }
16996}
16997
16998/// Request message for creating a BigQuery export.
16999#[derive(Clone, Default, PartialEq)]
17000#[non_exhaustive]
17001pub struct CreateBigQueryExportRequest {
17002 /// Required. The name of the parent resource of the new BigQuery export. Its
17003 /// format is `organizations/[organization_id]/locations/[location_id]`,
17004 /// `folders/[folder_id]/locations/[location_id]`, or
17005 /// `projects/[project_id]/locations/[location_id]`.
17006 pub parent: std::string::String,
17007
17008 /// Required. The BigQuery export being created.
17009 pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
17010
17011 /// Required. Unique identifier provided by the client within the parent scope.
17012 /// It must consist of only lowercase letters, numbers, and hyphens, must start
17013 /// with a letter, must end with either a letter or a number, and must be 63
17014 /// characters or less.
17015 pub big_query_export_id: std::string::String,
17016
17017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17018}
17019
17020impl CreateBigQueryExportRequest {
17021 pub fn new() -> Self {
17022 std::default::Default::default()
17023 }
17024
17025 /// Sets the value of [parent][crate::model::CreateBigQueryExportRequest::parent].
17026 ///
17027 /// # Example
17028 /// ```ignore,no_run
17029 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17030 /// let x = CreateBigQueryExportRequest::new().set_parent("example");
17031 /// ```
17032 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17033 self.parent = v.into();
17034 self
17035 }
17036
17037 /// Sets the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
17038 ///
17039 /// # Example
17040 /// ```ignore,no_run
17041 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17042 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
17043 /// let x = CreateBigQueryExportRequest::new().set_big_query_export(BigQueryExport::default()/* use setters */);
17044 /// ```
17045 pub fn set_big_query_export<T>(mut self, v: T) -> Self
17046 where
17047 T: std::convert::Into<crate::model::BigQueryExport>,
17048 {
17049 self.big_query_export = std::option::Option::Some(v.into());
17050 self
17051 }
17052
17053 /// Sets or clears the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
17054 ///
17055 /// # Example
17056 /// ```ignore,no_run
17057 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17058 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
17059 /// let x = CreateBigQueryExportRequest::new().set_or_clear_big_query_export(Some(BigQueryExport::default()/* use setters */));
17060 /// let x = CreateBigQueryExportRequest::new().set_or_clear_big_query_export(None::<BigQueryExport>);
17061 /// ```
17062 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
17063 where
17064 T: std::convert::Into<crate::model::BigQueryExport>,
17065 {
17066 self.big_query_export = v.map(|x| x.into());
17067 self
17068 }
17069
17070 /// Sets the value of [big_query_export_id][crate::model::CreateBigQueryExportRequest::big_query_export_id].
17071 ///
17072 /// # Example
17073 /// ```ignore,no_run
17074 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17075 /// let x = CreateBigQueryExportRequest::new().set_big_query_export_id("example");
17076 /// ```
17077 pub fn set_big_query_export_id<T: std::convert::Into<std::string::String>>(
17078 mut self,
17079 v: T,
17080 ) -> Self {
17081 self.big_query_export_id = v.into();
17082 self
17083 }
17084}
17085
17086impl wkt::message::Message for CreateBigQueryExportRequest {
17087 fn typename() -> &'static str {
17088 "type.googleapis.com/google.cloud.securitycenter.v2.CreateBigQueryExportRequest"
17089 }
17090}
17091
17092/// Request message for creating a finding.
17093#[derive(Clone, Default, PartialEq)]
17094#[non_exhaustive]
17095pub struct CreateFindingRequest {
17096 /// Required. Resource name of the new finding's parent. The following list
17097 /// shows some examples of the format:
17098 /// +
17099 /// `organizations/[organization_id]/sources/[source_id]`
17100 /// +
17101 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
17102 pub parent: std::string::String,
17103
17104 /// Required. Unique identifier provided by the client within the parent scope.
17105 /// It must be alphanumeric and less than or equal to 32 characters and
17106 /// greater than 0 characters in length.
17107 pub finding_id: std::string::String,
17108
17109 /// Required. The Finding being created. The name and security_marks will be
17110 /// ignored as they are both output only fields on this resource.
17111 pub finding: std::option::Option<crate::model::Finding>,
17112
17113 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17114}
17115
17116impl CreateFindingRequest {
17117 pub fn new() -> Self {
17118 std::default::Default::default()
17119 }
17120
17121 /// Sets the value of [parent][crate::model::CreateFindingRequest::parent].
17122 ///
17123 /// # Example
17124 /// ```ignore,no_run
17125 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17126 /// let x = CreateFindingRequest::new().set_parent("example");
17127 /// ```
17128 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17129 self.parent = v.into();
17130 self
17131 }
17132
17133 /// Sets the value of [finding_id][crate::model::CreateFindingRequest::finding_id].
17134 ///
17135 /// # Example
17136 /// ```ignore,no_run
17137 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17138 /// let x = CreateFindingRequest::new().set_finding_id("example");
17139 /// ```
17140 pub fn set_finding_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17141 self.finding_id = v.into();
17142 self
17143 }
17144
17145 /// Sets the value of [finding][crate::model::CreateFindingRequest::finding].
17146 ///
17147 /// # Example
17148 /// ```ignore,no_run
17149 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17150 /// use google_cloud_securitycenter_v2::model::Finding;
17151 /// let x = CreateFindingRequest::new().set_finding(Finding::default()/* use setters */);
17152 /// ```
17153 pub fn set_finding<T>(mut self, v: T) -> Self
17154 where
17155 T: std::convert::Into<crate::model::Finding>,
17156 {
17157 self.finding = std::option::Option::Some(v.into());
17158 self
17159 }
17160
17161 /// Sets or clears the value of [finding][crate::model::CreateFindingRequest::finding].
17162 ///
17163 /// # Example
17164 /// ```ignore,no_run
17165 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17166 /// use google_cloud_securitycenter_v2::model::Finding;
17167 /// let x = CreateFindingRequest::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
17168 /// let x = CreateFindingRequest::new().set_or_clear_finding(None::<Finding>);
17169 /// ```
17170 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
17171 where
17172 T: std::convert::Into<crate::model::Finding>,
17173 {
17174 self.finding = v.map(|x| x.into());
17175 self
17176 }
17177}
17178
17179impl wkt::message::Message for CreateFindingRequest {
17180 fn typename() -> &'static str {
17181 "type.googleapis.com/google.cloud.securitycenter.v2.CreateFindingRequest"
17182 }
17183}
17184
17185/// Request message for creating a mute config.
17186#[derive(Clone, Default, PartialEq)]
17187#[non_exhaustive]
17188pub struct CreateMuteConfigRequest {
17189 /// Required. Resource name of the new mute configs's parent. Its format is
17190 /// `organizations/[organization_id]/locations/[location_id]`,
17191 /// `folders/[folder_id]/locations/[location_id]`, or
17192 /// `projects/[project_id]/locations/[location_id]`.
17193 pub parent: std::string::String,
17194
17195 /// Required. The mute config being created.
17196 pub mute_config: std::option::Option<crate::model::MuteConfig>,
17197
17198 /// Required. Unique identifier provided by the client within the parent scope.
17199 /// It must consist of only lowercase letters, numbers, and hyphens, must start
17200 /// with a letter, must end with either a letter or a number, and must be 63
17201 /// characters or less.
17202 pub mute_config_id: std::string::String,
17203
17204 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17205}
17206
17207impl CreateMuteConfigRequest {
17208 pub fn new() -> Self {
17209 std::default::Default::default()
17210 }
17211
17212 /// Sets the value of [parent][crate::model::CreateMuteConfigRequest::parent].
17213 ///
17214 /// # Example
17215 /// ```ignore,no_run
17216 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17217 /// let x = CreateMuteConfigRequest::new().set_parent("example");
17218 /// ```
17219 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17220 self.parent = v.into();
17221 self
17222 }
17223
17224 /// Sets the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
17225 ///
17226 /// # Example
17227 /// ```ignore,no_run
17228 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17229 /// use google_cloud_securitycenter_v2::model::MuteConfig;
17230 /// let x = CreateMuteConfigRequest::new().set_mute_config(MuteConfig::default()/* use setters */);
17231 /// ```
17232 pub fn set_mute_config<T>(mut self, v: T) -> Self
17233 where
17234 T: std::convert::Into<crate::model::MuteConfig>,
17235 {
17236 self.mute_config = std::option::Option::Some(v.into());
17237 self
17238 }
17239
17240 /// Sets or clears the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
17241 ///
17242 /// # Example
17243 /// ```ignore,no_run
17244 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17245 /// use google_cloud_securitycenter_v2::model::MuteConfig;
17246 /// let x = CreateMuteConfigRequest::new().set_or_clear_mute_config(Some(MuteConfig::default()/* use setters */));
17247 /// let x = CreateMuteConfigRequest::new().set_or_clear_mute_config(None::<MuteConfig>);
17248 /// ```
17249 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
17250 where
17251 T: std::convert::Into<crate::model::MuteConfig>,
17252 {
17253 self.mute_config = v.map(|x| x.into());
17254 self
17255 }
17256
17257 /// Sets the value of [mute_config_id][crate::model::CreateMuteConfigRequest::mute_config_id].
17258 ///
17259 /// # Example
17260 /// ```ignore,no_run
17261 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17262 /// let x = CreateMuteConfigRequest::new().set_mute_config_id("example");
17263 /// ```
17264 pub fn set_mute_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17265 self.mute_config_id = v.into();
17266 self
17267 }
17268}
17269
17270impl wkt::message::Message for CreateMuteConfigRequest {
17271 fn typename() -> &'static str {
17272 "type.googleapis.com/google.cloud.securitycenter.v2.CreateMuteConfigRequest"
17273 }
17274}
17275
17276/// Request message for creating a notification config.
17277#[derive(Clone, Default, PartialEq)]
17278#[non_exhaustive]
17279pub struct CreateNotificationConfigRequest {
17280 /// Required. Resource name of the new notification config's parent. Its format
17281 /// is `organizations/[organization_id]/locations/[location_id]`,
17282 /// `folders/[folder_id]/locations/[location_id]`, or
17283 /// `projects/[project_id]/locations/[location_id]`.
17284 pub parent: std::string::String,
17285
17286 /// Required.
17287 /// Unique identifier provided by the client within the parent scope.
17288 /// It must be between 1 and 128 characters and contain alphanumeric
17289 /// characters, underscores, or hyphens only.
17290 pub config_id: std::string::String,
17291
17292 /// Required. The notification config being created. The name and the service
17293 /// account will be ignored as they are both output only fields on this
17294 /// resource.
17295 pub notification_config: std::option::Option<crate::model::NotificationConfig>,
17296
17297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17298}
17299
17300impl CreateNotificationConfigRequest {
17301 pub fn new() -> Self {
17302 std::default::Default::default()
17303 }
17304
17305 /// Sets the value of [parent][crate::model::CreateNotificationConfigRequest::parent].
17306 ///
17307 /// # Example
17308 /// ```ignore,no_run
17309 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17310 /// let x = CreateNotificationConfigRequest::new().set_parent("example");
17311 /// ```
17312 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17313 self.parent = v.into();
17314 self
17315 }
17316
17317 /// Sets the value of [config_id][crate::model::CreateNotificationConfigRequest::config_id].
17318 ///
17319 /// # Example
17320 /// ```ignore,no_run
17321 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17322 /// let x = CreateNotificationConfigRequest::new().set_config_id("example");
17323 /// ```
17324 pub fn set_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17325 self.config_id = v.into();
17326 self
17327 }
17328
17329 /// Sets the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
17330 ///
17331 /// # Example
17332 /// ```ignore,no_run
17333 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17334 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
17335 /// let x = CreateNotificationConfigRequest::new().set_notification_config(NotificationConfig::default()/* use setters */);
17336 /// ```
17337 pub fn set_notification_config<T>(mut self, v: T) -> Self
17338 where
17339 T: std::convert::Into<crate::model::NotificationConfig>,
17340 {
17341 self.notification_config = std::option::Option::Some(v.into());
17342 self
17343 }
17344
17345 /// Sets or clears the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
17346 ///
17347 /// # Example
17348 /// ```ignore,no_run
17349 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17350 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
17351 /// let x = CreateNotificationConfigRequest::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
17352 /// let x = CreateNotificationConfigRequest::new().set_or_clear_notification_config(None::<NotificationConfig>);
17353 /// ```
17354 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
17355 where
17356 T: std::convert::Into<crate::model::NotificationConfig>,
17357 {
17358 self.notification_config = v.map(|x| x.into());
17359 self
17360 }
17361}
17362
17363impl wkt::message::Message for CreateNotificationConfigRequest {
17364 fn typename() -> &'static str {
17365 "type.googleapis.com/google.cloud.securitycenter.v2.CreateNotificationConfigRequest"
17366 }
17367}
17368
17369/// Request message to create single resource value config
17370#[derive(Clone, Default, PartialEq)]
17371#[non_exhaustive]
17372pub struct CreateResourceValueConfigRequest {
17373 /// Required. Resource name of the new ResourceValueConfig's parent.
17374 pub parent: std::string::String,
17375
17376 /// Required. The resource value config being created.
17377 pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
17378
17379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17380}
17381
17382impl CreateResourceValueConfigRequest {
17383 pub fn new() -> Self {
17384 std::default::Default::default()
17385 }
17386
17387 /// Sets the value of [parent][crate::model::CreateResourceValueConfigRequest::parent].
17388 ///
17389 /// # Example
17390 /// ```ignore,no_run
17391 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17392 /// let x = CreateResourceValueConfigRequest::new().set_parent("example");
17393 /// ```
17394 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17395 self.parent = v.into();
17396 self
17397 }
17398
17399 /// Sets the value of [resource_value_config][crate::model::CreateResourceValueConfigRequest::resource_value_config].
17400 ///
17401 /// # Example
17402 /// ```ignore,no_run
17403 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17404 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
17405 /// let x = CreateResourceValueConfigRequest::new().set_resource_value_config(ResourceValueConfig::default()/* use setters */);
17406 /// ```
17407 pub fn set_resource_value_config<T>(mut self, v: T) -> Self
17408 where
17409 T: std::convert::Into<crate::model::ResourceValueConfig>,
17410 {
17411 self.resource_value_config = std::option::Option::Some(v.into());
17412 self
17413 }
17414
17415 /// Sets or clears the value of [resource_value_config][crate::model::CreateResourceValueConfigRequest::resource_value_config].
17416 ///
17417 /// # Example
17418 /// ```ignore,no_run
17419 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17420 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
17421 /// let x = CreateResourceValueConfigRequest::new().set_or_clear_resource_value_config(Some(ResourceValueConfig::default()/* use setters */));
17422 /// let x = CreateResourceValueConfigRequest::new().set_or_clear_resource_value_config(None::<ResourceValueConfig>);
17423 /// ```
17424 pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
17425 where
17426 T: std::convert::Into<crate::model::ResourceValueConfig>,
17427 {
17428 self.resource_value_config = v.map(|x| x.into());
17429 self
17430 }
17431}
17432
17433impl wkt::message::Message for CreateResourceValueConfigRequest {
17434 fn typename() -> &'static str {
17435 "type.googleapis.com/google.cloud.securitycenter.v2.CreateResourceValueConfigRequest"
17436 }
17437}
17438
17439/// Request message for creating a source.
17440#[derive(Clone, Default, PartialEq)]
17441#[non_exhaustive]
17442pub struct CreateSourceRequest {
17443 /// Required. Resource name of the new source's parent. Its format should be
17444 /// `organizations/[organization_id]`.
17445 pub parent: std::string::String,
17446
17447 /// Required. The Source being created, only the display_name and description
17448 /// will be used. All other fields will be ignored.
17449 pub source: std::option::Option<crate::model::Source>,
17450
17451 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17452}
17453
17454impl CreateSourceRequest {
17455 pub fn new() -> Self {
17456 std::default::Default::default()
17457 }
17458
17459 /// Sets the value of [parent][crate::model::CreateSourceRequest::parent].
17460 ///
17461 /// # Example
17462 /// ```ignore,no_run
17463 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17464 /// let x = CreateSourceRequest::new().set_parent("example");
17465 /// ```
17466 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17467 self.parent = v.into();
17468 self
17469 }
17470
17471 /// Sets the value of [source][crate::model::CreateSourceRequest::source].
17472 ///
17473 /// # Example
17474 /// ```ignore,no_run
17475 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17476 /// use google_cloud_securitycenter_v2::model::Source;
17477 /// let x = CreateSourceRequest::new().set_source(Source::default()/* use setters */);
17478 /// ```
17479 pub fn set_source<T>(mut self, v: T) -> Self
17480 where
17481 T: std::convert::Into<crate::model::Source>,
17482 {
17483 self.source = std::option::Option::Some(v.into());
17484 self
17485 }
17486
17487 /// Sets or clears the value of [source][crate::model::CreateSourceRequest::source].
17488 ///
17489 /// # Example
17490 /// ```ignore,no_run
17491 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17492 /// use google_cloud_securitycenter_v2::model::Source;
17493 /// let x = CreateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
17494 /// let x = CreateSourceRequest::new().set_or_clear_source(None::<Source>);
17495 /// ```
17496 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
17497 where
17498 T: std::convert::Into<crate::model::Source>,
17499 {
17500 self.source = v.map(|x| x.into());
17501 self
17502 }
17503}
17504
17505impl wkt::message::Message for CreateSourceRequest {
17506 fn typename() -> &'static str {
17507 "type.googleapis.com/google.cloud.securitycenter.v2.CreateSourceRequest"
17508 }
17509}
17510
17511/// Request message for deleting a BigQuery export.
17512#[derive(Clone, Default, PartialEq)]
17513#[non_exhaustive]
17514pub struct DeleteBigQueryExportRequest {
17515 /// Required. The name of the BigQuery export to delete. The following list
17516 /// shows some examples of the format:
17517 ///
17518 ///
17519 /// `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
17520 ///
17521 /// + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
17522 /// + `projects/{project}/locations/{location}/bigQueryExports/{export_id}`
17523 pub name: std::string::String,
17524
17525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17526}
17527
17528impl DeleteBigQueryExportRequest {
17529 pub fn new() -> Self {
17530 std::default::Default::default()
17531 }
17532
17533 /// Sets the value of [name][crate::model::DeleteBigQueryExportRequest::name].
17534 ///
17535 /// # Example
17536 /// ```ignore,no_run
17537 /// # use google_cloud_securitycenter_v2::model::DeleteBigQueryExportRequest;
17538 /// let x = DeleteBigQueryExportRequest::new().set_name("example");
17539 /// ```
17540 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17541 self.name = v.into();
17542 self
17543 }
17544}
17545
17546impl wkt::message::Message for DeleteBigQueryExportRequest {
17547 fn typename() -> &'static str {
17548 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteBigQueryExportRequest"
17549 }
17550}
17551
17552/// Request message for deleting a mute config. If no location is specified,
17553/// default is global.
17554#[derive(Clone, Default, PartialEq)]
17555#[non_exhaustive]
17556pub struct DeleteMuteConfigRequest {
17557 /// Required. Name of the mute config to delete. The following list shows some
17558 /// examples of the format:
17559 ///
17560 /// + `organizations/{organization}/muteConfigs/{config_id}`
17561 ///
17562 /// `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
17563 ///
17564 /// + `folders/{folder}/muteConfigs/{config_id}`
17565 /// + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
17566 /// + `projects/{project}/muteConfigs/{config_id}`
17567 /// + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
17568 pub name: std::string::String,
17569
17570 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17571}
17572
17573impl DeleteMuteConfigRequest {
17574 pub fn new() -> Self {
17575 std::default::Default::default()
17576 }
17577
17578 /// Sets the value of [name][crate::model::DeleteMuteConfigRequest::name].
17579 ///
17580 /// # Example
17581 /// ```ignore,no_run
17582 /// # use google_cloud_securitycenter_v2::model::DeleteMuteConfigRequest;
17583 /// let x = DeleteMuteConfigRequest::new().set_name("example");
17584 /// ```
17585 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17586 self.name = v.into();
17587 self
17588 }
17589}
17590
17591impl wkt::message::Message for DeleteMuteConfigRequest {
17592 fn typename() -> &'static str {
17593 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteMuteConfigRequest"
17594 }
17595}
17596
17597/// Request message for deleting a notification config.
17598#[derive(Clone, Default, PartialEq)]
17599#[non_exhaustive]
17600pub struct DeleteNotificationConfigRequest {
17601 /// Required. Name of the notification config to delete. The following list
17602 /// shows some examples of the format:
17603 ///
17604 ///
17605 /// `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
17606 /// +
17607 /// `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]`
17608 /// +
17609 /// `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]`
17610 pub name: std::string::String,
17611
17612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17613}
17614
17615impl DeleteNotificationConfigRequest {
17616 pub fn new() -> Self {
17617 std::default::Default::default()
17618 }
17619
17620 /// Sets the value of [name][crate::model::DeleteNotificationConfigRequest::name].
17621 ///
17622 /// # Example
17623 /// ```ignore,no_run
17624 /// # use google_cloud_securitycenter_v2::model::DeleteNotificationConfigRequest;
17625 /// let x = DeleteNotificationConfigRequest::new().set_name("example");
17626 /// ```
17627 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17628 self.name = v.into();
17629 self
17630 }
17631}
17632
17633impl wkt::message::Message for DeleteNotificationConfigRequest {
17634 fn typename() -> &'static str {
17635 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteNotificationConfigRequest"
17636 }
17637}
17638
17639/// Request message to delete resource value config
17640#[derive(Clone, Default, PartialEq)]
17641#[non_exhaustive]
17642pub struct DeleteResourceValueConfigRequest {
17643 /// Required. Name of the ResourceValueConfig to delete
17644 pub name: std::string::String,
17645
17646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17647}
17648
17649impl DeleteResourceValueConfigRequest {
17650 pub fn new() -> Self {
17651 std::default::Default::default()
17652 }
17653
17654 /// Sets the value of [name][crate::model::DeleteResourceValueConfigRequest::name].
17655 ///
17656 /// # Example
17657 /// ```ignore,no_run
17658 /// # use google_cloud_securitycenter_v2::model::DeleteResourceValueConfigRequest;
17659 /// let x = DeleteResourceValueConfigRequest::new().set_name("example");
17660 /// ```
17661 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17662 self.name = v.into();
17663 self
17664 }
17665}
17666
17667impl wkt::message::Message for DeleteResourceValueConfigRequest {
17668 fn typename() -> &'static str {
17669 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest"
17670 }
17671}
17672
17673/// The destination big query dataset to export findings to.
17674#[derive(Clone, Default, PartialEq)]
17675#[non_exhaustive]
17676pub struct BigQueryDestination {
17677 /// Required. The relative resource name of the destination dataset, in the
17678 /// form projects/{projectId}/datasets/{datasetId}.
17679 pub dataset: std::string::String,
17680
17681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17682}
17683
17684impl BigQueryDestination {
17685 pub fn new() -> Self {
17686 std::default::Default::default()
17687 }
17688
17689 /// Sets the value of [dataset][crate::model::BigQueryDestination::dataset].
17690 ///
17691 /// # Example
17692 /// ```ignore,no_run
17693 /// # use google_cloud_securitycenter_v2::model::BigQueryDestination;
17694 /// let x = BigQueryDestination::new().set_dataset("example");
17695 /// ```
17696 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17697 self.dataset = v.into();
17698 self
17699 }
17700}
17701
17702impl wkt::message::Message for BigQueryDestination {
17703 fn typename() -> &'static str {
17704 "type.googleapis.com/google.cloud.securitycenter.v2.BigQueryDestination"
17705 }
17706}
17707
17708/// The LRO metadata for a ExportFindings request.
17709#[derive(Clone, Default, PartialEq)]
17710#[non_exhaustive]
17711pub struct ExportFindingsMetadata {
17712 /// Optional. Timestamp at which export was started
17713 pub export_start_time: std::option::Option<wkt::Timestamp>,
17714
17715 /// The destination to export findings to.
17716 pub destination: std::option::Option<crate::model::export_findings_metadata::Destination>,
17717
17718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17719}
17720
17721impl ExportFindingsMetadata {
17722 pub fn new() -> Self {
17723 std::default::Default::default()
17724 }
17725
17726 /// Sets the value of [export_start_time][crate::model::ExportFindingsMetadata::export_start_time].
17727 ///
17728 /// # Example
17729 /// ```ignore,no_run
17730 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17731 /// use wkt::Timestamp;
17732 /// let x = ExportFindingsMetadata::new().set_export_start_time(Timestamp::default()/* use setters */);
17733 /// ```
17734 pub fn set_export_start_time<T>(mut self, v: T) -> Self
17735 where
17736 T: std::convert::Into<wkt::Timestamp>,
17737 {
17738 self.export_start_time = std::option::Option::Some(v.into());
17739 self
17740 }
17741
17742 /// Sets or clears the value of [export_start_time][crate::model::ExportFindingsMetadata::export_start_time].
17743 ///
17744 /// # Example
17745 /// ```ignore,no_run
17746 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17747 /// use wkt::Timestamp;
17748 /// let x = ExportFindingsMetadata::new().set_or_clear_export_start_time(Some(Timestamp::default()/* use setters */));
17749 /// let x = ExportFindingsMetadata::new().set_or_clear_export_start_time(None::<Timestamp>);
17750 /// ```
17751 pub fn set_or_clear_export_start_time<T>(mut self, v: std::option::Option<T>) -> Self
17752 where
17753 T: std::convert::Into<wkt::Timestamp>,
17754 {
17755 self.export_start_time = v.map(|x| x.into());
17756 self
17757 }
17758
17759 /// Sets the value of [destination][crate::model::ExportFindingsMetadata::destination].
17760 ///
17761 /// Note that all the setters affecting `destination` are mutually
17762 /// exclusive.
17763 ///
17764 /// # Example
17765 /// ```ignore,no_run
17766 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17767 /// use google_cloud_securitycenter_v2::model::BigQueryDestination;
17768 /// let x = ExportFindingsMetadata::new().set_destination(Some(
17769 /// google_cloud_securitycenter_v2::model::export_findings_metadata::Destination::BigQueryDestination(BigQueryDestination::default().into())));
17770 /// ```
17771 pub fn set_destination<
17772 T: std::convert::Into<
17773 std::option::Option<crate::model::export_findings_metadata::Destination>,
17774 >,
17775 >(
17776 mut self,
17777 v: T,
17778 ) -> Self {
17779 self.destination = v.into();
17780 self
17781 }
17782
17783 /// The value of [destination][crate::model::ExportFindingsMetadata::destination]
17784 /// if it holds a `BigQueryDestination`, `None` if the field is not set or
17785 /// holds a different branch.
17786 pub fn big_query_destination(
17787 &self,
17788 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestination>> {
17789 #[allow(unreachable_patterns)]
17790 self.destination.as_ref().and_then(|v| match v {
17791 crate::model::export_findings_metadata::Destination::BigQueryDestination(v) => {
17792 std::option::Option::Some(v)
17793 }
17794 _ => std::option::Option::None,
17795 })
17796 }
17797
17798 /// Sets the value of [destination][crate::model::ExportFindingsMetadata::destination]
17799 /// to hold a `BigQueryDestination`.
17800 ///
17801 /// Note that all the setters affecting `destination` are
17802 /// mutually exclusive.
17803 ///
17804 /// # Example
17805 /// ```ignore,no_run
17806 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17807 /// use google_cloud_securitycenter_v2::model::BigQueryDestination;
17808 /// let x = ExportFindingsMetadata::new().set_big_query_destination(BigQueryDestination::default()/* use setters */);
17809 /// assert!(x.big_query_destination().is_some());
17810 /// ```
17811 pub fn set_big_query_destination<
17812 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestination>>,
17813 >(
17814 mut self,
17815 v: T,
17816 ) -> Self {
17817 self.destination = std::option::Option::Some(
17818 crate::model::export_findings_metadata::Destination::BigQueryDestination(v.into()),
17819 );
17820 self
17821 }
17822}
17823
17824impl wkt::message::Message for ExportFindingsMetadata {
17825 fn typename() -> &'static str {
17826 "type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsMetadata"
17827 }
17828}
17829
17830/// Defines additional types related to [ExportFindingsMetadata].
17831pub mod export_findings_metadata {
17832 #[allow(unused_imports)]
17833 use super::*;
17834
17835 /// The destination to export findings to.
17836 #[derive(Clone, Debug, PartialEq)]
17837 #[non_exhaustive]
17838 pub enum Destination {
17839 /// Required. The destination big query dataset to export findings to.
17840 BigQueryDestination(std::boxed::Box<crate::model::BigQueryDestination>),
17841 }
17842}
17843
17844/// The response to a ExportFindings request. Contains the LRO information.
17845#[derive(Clone, Default, PartialEq)]
17846#[non_exhaustive]
17847pub struct ExportFindingsResponse {
17848 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17849}
17850
17851impl ExportFindingsResponse {
17852 pub fn new() -> Self {
17853 std::default::Default::default()
17854 }
17855}
17856
17857impl wkt::message::Message for ExportFindingsResponse {
17858 fn typename() -> &'static str {
17859 "type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsResponse"
17860 }
17861}
17862
17863/// Request message for retrieving a BigQuery export.
17864#[derive(Clone, Default, PartialEq)]
17865#[non_exhaustive]
17866pub struct GetBigQueryExportRequest {
17867 /// Required. Name of the BigQuery export to retrieve. The following list shows
17868 /// some examples of the format:
17869 ///
17870 ///
17871 /// `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
17872 ///
17873 /// + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
17874 /// + `projects/{project}locations/{location}//bigQueryExports/{export_id}`
17875 pub name: std::string::String,
17876
17877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17878}
17879
17880impl GetBigQueryExportRequest {
17881 pub fn new() -> Self {
17882 std::default::Default::default()
17883 }
17884
17885 /// Sets the value of [name][crate::model::GetBigQueryExportRequest::name].
17886 ///
17887 /// # Example
17888 /// ```ignore,no_run
17889 /// # use google_cloud_securitycenter_v2::model::GetBigQueryExportRequest;
17890 /// let x = GetBigQueryExportRequest::new().set_name("example");
17891 /// ```
17892 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17893 self.name = v.into();
17894 self
17895 }
17896}
17897
17898impl wkt::message::Message for GetBigQueryExportRequest {
17899 fn typename() -> &'static str {
17900 "type.googleapis.com/google.cloud.securitycenter.v2.GetBigQueryExportRequest"
17901 }
17902}
17903
17904/// Request message for retrieving a mute config. If no location is specified,
17905/// default is global.
17906#[derive(Clone, Default, PartialEq)]
17907#[non_exhaustive]
17908pub struct GetMuteConfigRequest {
17909 /// Required. Name of the mute config to retrieve. The following list shows
17910 /// some examples of the format:
17911 ///
17912 /// + `organizations/{organization}/muteConfigs/{config_id}`
17913 ///
17914 /// `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
17915 ///
17916 /// + `folders/{folder}/muteConfigs/{config_id}`
17917 /// + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
17918 /// + `projects/{project}/muteConfigs/{config_id}`
17919 /// + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
17920 pub name: std::string::String,
17921
17922 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17923}
17924
17925impl GetMuteConfigRequest {
17926 pub fn new() -> Self {
17927 std::default::Default::default()
17928 }
17929
17930 /// Sets the value of [name][crate::model::GetMuteConfigRequest::name].
17931 ///
17932 /// # Example
17933 /// ```ignore,no_run
17934 /// # use google_cloud_securitycenter_v2::model::GetMuteConfigRequest;
17935 /// let x = GetMuteConfigRequest::new().set_name("example");
17936 /// ```
17937 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17938 self.name = v.into();
17939 self
17940 }
17941}
17942
17943impl wkt::message::Message for GetMuteConfigRequest {
17944 fn typename() -> &'static str {
17945 "type.googleapis.com/google.cloud.securitycenter.v2.GetMuteConfigRequest"
17946 }
17947}
17948
17949/// Request message for getting a notification config.
17950#[derive(Clone, Default, PartialEq)]
17951#[non_exhaustive]
17952pub struct GetNotificationConfigRequest {
17953 /// Required. Name of the notification config to get. The following list shows
17954 /// some examples of the format:
17955 ///
17956 ///
17957 /// `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
17958 /// +
17959 /// `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]`
17960 /// +
17961 /// `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]`
17962 pub name: std::string::String,
17963
17964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17965}
17966
17967impl GetNotificationConfigRequest {
17968 pub fn new() -> Self {
17969 std::default::Default::default()
17970 }
17971
17972 /// Sets the value of [name][crate::model::GetNotificationConfigRequest::name].
17973 ///
17974 /// # Example
17975 /// ```ignore,no_run
17976 /// # use google_cloud_securitycenter_v2::model::GetNotificationConfigRequest;
17977 /// let x = GetNotificationConfigRequest::new().set_name("example");
17978 /// ```
17979 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17980 self.name = v.into();
17981 self
17982 }
17983}
17984
17985impl wkt::message::Message for GetNotificationConfigRequest {
17986 fn typename() -> &'static str {
17987 "type.googleapis.com/google.cloud.securitycenter.v2.GetNotificationConfigRequest"
17988 }
17989}
17990
17991/// Request message to get resource value config
17992#[derive(Clone, Default, PartialEq)]
17993#[non_exhaustive]
17994pub struct GetResourceValueConfigRequest {
17995 /// Required. Name of the resource value config to retrieve. Its format is
17996 /// organizations/{organization}/resourceValueConfigs/{config_id}.
17997 pub name: std::string::String,
17998
17999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18000}
18001
18002impl GetResourceValueConfigRequest {
18003 pub fn new() -> Self {
18004 std::default::Default::default()
18005 }
18006
18007 /// Sets the value of [name][crate::model::GetResourceValueConfigRequest::name].
18008 ///
18009 /// # Example
18010 /// ```ignore,no_run
18011 /// # use google_cloud_securitycenter_v2::model::GetResourceValueConfigRequest;
18012 /// let x = GetResourceValueConfigRequest::new().set_name("example");
18013 /// ```
18014 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18015 self.name = v.into();
18016 self
18017 }
18018}
18019
18020impl wkt::message::Message for GetResourceValueConfigRequest {
18021 fn typename() -> &'static str {
18022 "type.googleapis.com/google.cloud.securitycenter.v2.GetResourceValueConfigRequest"
18023 }
18024}
18025
18026/// Request message for getting a source.
18027#[derive(Clone, Default, PartialEq)]
18028#[non_exhaustive]
18029pub struct GetSourceRequest {
18030 /// Required. Relative resource name of the source. Its format is
18031 /// `organizations/[organization_id]/source/[source_id]`.
18032 pub name: std::string::String,
18033
18034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18035}
18036
18037impl GetSourceRequest {
18038 pub fn new() -> Self {
18039 std::default::Default::default()
18040 }
18041
18042 /// Sets the value of [name][crate::model::GetSourceRequest::name].
18043 ///
18044 /// # Example
18045 /// ```ignore,no_run
18046 /// # use google_cloud_securitycenter_v2::model::GetSourceRequest;
18047 /// let x = GetSourceRequest::new().set_name("example");
18048 /// ```
18049 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18050 self.name = v.into();
18051 self
18052 }
18053}
18054
18055impl wkt::message::Message for GetSourceRequest {
18056 fn typename() -> &'static str {
18057 "type.googleapis.com/google.cloud.securitycenter.v2.GetSourceRequest"
18058 }
18059}
18060
18061/// Request message for grouping by findings.
18062#[derive(Clone, Default, PartialEq)]
18063#[non_exhaustive]
18064pub struct GroupFindingsRequest {
18065 /// Required. Name of the source to groupBy. If no location is specified,
18066 /// finding is assumed to be in global.
18067 /// The following list shows some examples:
18068 ///
18069 /// + `organizations/[organization_id]/sources/[source_id]`
18070 ///
18071 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
18072 ///
18073 /// + `folders/[folder_id]/sources/[source_id]`
18074 /// + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
18075 /// + `projects/[project_id]/sources/[source_id]`
18076 /// + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
18077 ///
18078 /// To groupBy across all sources provide a source_id of `-`. The following
18079 /// list shows some examples:
18080 ///
18081 /// + `organizations/{organization_id}/sources/-`
18082 /// + `organizations/{organization_id}/sources/-/locations/[location_id]`
18083 /// + `folders/{folder_id}/sources/-`
18084 /// + `folders/{folder_id}/sources/-/locations/[location_id]`
18085 /// + `projects/{project_id}/sources/-`
18086 /// + `projects/{project_id}/sources/-/locations/[location_id]`
18087 pub parent: std::string::String,
18088
18089 /// Expression that defines the filter to apply across findings.
18090 /// The expression is a list of one or more restrictions combined via logical
18091 /// operators `AND` and `OR`.
18092 /// Parentheses are supported, and `OR` has higher precedence than `AND`.
18093 ///
18094 /// Restrictions have the form `<field> <operator> <value>` and may have a `-`
18095 /// character in front of them to indicate negation. Examples include:
18096 ///
18097 /// * name
18098 /// * security_marks.marks.marka
18099 ///
18100 /// The supported operators are:
18101 ///
18102 /// * `=` for all value types.
18103 /// * `>`, `<`, `>=`, `<=` for integer values.
18104 /// * `:`, meaning substring matching, for strings.
18105 ///
18106 /// The supported value types are:
18107 ///
18108 /// * string literals in quotes.
18109 /// * integer literals without quotes.
18110 /// * boolean literals `true` and `false` without quotes.
18111 ///
18112 /// The following field and operator combinations are supported:
18113 ///
18114 /// * name: `=`
18115 ///
18116 /// * parent: `=`, `:`
18117 ///
18118 /// * resource_name: `=`, `:`
18119 ///
18120 /// * state: `=`, `:`
18121 ///
18122 /// * category: `=`, `:`
18123 ///
18124 /// * external_uri: `=`, `:`
18125 ///
18126 /// * event_time: `=`, `>`, `<`, `>=`, `<=`
18127 ///
18128 /// Usage: This should be milliseconds since epoch or an RFC3339 string.
18129 /// Examples:
18130 /// `event_time = "2019-06-10T16:07:18-07:00"`
18131 /// `event_time = 1560208038000`
18132 ///
18133 /// * severity: `=`, `:`
18134 ///
18135 /// * security_marks.marks: `=`, `:`
18136 ///
18137 /// * resource:
18138 ///
18139 /// * resource.name: `=`, `:`
18140 /// * resource.parent_name: `=`, `:`
18141 /// * resource.parent_display_name: `=`, `:`
18142 /// * resource.project_name: `=`, `:`
18143 /// * resource.project_display_name: `=`, `:`
18144 /// * resource.type: `=`, `:`
18145 pub filter: std::string::String,
18146
18147 /// Required. Expression that defines what assets fields to use for grouping.
18148 /// The string value should follow SQL syntax: comma separated list of fields.
18149 /// For example: "parent,resource_name".
18150 pub group_by: std::string::String,
18151
18152 /// The value returned by the last `GroupFindingsResponse`; indicates
18153 /// that this is a continuation of a prior `GroupFindings` call, and
18154 /// that the system should return the next page of data.
18155 pub page_token: std::string::String,
18156
18157 /// The maximum number of results to return in a single response. Default is
18158 /// 10, minimum is 1, maximum is 1000.
18159 pub page_size: i32,
18160
18161 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18162}
18163
18164impl GroupFindingsRequest {
18165 pub fn new() -> Self {
18166 std::default::Default::default()
18167 }
18168
18169 /// Sets the value of [parent][crate::model::GroupFindingsRequest::parent].
18170 ///
18171 /// # Example
18172 /// ```ignore,no_run
18173 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18174 /// let x = GroupFindingsRequest::new().set_parent("example");
18175 /// ```
18176 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18177 self.parent = v.into();
18178 self
18179 }
18180
18181 /// Sets the value of [filter][crate::model::GroupFindingsRequest::filter].
18182 ///
18183 /// # Example
18184 /// ```ignore,no_run
18185 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18186 /// let x = GroupFindingsRequest::new().set_filter("example");
18187 /// ```
18188 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18189 self.filter = v.into();
18190 self
18191 }
18192
18193 /// Sets the value of [group_by][crate::model::GroupFindingsRequest::group_by].
18194 ///
18195 /// # Example
18196 /// ```ignore,no_run
18197 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18198 /// let x = GroupFindingsRequest::new().set_group_by("example");
18199 /// ```
18200 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18201 self.group_by = v.into();
18202 self
18203 }
18204
18205 /// Sets the value of [page_token][crate::model::GroupFindingsRequest::page_token].
18206 ///
18207 /// # Example
18208 /// ```ignore,no_run
18209 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18210 /// let x = GroupFindingsRequest::new().set_page_token("example");
18211 /// ```
18212 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18213 self.page_token = v.into();
18214 self
18215 }
18216
18217 /// Sets the value of [page_size][crate::model::GroupFindingsRequest::page_size].
18218 ///
18219 /// # Example
18220 /// ```ignore,no_run
18221 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18222 /// let x = GroupFindingsRequest::new().set_page_size(42);
18223 /// ```
18224 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18225 self.page_size = v.into();
18226 self
18227 }
18228}
18229
18230impl wkt::message::Message for GroupFindingsRequest {
18231 fn typename() -> &'static str {
18232 "type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsRequest"
18233 }
18234}
18235
18236/// Response message for group by findings.
18237#[derive(Clone, Default, PartialEq)]
18238#[non_exhaustive]
18239pub struct GroupFindingsResponse {
18240 /// Group results. There exists an element for each existing unique
18241 /// combination of property/values. The element contains a count for the number
18242 /// of times those specific property/values appear.
18243 pub group_by_results: std::vec::Vec<crate::model::GroupResult>,
18244
18245 /// Token to retrieve the next page of results, or empty if there are no more
18246 /// results.
18247 pub next_page_token: std::string::String,
18248
18249 /// The total number of results matching the query.
18250 pub total_size: i32,
18251
18252 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18253}
18254
18255impl GroupFindingsResponse {
18256 pub fn new() -> Self {
18257 std::default::Default::default()
18258 }
18259
18260 /// Sets the value of [group_by_results][crate::model::GroupFindingsResponse::group_by_results].
18261 ///
18262 /// # Example
18263 /// ```ignore,no_run
18264 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18265 /// use google_cloud_securitycenter_v2::model::GroupResult;
18266 /// let x = GroupFindingsResponse::new()
18267 /// .set_group_by_results([
18268 /// GroupResult::default()/* use setters */,
18269 /// GroupResult::default()/* use (different) setters */,
18270 /// ]);
18271 /// ```
18272 pub fn set_group_by_results<T, V>(mut self, v: T) -> Self
18273 where
18274 T: std::iter::IntoIterator<Item = V>,
18275 V: std::convert::Into<crate::model::GroupResult>,
18276 {
18277 use std::iter::Iterator;
18278 self.group_by_results = v.into_iter().map(|i| i.into()).collect();
18279 self
18280 }
18281
18282 /// Sets the value of [next_page_token][crate::model::GroupFindingsResponse::next_page_token].
18283 ///
18284 /// # Example
18285 /// ```ignore,no_run
18286 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18287 /// let x = GroupFindingsResponse::new().set_next_page_token("example");
18288 /// ```
18289 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18290 self.next_page_token = v.into();
18291 self
18292 }
18293
18294 /// Sets the value of [total_size][crate::model::GroupFindingsResponse::total_size].
18295 ///
18296 /// # Example
18297 /// ```ignore,no_run
18298 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18299 /// let x = GroupFindingsResponse::new().set_total_size(42);
18300 /// ```
18301 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18302 self.total_size = v.into();
18303 self
18304 }
18305}
18306
18307impl wkt::message::Message for GroupFindingsResponse {
18308 fn typename() -> &'static str {
18309 "type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsResponse"
18310 }
18311}
18312
18313#[doc(hidden)]
18314impl google_cloud_gax::paginator::internal::PageableResponse for GroupFindingsResponse {
18315 type PageItem = crate::model::GroupResult;
18316
18317 fn items(self) -> std::vec::Vec<Self::PageItem> {
18318 self.group_by_results
18319 }
18320
18321 fn next_page_token(&self) -> std::string::String {
18322 use std::clone::Clone;
18323 self.next_page_token.clone()
18324 }
18325}
18326
18327/// Result containing the properties and count of a groupBy request.
18328#[derive(Clone, Default, PartialEq)]
18329#[non_exhaustive]
18330pub struct GroupResult {
18331 /// Properties matching the groupBy fields in the request.
18332 pub properties: std::collections::HashMap<std::string::String, wkt::Value>,
18333
18334 /// Total count of resources for the given properties.
18335 pub count: i64,
18336
18337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18338}
18339
18340impl GroupResult {
18341 pub fn new() -> Self {
18342 std::default::Default::default()
18343 }
18344
18345 /// Sets the value of [properties][crate::model::GroupResult::properties].
18346 ///
18347 /// # Example
18348 /// ```ignore,no_run
18349 /// # use google_cloud_securitycenter_v2::model::GroupResult;
18350 /// use wkt::Value;
18351 /// let x = GroupResult::new().set_properties([
18352 /// ("key0", Value::default()/* use setters */),
18353 /// ("key1", Value::default()/* use (different) setters */),
18354 /// ]);
18355 /// ```
18356 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
18357 where
18358 T: std::iter::IntoIterator<Item = (K, V)>,
18359 K: std::convert::Into<std::string::String>,
18360 V: std::convert::Into<wkt::Value>,
18361 {
18362 use std::iter::Iterator;
18363 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18364 self
18365 }
18366
18367 /// Sets the value of [count][crate::model::GroupResult::count].
18368 ///
18369 /// # Example
18370 /// ```ignore,no_run
18371 /// # use google_cloud_securitycenter_v2::model::GroupResult;
18372 /// let x = GroupResult::new().set_count(42);
18373 /// ```
18374 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18375 self.count = v.into();
18376 self
18377 }
18378}
18379
18380impl wkt::message::Message for GroupResult {
18381 fn typename() -> &'static str {
18382 "type.googleapis.com/google.cloud.securitycenter.v2.GroupResult"
18383 }
18384}
18385
18386/// Request message for listing the attack paths for a given simulation or valued
18387/// resource.
18388#[derive(Clone, Default, PartialEq)]
18389#[non_exhaustive]
18390pub struct ListAttackPathsRequest {
18391 /// Required. Name of parent to list attack paths.
18392 ///
18393 /// Valid formats:
18394 /// `organizations/{organization}`,
18395 /// `organizations/{organization}/simulations/{simulation}`
18396 /// `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
18397 /// `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
18398 pub parent: std::string::String,
18399
18400 /// The filter expression that filters the attack path in the response.
18401 /// Supported fields:
18402 ///
18403 /// * `valued_resources` supports =
18404 pub filter: std::string::String,
18405
18406 /// The value returned by the last `ListAttackPathsResponse`; indicates
18407 /// that this is a continuation of a prior `ListAttackPaths` call, and
18408 /// that the system should return the next page of data.
18409 pub page_token: std::string::String,
18410
18411 /// The maximum number of results to return in a single response. Default is
18412 /// 10, minimum is 1, maximum is 1000.
18413 pub page_size: i32,
18414
18415 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18416}
18417
18418impl ListAttackPathsRequest {
18419 pub fn new() -> Self {
18420 std::default::Default::default()
18421 }
18422
18423 /// Sets the value of [parent][crate::model::ListAttackPathsRequest::parent].
18424 ///
18425 /// # Example
18426 /// ```ignore,no_run
18427 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18428 /// let x = ListAttackPathsRequest::new().set_parent("example");
18429 /// ```
18430 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18431 self.parent = v.into();
18432 self
18433 }
18434
18435 /// Sets the value of [filter][crate::model::ListAttackPathsRequest::filter].
18436 ///
18437 /// # Example
18438 /// ```ignore,no_run
18439 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18440 /// let x = ListAttackPathsRequest::new().set_filter("example");
18441 /// ```
18442 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18443 self.filter = v.into();
18444 self
18445 }
18446
18447 /// Sets the value of [page_token][crate::model::ListAttackPathsRequest::page_token].
18448 ///
18449 /// # Example
18450 /// ```ignore,no_run
18451 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18452 /// let x = ListAttackPathsRequest::new().set_page_token("example");
18453 /// ```
18454 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18455 self.page_token = v.into();
18456 self
18457 }
18458
18459 /// Sets the value of [page_size][crate::model::ListAttackPathsRequest::page_size].
18460 ///
18461 /// # Example
18462 /// ```ignore,no_run
18463 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18464 /// let x = ListAttackPathsRequest::new().set_page_size(42);
18465 /// ```
18466 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18467 self.page_size = v.into();
18468 self
18469 }
18470}
18471
18472impl wkt::message::Message for ListAttackPathsRequest {
18473 fn typename() -> &'static str {
18474 "type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsRequest"
18475 }
18476}
18477
18478/// Response message for listing the attack paths for a given simulation or
18479/// valued resource.
18480#[derive(Clone, Default, PartialEq)]
18481#[non_exhaustive]
18482pub struct ListAttackPathsResponse {
18483 /// The attack paths that the attack path simulation identified.
18484 pub attack_paths: std::vec::Vec<crate::model::AttackPath>,
18485
18486 /// Token to retrieve the next page of results, or empty if there are no more
18487 /// results.
18488 pub next_page_token: std::string::String,
18489
18490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18491}
18492
18493impl ListAttackPathsResponse {
18494 pub fn new() -> Self {
18495 std::default::Default::default()
18496 }
18497
18498 /// Sets the value of [attack_paths][crate::model::ListAttackPathsResponse::attack_paths].
18499 ///
18500 /// # Example
18501 /// ```ignore,no_run
18502 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsResponse;
18503 /// use google_cloud_securitycenter_v2::model::AttackPath;
18504 /// let x = ListAttackPathsResponse::new()
18505 /// .set_attack_paths([
18506 /// AttackPath::default()/* use setters */,
18507 /// AttackPath::default()/* use (different) setters */,
18508 /// ]);
18509 /// ```
18510 pub fn set_attack_paths<T, V>(mut self, v: T) -> Self
18511 where
18512 T: std::iter::IntoIterator<Item = V>,
18513 V: std::convert::Into<crate::model::AttackPath>,
18514 {
18515 use std::iter::Iterator;
18516 self.attack_paths = v.into_iter().map(|i| i.into()).collect();
18517 self
18518 }
18519
18520 /// Sets the value of [next_page_token][crate::model::ListAttackPathsResponse::next_page_token].
18521 ///
18522 /// # Example
18523 /// ```ignore,no_run
18524 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsResponse;
18525 /// let x = ListAttackPathsResponse::new().set_next_page_token("example");
18526 /// ```
18527 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18528 self.next_page_token = v.into();
18529 self
18530 }
18531}
18532
18533impl wkt::message::Message for ListAttackPathsResponse {
18534 fn typename() -> &'static str {
18535 "type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsResponse"
18536 }
18537}
18538
18539#[doc(hidden)]
18540impl google_cloud_gax::paginator::internal::PageableResponse for ListAttackPathsResponse {
18541 type PageItem = crate::model::AttackPath;
18542
18543 fn items(self) -> std::vec::Vec<Self::PageItem> {
18544 self.attack_paths
18545 }
18546
18547 fn next_page_token(&self) -> std::string::String {
18548 use std::clone::Clone;
18549 self.next_page_token.clone()
18550 }
18551}
18552
18553/// Request message for getting simulation.
18554/// Simulation name can include "latest" to retrieve the latest simulation
18555/// For example, "organizations/123/simulations/latest"
18556#[derive(Clone, Default, PartialEq)]
18557#[non_exhaustive]
18558pub struct GetSimulationRequest {
18559 /// Required. The organization name or simulation name of this simulation
18560 ///
18561 /// Valid format:
18562 /// `organizations/{organization}/simulations/latest`
18563 /// `organizations/{organization}/simulations/{simulation}`
18564 pub name: std::string::String,
18565
18566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18567}
18568
18569impl GetSimulationRequest {
18570 pub fn new() -> Self {
18571 std::default::Default::default()
18572 }
18573
18574 /// Sets the value of [name][crate::model::GetSimulationRequest::name].
18575 ///
18576 /// # Example
18577 /// ```ignore,no_run
18578 /// # use google_cloud_securitycenter_v2::model::GetSimulationRequest;
18579 /// let x = GetSimulationRequest::new().set_name("example");
18580 /// ```
18581 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18582 self.name = v.into();
18583 self
18584 }
18585}
18586
18587impl wkt::message::Message for GetSimulationRequest {
18588 fn typename() -> &'static str {
18589 "type.googleapis.com/google.cloud.securitycenter.v2.GetSimulationRequest"
18590 }
18591}
18592
18593/// Request message for getting a valued resource.
18594#[derive(Clone, Default, PartialEq)]
18595#[non_exhaustive]
18596pub struct GetValuedResourceRequest {
18597 /// Required. The name of this valued resource
18598 ///
18599 /// Valid format:
18600 /// `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
18601 pub name: std::string::String,
18602
18603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18604}
18605
18606impl GetValuedResourceRequest {
18607 pub fn new() -> Self {
18608 std::default::Default::default()
18609 }
18610
18611 /// Sets the value of [name][crate::model::GetValuedResourceRequest::name].
18612 ///
18613 /// # Example
18614 /// ```ignore,no_run
18615 /// # use google_cloud_securitycenter_v2::model::GetValuedResourceRequest;
18616 /// let x = GetValuedResourceRequest::new().set_name("example");
18617 /// ```
18618 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18619 self.name = v.into();
18620 self
18621 }
18622}
18623
18624impl wkt::message::Message for GetValuedResourceRequest {
18625 fn typename() -> &'static str {
18626 "type.googleapis.com/google.cloud.securitycenter.v2.GetValuedResourceRequest"
18627 }
18628}
18629
18630/// Request message for listing BigQuery exports at a given scope e.g.
18631/// organization, folder or project.
18632#[derive(Clone, Default, PartialEq)]
18633#[non_exhaustive]
18634pub struct ListBigQueryExportsRequest {
18635 /// Required. The parent, which owns the collection of BigQuery exports. Its
18636 /// format is `organizations/[organization_id]/locations/[location_id]`,
18637 /// `folders/[folder_id]/locations/[location_id]`, or
18638 /// `projects/[project_id]/locations/[location_id]`.
18639 pub parent: std::string::String,
18640
18641 /// The maximum number of configs to return. The service may return fewer than
18642 /// this value.
18643 /// If unspecified, at most 10 configs will be returned.
18644 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
18645 pub page_size: i32,
18646
18647 /// A page token, received from a previous `ListBigQueryExports` call.
18648 /// Provide this to retrieve the subsequent page.
18649 /// When paginating, all other parameters provided to `ListBigQueryExports`
18650 /// must match the call that provided the page token.
18651 pub page_token: std::string::String,
18652
18653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18654}
18655
18656impl ListBigQueryExportsRequest {
18657 pub fn new() -> Self {
18658 std::default::Default::default()
18659 }
18660
18661 /// Sets the value of [parent][crate::model::ListBigQueryExportsRequest::parent].
18662 ///
18663 /// # Example
18664 /// ```ignore,no_run
18665 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18666 /// let x = ListBigQueryExportsRequest::new().set_parent("example");
18667 /// ```
18668 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18669 self.parent = v.into();
18670 self
18671 }
18672
18673 /// Sets the value of [page_size][crate::model::ListBigQueryExportsRequest::page_size].
18674 ///
18675 /// # Example
18676 /// ```ignore,no_run
18677 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18678 /// let x = ListBigQueryExportsRequest::new().set_page_size(42);
18679 /// ```
18680 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18681 self.page_size = v.into();
18682 self
18683 }
18684
18685 /// Sets the value of [page_token][crate::model::ListBigQueryExportsRequest::page_token].
18686 ///
18687 /// # Example
18688 /// ```ignore,no_run
18689 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18690 /// let x = ListBigQueryExportsRequest::new().set_page_token("example");
18691 /// ```
18692 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18693 self.page_token = v.into();
18694 self
18695 }
18696}
18697
18698impl wkt::message::Message for ListBigQueryExportsRequest {
18699 fn typename() -> &'static str {
18700 "type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsRequest"
18701 }
18702}
18703
18704/// Response message for listing BigQuery exports.
18705#[derive(Clone, Default, PartialEq)]
18706#[non_exhaustive]
18707pub struct ListBigQueryExportsResponse {
18708 /// The BigQuery exports from the specified parent.
18709 pub big_query_exports: std::vec::Vec<crate::model::BigQueryExport>,
18710
18711 /// A token, which can be sent as `page_token` to retrieve the next page.
18712 /// If this field is omitted, there are no subsequent pages.
18713 pub next_page_token: std::string::String,
18714
18715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18716}
18717
18718impl ListBigQueryExportsResponse {
18719 pub fn new() -> Self {
18720 std::default::Default::default()
18721 }
18722
18723 /// Sets the value of [big_query_exports][crate::model::ListBigQueryExportsResponse::big_query_exports].
18724 ///
18725 /// # Example
18726 /// ```ignore,no_run
18727 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsResponse;
18728 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
18729 /// let x = ListBigQueryExportsResponse::new()
18730 /// .set_big_query_exports([
18731 /// BigQueryExport::default()/* use setters */,
18732 /// BigQueryExport::default()/* use (different) setters */,
18733 /// ]);
18734 /// ```
18735 pub fn set_big_query_exports<T, V>(mut self, v: T) -> Self
18736 where
18737 T: std::iter::IntoIterator<Item = V>,
18738 V: std::convert::Into<crate::model::BigQueryExport>,
18739 {
18740 use std::iter::Iterator;
18741 self.big_query_exports = v.into_iter().map(|i| i.into()).collect();
18742 self
18743 }
18744
18745 /// Sets the value of [next_page_token][crate::model::ListBigQueryExportsResponse::next_page_token].
18746 ///
18747 /// # Example
18748 /// ```ignore,no_run
18749 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsResponse;
18750 /// let x = ListBigQueryExportsResponse::new().set_next_page_token("example");
18751 /// ```
18752 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18753 self.next_page_token = v.into();
18754 self
18755 }
18756}
18757
18758impl wkt::message::Message for ListBigQueryExportsResponse {
18759 fn typename() -> &'static str {
18760 "type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsResponse"
18761 }
18762}
18763
18764#[doc(hidden)]
18765impl google_cloud_gax::paginator::internal::PageableResponse for ListBigQueryExportsResponse {
18766 type PageItem = crate::model::BigQueryExport;
18767
18768 fn items(self) -> std::vec::Vec<Self::PageItem> {
18769 self.big_query_exports
18770 }
18771
18772 fn next_page_token(&self) -> std::string::String {
18773 use std::clone::Clone;
18774 self.next_page_token.clone()
18775 }
18776}
18777
18778/// Request message for listing findings.
18779#[derive(Clone, Default, PartialEq)]
18780#[non_exhaustive]
18781pub struct ListFindingsRequest {
18782 /// Required. Name of the source the findings belong to. If no location is
18783 /// specified, the default is global. The following list shows some examples:
18784 ///
18785 /// + `organizations/[organization_id]/sources/[source_id]`
18786 ///
18787 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
18788 ///
18789 /// + `folders/[folder_id]/sources/[source_id]`
18790 /// + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
18791 /// + `projects/[project_id]/sources/[source_id]`
18792 /// + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
18793 ///
18794 /// To list across all sources provide a source_id of `-`. The following
18795 /// list shows some examples:
18796 ///
18797 /// + `organizations/{organization_id}/sources/-`
18798 /// + `organizations/{organization_id}/sources/-/locations/{location_id}`
18799 /// + `folders/{folder_id}/sources/-`
18800 /// + `folders/{folder_id}/sources/-locations/{location_id}`
18801 /// + `projects/{projects_id}/sources/-`
18802 /// + `projects/{projects_id}/sources/-/locations/{location_id}`
18803 pub parent: std::string::String,
18804
18805 /// Expression that defines the filter to apply across findings.
18806 /// The expression is a list of one or more restrictions combined via logical
18807 /// operators `AND` and `OR`.
18808 /// Parentheses are supported, and `OR` has higher precedence than `AND`.
18809 ///
18810 /// Restrictions have the form `<field> <operator> <value>` and may have a `-`
18811 /// character in front of them to indicate negation. Examples include:
18812 ///
18813 /// * name
18814 /// * security_marks.marks.marka
18815 ///
18816 /// The supported operators are:
18817 ///
18818 /// * `=` for all value types.
18819 /// * `>`, `<`, `>=`, `<=` for integer values.
18820 /// * `:`, meaning substring matching, for strings.
18821 ///
18822 /// The supported value types are:
18823 ///
18824 /// * string literals in quotes.
18825 /// * integer literals without quotes.
18826 /// * boolean literals `true` and `false` without quotes.
18827 ///
18828 /// The following field and operator combinations are supported:
18829 ///
18830 /// * name: `=`
18831 ///
18832 /// * parent: `=`, `:`
18833 ///
18834 /// * resource_name: `=`, `:`
18835 ///
18836 /// * state: `=`, `:`
18837 ///
18838 /// * category: `=`, `:`
18839 ///
18840 /// * external_uri: `=`, `:`
18841 ///
18842 /// * event_time: `=`, `>`, `<`, `>=`, `<=`
18843 ///
18844 /// Usage: This should be milliseconds since epoch or an RFC3339 string.
18845 /// Examples:
18846 /// `event_time = "2019-06-10T16:07:18-07:00"`
18847 /// `event_time = 1560208038000`
18848 ///
18849 /// * severity: `=`, `:`
18850 ///
18851 /// * security_marks.marks: `=`, `:`
18852 ///
18853 /// * resource:
18854 ///
18855 /// * resource.name: `=`, `:`
18856 /// * resource.parent_name: `=`, `:`
18857 /// * resource.parent_display_name: `=`, `:`
18858 /// * resource.project_name: `=`, `:`
18859 /// * resource.project_display_name: `=`, `:`
18860 /// * resource.type: `=`, `:`
18861 /// * resource.folders.resource_folder: `=`, `:`
18862 /// * resource.display_name: `=`, `:`
18863 pub filter: std::string::String,
18864
18865 /// Expression that defines what fields and order to use for sorting. The
18866 /// string value should follow SQL syntax: comma separated list of fields. For
18867 /// example: "name,parent". The default sorting order
18868 /// is ascending. To specify descending order for a field, a suffix " desc"
18869 /// should be appended to the field name. For example: "name
18870 /// desc,parent". Redundant space characters in the
18871 /// syntax are insignificant. "name desc,parent" and "
18872 /// name desc , parent " are equivalent.
18873 ///
18874 /// The following fields are supported:
18875 /// name
18876 /// parent
18877 /// state
18878 /// category
18879 /// resource_name
18880 /// event_time
18881 /// security_marks.marks
18882 pub order_by: std::string::String,
18883
18884 /// A field mask to specify the Finding fields to be listed in the response.
18885 /// An empty field mask will list all fields.
18886 pub field_mask: std::option::Option<wkt::FieldMask>,
18887
18888 /// The value returned by the last `ListFindingsResponse`; indicates
18889 /// that this is a continuation of a prior `ListFindings` call, and
18890 /// that the system should return the next page of data.
18891 pub page_token: std::string::String,
18892
18893 /// The maximum number of results to return in a single response. Default is
18894 /// 10, minimum is 1, maximum is 1000.
18895 pub page_size: i32,
18896
18897 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18898}
18899
18900impl ListFindingsRequest {
18901 pub fn new() -> Self {
18902 std::default::Default::default()
18903 }
18904
18905 /// Sets the value of [parent][crate::model::ListFindingsRequest::parent].
18906 ///
18907 /// # Example
18908 /// ```ignore,no_run
18909 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18910 /// let x = ListFindingsRequest::new().set_parent("example");
18911 /// ```
18912 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18913 self.parent = v.into();
18914 self
18915 }
18916
18917 /// Sets the value of [filter][crate::model::ListFindingsRequest::filter].
18918 ///
18919 /// # Example
18920 /// ```ignore,no_run
18921 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18922 /// let x = ListFindingsRequest::new().set_filter("example");
18923 /// ```
18924 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18925 self.filter = v.into();
18926 self
18927 }
18928
18929 /// Sets the value of [order_by][crate::model::ListFindingsRequest::order_by].
18930 ///
18931 /// # Example
18932 /// ```ignore,no_run
18933 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18934 /// let x = ListFindingsRequest::new().set_order_by("example");
18935 /// ```
18936 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18937 self.order_by = v.into();
18938 self
18939 }
18940
18941 /// Sets the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
18942 ///
18943 /// # Example
18944 /// ```ignore,no_run
18945 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18946 /// use wkt::FieldMask;
18947 /// let x = ListFindingsRequest::new().set_field_mask(FieldMask::default()/* use setters */);
18948 /// ```
18949 pub fn set_field_mask<T>(mut self, v: T) -> Self
18950 where
18951 T: std::convert::Into<wkt::FieldMask>,
18952 {
18953 self.field_mask = std::option::Option::Some(v.into());
18954 self
18955 }
18956
18957 /// Sets or clears the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
18958 ///
18959 /// # Example
18960 /// ```ignore,no_run
18961 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18962 /// use wkt::FieldMask;
18963 /// let x = ListFindingsRequest::new().set_or_clear_field_mask(Some(FieldMask::default()/* use setters */));
18964 /// let x = ListFindingsRequest::new().set_or_clear_field_mask(None::<FieldMask>);
18965 /// ```
18966 pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
18967 where
18968 T: std::convert::Into<wkt::FieldMask>,
18969 {
18970 self.field_mask = v.map(|x| x.into());
18971 self
18972 }
18973
18974 /// Sets the value of [page_token][crate::model::ListFindingsRequest::page_token].
18975 ///
18976 /// # Example
18977 /// ```ignore,no_run
18978 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18979 /// let x = ListFindingsRequest::new().set_page_token("example");
18980 /// ```
18981 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18982 self.page_token = v.into();
18983 self
18984 }
18985
18986 /// Sets the value of [page_size][crate::model::ListFindingsRequest::page_size].
18987 ///
18988 /// # Example
18989 /// ```ignore,no_run
18990 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18991 /// let x = ListFindingsRequest::new().set_page_size(42);
18992 /// ```
18993 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18994 self.page_size = v.into();
18995 self
18996 }
18997}
18998
18999impl wkt::message::Message for ListFindingsRequest {
19000 fn typename() -> &'static str {
19001 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsRequest"
19002 }
19003}
19004
19005/// Response message for listing findings.
19006#[derive(Clone, Default, PartialEq)]
19007#[non_exhaustive]
19008pub struct ListFindingsResponse {
19009 /// Findings matching the list request.
19010 pub list_findings_results:
19011 std::vec::Vec<crate::model::list_findings_response::ListFindingsResult>,
19012
19013 /// Token to retrieve the next page of results, or empty if there are no more
19014 /// results.
19015 pub next_page_token: std::string::String,
19016
19017 /// The total number of findings matching the query.
19018 pub total_size: i32,
19019
19020 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19021}
19022
19023impl ListFindingsResponse {
19024 pub fn new() -> Self {
19025 std::default::Default::default()
19026 }
19027
19028 /// Sets the value of [list_findings_results][crate::model::ListFindingsResponse::list_findings_results].
19029 ///
19030 /// # Example
19031 /// ```ignore,no_run
19032 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19033 /// use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19034 /// let x = ListFindingsResponse::new()
19035 /// .set_list_findings_results([
19036 /// ListFindingsResult::default()/* use setters */,
19037 /// ListFindingsResult::default()/* use (different) setters */,
19038 /// ]);
19039 /// ```
19040 pub fn set_list_findings_results<T, V>(mut self, v: T) -> Self
19041 where
19042 T: std::iter::IntoIterator<Item = V>,
19043 V: std::convert::Into<crate::model::list_findings_response::ListFindingsResult>,
19044 {
19045 use std::iter::Iterator;
19046 self.list_findings_results = v.into_iter().map(|i| i.into()).collect();
19047 self
19048 }
19049
19050 /// Sets the value of [next_page_token][crate::model::ListFindingsResponse::next_page_token].
19051 ///
19052 /// # Example
19053 /// ```ignore,no_run
19054 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19055 /// let x = ListFindingsResponse::new().set_next_page_token("example");
19056 /// ```
19057 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19058 self.next_page_token = v.into();
19059 self
19060 }
19061
19062 /// Sets the value of [total_size][crate::model::ListFindingsResponse::total_size].
19063 ///
19064 /// # Example
19065 /// ```ignore,no_run
19066 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19067 /// let x = ListFindingsResponse::new().set_total_size(42);
19068 /// ```
19069 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19070 self.total_size = v.into();
19071 self
19072 }
19073}
19074
19075impl wkt::message::Message for ListFindingsResponse {
19076 fn typename() -> &'static str {
19077 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse"
19078 }
19079}
19080
19081#[doc(hidden)]
19082impl google_cloud_gax::paginator::internal::PageableResponse for ListFindingsResponse {
19083 type PageItem = crate::model::list_findings_response::ListFindingsResult;
19084
19085 fn items(self) -> std::vec::Vec<Self::PageItem> {
19086 self.list_findings_results
19087 }
19088
19089 fn next_page_token(&self) -> std::string::String {
19090 use std::clone::Clone;
19091 self.next_page_token.clone()
19092 }
19093}
19094
19095/// Defines additional types related to [ListFindingsResponse].
19096pub mod list_findings_response {
19097 #[allow(unused_imports)]
19098 use super::*;
19099
19100 /// Result containing the Finding.
19101 #[derive(Clone, Default, PartialEq)]
19102 #[non_exhaustive]
19103 pub struct ListFindingsResult {
19104 /// Finding matching the search request.
19105 pub finding: std::option::Option<crate::model::Finding>,
19106
19107 /// Output only. Resource that is associated with this finding.
19108 pub resource: std::option::Option<
19109 crate::model::list_findings_response::list_findings_result::Resource,
19110 >,
19111
19112 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19113 }
19114
19115 impl ListFindingsResult {
19116 pub fn new() -> Self {
19117 std::default::Default::default()
19118 }
19119
19120 /// Sets the value of [finding][crate::model::list_findings_response::ListFindingsResult::finding].
19121 ///
19122 /// # Example
19123 /// ```ignore,no_run
19124 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19125 /// use google_cloud_securitycenter_v2::model::Finding;
19126 /// let x = ListFindingsResult::new().set_finding(Finding::default()/* use setters */);
19127 /// ```
19128 pub fn set_finding<T>(mut self, v: T) -> Self
19129 where
19130 T: std::convert::Into<crate::model::Finding>,
19131 {
19132 self.finding = std::option::Option::Some(v.into());
19133 self
19134 }
19135
19136 /// Sets or clears the value of [finding][crate::model::list_findings_response::ListFindingsResult::finding].
19137 ///
19138 /// # Example
19139 /// ```ignore,no_run
19140 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19141 /// use google_cloud_securitycenter_v2::model::Finding;
19142 /// let x = ListFindingsResult::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
19143 /// let x = ListFindingsResult::new().set_or_clear_finding(None::<Finding>);
19144 /// ```
19145 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
19146 where
19147 T: std::convert::Into<crate::model::Finding>,
19148 {
19149 self.finding = v.map(|x| x.into());
19150 self
19151 }
19152
19153 /// Sets the value of [resource][crate::model::list_findings_response::ListFindingsResult::resource].
19154 ///
19155 /// # Example
19156 /// ```ignore,no_run
19157 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19158 /// use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19159 /// let x = ListFindingsResult::new().set_resource(Resource::default()/* use setters */);
19160 /// ```
19161 pub fn set_resource<T>(mut self, v: T) -> Self
19162 where
19163 T: std::convert::Into<
19164 crate::model::list_findings_response::list_findings_result::Resource,
19165 >,
19166 {
19167 self.resource = std::option::Option::Some(v.into());
19168 self
19169 }
19170
19171 /// Sets or clears the value of [resource][crate::model::list_findings_response::ListFindingsResult::resource].
19172 ///
19173 /// # Example
19174 /// ```ignore,no_run
19175 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19176 /// use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19177 /// let x = ListFindingsResult::new().set_or_clear_resource(Some(Resource::default()/* use setters */));
19178 /// let x = ListFindingsResult::new().set_or_clear_resource(None::<Resource>);
19179 /// ```
19180 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
19181 where
19182 T: std::convert::Into<
19183 crate::model::list_findings_response::list_findings_result::Resource,
19184 >,
19185 {
19186 self.resource = v.map(|x| x.into());
19187 self
19188 }
19189 }
19190
19191 impl wkt::message::Message for ListFindingsResult {
19192 fn typename() -> &'static str {
19193 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult"
19194 }
19195 }
19196
19197 /// Defines additional types related to [ListFindingsResult].
19198 pub mod list_findings_result {
19199 #[allow(unused_imports)]
19200 use super::*;
19201
19202 /// Information related to the Google Cloud resource that is
19203 /// associated with this finding.
19204 #[derive(Clone, Default, PartialEq)]
19205 #[non_exhaustive]
19206 pub struct Resource {
19207
19208 /// The full resource name of the resource. See:
19209 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
19210 pub name: std::string::String,
19211
19212 /// The human readable name of the resource.
19213 pub display_name: std::string::String,
19214
19215 /// The full resource type of the resource.
19216 pub r#type: std::string::String,
19217
19218 /// Indicates which cloud provider the finding is from.
19219 pub cloud_provider: crate::model::CloudProvider,
19220
19221 /// The service or resource provider associated with the resource.
19222 pub service: std::string::String,
19223
19224 /// The region or location of the service (if applicable).
19225 pub location: std::string::String,
19226
19227 /// Provides the path to the resource within the resource hierarchy.
19228 pub resource_path: std::option::Option<crate::model::ResourcePath>,
19229
19230 /// A string representation of the resource path.
19231 /// For Google Cloud, it has the format of
19232 /// `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}`
19233 /// where there can be any number of folders.
19234 /// For AWS, it has the format of
19235 /// `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}`
19236 /// where there can be any number of organizational units.
19237 /// For Azure, it has the format of
19238 /// `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}`
19239 /// where there can be any number of management groups.
19240 pub resource_path_string: std::string::String,
19241
19242 /// The metadata associated with the cloud provider.
19243 pub cloud_provider_metadata: std::option::Option<crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata>,
19244
19245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19246 }
19247
19248 impl Resource {
19249 pub fn new() -> Self {
19250 std::default::Default::default()
19251 }
19252
19253 /// Sets the value of [name][crate::model::list_findings_response::list_findings_result::Resource::name].
19254 ///
19255 /// # Example
19256 /// ```ignore,no_run
19257 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19258 /// let x = Resource::new().set_name("example");
19259 /// ```
19260 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19261 self.name = v.into();
19262 self
19263 }
19264
19265 /// Sets the value of [display_name][crate::model::list_findings_response::list_findings_result::Resource::display_name].
19266 ///
19267 /// # Example
19268 /// ```ignore,no_run
19269 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19270 /// let x = Resource::new().set_display_name("example");
19271 /// ```
19272 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
19273 mut self,
19274 v: T,
19275 ) -> Self {
19276 self.display_name = v.into();
19277 self
19278 }
19279
19280 /// Sets the value of [r#type][crate::model::list_findings_response::list_findings_result::Resource::type].
19281 ///
19282 /// # Example
19283 /// ```ignore,no_run
19284 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19285 /// let x = Resource::new().set_type("example");
19286 /// ```
19287 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19288 self.r#type = v.into();
19289 self
19290 }
19291
19292 /// Sets the value of [cloud_provider][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider].
19293 ///
19294 /// # Example
19295 /// ```ignore,no_run
19296 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19297 /// use google_cloud_securitycenter_v2::model::CloudProvider;
19298 /// let x0 = Resource::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
19299 /// let x1 = Resource::new().set_cloud_provider(CloudProvider::AmazonWebServices);
19300 /// let x2 = Resource::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
19301 /// ```
19302 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
19303 mut self,
19304 v: T,
19305 ) -> Self {
19306 self.cloud_provider = v.into();
19307 self
19308 }
19309
19310 /// Sets the value of [service][crate::model::list_findings_response::list_findings_result::Resource::service].
19311 ///
19312 /// # Example
19313 /// ```ignore,no_run
19314 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19315 /// let x = Resource::new().set_service("example");
19316 /// ```
19317 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19318 self.service = v.into();
19319 self
19320 }
19321
19322 /// Sets the value of [location][crate::model::list_findings_response::list_findings_result::Resource::location].
19323 ///
19324 /// # Example
19325 /// ```ignore,no_run
19326 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19327 /// let x = Resource::new().set_location("example");
19328 /// ```
19329 pub fn set_location<T: std::convert::Into<std::string::String>>(
19330 mut self,
19331 v: T,
19332 ) -> Self {
19333 self.location = v.into();
19334 self
19335 }
19336
19337 /// Sets the value of [resource_path][crate::model::list_findings_response::list_findings_result::Resource::resource_path].
19338 ///
19339 /// # Example
19340 /// ```ignore,no_run
19341 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19342 /// use google_cloud_securitycenter_v2::model::ResourcePath;
19343 /// let x = Resource::new().set_resource_path(ResourcePath::default()/* use setters */);
19344 /// ```
19345 pub fn set_resource_path<T>(mut self, v: T) -> Self
19346 where
19347 T: std::convert::Into<crate::model::ResourcePath>,
19348 {
19349 self.resource_path = std::option::Option::Some(v.into());
19350 self
19351 }
19352
19353 /// Sets or clears the value of [resource_path][crate::model::list_findings_response::list_findings_result::Resource::resource_path].
19354 ///
19355 /// # Example
19356 /// ```ignore,no_run
19357 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19358 /// use google_cloud_securitycenter_v2::model::ResourcePath;
19359 /// let x = Resource::new().set_or_clear_resource_path(Some(ResourcePath::default()/* use setters */));
19360 /// let x = Resource::new().set_or_clear_resource_path(None::<ResourcePath>);
19361 /// ```
19362 pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
19363 where
19364 T: std::convert::Into<crate::model::ResourcePath>,
19365 {
19366 self.resource_path = v.map(|x| x.into());
19367 self
19368 }
19369
19370 /// Sets the value of [resource_path_string][crate::model::list_findings_response::list_findings_result::Resource::resource_path_string].
19371 ///
19372 /// # Example
19373 /// ```ignore,no_run
19374 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19375 /// let x = Resource::new().set_resource_path_string("example");
19376 /// ```
19377 pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
19378 mut self,
19379 v: T,
19380 ) -> Self {
19381 self.resource_path_string = v.into();
19382 self
19383 }
19384
19385 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata].
19386 ///
19387 /// Note that all the setters affecting `cloud_provider_metadata` are mutually
19388 /// exclusive.
19389 ///
19390 /// # Example
19391 /// ```ignore,no_run
19392 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19393 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
19394 /// let x = Resource::new().set_cloud_provider_metadata(Some(
19395 /// google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(GcpMetadata::default().into())));
19396 /// ```
19397 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
19398 {
19399 self.cloud_provider_metadata = v.into();
19400 self
19401 }
19402
19403 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19404 /// if it holds a `GcpMetadata`, `None` if the field is not set or
19405 /// holds a different branch.
19406 pub fn gcp_metadata(
19407 &self,
19408 ) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
19409 #[allow(unreachable_patterns)]
19410 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19411 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(v) => std::option::Option::Some(v),
19412 _ => std::option::Option::None,
19413 })
19414 }
19415
19416 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19417 /// to hold a `GcpMetadata`.
19418 ///
19419 /// Note that all the setters affecting `cloud_provider_metadata` are
19420 /// mutually exclusive.
19421 ///
19422 /// # Example
19423 /// ```ignore,no_run
19424 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19425 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
19426 /// let x = Resource::new().set_gcp_metadata(GcpMetadata::default()/* use setters */);
19427 /// assert!(x.gcp_metadata().is_some());
19428 /// assert!(x.aws_metadata().is_none());
19429 /// assert!(x.azure_metadata().is_none());
19430 /// ```
19431 pub fn set_gcp_metadata<
19432 T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>,
19433 >(
19434 mut self,
19435 v: T,
19436 ) -> Self {
19437 self.cloud_provider_metadata = std::option::Option::Some(
19438 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(
19439 v.into()
19440 )
19441 );
19442 self
19443 }
19444
19445 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19446 /// if it holds a `AwsMetadata`, `None` if the field is not set or
19447 /// holds a different branch.
19448 pub fn aws_metadata(
19449 &self,
19450 ) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
19451 #[allow(unreachable_patterns)]
19452 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19453 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(v) => std::option::Option::Some(v),
19454 _ => std::option::Option::None,
19455 })
19456 }
19457
19458 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19459 /// to hold a `AwsMetadata`.
19460 ///
19461 /// Note that all the setters affecting `cloud_provider_metadata` are
19462 /// mutually exclusive.
19463 ///
19464 /// # Example
19465 /// ```ignore,no_run
19466 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19467 /// use google_cloud_securitycenter_v2::model::AwsMetadata;
19468 /// let x = Resource::new().set_aws_metadata(AwsMetadata::default()/* use setters */);
19469 /// assert!(x.aws_metadata().is_some());
19470 /// assert!(x.gcp_metadata().is_none());
19471 /// assert!(x.azure_metadata().is_none());
19472 /// ```
19473 pub fn set_aws_metadata<
19474 T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>,
19475 >(
19476 mut self,
19477 v: T,
19478 ) -> Self {
19479 self.cloud_provider_metadata = std::option::Option::Some(
19480 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(
19481 v.into()
19482 )
19483 );
19484 self
19485 }
19486
19487 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19488 /// if it holds a `AzureMetadata`, `None` if the field is not set or
19489 /// holds a different branch.
19490 pub fn azure_metadata(
19491 &self,
19492 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
19493 #[allow(unreachable_patterns)]
19494 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19495 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(v) => std::option::Option::Some(v),
19496 _ => std::option::Option::None,
19497 })
19498 }
19499
19500 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19501 /// to hold a `AzureMetadata`.
19502 ///
19503 /// Note that all the setters affecting `cloud_provider_metadata` are
19504 /// mutually exclusive.
19505 ///
19506 /// # Example
19507 /// ```ignore,no_run
19508 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19509 /// use google_cloud_securitycenter_v2::model::AzureMetadata;
19510 /// let x = Resource::new().set_azure_metadata(AzureMetadata::default()/* use setters */);
19511 /// assert!(x.azure_metadata().is_some());
19512 /// assert!(x.gcp_metadata().is_none());
19513 /// assert!(x.aws_metadata().is_none());
19514 /// ```
19515 pub fn set_azure_metadata<
19516 T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
19517 >(
19518 mut self,
19519 v: T,
19520 ) -> Self {
19521 self.cloud_provider_metadata = std::option::Option::Some(
19522 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(
19523 v.into()
19524 )
19525 );
19526 self
19527 }
19528 }
19529
19530 impl wkt::message::Message for Resource {
19531 fn typename() -> &'static str {
19532 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource"
19533 }
19534 }
19535
19536 /// Defines additional types related to [Resource].
19537 pub mod resource {
19538 #[allow(unused_imports)]
19539 use super::*;
19540
19541 /// The metadata associated with the cloud provider.
19542 #[derive(Clone, Debug, PartialEq)]
19543 #[non_exhaustive]
19544 pub enum CloudProviderMetadata {
19545 /// The GCP metadata associated with the finding.
19546 GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
19547 /// The AWS metadata associated with the finding.
19548 AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
19549 /// The Azure metadata associated with the finding.
19550 AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
19551 }
19552 }
19553 }
19554}
19555
19556/// Request message for listing mute configs at a given scope e.g. organization,
19557/// folder or project. If no location is specified, default is
19558/// global.
19559#[derive(Clone, Default, PartialEq)]
19560#[non_exhaustive]
19561pub struct ListMuteConfigsRequest {
19562 /// Required. The parent, which owns the collection of mute configs. Its format
19563 /// is `organizations/[organization_id]", "folders/[folder_id]`,
19564 /// `projects/[project_id]`,
19565 /// `organizations/[organization_id]/locations/[location_id]`,
19566 /// `folders/[folder_id]/locations/[location_id]`,
19567 /// `projects/[project_id]/locations/[location_id]`.
19568 pub parent: std::string::String,
19569
19570 /// The maximum number of configs to return. The service may return fewer than
19571 /// this value.
19572 /// If unspecified, at most 10 configs will be returned.
19573 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
19574 pub page_size: i32,
19575
19576 /// A page token, received from a previous `ListMuteConfigs` call.
19577 /// Provide this to retrieve the subsequent page.
19578 ///
19579 /// When paginating, all other parameters provided to `ListMuteConfigs` must
19580 /// match the call that provided the page token.
19581 pub page_token: std::string::String,
19582
19583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19584}
19585
19586impl ListMuteConfigsRequest {
19587 pub fn new() -> Self {
19588 std::default::Default::default()
19589 }
19590
19591 /// Sets the value of [parent][crate::model::ListMuteConfigsRequest::parent].
19592 ///
19593 /// # Example
19594 /// ```ignore,no_run
19595 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19596 /// let x = ListMuteConfigsRequest::new().set_parent("example");
19597 /// ```
19598 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19599 self.parent = v.into();
19600 self
19601 }
19602
19603 /// Sets the value of [page_size][crate::model::ListMuteConfigsRequest::page_size].
19604 ///
19605 /// # Example
19606 /// ```ignore,no_run
19607 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19608 /// let x = ListMuteConfigsRequest::new().set_page_size(42);
19609 /// ```
19610 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19611 self.page_size = v.into();
19612 self
19613 }
19614
19615 /// Sets the value of [page_token][crate::model::ListMuteConfigsRequest::page_token].
19616 ///
19617 /// # Example
19618 /// ```ignore,no_run
19619 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19620 /// let x = ListMuteConfigsRequest::new().set_page_token("example");
19621 /// ```
19622 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19623 self.page_token = v.into();
19624 self
19625 }
19626}
19627
19628impl wkt::message::Message for ListMuteConfigsRequest {
19629 fn typename() -> &'static str {
19630 "type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsRequest"
19631 }
19632}
19633
19634/// Response message for listing mute configs.
19635#[derive(Clone, Default, PartialEq)]
19636#[non_exhaustive]
19637pub struct ListMuteConfigsResponse {
19638 /// The mute configs from the specified parent.
19639 pub mute_configs: std::vec::Vec<crate::model::MuteConfig>,
19640
19641 /// A token, which can be sent as `page_token` to retrieve the next page.
19642 /// If this field is omitted, there are no subsequent pages.
19643 pub next_page_token: std::string::String,
19644
19645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19646}
19647
19648impl ListMuteConfigsResponse {
19649 pub fn new() -> Self {
19650 std::default::Default::default()
19651 }
19652
19653 /// Sets the value of [mute_configs][crate::model::ListMuteConfigsResponse::mute_configs].
19654 ///
19655 /// # Example
19656 /// ```ignore,no_run
19657 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsResponse;
19658 /// use google_cloud_securitycenter_v2::model::MuteConfig;
19659 /// let x = ListMuteConfigsResponse::new()
19660 /// .set_mute_configs([
19661 /// MuteConfig::default()/* use setters */,
19662 /// MuteConfig::default()/* use (different) setters */,
19663 /// ]);
19664 /// ```
19665 pub fn set_mute_configs<T, V>(mut self, v: T) -> Self
19666 where
19667 T: std::iter::IntoIterator<Item = V>,
19668 V: std::convert::Into<crate::model::MuteConfig>,
19669 {
19670 use std::iter::Iterator;
19671 self.mute_configs = v.into_iter().map(|i| i.into()).collect();
19672 self
19673 }
19674
19675 /// Sets the value of [next_page_token][crate::model::ListMuteConfigsResponse::next_page_token].
19676 ///
19677 /// # Example
19678 /// ```ignore,no_run
19679 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsResponse;
19680 /// let x = ListMuteConfigsResponse::new().set_next_page_token("example");
19681 /// ```
19682 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19683 self.next_page_token = v.into();
19684 self
19685 }
19686}
19687
19688impl wkt::message::Message for ListMuteConfigsResponse {
19689 fn typename() -> &'static str {
19690 "type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsResponse"
19691 }
19692}
19693
19694#[doc(hidden)]
19695impl google_cloud_gax::paginator::internal::PageableResponse for ListMuteConfigsResponse {
19696 type PageItem = crate::model::MuteConfig;
19697
19698 fn items(self) -> std::vec::Vec<Self::PageItem> {
19699 self.mute_configs
19700 }
19701
19702 fn next_page_token(&self) -> std::string::String {
19703 use std::clone::Clone;
19704 self.next_page_token.clone()
19705 }
19706}
19707
19708/// Request message for listing notification configs.
19709#[derive(Clone, Default, PartialEq)]
19710#[non_exhaustive]
19711pub struct ListNotificationConfigsRequest {
19712 /// Required. The name of the parent in which to list the notification
19713 /// configurations. Its format is
19714 /// "organizations/[organization_id]/locations/[location_id]",
19715 /// "folders/[folder_id]/locations/[location_id]", or
19716 /// "projects/[project_id]/locations/[location_id]".
19717 pub parent: std::string::String,
19718
19719 /// The value returned by the last `ListNotificationConfigsResponse`; indicates
19720 /// that this is a continuation of a prior `ListNotificationConfigs` call, and
19721 /// that the system should return the next page of data.
19722 pub page_token: std::string::String,
19723
19724 /// The maximum number of results to return in a single response. Default is
19725 /// 10, minimum is 1, maximum is 1000.
19726 pub page_size: i32,
19727
19728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19729}
19730
19731impl ListNotificationConfigsRequest {
19732 pub fn new() -> Self {
19733 std::default::Default::default()
19734 }
19735
19736 /// Sets the value of [parent][crate::model::ListNotificationConfigsRequest::parent].
19737 ///
19738 /// # Example
19739 /// ```ignore,no_run
19740 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19741 /// let x = ListNotificationConfigsRequest::new().set_parent("example");
19742 /// ```
19743 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19744 self.parent = v.into();
19745 self
19746 }
19747
19748 /// Sets the value of [page_token][crate::model::ListNotificationConfigsRequest::page_token].
19749 ///
19750 /// # Example
19751 /// ```ignore,no_run
19752 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19753 /// let x = ListNotificationConfigsRequest::new().set_page_token("example");
19754 /// ```
19755 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19756 self.page_token = v.into();
19757 self
19758 }
19759
19760 /// Sets the value of [page_size][crate::model::ListNotificationConfigsRequest::page_size].
19761 ///
19762 /// # Example
19763 /// ```ignore,no_run
19764 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19765 /// let x = ListNotificationConfigsRequest::new().set_page_size(42);
19766 /// ```
19767 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19768 self.page_size = v.into();
19769 self
19770 }
19771}
19772
19773impl wkt::message::Message for ListNotificationConfigsRequest {
19774 fn typename() -> &'static str {
19775 "type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsRequest"
19776 }
19777}
19778
19779/// Response message for listing notification configs.
19780#[derive(Clone, Default, PartialEq)]
19781#[non_exhaustive]
19782pub struct ListNotificationConfigsResponse {
19783 /// Notification configs belonging to the requested parent.
19784 pub notification_configs: std::vec::Vec<crate::model::NotificationConfig>,
19785
19786 /// Token to retrieve the next page of results, or empty if there are no more
19787 /// results.
19788 pub next_page_token: std::string::String,
19789
19790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19791}
19792
19793impl ListNotificationConfigsResponse {
19794 pub fn new() -> Self {
19795 std::default::Default::default()
19796 }
19797
19798 /// Sets the value of [notification_configs][crate::model::ListNotificationConfigsResponse::notification_configs].
19799 ///
19800 /// # Example
19801 /// ```ignore,no_run
19802 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsResponse;
19803 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
19804 /// let x = ListNotificationConfigsResponse::new()
19805 /// .set_notification_configs([
19806 /// NotificationConfig::default()/* use setters */,
19807 /// NotificationConfig::default()/* use (different) setters */,
19808 /// ]);
19809 /// ```
19810 pub fn set_notification_configs<T, V>(mut self, v: T) -> Self
19811 where
19812 T: std::iter::IntoIterator<Item = V>,
19813 V: std::convert::Into<crate::model::NotificationConfig>,
19814 {
19815 use std::iter::Iterator;
19816 self.notification_configs = v.into_iter().map(|i| i.into()).collect();
19817 self
19818 }
19819
19820 /// Sets the value of [next_page_token][crate::model::ListNotificationConfigsResponse::next_page_token].
19821 ///
19822 /// # Example
19823 /// ```ignore,no_run
19824 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsResponse;
19825 /// let x = ListNotificationConfigsResponse::new().set_next_page_token("example");
19826 /// ```
19827 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19828 self.next_page_token = v.into();
19829 self
19830 }
19831}
19832
19833impl wkt::message::Message for ListNotificationConfigsResponse {
19834 fn typename() -> &'static str {
19835 "type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsResponse"
19836 }
19837}
19838
19839#[doc(hidden)]
19840impl google_cloud_gax::paginator::internal::PageableResponse for ListNotificationConfigsResponse {
19841 type PageItem = crate::model::NotificationConfig;
19842
19843 fn items(self) -> std::vec::Vec<Self::PageItem> {
19844 self.notification_configs
19845 }
19846
19847 fn next_page_token(&self) -> std::string::String {
19848 use std::clone::Clone;
19849 self.next_page_token.clone()
19850 }
19851}
19852
19853/// Request message to list resource value configs of a parent
19854#[derive(Clone, Default, PartialEq)]
19855#[non_exhaustive]
19856pub struct ListResourceValueConfigsRequest {
19857 /// Required. The parent, which owns the collection of resource value configs.
19858 /// Its format is
19859 /// `organizations/[organization_id]`
19860 pub parent: std::string::String,
19861
19862 /// The maximum number of configs to return. The service may return fewer than
19863 /// this value.
19864 /// If unspecified, at most 10 configs will be returned.
19865 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
19866 pub page_size: i32,
19867
19868 /// A page token, received from a previous `ListResourceValueConfigs` call.
19869 /// Provide this to retrieve the subsequent page.
19870 ///
19871 /// When paginating, all other parameters provided to
19872 /// `ListResourceValueConfigs` must match the call that provided the
19873 /// page token.
19874 ///
19875 /// page_size can be specified, and the new page_size will be used.
19876 pub page_token: std::string::String,
19877
19878 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19879}
19880
19881impl ListResourceValueConfigsRequest {
19882 pub fn new() -> Self {
19883 std::default::Default::default()
19884 }
19885
19886 /// Sets the value of [parent][crate::model::ListResourceValueConfigsRequest::parent].
19887 ///
19888 /// # Example
19889 /// ```ignore,no_run
19890 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
19891 /// let x = ListResourceValueConfigsRequest::new().set_parent("example");
19892 /// ```
19893 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19894 self.parent = v.into();
19895 self
19896 }
19897
19898 /// Sets the value of [page_size][crate::model::ListResourceValueConfigsRequest::page_size].
19899 ///
19900 /// # Example
19901 /// ```ignore,no_run
19902 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
19903 /// let x = ListResourceValueConfigsRequest::new().set_page_size(42);
19904 /// ```
19905 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19906 self.page_size = v.into();
19907 self
19908 }
19909
19910 /// Sets the value of [page_token][crate::model::ListResourceValueConfigsRequest::page_token].
19911 ///
19912 /// # Example
19913 /// ```ignore,no_run
19914 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
19915 /// let x = ListResourceValueConfigsRequest::new().set_page_token("example");
19916 /// ```
19917 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19918 self.page_token = v.into();
19919 self
19920 }
19921}
19922
19923impl wkt::message::Message for ListResourceValueConfigsRequest {
19924 fn typename() -> &'static str {
19925 "type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsRequest"
19926 }
19927}
19928
19929/// Response message to list resource value configs
19930#[derive(Clone, Default, PartialEq)]
19931#[non_exhaustive]
19932pub struct ListResourceValueConfigsResponse {
19933 /// The resource value configs from the specified parent.
19934 pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
19935
19936 /// A token, which can be sent as `page_token` to retrieve the next page.
19937 /// If this field is empty, there are no subsequent pages.
19938 pub next_page_token: std::string::String,
19939
19940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19941}
19942
19943impl ListResourceValueConfigsResponse {
19944 pub fn new() -> Self {
19945 std::default::Default::default()
19946 }
19947
19948 /// Sets the value of [resource_value_configs][crate::model::ListResourceValueConfigsResponse::resource_value_configs].
19949 ///
19950 /// # Example
19951 /// ```ignore,no_run
19952 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsResponse;
19953 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
19954 /// let x = ListResourceValueConfigsResponse::new()
19955 /// .set_resource_value_configs([
19956 /// ResourceValueConfig::default()/* use setters */,
19957 /// ResourceValueConfig::default()/* use (different) setters */,
19958 /// ]);
19959 /// ```
19960 pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
19961 where
19962 T: std::iter::IntoIterator<Item = V>,
19963 V: std::convert::Into<crate::model::ResourceValueConfig>,
19964 {
19965 use std::iter::Iterator;
19966 self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
19967 self
19968 }
19969
19970 /// Sets the value of [next_page_token][crate::model::ListResourceValueConfigsResponse::next_page_token].
19971 ///
19972 /// # Example
19973 /// ```ignore,no_run
19974 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsResponse;
19975 /// let x = ListResourceValueConfigsResponse::new().set_next_page_token("example");
19976 /// ```
19977 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19978 self.next_page_token = v.into();
19979 self
19980 }
19981}
19982
19983impl wkt::message::Message for ListResourceValueConfigsResponse {
19984 fn typename() -> &'static str {
19985 "type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsResponse"
19986 }
19987}
19988
19989#[doc(hidden)]
19990impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceValueConfigsResponse {
19991 type PageItem = crate::model::ResourceValueConfig;
19992
19993 fn items(self) -> std::vec::Vec<Self::PageItem> {
19994 self.resource_value_configs
19995 }
19996
19997 fn next_page_token(&self) -> std::string::String {
19998 use std::clone::Clone;
19999 self.next_page_token.clone()
20000 }
20001}
20002
20003/// Request message for listing sources.
20004#[derive(Clone, Default, PartialEq)]
20005#[non_exhaustive]
20006pub struct ListSourcesRequest {
20007 /// Required. Resource name of the parent of sources to list. Its format should
20008 /// be `organizations/[organization_id]`, `folders/[folder_id]`, or
20009 /// `projects/[project_id]`.
20010 pub parent: std::string::String,
20011
20012 /// The value returned by the last `ListSourcesResponse`; indicates
20013 /// that this is a continuation of a prior `ListSources` call, and
20014 /// that the system should return the next page of data.
20015 pub page_token: std::string::String,
20016
20017 /// The maximum number of results to return in a single response. Default is
20018 /// 10, minimum is 1, maximum is 1000.
20019 pub page_size: i32,
20020
20021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20022}
20023
20024impl ListSourcesRequest {
20025 pub fn new() -> Self {
20026 std::default::Default::default()
20027 }
20028
20029 /// Sets the value of [parent][crate::model::ListSourcesRequest::parent].
20030 ///
20031 /// # Example
20032 /// ```ignore,no_run
20033 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20034 /// let x = ListSourcesRequest::new().set_parent("example");
20035 /// ```
20036 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20037 self.parent = v.into();
20038 self
20039 }
20040
20041 /// Sets the value of [page_token][crate::model::ListSourcesRequest::page_token].
20042 ///
20043 /// # Example
20044 /// ```ignore,no_run
20045 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20046 /// let x = ListSourcesRequest::new().set_page_token("example");
20047 /// ```
20048 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20049 self.page_token = v.into();
20050 self
20051 }
20052
20053 /// Sets the value of [page_size][crate::model::ListSourcesRequest::page_size].
20054 ///
20055 /// # Example
20056 /// ```ignore,no_run
20057 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20058 /// let x = ListSourcesRequest::new().set_page_size(42);
20059 /// ```
20060 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20061 self.page_size = v.into();
20062 self
20063 }
20064}
20065
20066impl wkt::message::Message for ListSourcesRequest {
20067 fn typename() -> &'static str {
20068 "type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesRequest"
20069 }
20070}
20071
20072/// Response message for listing sources.
20073#[derive(Clone, Default, PartialEq)]
20074#[non_exhaustive]
20075pub struct ListSourcesResponse {
20076 /// Sources belonging to the requested parent.
20077 pub sources: std::vec::Vec<crate::model::Source>,
20078
20079 /// Token to retrieve the next page of results, or empty if there are no more
20080 /// results.
20081 pub next_page_token: std::string::String,
20082
20083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20084}
20085
20086impl ListSourcesResponse {
20087 pub fn new() -> Self {
20088 std::default::Default::default()
20089 }
20090
20091 /// Sets the value of [sources][crate::model::ListSourcesResponse::sources].
20092 ///
20093 /// # Example
20094 /// ```ignore,no_run
20095 /// # use google_cloud_securitycenter_v2::model::ListSourcesResponse;
20096 /// use google_cloud_securitycenter_v2::model::Source;
20097 /// let x = ListSourcesResponse::new()
20098 /// .set_sources([
20099 /// Source::default()/* use setters */,
20100 /// Source::default()/* use (different) setters */,
20101 /// ]);
20102 /// ```
20103 pub fn set_sources<T, V>(mut self, v: T) -> Self
20104 where
20105 T: std::iter::IntoIterator<Item = V>,
20106 V: std::convert::Into<crate::model::Source>,
20107 {
20108 use std::iter::Iterator;
20109 self.sources = v.into_iter().map(|i| i.into()).collect();
20110 self
20111 }
20112
20113 /// Sets the value of [next_page_token][crate::model::ListSourcesResponse::next_page_token].
20114 ///
20115 /// # Example
20116 /// ```ignore,no_run
20117 /// # use google_cloud_securitycenter_v2::model::ListSourcesResponse;
20118 /// let x = ListSourcesResponse::new().set_next_page_token("example");
20119 /// ```
20120 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20121 self.next_page_token = v.into();
20122 self
20123 }
20124}
20125
20126impl wkt::message::Message for ListSourcesResponse {
20127 fn typename() -> &'static str {
20128 "type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesResponse"
20129 }
20130}
20131
20132#[doc(hidden)]
20133impl google_cloud_gax::paginator::internal::PageableResponse for ListSourcesResponse {
20134 type PageItem = crate::model::Source;
20135
20136 fn items(self) -> std::vec::Vec<Self::PageItem> {
20137 self.sources
20138 }
20139
20140 fn next_page_token(&self) -> std::string::String {
20141 use std::clone::Clone;
20142 self.next_page_token.clone()
20143 }
20144}
20145
20146/// Request message for listing the valued resources for a given simulation.
20147#[derive(Clone, Default, PartialEq)]
20148#[non_exhaustive]
20149pub struct ListValuedResourcesRequest {
20150 /// Required. Name of parent to list exposed resources.
20151 ///
20152 /// Valid formats:
20153 /// `organizations/{organization}`,
20154 /// `organizations/{organization}/simulations/{simulation}`
20155 /// `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
20156 pub parent: std::string::String,
20157
20158 /// The filter expression that filters the valued resources in the response.
20159 /// Supported fields:
20160 ///
20161 /// * `resource_value` supports =
20162 /// * `resource_type` supports =
20163 pub filter: std::string::String,
20164
20165 /// The value returned by the last `ListValuedResourcesResponse`; indicates
20166 /// that this is a continuation of a prior `ListValuedResources` call, and
20167 /// that the system should return the next page of data.
20168 pub page_token: std::string::String,
20169
20170 /// The maximum number of results to return in a single response. Default is
20171 /// 10, minimum is 1, maximum is 1000.
20172 pub page_size: i32,
20173
20174 /// Optional. The fields by which to order the valued resources response.
20175 ///
20176 /// Supported fields:
20177 ///
20178 /// * `exposed_score`
20179 ///
20180 /// * `resource_value`
20181 ///
20182 /// * `resource_type`
20183 ///
20184 ///
20185 /// Values should be a comma separated list of fields. For example:
20186 /// `exposed_score,resource_value`.
20187 ///
20188 /// The default sorting order is descending. To specify ascending or descending
20189 /// order for a field, append a " ASC" or a " DESC" suffix, respectively; for
20190 /// example: `exposed_score DESC`.
20191 pub order_by: std::string::String,
20192
20193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20194}
20195
20196impl ListValuedResourcesRequest {
20197 pub fn new() -> Self {
20198 std::default::Default::default()
20199 }
20200
20201 /// Sets the value of [parent][crate::model::ListValuedResourcesRequest::parent].
20202 ///
20203 /// # Example
20204 /// ```ignore,no_run
20205 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20206 /// let x = ListValuedResourcesRequest::new().set_parent("example");
20207 /// ```
20208 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20209 self.parent = v.into();
20210 self
20211 }
20212
20213 /// Sets the value of [filter][crate::model::ListValuedResourcesRequest::filter].
20214 ///
20215 /// # Example
20216 /// ```ignore,no_run
20217 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20218 /// let x = ListValuedResourcesRequest::new().set_filter("example");
20219 /// ```
20220 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20221 self.filter = v.into();
20222 self
20223 }
20224
20225 /// Sets the value of [page_token][crate::model::ListValuedResourcesRequest::page_token].
20226 ///
20227 /// # Example
20228 /// ```ignore,no_run
20229 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20230 /// let x = ListValuedResourcesRequest::new().set_page_token("example");
20231 /// ```
20232 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20233 self.page_token = v.into();
20234 self
20235 }
20236
20237 /// Sets the value of [page_size][crate::model::ListValuedResourcesRequest::page_size].
20238 ///
20239 /// # Example
20240 /// ```ignore,no_run
20241 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20242 /// let x = ListValuedResourcesRequest::new().set_page_size(42);
20243 /// ```
20244 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20245 self.page_size = v.into();
20246 self
20247 }
20248
20249 /// Sets the value of [order_by][crate::model::ListValuedResourcesRequest::order_by].
20250 ///
20251 /// # Example
20252 /// ```ignore,no_run
20253 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20254 /// let x = ListValuedResourcesRequest::new().set_order_by("example");
20255 /// ```
20256 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20257 self.order_by = v.into();
20258 self
20259 }
20260}
20261
20262impl wkt::message::Message for ListValuedResourcesRequest {
20263 fn typename() -> &'static str {
20264 "type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesRequest"
20265 }
20266}
20267
20268/// Response message for listing the valued resources for a given simulation.
20269#[derive(Clone, Default, PartialEq)]
20270#[non_exhaustive]
20271pub struct ListValuedResourcesResponse {
20272 /// The valued resources that the attack path simulation identified.
20273 pub valued_resources: std::vec::Vec<crate::model::ValuedResource>,
20274
20275 /// Token to retrieve the next page of results, or empty if there are no more
20276 /// results.
20277 pub next_page_token: std::string::String,
20278
20279 /// The estimated total number of results matching the query.
20280 pub total_size: i32,
20281
20282 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20283}
20284
20285impl ListValuedResourcesResponse {
20286 pub fn new() -> Self {
20287 std::default::Default::default()
20288 }
20289
20290 /// Sets the value of [valued_resources][crate::model::ListValuedResourcesResponse::valued_resources].
20291 ///
20292 /// # Example
20293 /// ```ignore,no_run
20294 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20295 /// use google_cloud_securitycenter_v2::model::ValuedResource;
20296 /// let x = ListValuedResourcesResponse::new()
20297 /// .set_valued_resources([
20298 /// ValuedResource::default()/* use setters */,
20299 /// ValuedResource::default()/* use (different) setters */,
20300 /// ]);
20301 /// ```
20302 pub fn set_valued_resources<T, V>(mut self, v: T) -> Self
20303 where
20304 T: std::iter::IntoIterator<Item = V>,
20305 V: std::convert::Into<crate::model::ValuedResource>,
20306 {
20307 use std::iter::Iterator;
20308 self.valued_resources = v.into_iter().map(|i| i.into()).collect();
20309 self
20310 }
20311
20312 /// Sets the value of [next_page_token][crate::model::ListValuedResourcesResponse::next_page_token].
20313 ///
20314 /// # Example
20315 /// ```ignore,no_run
20316 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20317 /// let x = ListValuedResourcesResponse::new().set_next_page_token("example");
20318 /// ```
20319 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20320 self.next_page_token = v.into();
20321 self
20322 }
20323
20324 /// Sets the value of [total_size][crate::model::ListValuedResourcesResponse::total_size].
20325 ///
20326 /// # Example
20327 /// ```ignore,no_run
20328 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20329 /// let x = ListValuedResourcesResponse::new().set_total_size(42);
20330 /// ```
20331 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20332 self.total_size = v.into();
20333 self
20334 }
20335}
20336
20337impl wkt::message::Message for ListValuedResourcesResponse {
20338 fn typename() -> &'static str {
20339 "type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesResponse"
20340 }
20341}
20342
20343#[doc(hidden)]
20344impl google_cloud_gax::paginator::internal::PageableResponse for ListValuedResourcesResponse {
20345 type PageItem = crate::model::ValuedResource;
20346
20347 fn items(self) -> std::vec::Vec<Self::PageItem> {
20348 self.valued_resources
20349 }
20350
20351 fn next_page_token(&self) -> std::string::String {
20352 use std::clone::Clone;
20353 self.next_page_token.clone()
20354 }
20355}
20356
20357/// Request message for updating a finding's state.
20358#[derive(Clone, Default, PartialEq)]
20359#[non_exhaustive]
20360pub struct SetFindingStateRequest {
20361 /// Required. The [relative resource
20362 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
20363 /// of the finding. If no location is specified, finding is assumed to be in
20364 /// global. The following list shows some examples:
20365 ///
20366 ///
20367 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
20368 /// +
20369 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20370 ///
20371 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
20372 ///
20373 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20374 ///
20375 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
20376 ///
20377 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20378 pub name: std::string::String,
20379
20380 /// Required. The desired State of the finding.
20381 pub state: crate::model::finding::State,
20382
20383 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20384}
20385
20386impl SetFindingStateRequest {
20387 pub fn new() -> Self {
20388 std::default::Default::default()
20389 }
20390
20391 /// Sets the value of [name][crate::model::SetFindingStateRequest::name].
20392 ///
20393 /// # Example
20394 /// ```ignore,no_run
20395 /// # use google_cloud_securitycenter_v2::model::SetFindingStateRequest;
20396 /// let x = SetFindingStateRequest::new().set_name("example");
20397 /// ```
20398 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20399 self.name = v.into();
20400 self
20401 }
20402
20403 /// Sets the value of [state][crate::model::SetFindingStateRequest::state].
20404 ///
20405 /// # Example
20406 /// ```ignore,no_run
20407 /// # use google_cloud_securitycenter_v2::model::SetFindingStateRequest;
20408 /// use google_cloud_securitycenter_v2::model::finding::State;
20409 /// let x0 = SetFindingStateRequest::new().set_state(State::Active);
20410 /// let x1 = SetFindingStateRequest::new().set_state(State::Inactive);
20411 /// ```
20412 pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
20413 self.state = v.into();
20414 self
20415 }
20416}
20417
20418impl wkt::message::Message for SetFindingStateRequest {
20419 fn typename() -> &'static str {
20420 "type.googleapis.com/google.cloud.securitycenter.v2.SetFindingStateRequest"
20421 }
20422}
20423
20424/// Request message for updating a finding's mute status.
20425#[derive(Clone, Default, PartialEq)]
20426#[non_exhaustive]
20427pub struct SetMuteRequest {
20428 /// Required. The [relative resource
20429 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
20430 /// of the finding. If no location is specified, finding is assumed to be in
20431 /// global. The following list shows some examples:
20432 ///
20433 ///
20434 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
20435 /// +
20436 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20437 ///
20438 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
20439 ///
20440 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20441 ///
20442 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
20443 ///
20444 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20445 pub name: std::string::String,
20446
20447 /// Required. The desired state of the Mute.
20448 pub mute: crate::model::finding::Mute,
20449
20450 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20451}
20452
20453impl SetMuteRequest {
20454 pub fn new() -> Self {
20455 std::default::Default::default()
20456 }
20457
20458 /// Sets the value of [name][crate::model::SetMuteRequest::name].
20459 ///
20460 /// # Example
20461 /// ```ignore,no_run
20462 /// # use google_cloud_securitycenter_v2::model::SetMuteRequest;
20463 /// let x = SetMuteRequest::new().set_name("example");
20464 /// ```
20465 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20466 self.name = v.into();
20467 self
20468 }
20469
20470 /// Sets the value of [mute][crate::model::SetMuteRequest::mute].
20471 ///
20472 /// # Example
20473 /// ```ignore,no_run
20474 /// # use google_cloud_securitycenter_v2::model::SetMuteRequest;
20475 /// use google_cloud_securitycenter_v2::model::finding::Mute;
20476 /// let x0 = SetMuteRequest::new().set_mute(Mute::Muted);
20477 /// let x1 = SetMuteRequest::new().set_mute(Mute::Unmuted);
20478 /// let x2 = SetMuteRequest::new().set_mute(Mute::Undefined);
20479 /// ```
20480 pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
20481 self.mute = v.into();
20482 self
20483 }
20484}
20485
20486impl wkt::message::Message for SetMuteRequest {
20487 fn typename() -> &'static str {
20488 "type.googleapis.com/google.cloud.securitycenter.v2.SetMuteRequest"
20489 }
20490}
20491
20492/// Request message for updating a BigQuery export.
20493#[derive(Clone, Default, PartialEq)]
20494#[non_exhaustive]
20495pub struct UpdateBigQueryExportRequest {
20496 /// Required. The BigQuery export being updated.
20497 pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
20498
20499 /// The list of fields to be updated.
20500 /// If empty all mutable fields will be updated.
20501 pub update_mask: std::option::Option<wkt::FieldMask>,
20502
20503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20504}
20505
20506impl UpdateBigQueryExportRequest {
20507 pub fn new() -> Self {
20508 std::default::Default::default()
20509 }
20510
20511 /// Sets the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
20512 ///
20513 /// # Example
20514 /// ```ignore,no_run
20515 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20516 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
20517 /// let x = UpdateBigQueryExportRequest::new().set_big_query_export(BigQueryExport::default()/* use setters */);
20518 /// ```
20519 pub fn set_big_query_export<T>(mut self, v: T) -> Self
20520 where
20521 T: std::convert::Into<crate::model::BigQueryExport>,
20522 {
20523 self.big_query_export = std::option::Option::Some(v.into());
20524 self
20525 }
20526
20527 /// Sets or clears the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
20528 ///
20529 /// # Example
20530 /// ```ignore,no_run
20531 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20532 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
20533 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_big_query_export(Some(BigQueryExport::default()/* use setters */));
20534 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_big_query_export(None::<BigQueryExport>);
20535 /// ```
20536 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
20537 where
20538 T: std::convert::Into<crate::model::BigQueryExport>,
20539 {
20540 self.big_query_export = v.map(|x| x.into());
20541 self
20542 }
20543
20544 /// Sets the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
20545 ///
20546 /// # Example
20547 /// ```ignore,no_run
20548 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20549 /// use wkt::FieldMask;
20550 /// let x = UpdateBigQueryExportRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20551 /// ```
20552 pub fn set_update_mask<T>(mut self, v: T) -> Self
20553 where
20554 T: std::convert::Into<wkt::FieldMask>,
20555 {
20556 self.update_mask = std::option::Option::Some(v.into());
20557 self
20558 }
20559
20560 /// Sets or clears the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
20561 ///
20562 /// # Example
20563 /// ```ignore,no_run
20564 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20565 /// use wkt::FieldMask;
20566 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20567 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20568 /// ```
20569 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20570 where
20571 T: std::convert::Into<wkt::FieldMask>,
20572 {
20573 self.update_mask = v.map(|x| x.into());
20574 self
20575 }
20576}
20577
20578impl wkt::message::Message for UpdateBigQueryExportRequest {
20579 fn typename() -> &'static str {
20580 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateBigQueryExportRequest"
20581 }
20582}
20583
20584/// Request message for updating a ExternalSystem resource.
20585#[derive(Clone, Default, PartialEq)]
20586#[non_exhaustive]
20587pub struct UpdateExternalSystemRequest {
20588 /// Required. The external system resource to update.
20589 pub external_system: std::option::Option<crate::model::ExternalSystem>,
20590
20591 /// The FieldMask to use when updating the external system resource.
20592 ///
20593 /// If empty all mutable fields will be updated.
20594 pub update_mask: std::option::Option<wkt::FieldMask>,
20595
20596 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20597}
20598
20599impl UpdateExternalSystemRequest {
20600 pub fn new() -> Self {
20601 std::default::Default::default()
20602 }
20603
20604 /// Sets the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
20605 ///
20606 /// # Example
20607 /// ```ignore,no_run
20608 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20609 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
20610 /// let x = UpdateExternalSystemRequest::new().set_external_system(ExternalSystem::default()/* use setters */);
20611 /// ```
20612 pub fn set_external_system<T>(mut self, v: T) -> Self
20613 where
20614 T: std::convert::Into<crate::model::ExternalSystem>,
20615 {
20616 self.external_system = std::option::Option::Some(v.into());
20617 self
20618 }
20619
20620 /// Sets or clears the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
20621 ///
20622 /// # Example
20623 /// ```ignore,no_run
20624 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20625 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
20626 /// let x = UpdateExternalSystemRequest::new().set_or_clear_external_system(Some(ExternalSystem::default()/* use setters */));
20627 /// let x = UpdateExternalSystemRequest::new().set_or_clear_external_system(None::<ExternalSystem>);
20628 /// ```
20629 pub fn set_or_clear_external_system<T>(mut self, v: std::option::Option<T>) -> Self
20630 where
20631 T: std::convert::Into<crate::model::ExternalSystem>,
20632 {
20633 self.external_system = v.map(|x| x.into());
20634 self
20635 }
20636
20637 /// Sets the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
20638 ///
20639 /// # Example
20640 /// ```ignore,no_run
20641 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20642 /// use wkt::FieldMask;
20643 /// let x = UpdateExternalSystemRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20644 /// ```
20645 pub fn set_update_mask<T>(mut self, v: T) -> Self
20646 where
20647 T: std::convert::Into<wkt::FieldMask>,
20648 {
20649 self.update_mask = std::option::Option::Some(v.into());
20650 self
20651 }
20652
20653 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
20654 ///
20655 /// # Example
20656 /// ```ignore,no_run
20657 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20658 /// use wkt::FieldMask;
20659 /// let x = UpdateExternalSystemRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20660 /// let x = UpdateExternalSystemRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20661 /// ```
20662 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20663 where
20664 T: std::convert::Into<wkt::FieldMask>,
20665 {
20666 self.update_mask = v.map(|x| x.into());
20667 self
20668 }
20669}
20670
20671impl wkt::message::Message for UpdateExternalSystemRequest {
20672 fn typename() -> &'static str {
20673 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateExternalSystemRequest"
20674 }
20675}
20676
20677/// Request message for updating or creating a finding.
20678#[derive(Clone, Default, PartialEq)]
20679#[non_exhaustive]
20680pub struct UpdateFindingRequest {
20681 /// Required. The finding resource to update or create if it does not already
20682 /// exist. parent, security_marks, and update_time will be ignored.
20683 ///
20684 /// In the case of creation, the finding id portion of the name must be
20685 /// alphanumeric and less than or equal to 32 characters and greater than 0
20686 /// characters in length.
20687 pub finding: std::option::Option<crate::model::Finding>,
20688
20689 /// The FieldMask to use when updating the finding resource. This field should
20690 /// not be specified when creating a finding.
20691 ///
20692 /// When updating a finding, an empty mask is treated as updating all mutable
20693 /// fields and replacing source_properties. Individual source_properties can
20694 /// be added/updated by using "source_properties.\<property key\>" in the field
20695 /// mask.
20696 pub update_mask: std::option::Option<wkt::FieldMask>,
20697
20698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20699}
20700
20701impl UpdateFindingRequest {
20702 pub fn new() -> Self {
20703 std::default::Default::default()
20704 }
20705
20706 /// Sets the value of [finding][crate::model::UpdateFindingRequest::finding].
20707 ///
20708 /// # Example
20709 /// ```ignore,no_run
20710 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20711 /// use google_cloud_securitycenter_v2::model::Finding;
20712 /// let x = UpdateFindingRequest::new().set_finding(Finding::default()/* use setters */);
20713 /// ```
20714 pub fn set_finding<T>(mut self, v: T) -> Self
20715 where
20716 T: std::convert::Into<crate::model::Finding>,
20717 {
20718 self.finding = std::option::Option::Some(v.into());
20719 self
20720 }
20721
20722 /// Sets or clears the value of [finding][crate::model::UpdateFindingRequest::finding].
20723 ///
20724 /// # Example
20725 /// ```ignore,no_run
20726 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20727 /// use google_cloud_securitycenter_v2::model::Finding;
20728 /// let x = UpdateFindingRequest::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
20729 /// let x = UpdateFindingRequest::new().set_or_clear_finding(None::<Finding>);
20730 /// ```
20731 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
20732 where
20733 T: std::convert::Into<crate::model::Finding>,
20734 {
20735 self.finding = v.map(|x| x.into());
20736 self
20737 }
20738
20739 /// Sets the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
20740 ///
20741 /// # Example
20742 /// ```ignore,no_run
20743 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20744 /// use wkt::FieldMask;
20745 /// let x = UpdateFindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20746 /// ```
20747 pub fn set_update_mask<T>(mut self, v: T) -> Self
20748 where
20749 T: std::convert::Into<wkt::FieldMask>,
20750 {
20751 self.update_mask = std::option::Option::Some(v.into());
20752 self
20753 }
20754
20755 /// Sets or clears the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
20756 ///
20757 /// # Example
20758 /// ```ignore,no_run
20759 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20760 /// use wkt::FieldMask;
20761 /// let x = UpdateFindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20762 /// let x = UpdateFindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20763 /// ```
20764 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20765 where
20766 T: std::convert::Into<wkt::FieldMask>,
20767 {
20768 self.update_mask = v.map(|x| x.into());
20769 self
20770 }
20771}
20772
20773impl wkt::message::Message for UpdateFindingRequest {
20774 fn typename() -> &'static str {
20775 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateFindingRequest"
20776 }
20777}
20778
20779/// Request message for updating a mute config.
20780#[derive(Clone, Default, PartialEq)]
20781#[non_exhaustive]
20782pub struct UpdateMuteConfigRequest {
20783 /// Required. The mute config being updated.
20784 pub mute_config: std::option::Option<crate::model::MuteConfig>,
20785
20786 /// The list of fields to be updated.
20787 /// If empty all mutable fields will be updated.
20788 pub update_mask: std::option::Option<wkt::FieldMask>,
20789
20790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20791}
20792
20793impl UpdateMuteConfigRequest {
20794 pub fn new() -> Self {
20795 std::default::Default::default()
20796 }
20797
20798 /// Sets the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
20799 ///
20800 /// # Example
20801 /// ```ignore,no_run
20802 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20803 /// use google_cloud_securitycenter_v2::model::MuteConfig;
20804 /// let x = UpdateMuteConfigRequest::new().set_mute_config(MuteConfig::default()/* use setters */);
20805 /// ```
20806 pub fn set_mute_config<T>(mut self, v: T) -> Self
20807 where
20808 T: std::convert::Into<crate::model::MuteConfig>,
20809 {
20810 self.mute_config = std::option::Option::Some(v.into());
20811 self
20812 }
20813
20814 /// Sets or clears the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
20815 ///
20816 /// # Example
20817 /// ```ignore,no_run
20818 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20819 /// use google_cloud_securitycenter_v2::model::MuteConfig;
20820 /// let x = UpdateMuteConfigRequest::new().set_or_clear_mute_config(Some(MuteConfig::default()/* use setters */));
20821 /// let x = UpdateMuteConfigRequest::new().set_or_clear_mute_config(None::<MuteConfig>);
20822 /// ```
20823 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
20824 where
20825 T: std::convert::Into<crate::model::MuteConfig>,
20826 {
20827 self.mute_config = v.map(|x| x.into());
20828 self
20829 }
20830
20831 /// Sets the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
20832 ///
20833 /// # Example
20834 /// ```ignore,no_run
20835 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20836 /// use wkt::FieldMask;
20837 /// let x = UpdateMuteConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20838 /// ```
20839 pub fn set_update_mask<T>(mut self, v: T) -> Self
20840 where
20841 T: std::convert::Into<wkt::FieldMask>,
20842 {
20843 self.update_mask = std::option::Option::Some(v.into());
20844 self
20845 }
20846
20847 /// Sets or clears the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
20848 ///
20849 /// # Example
20850 /// ```ignore,no_run
20851 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20852 /// use wkt::FieldMask;
20853 /// let x = UpdateMuteConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20854 /// let x = UpdateMuteConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20855 /// ```
20856 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20857 where
20858 T: std::convert::Into<wkt::FieldMask>,
20859 {
20860 self.update_mask = v.map(|x| x.into());
20861 self
20862 }
20863}
20864
20865impl wkt::message::Message for UpdateMuteConfigRequest {
20866 fn typename() -> &'static str {
20867 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateMuteConfigRequest"
20868 }
20869}
20870
20871/// Request message for updating a notification config.
20872#[derive(Clone, Default, PartialEq)]
20873#[non_exhaustive]
20874pub struct UpdateNotificationConfigRequest {
20875 /// Required. The notification config to update.
20876 pub notification_config: std::option::Option<crate::model::NotificationConfig>,
20877
20878 /// The FieldMask to use when updating the notification config.
20879 ///
20880 /// If empty all mutable fields will be updated.
20881 pub update_mask: std::option::Option<wkt::FieldMask>,
20882
20883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20884}
20885
20886impl UpdateNotificationConfigRequest {
20887 pub fn new() -> Self {
20888 std::default::Default::default()
20889 }
20890
20891 /// Sets the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
20892 ///
20893 /// # Example
20894 /// ```ignore,no_run
20895 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
20896 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
20897 /// let x = UpdateNotificationConfigRequest::new().set_notification_config(NotificationConfig::default()/* use setters */);
20898 /// ```
20899 pub fn set_notification_config<T>(mut self, v: T) -> Self
20900 where
20901 T: std::convert::Into<crate::model::NotificationConfig>,
20902 {
20903 self.notification_config = std::option::Option::Some(v.into());
20904 self
20905 }
20906
20907 /// Sets or clears the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
20908 ///
20909 /// # Example
20910 /// ```ignore,no_run
20911 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
20912 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
20913 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
20914 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_notification_config(None::<NotificationConfig>);
20915 /// ```
20916 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
20917 where
20918 T: std::convert::Into<crate::model::NotificationConfig>,
20919 {
20920 self.notification_config = v.map(|x| x.into());
20921 self
20922 }
20923
20924 /// Sets the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
20925 ///
20926 /// # Example
20927 /// ```ignore,no_run
20928 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
20929 /// use wkt::FieldMask;
20930 /// let x = UpdateNotificationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20931 /// ```
20932 pub fn set_update_mask<T>(mut self, v: T) -> Self
20933 where
20934 T: std::convert::Into<wkt::FieldMask>,
20935 {
20936 self.update_mask = std::option::Option::Some(v.into());
20937 self
20938 }
20939
20940 /// Sets or clears the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
20941 ///
20942 /// # Example
20943 /// ```ignore,no_run
20944 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
20945 /// use wkt::FieldMask;
20946 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20947 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20948 /// ```
20949 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20950 where
20951 T: std::convert::Into<wkt::FieldMask>,
20952 {
20953 self.update_mask = v.map(|x| x.into());
20954 self
20955 }
20956}
20957
20958impl wkt::message::Message for UpdateNotificationConfigRequest {
20959 fn typename() -> &'static str {
20960 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateNotificationConfigRequest"
20961 }
20962}
20963
20964/// Request message to update resource value config
20965#[derive(Clone, Default, PartialEq)]
20966#[non_exhaustive]
20967pub struct UpdateResourceValueConfigRequest {
20968 /// Required. The resource value config being updated.
20969 pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
20970
20971 /// The list of fields to be updated.
20972 /// If empty all mutable fields will be updated.
20973 ///
20974 /// To update nested fields, include the top level field in the mask
20975 /// For example, to update gcp_metadata.resource_type, include the
20976 /// "gcp_metadata" field mask
20977 pub update_mask: std::option::Option<wkt::FieldMask>,
20978
20979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20980}
20981
20982impl UpdateResourceValueConfigRequest {
20983 pub fn new() -> Self {
20984 std::default::Default::default()
20985 }
20986
20987 /// Sets the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
20988 ///
20989 /// # Example
20990 /// ```ignore,no_run
20991 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
20992 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
20993 /// let x = UpdateResourceValueConfigRequest::new().set_resource_value_config(ResourceValueConfig::default()/* use setters */);
20994 /// ```
20995 pub fn set_resource_value_config<T>(mut self, v: T) -> Self
20996 where
20997 T: std::convert::Into<crate::model::ResourceValueConfig>,
20998 {
20999 self.resource_value_config = std::option::Option::Some(v.into());
21000 self
21001 }
21002
21003 /// Sets or clears the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
21004 ///
21005 /// # Example
21006 /// ```ignore,no_run
21007 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21008 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
21009 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_resource_value_config(Some(ResourceValueConfig::default()/* use setters */));
21010 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_resource_value_config(None::<ResourceValueConfig>);
21011 /// ```
21012 pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
21013 where
21014 T: std::convert::Into<crate::model::ResourceValueConfig>,
21015 {
21016 self.resource_value_config = v.map(|x| x.into());
21017 self
21018 }
21019
21020 /// Sets the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
21021 ///
21022 /// # Example
21023 /// ```ignore,no_run
21024 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21025 /// use wkt::FieldMask;
21026 /// let x = UpdateResourceValueConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21027 /// ```
21028 pub fn set_update_mask<T>(mut self, v: T) -> Self
21029 where
21030 T: std::convert::Into<wkt::FieldMask>,
21031 {
21032 self.update_mask = std::option::Option::Some(v.into());
21033 self
21034 }
21035
21036 /// Sets or clears the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
21037 ///
21038 /// # Example
21039 /// ```ignore,no_run
21040 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21041 /// use wkt::FieldMask;
21042 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21043 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21044 /// ```
21045 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21046 where
21047 T: std::convert::Into<wkt::FieldMask>,
21048 {
21049 self.update_mask = v.map(|x| x.into());
21050 self
21051 }
21052}
21053
21054impl wkt::message::Message for UpdateResourceValueConfigRequest {
21055 fn typename() -> &'static str {
21056 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest"
21057 }
21058}
21059
21060/// Request message for updating a SecurityMarks resource.
21061#[derive(Clone, Default, PartialEq)]
21062#[non_exhaustive]
21063pub struct UpdateSecurityMarksRequest {
21064 /// Required. The security marks resource to update.
21065 pub security_marks: std::option::Option<crate::model::SecurityMarks>,
21066
21067 /// The FieldMask to use when updating the security marks resource.
21068 ///
21069 /// The field mask must not contain duplicate fields.
21070 /// If empty or set to "marks", all marks will be replaced. Individual
21071 /// marks can be updated using "marks.<mark_key>".
21072 pub update_mask: std::option::Option<wkt::FieldMask>,
21073
21074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21075}
21076
21077impl UpdateSecurityMarksRequest {
21078 pub fn new() -> Self {
21079 std::default::Default::default()
21080 }
21081
21082 /// Sets the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
21083 ///
21084 /// # Example
21085 /// ```ignore,no_run
21086 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21087 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
21088 /// let x = UpdateSecurityMarksRequest::new().set_security_marks(SecurityMarks::default()/* use setters */);
21089 /// ```
21090 pub fn set_security_marks<T>(mut self, v: T) -> Self
21091 where
21092 T: std::convert::Into<crate::model::SecurityMarks>,
21093 {
21094 self.security_marks = std::option::Option::Some(v.into());
21095 self
21096 }
21097
21098 /// Sets or clears the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
21099 ///
21100 /// # Example
21101 /// ```ignore,no_run
21102 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21103 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
21104 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_security_marks(Some(SecurityMarks::default()/* use setters */));
21105 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_security_marks(None::<SecurityMarks>);
21106 /// ```
21107 pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
21108 where
21109 T: std::convert::Into<crate::model::SecurityMarks>,
21110 {
21111 self.security_marks = v.map(|x| x.into());
21112 self
21113 }
21114
21115 /// Sets the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
21116 ///
21117 /// # Example
21118 /// ```ignore,no_run
21119 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21120 /// use wkt::FieldMask;
21121 /// let x = UpdateSecurityMarksRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21122 /// ```
21123 pub fn set_update_mask<T>(mut self, v: T) -> Self
21124 where
21125 T: std::convert::Into<wkt::FieldMask>,
21126 {
21127 self.update_mask = std::option::Option::Some(v.into());
21128 self
21129 }
21130
21131 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
21132 ///
21133 /// # Example
21134 /// ```ignore,no_run
21135 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21136 /// use wkt::FieldMask;
21137 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21138 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21139 /// ```
21140 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21141 where
21142 T: std::convert::Into<wkt::FieldMask>,
21143 {
21144 self.update_mask = v.map(|x| x.into());
21145 self
21146 }
21147}
21148
21149impl wkt::message::Message for UpdateSecurityMarksRequest {
21150 fn typename() -> &'static str {
21151 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateSecurityMarksRequest"
21152 }
21153}
21154
21155/// Request message for updating a source.
21156#[derive(Clone, Default, PartialEq)]
21157#[non_exhaustive]
21158pub struct UpdateSourceRequest {
21159 /// Required. The source resource to update.
21160 pub source: std::option::Option<crate::model::Source>,
21161
21162 /// The FieldMask to use when updating the source resource.
21163 ///
21164 /// If empty all mutable fields will be updated.
21165 pub update_mask: std::option::Option<wkt::FieldMask>,
21166
21167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21168}
21169
21170impl UpdateSourceRequest {
21171 pub fn new() -> Self {
21172 std::default::Default::default()
21173 }
21174
21175 /// Sets the value of [source][crate::model::UpdateSourceRequest::source].
21176 ///
21177 /// # Example
21178 /// ```ignore,no_run
21179 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21180 /// use google_cloud_securitycenter_v2::model::Source;
21181 /// let x = UpdateSourceRequest::new().set_source(Source::default()/* use setters */);
21182 /// ```
21183 pub fn set_source<T>(mut self, v: T) -> Self
21184 where
21185 T: std::convert::Into<crate::model::Source>,
21186 {
21187 self.source = std::option::Option::Some(v.into());
21188 self
21189 }
21190
21191 /// Sets or clears the value of [source][crate::model::UpdateSourceRequest::source].
21192 ///
21193 /// # Example
21194 /// ```ignore,no_run
21195 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21196 /// use google_cloud_securitycenter_v2::model::Source;
21197 /// let x = UpdateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
21198 /// let x = UpdateSourceRequest::new().set_or_clear_source(None::<Source>);
21199 /// ```
21200 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
21201 where
21202 T: std::convert::Into<crate::model::Source>,
21203 {
21204 self.source = v.map(|x| x.into());
21205 self
21206 }
21207
21208 /// Sets the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
21209 ///
21210 /// # Example
21211 /// ```ignore,no_run
21212 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21213 /// use wkt::FieldMask;
21214 /// let x = UpdateSourceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21215 /// ```
21216 pub fn set_update_mask<T>(mut self, v: T) -> Self
21217 where
21218 T: std::convert::Into<wkt::FieldMask>,
21219 {
21220 self.update_mask = std::option::Option::Some(v.into());
21221 self
21222 }
21223
21224 /// Sets or clears the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
21225 ///
21226 /// # Example
21227 /// ```ignore,no_run
21228 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21229 /// use wkt::FieldMask;
21230 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21231 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21232 /// ```
21233 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21234 where
21235 T: std::convert::Into<wkt::FieldMask>,
21236 {
21237 self.update_mask = v.map(|x| x.into());
21238 self
21239 }
21240}
21241
21242impl wkt::message::Message for UpdateSourceRequest {
21243 fn typename() -> &'static str {
21244 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateSourceRequest"
21245 }
21246}
21247
21248/// Attack path simulation
21249#[derive(Clone, Default, PartialEq)]
21250#[non_exhaustive]
21251pub struct Simulation {
21252 /// Full resource name of the Simulation:
21253 /// `organizations/123/simulations/456`
21254 pub name: std::string::String,
21255
21256 /// Output only. Time simulation was created
21257 pub create_time: std::option::Option<wkt::Timestamp>,
21258
21259 /// Resource value configurations' metadata used in this simulation. Maximum of
21260 /// 100.
21261 pub resource_value_configs_metadata: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
21262
21263 /// Indicates which cloud provider was used in this simulation.
21264 pub cloud_provider: crate::model::CloudProvider,
21265
21266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21267}
21268
21269impl Simulation {
21270 pub fn new() -> Self {
21271 std::default::Default::default()
21272 }
21273
21274 /// Sets the value of [name][crate::model::Simulation::name].
21275 ///
21276 /// # Example
21277 /// ```ignore,no_run
21278 /// # use google_cloud_securitycenter_v2::model::Simulation;
21279 /// let x = Simulation::new().set_name("example");
21280 /// ```
21281 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21282 self.name = v.into();
21283 self
21284 }
21285
21286 /// Sets the value of [create_time][crate::model::Simulation::create_time].
21287 ///
21288 /// # Example
21289 /// ```ignore,no_run
21290 /// # use google_cloud_securitycenter_v2::model::Simulation;
21291 /// use wkt::Timestamp;
21292 /// let x = Simulation::new().set_create_time(Timestamp::default()/* use setters */);
21293 /// ```
21294 pub fn set_create_time<T>(mut self, v: T) -> Self
21295 where
21296 T: std::convert::Into<wkt::Timestamp>,
21297 {
21298 self.create_time = std::option::Option::Some(v.into());
21299 self
21300 }
21301
21302 /// Sets or clears the value of [create_time][crate::model::Simulation::create_time].
21303 ///
21304 /// # Example
21305 /// ```ignore,no_run
21306 /// # use google_cloud_securitycenter_v2::model::Simulation;
21307 /// use wkt::Timestamp;
21308 /// let x = Simulation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21309 /// let x = Simulation::new().set_or_clear_create_time(None::<Timestamp>);
21310 /// ```
21311 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21312 where
21313 T: std::convert::Into<wkt::Timestamp>,
21314 {
21315 self.create_time = v.map(|x| x.into());
21316 self
21317 }
21318
21319 /// Sets the value of [resource_value_configs_metadata][crate::model::Simulation::resource_value_configs_metadata].
21320 ///
21321 /// # Example
21322 /// ```ignore,no_run
21323 /// # use google_cloud_securitycenter_v2::model::Simulation;
21324 /// use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21325 /// let x = Simulation::new()
21326 /// .set_resource_value_configs_metadata([
21327 /// ResourceValueConfigMetadata::default()/* use setters */,
21328 /// ResourceValueConfigMetadata::default()/* use (different) setters */,
21329 /// ]);
21330 /// ```
21331 pub fn set_resource_value_configs_metadata<T, V>(mut self, v: T) -> Self
21332 where
21333 T: std::iter::IntoIterator<Item = V>,
21334 V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
21335 {
21336 use std::iter::Iterator;
21337 self.resource_value_configs_metadata = v.into_iter().map(|i| i.into()).collect();
21338 self
21339 }
21340
21341 /// Sets the value of [cloud_provider][crate::model::Simulation::cloud_provider].
21342 ///
21343 /// # Example
21344 /// ```ignore,no_run
21345 /// # use google_cloud_securitycenter_v2::model::Simulation;
21346 /// use google_cloud_securitycenter_v2::model::CloudProvider;
21347 /// let x0 = Simulation::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
21348 /// let x1 = Simulation::new().set_cloud_provider(CloudProvider::AmazonWebServices);
21349 /// let x2 = Simulation::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
21350 /// ```
21351 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
21352 mut self,
21353 v: T,
21354 ) -> Self {
21355 self.cloud_provider = v.into();
21356 self
21357 }
21358}
21359
21360impl wkt::message::Message for Simulation {
21361 fn typename() -> &'static str {
21362 "type.googleapis.com/google.cloud.securitycenter.v2.Simulation"
21363 }
21364}
21365
21366/// Security Command Center finding source. A finding source
21367/// is an entity or a mechanism that can produce a finding. A source is like a
21368/// container of findings that come from the same scanner, logger, monitor, and
21369/// other tools.
21370#[derive(Clone, Default, PartialEq)]
21371#[non_exhaustive]
21372pub struct Source {
21373 /// The relative resource name of this source. See:
21374 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
21375 /// Example:
21376 /// "organizations/{organization_id}/sources/{source_id}"
21377 pub name: std::string::String,
21378
21379 /// The source's display name.
21380 /// A source's display name must be unique amongst its siblings, for example,
21381 /// two sources with the same parent can't share the same display name.
21382 /// The display name must have a length between 1 and 64 characters
21383 /// (inclusive).
21384 pub display_name: std::string::String,
21385
21386 /// The description of the source (max of 1024 characters).
21387 /// Example:
21388 /// "Web Security Scanner is a web security scanner for common
21389 /// vulnerabilities in App Engine applications. It can automatically
21390 /// scan and detect four common vulnerabilities, including cross-site-scripting
21391 /// (XSS), Flash injection, mixed content (HTTP in HTTPS), and
21392 /// outdated or insecure libraries."
21393 pub description: std::string::String,
21394
21395 /// The canonical name of the finding source. It's either
21396 /// "organizations/{organization_id}/sources/{source_id}",
21397 /// "folders/{folder_id}/sources/{source_id}", or
21398 /// "projects/{project_number}/sources/{source_id}",
21399 /// depending on the closest CRM ancestor of the resource associated with the
21400 /// finding.
21401 pub canonical_name: std::string::String,
21402
21403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21404}
21405
21406impl Source {
21407 pub fn new() -> Self {
21408 std::default::Default::default()
21409 }
21410
21411 /// Sets the value of [name][crate::model::Source::name].
21412 ///
21413 /// # Example
21414 /// ```ignore,no_run
21415 /// # use google_cloud_securitycenter_v2::model::Source;
21416 /// let x = Source::new().set_name("example");
21417 /// ```
21418 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21419 self.name = v.into();
21420 self
21421 }
21422
21423 /// Sets the value of [display_name][crate::model::Source::display_name].
21424 ///
21425 /// # Example
21426 /// ```ignore,no_run
21427 /// # use google_cloud_securitycenter_v2::model::Source;
21428 /// let x = Source::new().set_display_name("example");
21429 /// ```
21430 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21431 self.display_name = v.into();
21432 self
21433 }
21434
21435 /// Sets the value of [description][crate::model::Source::description].
21436 ///
21437 /// # Example
21438 /// ```ignore,no_run
21439 /// # use google_cloud_securitycenter_v2::model::Source;
21440 /// let x = Source::new().set_description("example");
21441 /// ```
21442 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21443 self.description = v.into();
21444 self
21445 }
21446
21447 /// Sets the value of [canonical_name][crate::model::Source::canonical_name].
21448 ///
21449 /// # Example
21450 /// ```ignore,no_run
21451 /// # use google_cloud_securitycenter_v2::model::Source;
21452 /// let x = Source::new().set_canonical_name("example");
21453 /// ```
21454 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21455 self.canonical_name = v.into();
21456 self
21457 }
21458}
21459
21460impl wkt::message::Message for Source {
21461 fn typename() -> &'static str {
21462 "type.googleapis.com/google.cloud.securitycenter.v2.Source"
21463 }
21464}
21465
21466/// Contains details about a group of security issues that, when the issues
21467/// occur together, represent a greater risk than when the issues occur
21468/// independently. A group of such issues is referred to as a toxic
21469/// combination.
21470#[derive(Clone, Default, PartialEq)]
21471#[non_exhaustive]
21472pub struct ToxicCombination {
21473 /// The
21474 /// [Attack exposure
21475 /// score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores)
21476 /// of this toxic combination. The score is a measure of how much this toxic
21477 /// combination exposes one or more high-value resources to potential attack.
21478 pub attack_exposure_score: f64,
21479
21480 /// List of resource names of findings associated with this toxic combination.
21481 /// For example, `organizations/123/sources/456/findings/789`.
21482 pub related_findings: std::vec::Vec<std::string::String>,
21483
21484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21485}
21486
21487impl ToxicCombination {
21488 pub fn new() -> Self {
21489 std::default::Default::default()
21490 }
21491
21492 /// Sets the value of [attack_exposure_score][crate::model::ToxicCombination::attack_exposure_score].
21493 ///
21494 /// # Example
21495 /// ```ignore,no_run
21496 /// # use google_cloud_securitycenter_v2::model::ToxicCombination;
21497 /// let x = ToxicCombination::new().set_attack_exposure_score(42.0);
21498 /// ```
21499 pub fn set_attack_exposure_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
21500 self.attack_exposure_score = v.into();
21501 self
21502 }
21503
21504 /// Sets the value of [related_findings][crate::model::ToxicCombination::related_findings].
21505 ///
21506 /// # Example
21507 /// ```ignore,no_run
21508 /// # use google_cloud_securitycenter_v2::model::ToxicCombination;
21509 /// let x = ToxicCombination::new().set_related_findings(["a", "b", "c"]);
21510 /// ```
21511 pub fn set_related_findings<T, V>(mut self, v: T) -> Self
21512 where
21513 T: std::iter::IntoIterator<Item = V>,
21514 V: std::convert::Into<std::string::String>,
21515 {
21516 use std::iter::Iterator;
21517 self.related_findings = v.into_iter().map(|i| i.into()).collect();
21518 self
21519 }
21520}
21521
21522impl wkt::message::Message for ToxicCombination {
21523 fn typename() -> &'static str {
21524 "type.googleapis.com/google.cloud.securitycenter.v2.ToxicCombination"
21525 }
21526}
21527
21528/// A resource that is determined to have value to a user's system
21529#[derive(Clone, Default, PartialEq)]
21530#[non_exhaustive]
21531pub struct ValuedResource {
21532 /// Valued resource name, for example,
21533 /// e.g.:
21534 /// `organizations/123/simulations/456/valuedResources/789`
21535 pub name: std::string::String,
21536
21537 /// The
21538 /// [full resource
21539 /// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
21540 /// of the valued resource.
21541 pub resource: std::string::String,
21542
21543 /// The [resource
21544 /// type](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
21545 /// of the valued resource.
21546 pub resource_type: std::string::String,
21547
21548 /// Human-readable name of the valued resource.
21549 pub display_name: std::string::String,
21550
21551 /// How valuable this resource is.
21552 pub resource_value: crate::model::valued_resource::ResourceValue,
21553
21554 /// Exposed score for this valued resource. A value of 0 means no exposure was
21555 /// detected exposure.
21556 pub exposed_score: f64,
21557
21558 /// List of resource value configurations' metadata used to determine the value
21559 /// of this resource. Maximum of 100.
21560 pub resource_value_configs_used: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
21561
21562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21563}
21564
21565impl ValuedResource {
21566 pub fn new() -> Self {
21567 std::default::Default::default()
21568 }
21569
21570 /// Sets the value of [name][crate::model::ValuedResource::name].
21571 ///
21572 /// # Example
21573 /// ```ignore,no_run
21574 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21575 /// let x = ValuedResource::new().set_name("example");
21576 /// ```
21577 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21578 self.name = v.into();
21579 self
21580 }
21581
21582 /// Sets the value of [resource][crate::model::ValuedResource::resource].
21583 ///
21584 /// # Example
21585 /// ```ignore,no_run
21586 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21587 /// let x = ValuedResource::new().set_resource("example");
21588 /// ```
21589 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21590 self.resource = v.into();
21591 self
21592 }
21593
21594 /// Sets the value of [resource_type][crate::model::ValuedResource::resource_type].
21595 ///
21596 /// # Example
21597 /// ```ignore,no_run
21598 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21599 /// let x = ValuedResource::new().set_resource_type("example");
21600 /// ```
21601 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21602 self.resource_type = v.into();
21603 self
21604 }
21605
21606 /// Sets the value of [display_name][crate::model::ValuedResource::display_name].
21607 ///
21608 /// # Example
21609 /// ```ignore,no_run
21610 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21611 /// let x = ValuedResource::new().set_display_name("example");
21612 /// ```
21613 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21614 self.display_name = v.into();
21615 self
21616 }
21617
21618 /// Sets the value of [resource_value][crate::model::ValuedResource::resource_value].
21619 ///
21620 /// # Example
21621 /// ```ignore,no_run
21622 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21623 /// use google_cloud_securitycenter_v2::model::valued_resource::ResourceValue;
21624 /// let x0 = ValuedResource::new().set_resource_value(ResourceValue::Low);
21625 /// let x1 = ValuedResource::new().set_resource_value(ResourceValue::Medium);
21626 /// let x2 = ValuedResource::new().set_resource_value(ResourceValue::High);
21627 /// ```
21628 pub fn set_resource_value<
21629 T: std::convert::Into<crate::model::valued_resource::ResourceValue>,
21630 >(
21631 mut self,
21632 v: T,
21633 ) -> Self {
21634 self.resource_value = v.into();
21635 self
21636 }
21637
21638 /// Sets the value of [exposed_score][crate::model::ValuedResource::exposed_score].
21639 ///
21640 /// # Example
21641 /// ```ignore,no_run
21642 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21643 /// let x = ValuedResource::new().set_exposed_score(42.0);
21644 /// ```
21645 pub fn set_exposed_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
21646 self.exposed_score = v.into();
21647 self
21648 }
21649
21650 /// Sets the value of [resource_value_configs_used][crate::model::ValuedResource::resource_value_configs_used].
21651 ///
21652 /// # Example
21653 /// ```ignore,no_run
21654 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21655 /// use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21656 /// let x = ValuedResource::new()
21657 /// .set_resource_value_configs_used([
21658 /// ResourceValueConfigMetadata::default()/* use setters */,
21659 /// ResourceValueConfigMetadata::default()/* use (different) setters */,
21660 /// ]);
21661 /// ```
21662 pub fn set_resource_value_configs_used<T, V>(mut self, v: T) -> Self
21663 where
21664 T: std::iter::IntoIterator<Item = V>,
21665 V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
21666 {
21667 use std::iter::Iterator;
21668 self.resource_value_configs_used = v.into_iter().map(|i| i.into()).collect();
21669 self
21670 }
21671}
21672
21673impl wkt::message::Message for ValuedResource {
21674 fn typename() -> &'static str {
21675 "type.googleapis.com/google.cloud.securitycenter.v2.ValuedResource"
21676 }
21677}
21678
21679/// Defines additional types related to [ValuedResource].
21680pub mod valued_resource {
21681 #[allow(unused_imports)]
21682 use super::*;
21683
21684 /// How valuable the resource is.
21685 ///
21686 /// # Working with unknown values
21687 ///
21688 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21689 /// additional enum variants at any time. Adding new variants is not considered
21690 /// a breaking change. Applications should write their code in anticipation of:
21691 ///
21692 /// - New values appearing in future releases of the client library, **and**
21693 /// - New values received dynamically, without application changes.
21694 ///
21695 /// Please consult the [Working with enums] section in the user guide for some
21696 /// guidelines.
21697 ///
21698 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
21699 #[derive(Clone, Debug, PartialEq)]
21700 #[non_exhaustive]
21701 pub enum ResourceValue {
21702 /// The resource value isn't specified.
21703 Unspecified,
21704 /// This is a low-value resource.
21705 Low,
21706 /// This is a medium-value resource.
21707 Medium,
21708 /// This is a high-value resource.
21709 High,
21710 /// If set, the enum was initialized with an unknown value.
21711 ///
21712 /// Applications can examine the value using [ResourceValue::value] or
21713 /// [ResourceValue::name].
21714 UnknownValue(resource_value::UnknownValue),
21715 }
21716
21717 #[doc(hidden)]
21718 pub mod resource_value {
21719 #[allow(unused_imports)]
21720 use super::*;
21721 #[derive(Clone, Debug, PartialEq)]
21722 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21723 }
21724
21725 impl ResourceValue {
21726 /// Gets the enum value.
21727 ///
21728 /// Returns `None` if the enum contains an unknown value deserialized from
21729 /// the string representation of enums.
21730 pub fn value(&self) -> std::option::Option<i32> {
21731 match self {
21732 Self::Unspecified => std::option::Option::Some(0),
21733 Self::Low => std::option::Option::Some(1),
21734 Self::Medium => std::option::Option::Some(2),
21735 Self::High => std::option::Option::Some(3),
21736 Self::UnknownValue(u) => u.0.value(),
21737 }
21738 }
21739
21740 /// Gets the enum value as a string.
21741 ///
21742 /// Returns `None` if the enum contains an unknown value deserialized from
21743 /// the integer representation of enums.
21744 pub fn name(&self) -> std::option::Option<&str> {
21745 match self {
21746 Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
21747 Self::Low => std::option::Option::Some("RESOURCE_VALUE_LOW"),
21748 Self::Medium => std::option::Option::Some("RESOURCE_VALUE_MEDIUM"),
21749 Self::High => std::option::Option::Some("RESOURCE_VALUE_HIGH"),
21750 Self::UnknownValue(u) => u.0.name(),
21751 }
21752 }
21753 }
21754
21755 impl std::default::Default for ResourceValue {
21756 fn default() -> Self {
21757 use std::convert::From;
21758 Self::from(0)
21759 }
21760 }
21761
21762 impl std::fmt::Display for ResourceValue {
21763 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21764 wkt::internal::display_enum(f, self.name(), self.value())
21765 }
21766 }
21767
21768 impl std::convert::From<i32> for ResourceValue {
21769 fn from(value: i32) -> Self {
21770 match value {
21771 0 => Self::Unspecified,
21772 1 => Self::Low,
21773 2 => Self::Medium,
21774 3 => Self::High,
21775 _ => Self::UnknownValue(resource_value::UnknownValue(
21776 wkt::internal::UnknownEnumValue::Integer(value),
21777 )),
21778 }
21779 }
21780 }
21781
21782 impl std::convert::From<&str> for ResourceValue {
21783 fn from(value: &str) -> Self {
21784 use std::string::ToString;
21785 match value {
21786 "RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
21787 "RESOURCE_VALUE_LOW" => Self::Low,
21788 "RESOURCE_VALUE_MEDIUM" => Self::Medium,
21789 "RESOURCE_VALUE_HIGH" => Self::High,
21790 _ => Self::UnknownValue(resource_value::UnknownValue(
21791 wkt::internal::UnknownEnumValue::String(value.to_string()),
21792 )),
21793 }
21794 }
21795 }
21796
21797 impl serde::ser::Serialize for ResourceValue {
21798 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21799 where
21800 S: serde::Serializer,
21801 {
21802 match self {
21803 Self::Unspecified => serializer.serialize_i32(0),
21804 Self::Low => serializer.serialize_i32(1),
21805 Self::Medium => serializer.serialize_i32(2),
21806 Self::High => serializer.serialize_i32(3),
21807 Self::UnknownValue(u) => u.0.serialize(serializer),
21808 }
21809 }
21810 }
21811
21812 impl<'de> serde::de::Deserialize<'de> for ResourceValue {
21813 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21814 where
21815 D: serde::Deserializer<'de>,
21816 {
21817 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
21818 ".google.cloud.securitycenter.v2.ValuedResource.ResourceValue",
21819 ))
21820 }
21821 }
21822}
21823
21824/// Metadata about a ResourceValueConfig. For example, id and name.
21825#[derive(Clone, Default, PartialEq)]
21826#[non_exhaustive]
21827pub struct ResourceValueConfigMetadata {
21828 /// Resource value config name
21829 pub name: std::string::String,
21830
21831 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21832}
21833
21834impl ResourceValueConfigMetadata {
21835 pub fn new() -> Self {
21836 std::default::Default::default()
21837 }
21838
21839 /// Sets the value of [name][crate::model::ResourceValueConfigMetadata::name].
21840 ///
21841 /// # Example
21842 /// ```ignore,no_run
21843 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21844 /// let x = ResourceValueConfigMetadata::new().set_name("example");
21845 /// ```
21846 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21847 self.name = v.into();
21848 self
21849 }
21850}
21851
21852impl wkt::message::Message for ResourceValueConfigMetadata {
21853 fn typename() -> &'static str {
21854 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfigMetadata"
21855 }
21856}
21857
21858/// Vertex AI-related information associated with the finding.
21859#[derive(Clone, Default, PartialEq)]
21860#[non_exhaustive]
21861pub struct VertexAi {
21862 /// Datasets associated with the finding.
21863 pub datasets: std::vec::Vec<crate::model::vertex_ai::Dataset>,
21864
21865 /// Pipelines associated with the finding.
21866 pub pipelines: std::vec::Vec<crate::model::vertex_ai::Pipeline>,
21867
21868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21869}
21870
21871impl VertexAi {
21872 pub fn new() -> Self {
21873 std::default::Default::default()
21874 }
21875
21876 /// Sets the value of [datasets][crate::model::VertexAi::datasets].
21877 ///
21878 /// # Example
21879 /// ```ignore,no_run
21880 /// # use google_cloud_securitycenter_v2::model::VertexAi;
21881 /// use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
21882 /// let x = VertexAi::new()
21883 /// .set_datasets([
21884 /// Dataset::default()/* use setters */,
21885 /// Dataset::default()/* use (different) setters */,
21886 /// ]);
21887 /// ```
21888 pub fn set_datasets<T, V>(mut self, v: T) -> Self
21889 where
21890 T: std::iter::IntoIterator<Item = V>,
21891 V: std::convert::Into<crate::model::vertex_ai::Dataset>,
21892 {
21893 use std::iter::Iterator;
21894 self.datasets = v.into_iter().map(|i| i.into()).collect();
21895 self
21896 }
21897
21898 /// Sets the value of [pipelines][crate::model::VertexAi::pipelines].
21899 ///
21900 /// # Example
21901 /// ```ignore,no_run
21902 /// # use google_cloud_securitycenter_v2::model::VertexAi;
21903 /// use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
21904 /// let x = VertexAi::new()
21905 /// .set_pipelines([
21906 /// Pipeline::default()/* use setters */,
21907 /// Pipeline::default()/* use (different) setters */,
21908 /// ]);
21909 /// ```
21910 pub fn set_pipelines<T, V>(mut self, v: T) -> Self
21911 where
21912 T: std::iter::IntoIterator<Item = V>,
21913 V: std::convert::Into<crate::model::vertex_ai::Pipeline>,
21914 {
21915 use std::iter::Iterator;
21916 self.pipelines = v.into_iter().map(|i| i.into()).collect();
21917 self
21918 }
21919}
21920
21921impl wkt::message::Message for VertexAi {
21922 fn typename() -> &'static str {
21923 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi"
21924 }
21925}
21926
21927/// Defines additional types related to [VertexAi].
21928pub mod vertex_ai {
21929 #[allow(unused_imports)]
21930 use super::*;
21931
21932 /// Vertex AI dataset associated with the finding.
21933 #[derive(Clone, Default, PartialEq)]
21934 #[non_exhaustive]
21935 pub struct Dataset {
21936 /// Resource name of the dataset, e.g.
21937 /// projects/{project}/locations/{location}/datasets/2094040236064505856
21938 pub name: std::string::String,
21939
21940 /// The user defined display name of dataset, e.g. plants-dataset
21941 pub display_name: std::string::String,
21942
21943 /// Data source, such as a BigQuery source URI, e.g.
21944 /// bq://scc-nexus-test.AIPPtest.gsod
21945 pub source: std::string::String,
21946
21947 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21948 }
21949
21950 impl Dataset {
21951 pub fn new() -> Self {
21952 std::default::Default::default()
21953 }
21954
21955 /// Sets the value of [name][crate::model::vertex_ai::Dataset::name].
21956 ///
21957 /// # Example
21958 /// ```ignore,no_run
21959 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
21960 /// let x = Dataset::new().set_name("example");
21961 /// ```
21962 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21963 self.name = v.into();
21964 self
21965 }
21966
21967 /// Sets the value of [display_name][crate::model::vertex_ai::Dataset::display_name].
21968 ///
21969 /// # Example
21970 /// ```ignore,no_run
21971 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
21972 /// let x = Dataset::new().set_display_name("example");
21973 /// ```
21974 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
21975 mut self,
21976 v: T,
21977 ) -> Self {
21978 self.display_name = v.into();
21979 self
21980 }
21981
21982 /// Sets the value of [source][crate::model::vertex_ai::Dataset::source].
21983 ///
21984 /// # Example
21985 /// ```ignore,no_run
21986 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
21987 /// let x = Dataset::new().set_source("example");
21988 /// ```
21989 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21990 self.source = v.into();
21991 self
21992 }
21993 }
21994
21995 impl wkt::message::Message for Dataset {
21996 fn typename() -> &'static str {
21997 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Dataset"
21998 }
21999 }
22000
22001 /// Vertex AI training pipeline associated with the finding.
22002 #[derive(Clone, Default, PartialEq)]
22003 #[non_exhaustive]
22004 pub struct Pipeline {
22005 /// Resource name of the pipeline, e.g.
22006 /// projects/{project}/locations/{location}/trainingPipelines/5253428229225578496
22007 pub name: std::string::String,
22008
22009 /// The user-defined display name of pipeline, e.g. plants-classification
22010 pub display_name: std::string::String,
22011
22012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22013 }
22014
22015 impl Pipeline {
22016 pub fn new() -> Self {
22017 std::default::Default::default()
22018 }
22019
22020 /// Sets the value of [name][crate::model::vertex_ai::Pipeline::name].
22021 ///
22022 /// # Example
22023 /// ```ignore,no_run
22024 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22025 /// let x = Pipeline::new().set_name("example");
22026 /// ```
22027 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22028 self.name = v.into();
22029 self
22030 }
22031
22032 /// Sets the value of [display_name][crate::model::vertex_ai::Pipeline::display_name].
22033 ///
22034 /// # Example
22035 /// ```ignore,no_run
22036 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22037 /// let x = Pipeline::new().set_display_name("example");
22038 /// ```
22039 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
22040 mut self,
22041 v: T,
22042 ) -> Self {
22043 self.display_name = v.into();
22044 self
22045 }
22046 }
22047
22048 impl wkt::message::Message for Pipeline {
22049 fn typename() -> &'static str {
22050 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Pipeline"
22051 }
22052 }
22053}
22054
22055/// Refers to common vulnerability fields e.g. cve, cvss, cwe etc.
22056#[derive(Clone, Default, PartialEq)]
22057#[non_exhaustive]
22058pub struct Vulnerability {
22059 /// CVE stands for Common Vulnerabilities and Exposures
22060 /// (<https://cve.mitre.org/about/>)
22061 pub cve: std::option::Option<crate::model::Cve>,
22062
22063 /// The offending package is relevant to the finding.
22064 pub offending_package: std::option::Option<crate::model::Package>,
22065
22066 /// The fixed package is relevant to the finding.
22067 pub fixed_package: std::option::Option<crate::model::Package>,
22068
22069 /// The security bulletin is relevant to this finding.
22070 pub security_bulletin: std::option::Option<crate::model::SecurityBulletin>,
22071
22072 /// Provider provided risk_score based on multiple factors. The higher the risk
22073 /// score, the more risky the vulnerability is.
22074 pub provider_risk_score: i64,
22075
22076 /// Represents whether the vulnerability is reachable (detected via static
22077 /// analysis)
22078 pub reachable: bool,
22079
22080 /// Represents one or more Common Weakness Enumeration (CWE) information on
22081 /// this vulnerability.
22082 pub cwes: std::vec::Vec<crate::model::Cwe>,
22083
22084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22085}
22086
22087impl Vulnerability {
22088 pub fn new() -> Self {
22089 std::default::Default::default()
22090 }
22091
22092 /// Sets the value of [cve][crate::model::Vulnerability::cve].
22093 ///
22094 /// # Example
22095 /// ```ignore,no_run
22096 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22097 /// use google_cloud_securitycenter_v2::model::Cve;
22098 /// let x = Vulnerability::new().set_cve(Cve::default()/* use setters */);
22099 /// ```
22100 pub fn set_cve<T>(mut self, v: T) -> Self
22101 where
22102 T: std::convert::Into<crate::model::Cve>,
22103 {
22104 self.cve = std::option::Option::Some(v.into());
22105 self
22106 }
22107
22108 /// Sets or clears the value of [cve][crate::model::Vulnerability::cve].
22109 ///
22110 /// # Example
22111 /// ```ignore,no_run
22112 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22113 /// use google_cloud_securitycenter_v2::model::Cve;
22114 /// let x = Vulnerability::new().set_or_clear_cve(Some(Cve::default()/* use setters */));
22115 /// let x = Vulnerability::new().set_or_clear_cve(None::<Cve>);
22116 /// ```
22117 pub fn set_or_clear_cve<T>(mut self, v: std::option::Option<T>) -> Self
22118 where
22119 T: std::convert::Into<crate::model::Cve>,
22120 {
22121 self.cve = v.map(|x| x.into());
22122 self
22123 }
22124
22125 /// Sets the value of [offending_package][crate::model::Vulnerability::offending_package].
22126 ///
22127 /// # Example
22128 /// ```ignore,no_run
22129 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22130 /// use google_cloud_securitycenter_v2::model::Package;
22131 /// let x = Vulnerability::new().set_offending_package(Package::default()/* use setters */);
22132 /// ```
22133 pub fn set_offending_package<T>(mut self, v: T) -> Self
22134 where
22135 T: std::convert::Into<crate::model::Package>,
22136 {
22137 self.offending_package = std::option::Option::Some(v.into());
22138 self
22139 }
22140
22141 /// Sets or clears the value of [offending_package][crate::model::Vulnerability::offending_package].
22142 ///
22143 /// # Example
22144 /// ```ignore,no_run
22145 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22146 /// use google_cloud_securitycenter_v2::model::Package;
22147 /// let x = Vulnerability::new().set_or_clear_offending_package(Some(Package::default()/* use setters */));
22148 /// let x = Vulnerability::new().set_or_clear_offending_package(None::<Package>);
22149 /// ```
22150 pub fn set_or_clear_offending_package<T>(mut self, v: std::option::Option<T>) -> Self
22151 where
22152 T: std::convert::Into<crate::model::Package>,
22153 {
22154 self.offending_package = v.map(|x| x.into());
22155 self
22156 }
22157
22158 /// Sets the value of [fixed_package][crate::model::Vulnerability::fixed_package].
22159 ///
22160 /// # Example
22161 /// ```ignore,no_run
22162 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22163 /// use google_cloud_securitycenter_v2::model::Package;
22164 /// let x = Vulnerability::new().set_fixed_package(Package::default()/* use setters */);
22165 /// ```
22166 pub fn set_fixed_package<T>(mut self, v: T) -> Self
22167 where
22168 T: std::convert::Into<crate::model::Package>,
22169 {
22170 self.fixed_package = std::option::Option::Some(v.into());
22171 self
22172 }
22173
22174 /// Sets or clears the value of [fixed_package][crate::model::Vulnerability::fixed_package].
22175 ///
22176 /// # Example
22177 /// ```ignore,no_run
22178 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22179 /// use google_cloud_securitycenter_v2::model::Package;
22180 /// let x = Vulnerability::new().set_or_clear_fixed_package(Some(Package::default()/* use setters */));
22181 /// let x = Vulnerability::new().set_or_clear_fixed_package(None::<Package>);
22182 /// ```
22183 pub fn set_or_clear_fixed_package<T>(mut self, v: std::option::Option<T>) -> Self
22184 where
22185 T: std::convert::Into<crate::model::Package>,
22186 {
22187 self.fixed_package = v.map(|x| x.into());
22188 self
22189 }
22190
22191 /// Sets the value of [security_bulletin][crate::model::Vulnerability::security_bulletin].
22192 ///
22193 /// # Example
22194 /// ```ignore,no_run
22195 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22196 /// use google_cloud_securitycenter_v2::model::SecurityBulletin;
22197 /// let x = Vulnerability::new().set_security_bulletin(SecurityBulletin::default()/* use setters */);
22198 /// ```
22199 pub fn set_security_bulletin<T>(mut self, v: T) -> Self
22200 where
22201 T: std::convert::Into<crate::model::SecurityBulletin>,
22202 {
22203 self.security_bulletin = std::option::Option::Some(v.into());
22204 self
22205 }
22206
22207 /// Sets or clears the value of [security_bulletin][crate::model::Vulnerability::security_bulletin].
22208 ///
22209 /// # Example
22210 /// ```ignore,no_run
22211 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22212 /// use google_cloud_securitycenter_v2::model::SecurityBulletin;
22213 /// let x = Vulnerability::new().set_or_clear_security_bulletin(Some(SecurityBulletin::default()/* use setters */));
22214 /// let x = Vulnerability::new().set_or_clear_security_bulletin(None::<SecurityBulletin>);
22215 /// ```
22216 pub fn set_or_clear_security_bulletin<T>(mut self, v: std::option::Option<T>) -> Self
22217 where
22218 T: std::convert::Into<crate::model::SecurityBulletin>,
22219 {
22220 self.security_bulletin = v.map(|x| x.into());
22221 self
22222 }
22223
22224 /// Sets the value of [provider_risk_score][crate::model::Vulnerability::provider_risk_score].
22225 ///
22226 /// # Example
22227 /// ```ignore,no_run
22228 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22229 /// let x = Vulnerability::new().set_provider_risk_score(42);
22230 /// ```
22231 pub fn set_provider_risk_score<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22232 self.provider_risk_score = v.into();
22233 self
22234 }
22235
22236 /// Sets the value of [reachable][crate::model::Vulnerability::reachable].
22237 ///
22238 /// # Example
22239 /// ```ignore,no_run
22240 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22241 /// let x = Vulnerability::new().set_reachable(true);
22242 /// ```
22243 pub fn set_reachable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22244 self.reachable = v.into();
22245 self
22246 }
22247
22248 /// Sets the value of [cwes][crate::model::Vulnerability::cwes].
22249 ///
22250 /// # Example
22251 /// ```ignore,no_run
22252 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22253 /// use google_cloud_securitycenter_v2::model::Cwe;
22254 /// let x = Vulnerability::new()
22255 /// .set_cwes([
22256 /// Cwe::default()/* use setters */,
22257 /// Cwe::default()/* use (different) setters */,
22258 /// ]);
22259 /// ```
22260 pub fn set_cwes<T, V>(mut self, v: T) -> Self
22261 where
22262 T: std::iter::IntoIterator<Item = V>,
22263 V: std::convert::Into<crate::model::Cwe>,
22264 {
22265 use std::iter::Iterator;
22266 self.cwes = v.into_iter().map(|i| i.into()).collect();
22267 self
22268 }
22269}
22270
22271impl wkt::message::Message for Vulnerability {
22272 fn typename() -> &'static str {
22273 "type.googleapis.com/google.cloud.securitycenter.v2.Vulnerability"
22274 }
22275}
22276
22277/// CVE stands for Common Vulnerabilities and Exposures.
22278/// Information from the [CVE
22279/// record](https://www.cve.org/ResourcesSupport/Glossary) that describes this
22280/// vulnerability.
22281#[derive(Clone, Default, PartialEq)]
22282#[non_exhaustive]
22283pub struct Cve {
22284 /// The unique identifier for the vulnerability. e.g. CVE-2021-34527
22285 pub id: std::string::String,
22286
22287 /// Additional information about the CVE.
22288 /// e.g. <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527>
22289 pub references: std::vec::Vec<crate::model::Reference>,
22290
22291 /// Describe Common Vulnerability Scoring System specified at
22292 /// <https://www.first.org/cvss/v3.1/specification-document>
22293 pub cvssv3: std::option::Option<crate::model::Cvssv3>,
22294
22295 /// Whether upstream fix is available for the CVE.
22296 pub upstream_fix_available: bool,
22297
22298 /// The potential impact of the vulnerability if it was to be exploited.
22299 pub impact: crate::model::cve::RiskRating,
22300
22301 /// The exploitation activity of the vulnerability in the wild.
22302 pub exploitation_activity: crate::model::cve::ExploitationActivity,
22303
22304 /// Whether or not the vulnerability has been observed in the wild.
22305 pub observed_in_the_wild: bool,
22306
22307 /// Whether or not the vulnerability was zero day when the finding was
22308 /// published.
22309 pub zero_day: bool,
22310
22311 /// Date the first publicly available exploit or PoC was released.
22312 pub exploit_release_date: std::option::Option<wkt::Timestamp>,
22313
22314 /// Date of the earliest known exploitation.
22315 pub first_exploitation_date: std::option::Option<wkt::Timestamp>,
22316
22317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22318}
22319
22320impl Cve {
22321 pub fn new() -> Self {
22322 std::default::Default::default()
22323 }
22324
22325 /// Sets the value of [id][crate::model::Cve::id].
22326 ///
22327 /// # Example
22328 /// ```ignore,no_run
22329 /// # use google_cloud_securitycenter_v2::model::Cve;
22330 /// let x = Cve::new().set_id("example");
22331 /// ```
22332 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22333 self.id = v.into();
22334 self
22335 }
22336
22337 /// Sets the value of [references][crate::model::Cve::references].
22338 ///
22339 /// # Example
22340 /// ```ignore,no_run
22341 /// # use google_cloud_securitycenter_v2::model::Cve;
22342 /// use google_cloud_securitycenter_v2::model::Reference;
22343 /// let x = Cve::new()
22344 /// .set_references([
22345 /// Reference::default()/* use setters */,
22346 /// Reference::default()/* use (different) setters */,
22347 /// ]);
22348 /// ```
22349 pub fn set_references<T, V>(mut self, v: T) -> Self
22350 where
22351 T: std::iter::IntoIterator<Item = V>,
22352 V: std::convert::Into<crate::model::Reference>,
22353 {
22354 use std::iter::Iterator;
22355 self.references = v.into_iter().map(|i| i.into()).collect();
22356 self
22357 }
22358
22359 /// Sets the value of [cvssv3][crate::model::Cve::cvssv3].
22360 ///
22361 /// # Example
22362 /// ```ignore,no_run
22363 /// # use google_cloud_securitycenter_v2::model::Cve;
22364 /// use google_cloud_securitycenter_v2::model::Cvssv3;
22365 /// let x = Cve::new().set_cvssv3(Cvssv3::default()/* use setters */);
22366 /// ```
22367 pub fn set_cvssv3<T>(mut self, v: T) -> Self
22368 where
22369 T: std::convert::Into<crate::model::Cvssv3>,
22370 {
22371 self.cvssv3 = std::option::Option::Some(v.into());
22372 self
22373 }
22374
22375 /// Sets or clears the value of [cvssv3][crate::model::Cve::cvssv3].
22376 ///
22377 /// # Example
22378 /// ```ignore,no_run
22379 /// # use google_cloud_securitycenter_v2::model::Cve;
22380 /// use google_cloud_securitycenter_v2::model::Cvssv3;
22381 /// let x = Cve::new().set_or_clear_cvssv3(Some(Cvssv3::default()/* use setters */));
22382 /// let x = Cve::new().set_or_clear_cvssv3(None::<Cvssv3>);
22383 /// ```
22384 pub fn set_or_clear_cvssv3<T>(mut self, v: std::option::Option<T>) -> Self
22385 where
22386 T: std::convert::Into<crate::model::Cvssv3>,
22387 {
22388 self.cvssv3 = v.map(|x| x.into());
22389 self
22390 }
22391
22392 /// Sets the value of [upstream_fix_available][crate::model::Cve::upstream_fix_available].
22393 ///
22394 /// # Example
22395 /// ```ignore,no_run
22396 /// # use google_cloud_securitycenter_v2::model::Cve;
22397 /// let x = Cve::new().set_upstream_fix_available(true);
22398 /// ```
22399 pub fn set_upstream_fix_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22400 self.upstream_fix_available = v.into();
22401 self
22402 }
22403
22404 /// Sets the value of [impact][crate::model::Cve::impact].
22405 ///
22406 /// # Example
22407 /// ```ignore,no_run
22408 /// # use google_cloud_securitycenter_v2::model::Cve;
22409 /// use google_cloud_securitycenter_v2::model::cve::RiskRating;
22410 /// let x0 = Cve::new().set_impact(RiskRating::Low);
22411 /// let x1 = Cve::new().set_impact(RiskRating::Medium);
22412 /// let x2 = Cve::new().set_impact(RiskRating::High);
22413 /// ```
22414 pub fn set_impact<T: std::convert::Into<crate::model::cve::RiskRating>>(
22415 mut self,
22416 v: T,
22417 ) -> Self {
22418 self.impact = v.into();
22419 self
22420 }
22421
22422 /// Sets the value of [exploitation_activity][crate::model::Cve::exploitation_activity].
22423 ///
22424 /// # Example
22425 /// ```ignore,no_run
22426 /// # use google_cloud_securitycenter_v2::model::Cve;
22427 /// use google_cloud_securitycenter_v2::model::cve::ExploitationActivity;
22428 /// let x0 = Cve::new().set_exploitation_activity(ExploitationActivity::Wide);
22429 /// let x1 = Cve::new().set_exploitation_activity(ExploitationActivity::Confirmed);
22430 /// let x2 = Cve::new().set_exploitation_activity(ExploitationActivity::Available);
22431 /// ```
22432 pub fn set_exploitation_activity<
22433 T: std::convert::Into<crate::model::cve::ExploitationActivity>,
22434 >(
22435 mut self,
22436 v: T,
22437 ) -> Self {
22438 self.exploitation_activity = v.into();
22439 self
22440 }
22441
22442 /// Sets the value of [observed_in_the_wild][crate::model::Cve::observed_in_the_wild].
22443 ///
22444 /// # Example
22445 /// ```ignore,no_run
22446 /// # use google_cloud_securitycenter_v2::model::Cve;
22447 /// let x = Cve::new().set_observed_in_the_wild(true);
22448 /// ```
22449 pub fn set_observed_in_the_wild<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22450 self.observed_in_the_wild = v.into();
22451 self
22452 }
22453
22454 /// Sets the value of [zero_day][crate::model::Cve::zero_day].
22455 ///
22456 /// # Example
22457 /// ```ignore,no_run
22458 /// # use google_cloud_securitycenter_v2::model::Cve;
22459 /// let x = Cve::new().set_zero_day(true);
22460 /// ```
22461 pub fn set_zero_day<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22462 self.zero_day = v.into();
22463 self
22464 }
22465
22466 /// Sets the value of [exploit_release_date][crate::model::Cve::exploit_release_date].
22467 ///
22468 /// # Example
22469 /// ```ignore,no_run
22470 /// # use google_cloud_securitycenter_v2::model::Cve;
22471 /// use wkt::Timestamp;
22472 /// let x = Cve::new().set_exploit_release_date(Timestamp::default()/* use setters */);
22473 /// ```
22474 pub fn set_exploit_release_date<T>(mut self, v: T) -> Self
22475 where
22476 T: std::convert::Into<wkt::Timestamp>,
22477 {
22478 self.exploit_release_date = std::option::Option::Some(v.into());
22479 self
22480 }
22481
22482 /// Sets or clears the value of [exploit_release_date][crate::model::Cve::exploit_release_date].
22483 ///
22484 /// # Example
22485 /// ```ignore,no_run
22486 /// # use google_cloud_securitycenter_v2::model::Cve;
22487 /// use wkt::Timestamp;
22488 /// let x = Cve::new().set_or_clear_exploit_release_date(Some(Timestamp::default()/* use setters */));
22489 /// let x = Cve::new().set_or_clear_exploit_release_date(None::<Timestamp>);
22490 /// ```
22491 pub fn set_or_clear_exploit_release_date<T>(mut self, v: std::option::Option<T>) -> Self
22492 where
22493 T: std::convert::Into<wkt::Timestamp>,
22494 {
22495 self.exploit_release_date = v.map(|x| x.into());
22496 self
22497 }
22498
22499 /// Sets the value of [first_exploitation_date][crate::model::Cve::first_exploitation_date].
22500 ///
22501 /// # Example
22502 /// ```ignore,no_run
22503 /// # use google_cloud_securitycenter_v2::model::Cve;
22504 /// use wkt::Timestamp;
22505 /// let x = Cve::new().set_first_exploitation_date(Timestamp::default()/* use setters */);
22506 /// ```
22507 pub fn set_first_exploitation_date<T>(mut self, v: T) -> Self
22508 where
22509 T: std::convert::Into<wkt::Timestamp>,
22510 {
22511 self.first_exploitation_date = std::option::Option::Some(v.into());
22512 self
22513 }
22514
22515 /// Sets or clears the value of [first_exploitation_date][crate::model::Cve::first_exploitation_date].
22516 ///
22517 /// # Example
22518 /// ```ignore,no_run
22519 /// # use google_cloud_securitycenter_v2::model::Cve;
22520 /// use wkt::Timestamp;
22521 /// let x = Cve::new().set_or_clear_first_exploitation_date(Some(Timestamp::default()/* use setters */));
22522 /// let x = Cve::new().set_or_clear_first_exploitation_date(None::<Timestamp>);
22523 /// ```
22524 pub fn set_or_clear_first_exploitation_date<T>(mut self, v: std::option::Option<T>) -> Self
22525 where
22526 T: std::convert::Into<wkt::Timestamp>,
22527 {
22528 self.first_exploitation_date = v.map(|x| x.into());
22529 self
22530 }
22531}
22532
22533impl wkt::message::Message for Cve {
22534 fn typename() -> &'static str {
22535 "type.googleapis.com/google.cloud.securitycenter.v2.Cve"
22536 }
22537}
22538
22539/// Defines additional types related to [Cve].
22540pub mod cve {
22541 #[allow(unused_imports)]
22542 use super::*;
22543
22544 /// The possible values of impact of the vulnerability if it was to be
22545 /// exploited.
22546 ///
22547 /// # Working with unknown values
22548 ///
22549 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22550 /// additional enum variants at any time. Adding new variants is not considered
22551 /// a breaking change. Applications should write their code in anticipation of:
22552 ///
22553 /// - New values appearing in future releases of the client library, **and**
22554 /// - New values received dynamically, without application changes.
22555 ///
22556 /// Please consult the [Working with enums] section in the user guide for some
22557 /// guidelines.
22558 ///
22559 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22560 #[derive(Clone, Debug, PartialEq)]
22561 #[non_exhaustive]
22562 pub enum RiskRating {
22563 /// Invalid or empty value.
22564 Unspecified,
22565 /// Exploitation would have little to no security impact.
22566 Low,
22567 /// Exploitation would enable attackers to perform activities, or could allow
22568 /// attackers to have a direct impact, but would require additional steps.
22569 Medium,
22570 /// Exploitation would enable attackers to have a notable direct impact
22571 /// without needing to overcome any major mitigating factors.
22572 High,
22573 /// Exploitation would fundamentally undermine the security of affected
22574 /// systems, enable actors to perform significant attacks with minimal
22575 /// effort, with little to no mitigating factors to overcome.
22576 Critical,
22577 /// If set, the enum was initialized with an unknown value.
22578 ///
22579 /// Applications can examine the value using [RiskRating::value] or
22580 /// [RiskRating::name].
22581 UnknownValue(risk_rating::UnknownValue),
22582 }
22583
22584 #[doc(hidden)]
22585 pub mod risk_rating {
22586 #[allow(unused_imports)]
22587 use super::*;
22588 #[derive(Clone, Debug, PartialEq)]
22589 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22590 }
22591
22592 impl RiskRating {
22593 /// Gets the enum value.
22594 ///
22595 /// Returns `None` if the enum contains an unknown value deserialized from
22596 /// the string representation of enums.
22597 pub fn value(&self) -> std::option::Option<i32> {
22598 match self {
22599 Self::Unspecified => std::option::Option::Some(0),
22600 Self::Low => std::option::Option::Some(1),
22601 Self::Medium => std::option::Option::Some(2),
22602 Self::High => std::option::Option::Some(3),
22603 Self::Critical => std::option::Option::Some(4),
22604 Self::UnknownValue(u) => u.0.value(),
22605 }
22606 }
22607
22608 /// Gets the enum value as a string.
22609 ///
22610 /// Returns `None` if the enum contains an unknown value deserialized from
22611 /// the integer representation of enums.
22612 pub fn name(&self) -> std::option::Option<&str> {
22613 match self {
22614 Self::Unspecified => std::option::Option::Some("RISK_RATING_UNSPECIFIED"),
22615 Self::Low => std::option::Option::Some("LOW"),
22616 Self::Medium => std::option::Option::Some("MEDIUM"),
22617 Self::High => std::option::Option::Some("HIGH"),
22618 Self::Critical => std::option::Option::Some("CRITICAL"),
22619 Self::UnknownValue(u) => u.0.name(),
22620 }
22621 }
22622 }
22623
22624 impl std::default::Default for RiskRating {
22625 fn default() -> Self {
22626 use std::convert::From;
22627 Self::from(0)
22628 }
22629 }
22630
22631 impl std::fmt::Display for RiskRating {
22632 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22633 wkt::internal::display_enum(f, self.name(), self.value())
22634 }
22635 }
22636
22637 impl std::convert::From<i32> for RiskRating {
22638 fn from(value: i32) -> Self {
22639 match value {
22640 0 => Self::Unspecified,
22641 1 => Self::Low,
22642 2 => Self::Medium,
22643 3 => Self::High,
22644 4 => Self::Critical,
22645 _ => Self::UnknownValue(risk_rating::UnknownValue(
22646 wkt::internal::UnknownEnumValue::Integer(value),
22647 )),
22648 }
22649 }
22650 }
22651
22652 impl std::convert::From<&str> for RiskRating {
22653 fn from(value: &str) -> Self {
22654 use std::string::ToString;
22655 match value {
22656 "RISK_RATING_UNSPECIFIED" => Self::Unspecified,
22657 "LOW" => Self::Low,
22658 "MEDIUM" => Self::Medium,
22659 "HIGH" => Self::High,
22660 "CRITICAL" => Self::Critical,
22661 _ => Self::UnknownValue(risk_rating::UnknownValue(
22662 wkt::internal::UnknownEnumValue::String(value.to_string()),
22663 )),
22664 }
22665 }
22666 }
22667
22668 impl serde::ser::Serialize for RiskRating {
22669 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22670 where
22671 S: serde::Serializer,
22672 {
22673 match self {
22674 Self::Unspecified => serializer.serialize_i32(0),
22675 Self::Low => serializer.serialize_i32(1),
22676 Self::Medium => serializer.serialize_i32(2),
22677 Self::High => serializer.serialize_i32(3),
22678 Self::Critical => serializer.serialize_i32(4),
22679 Self::UnknownValue(u) => u.0.serialize(serializer),
22680 }
22681 }
22682 }
22683
22684 impl<'de> serde::de::Deserialize<'de> for RiskRating {
22685 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22686 where
22687 D: serde::Deserializer<'de>,
22688 {
22689 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RiskRating>::new(
22690 ".google.cloud.securitycenter.v2.Cve.RiskRating",
22691 ))
22692 }
22693 }
22694
22695 /// The possible values of exploitation activity of the vulnerability in the
22696 /// wild.
22697 ///
22698 /// # Working with unknown values
22699 ///
22700 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22701 /// additional enum variants at any time. Adding new variants is not considered
22702 /// a breaking change. Applications should write their code in anticipation of:
22703 ///
22704 /// - New values appearing in future releases of the client library, **and**
22705 /// - New values received dynamically, without application changes.
22706 ///
22707 /// Please consult the [Working with enums] section in the user guide for some
22708 /// guidelines.
22709 ///
22710 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22711 #[derive(Clone, Debug, PartialEq)]
22712 #[non_exhaustive]
22713 pub enum ExploitationActivity {
22714 /// Invalid or empty value.
22715 Unspecified,
22716 /// Exploitation has been reported or confirmed to widely occur.
22717 Wide,
22718 /// Limited reported or confirmed exploitation activities.
22719 Confirmed,
22720 /// Exploit is publicly available.
22721 Available,
22722 /// No known exploitation activity, but has a high potential for
22723 /// exploitation.
22724 Anticipated,
22725 /// No known exploitation activity.
22726 NoKnown,
22727 /// If set, the enum was initialized with an unknown value.
22728 ///
22729 /// Applications can examine the value using [ExploitationActivity::value] or
22730 /// [ExploitationActivity::name].
22731 UnknownValue(exploitation_activity::UnknownValue),
22732 }
22733
22734 #[doc(hidden)]
22735 pub mod exploitation_activity {
22736 #[allow(unused_imports)]
22737 use super::*;
22738 #[derive(Clone, Debug, PartialEq)]
22739 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22740 }
22741
22742 impl ExploitationActivity {
22743 /// Gets the enum value.
22744 ///
22745 /// Returns `None` if the enum contains an unknown value deserialized from
22746 /// the string representation of enums.
22747 pub fn value(&self) -> std::option::Option<i32> {
22748 match self {
22749 Self::Unspecified => std::option::Option::Some(0),
22750 Self::Wide => std::option::Option::Some(1),
22751 Self::Confirmed => std::option::Option::Some(2),
22752 Self::Available => std::option::Option::Some(3),
22753 Self::Anticipated => std::option::Option::Some(4),
22754 Self::NoKnown => std::option::Option::Some(5),
22755 Self::UnknownValue(u) => u.0.value(),
22756 }
22757 }
22758
22759 /// Gets the enum value as a string.
22760 ///
22761 /// Returns `None` if the enum contains an unknown value deserialized from
22762 /// the integer representation of enums.
22763 pub fn name(&self) -> std::option::Option<&str> {
22764 match self {
22765 Self::Unspecified => std::option::Option::Some("EXPLOITATION_ACTIVITY_UNSPECIFIED"),
22766 Self::Wide => std::option::Option::Some("WIDE"),
22767 Self::Confirmed => std::option::Option::Some("CONFIRMED"),
22768 Self::Available => std::option::Option::Some("AVAILABLE"),
22769 Self::Anticipated => std::option::Option::Some("ANTICIPATED"),
22770 Self::NoKnown => std::option::Option::Some("NO_KNOWN"),
22771 Self::UnknownValue(u) => u.0.name(),
22772 }
22773 }
22774 }
22775
22776 impl std::default::Default for ExploitationActivity {
22777 fn default() -> Self {
22778 use std::convert::From;
22779 Self::from(0)
22780 }
22781 }
22782
22783 impl std::fmt::Display for ExploitationActivity {
22784 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22785 wkt::internal::display_enum(f, self.name(), self.value())
22786 }
22787 }
22788
22789 impl std::convert::From<i32> for ExploitationActivity {
22790 fn from(value: i32) -> Self {
22791 match value {
22792 0 => Self::Unspecified,
22793 1 => Self::Wide,
22794 2 => Self::Confirmed,
22795 3 => Self::Available,
22796 4 => Self::Anticipated,
22797 5 => Self::NoKnown,
22798 _ => Self::UnknownValue(exploitation_activity::UnknownValue(
22799 wkt::internal::UnknownEnumValue::Integer(value),
22800 )),
22801 }
22802 }
22803 }
22804
22805 impl std::convert::From<&str> for ExploitationActivity {
22806 fn from(value: &str) -> Self {
22807 use std::string::ToString;
22808 match value {
22809 "EXPLOITATION_ACTIVITY_UNSPECIFIED" => Self::Unspecified,
22810 "WIDE" => Self::Wide,
22811 "CONFIRMED" => Self::Confirmed,
22812 "AVAILABLE" => Self::Available,
22813 "ANTICIPATED" => Self::Anticipated,
22814 "NO_KNOWN" => Self::NoKnown,
22815 _ => Self::UnknownValue(exploitation_activity::UnknownValue(
22816 wkt::internal::UnknownEnumValue::String(value.to_string()),
22817 )),
22818 }
22819 }
22820 }
22821
22822 impl serde::ser::Serialize for ExploitationActivity {
22823 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22824 where
22825 S: serde::Serializer,
22826 {
22827 match self {
22828 Self::Unspecified => serializer.serialize_i32(0),
22829 Self::Wide => serializer.serialize_i32(1),
22830 Self::Confirmed => serializer.serialize_i32(2),
22831 Self::Available => serializer.serialize_i32(3),
22832 Self::Anticipated => serializer.serialize_i32(4),
22833 Self::NoKnown => serializer.serialize_i32(5),
22834 Self::UnknownValue(u) => u.0.serialize(serializer),
22835 }
22836 }
22837 }
22838
22839 impl<'de> serde::de::Deserialize<'de> for ExploitationActivity {
22840 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22841 where
22842 D: serde::Deserializer<'de>,
22843 {
22844 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExploitationActivity>::new(
22845 ".google.cloud.securitycenter.v2.Cve.ExploitationActivity",
22846 ))
22847 }
22848 }
22849}
22850
22851/// Additional Links
22852#[derive(Clone, Default, PartialEq)]
22853#[non_exhaustive]
22854pub struct Reference {
22855 /// Source of the reference e.g. NVD
22856 pub source: std::string::String,
22857
22858 /// Uri for the mentioned source e.g.
22859 /// <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527>.
22860 pub uri: std::string::String,
22861
22862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22863}
22864
22865impl Reference {
22866 pub fn new() -> Self {
22867 std::default::Default::default()
22868 }
22869
22870 /// Sets the value of [source][crate::model::Reference::source].
22871 ///
22872 /// # Example
22873 /// ```ignore,no_run
22874 /// # use google_cloud_securitycenter_v2::model::Reference;
22875 /// let x = Reference::new().set_source("example");
22876 /// ```
22877 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22878 self.source = v.into();
22879 self
22880 }
22881
22882 /// Sets the value of [uri][crate::model::Reference::uri].
22883 ///
22884 /// # Example
22885 /// ```ignore,no_run
22886 /// # use google_cloud_securitycenter_v2::model::Reference;
22887 /// let x = Reference::new().set_uri("example");
22888 /// ```
22889 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22890 self.uri = v.into();
22891 self
22892 }
22893}
22894
22895impl wkt::message::Message for Reference {
22896 fn typename() -> &'static str {
22897 "type.googleapis.com/google.cloud.securitycenter.v2.Reference"
22898 }
22899}
22900
22901/// Common Vulnerability Scoring System version 3.
22902#[derive(Clone, Default, PartialEq)]
22903#[non_exhaustive]
22904pub struct Cvssv3 {
22905 /// The base score is a function of the base metric scores.
22906 pub base_score: f64,
22907
22908 /// Base Metrics
22909 /// Represents the intrinsic characteristics of a vulnerability that are
22910 /// constant over time and across user environments.
22911 /// This metric reflects the context by which vulnerability exploitation is
22912 /// possible.
22913 pub attack_vector: crate::model::cvssv_3::AttackVector,
22914
22915 /// This metric describes the conditions beyond the attacker's control that
22916 /// must exist in order to exploit the vulnerability.
22917 pub attack_complexity: crate::model::cvssv_3::AttackComplexity,
22918
22919 /// This metric describes the level of privileges an attacker must possess
22920 /// before successfully exploiting the vulnerability.
22921 pub privileges_required: crate::model::cvssv_3::PrivilegesRequired,
22922
22923 /// This metric captures the requirement for a human user, other than the
22924 /// attacker, to participate in the successful compromise of the vulnerable
22925 /// component.
22926 pub user_interaction: crate::model::cvssv_3::UserInteraction,
22927
22928 /// The Scope metric captures whether a vulnerability in one vulnerable
22929 /// component impacts resources in components beyond its security scope.
22930 pub scope: crate::model::cvssv_3::Scope,
22931
22932 /// This metric measures the impact to the confidentiality of the information
22933 /// resources managed by a software component due to a successfully exploited
22934 /// vulnerability.
22935 pub confidentiality_impact: crate::model::cvssv_3::Impact,
22936
22937 /// This metric measures the impact to integrity of a successfully exploited
22938 /// vulnerability.
22939 pub integrity_impact: crate::model::cvssv_3::Impact,
22940
22941 /// This metric measures the impact to the availability of the impacted
22942 /// component resulting from a successfully exploited vulnerability.
22943 pub availability_impact: crate::model::cvssv_3::Impact,
22944
22945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22946}
22947
22948impl Cvssv3 {
22949 pub fn new() -> Self {
22950 std::default::Default::default()
22951 }
22952
22953 /// Sets the value of [base_score][crate::model::Cvssv3::base_score].
22954 ///
22955 /// # Example
22956 /// ```ignore,no_run
22957 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
22958 /// let x = Cvssv3::new().set_base_score(42.0);
22959 /// ```
22960 pub fn set_base_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
22961 self.base_score = v.into();
22962 self
22963 }
22964
22965 /// Sets the value of [attack_vector][crate::model::Cvssv3::attack_vector].
22966 ///
22967 /// # Example
22968 /// ```ignore,no_run
22969 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
22970 /// use google_cloud_securitycenter_v2::model::cvssv_3::AttackVector;
22971 /// let x0 = Cvssv3::new().set_attack_vector(AttackVector::Network);
22972 /// let x1 = Cvssv3::new().set_attack_vector(AttackVector::Adjacent);
22973 /// let x2 = Cvssv3::new().set_attack_vector(AttackVector::Local);
22974 /// ```
22975 pub fn set_attack_vector<T: std::convert::Into<crate::model::cvssv_3::AttackVector>>(
22976 mut self,
22977 v: T,
22978 ) -> Self {
22979 self.attack_vector = v.into();
22980 self
22981 }
22982
22983 /// Sets the value of [attack_complexity][crate::model::Cvssv3::attack_complexity].
22984 ///
22985 /// # Example
22986 /// ```ignore,no_run
22987 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
22988 /// use google_cloud_securitycenter_v2::model::cvssv_3::AttackComplexity;
22989 /// let x0 = Cvssv3::new().set_attack_complexity(AttackComplexity::Low);
22990 /// let x1 = Cvssv3::new().set_attack_complexity(AttackComplexity::High);
22991 /// ```
22992 pub fn set_attack_complexity<T: std::convert::Into<crate::model::cvssv_3::AttackComplexity>>(
22993 mut self,
22994 v: T,
22995 ) -> Self {
22996 self.attack_complexity = v.into();
22997 self
22998 }
22999
23000 /// Sets the value of [privileges_required][crate::model::Cvssv3::privileges_required].
23001 ///
23002 /// # Example
23003 /// ```ignore,no_run
23004 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23005 /// use google_cloud_securitycenter_v2::model::cvssv_3::PrivilegesRequired;
23006 /// let x0 = Cvssv3::new().set_privileges_required(PrivilegesRequired::None);
23007 /// let x1 = Cvssv3::new().set_privileges_required(PrivilegesRequired::Low);
23008 /// let x2 = Cvssv3::new().set_privileges_required(PrivilegesRequired::High);
23009 /// ```
23010 pub fn set_privileges_required<
23011 T: std::convert::Into<crate::model::cvssv_3::PrivilegesRequired>,
23012 >(
23013 mut self,
23014 v: T,
23015 ) -> Self {
23016 self.privileges_required = v.into();
23017 self
23018 }
23019
23020 /// Sets the value of [user_interaction][crate::model::Cvssv3::user_interaction].
23021 ///
23022 /// # Example
23023 /// ```ignore,no_run
23024 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23025 /// use google_cloud_securitycenter_v2::model::cvssv_3::UserInteraction;
23026 /// let x0 = Cvssv3::new().set_user_interaction(UserInteraction::None);
23027 /// let x1 = Cvssv3::new().set_user_interaction(UserInteraction::Required);
23028 /// ```
23029 pub fn set_user_interaction<T: std::convert::Into<crate::model::cvssv_3::UserInteraction>>(
23030 mut self,
23031 v: T,
23032 ) -> Self {
23033 self.user_interaction = v.into();
23034 self
23035 }
23036
23037 /// Sets the value of [scope][crate::model::Cvssv3::scope].
23038 ///
23039 /// # Example
23040 /// ```ignore,no_run
23041 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23042 /// use google_cloud_securitycenter_v2::model::cvssv_3::Scope;
23043 /// let x0 = Cvssv3::new().set_scope(Scope::Unchanged);
23044 /// let x1 = Cvssv3::new().set_scope(Scope::Changed);
23045 /// ```
23046 pub fn set_scope<T: std::convert::Into<crate::model::cvssv_3::Scope>>(mut self, v: T) -> Self {
23047 self.scope = v.into();
23048 self
23049 }
23050
23051 /// Sets the value of [confidentiality_impact][crate::model::Cvssv3::confidentiality_impact].
23052 ///
23053 /// # Example
23054 /// ```ignore,no_run
23055 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23056 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23057 /// let x0 = Cvssv3::new().set_confidentiality_impact(Impact::High);
23058 /// let x1 = Cvssv3::new().set_confidentiality_impact(Impact::Low);
23059 /// let x2 = Cvssv3::new().set_confidentiality_impact(Impact::None);
23060 /// ```
23061 pub fn set_confidentiality_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23062 mut self,
23063 v: T,
23064 ) -> Self {
23065 self.confidentiality_impact = v.into();
23066 self
23067 }
23068
23069 /// Sets the value of [integrity_impact][crate::model::Cvssv3::integrity_impact].
23070 ///
23071 /// # Example
23072 /// ```ignore,no_run
23073 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23074 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23075 /// let x0 = Cvssv3::new().set_integrity_impact(Impact::High);
23076 /// let x1 = Cvssv3::new().set_integrity_impact(Impact::Low);
23077 /// let x2 = Cvssv3::new().set_integrity_impact(Impact::None);
23078 /// ```
23079 pub fn set_integrity_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23080 mut self,
23081 v: T,
23082 ) -> Self {
23083 self.integrity_impact = v.into();
23084 self
23085 }
23086
23087 /// Sets the value of [availability_impact][crate::model::Cvssv3::availability_impact].
23088 ///
23089 /// # Example
23090 /// ```ignore,no_run
23091 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23092 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23093 /// let x0 = Cvssv3::new().set_availability_impact(Impact::High);
23094 /// let x1 = Cvssv3::new().set_availability_impact(Impact::Low);
23095 /// let x2 = Cvssv3::new().set_availability_impact(Impact::None);
23096 /// ```
23097 pub fn set_availability_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23098 mut self,
23099 v: T,
23100 ) -> Self {
23101 self.availability_impact = v.into();
23102 self
23103 }
23104}
23105
23106impl wkt::message::Message for Cvssv3 {
23107 fn typename() -> &'static str {
23108 "type.googleapis.com/google.cloud.securitycenter.v2.Cvssv3"
23109 }
23110}
23111
23112/// Defines additional types related to [Cvssv3].
23113pub mod cvssv_3 {
23114 #[allow(unused_imports)]
23115 use super::*;
23116
23117 /// This metric reflects the context by which vulnerability exploitation is
23118 /// possible.
23119 ///
23120 /// # Working with unknown values
23121 ///
23122 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23123 /// additional enum variants at any time. Adding new variants is not considered
23124 /// a breaking change. Applications should write their code in anticipation of:
23125 ///
23126 /// - New values appearing in future releases of the client library, **and**
23127 /// - New values received dynamically, without application changes.
23128 ///
23129 /// Please consult the [Working with enums] section in the user guide for some
23130 /// guidelines.
23131 ///
23132 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23133 #[derive(Clone, Debug, PartialEq)]
23134 #[non_exhaustive]
23135 pub enum AttackVector {
23136 /// Invalid value.
23137 Unspecified,
23138 /// The vulnerable component is bound to the network stack and the set of
23139 /// possible attackers extends beyond the other options listed below, up to
23140 /// and including the entire Internet.
23141 Network,
23142 /// The vulnerable component is bound to the network stack, but the attack is
23143 /// limited at the protocol level to a logically adjacent topology.
23144 Adjacent,
23145 /// The vulnerable component is not bound to the network stack and the
23146 /// attacker's path is via read/write/execute capabilities.
23147 Local,
23148 /// The attack requires the attacker to physically touch or manipulate the
23149 /// vulnerable component.
23150 Physical,
23151 /// If set, the enum was initialized with an unknown value.
23152 ///
23153 /// Applications can examine the value using [AttackVector::value] or
23154 /// [AttackVector::name].
23155 UnknownValue(attack_vector::UnknownValue),
23156 }
23157
23158 #[doc(hidden)]
23159 pub mod attack_vector {
23160 #[allow(unused_imports)]
23161 use super::*;
23162 #[derive(Clone, Debug, PartialEq)]
23163 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23164 }
23165
23166 impl AttackVector {
23167 /// Gets the enum value.
23168 ///
23169 /// Returns `None` if the enum contains an unknown value deserialized from
23170 /// the string representation of enums.
23171 pub fn value(&self) -> std::option::Option<i32> {
23172 match self {
23173 Self::Unspecified => std::option::Option::Some(0),
23174 Self::Network => std::option::Option::Some(1),
23175 Self::Adjacent => std::option::Option::Some(2),
23176 Self::Local => std::option::Option::Some(3),
23177 Self::Physical => std::option::Option::Some(4),
23178 Self::UnknownValue(u) => u.0.value(),
23179 }
23180 }
23181
23182 /// Gets the enum value as a string.
23183 ///
23184 /// Returns `None` if the enum contains an unknown value deserialized from
23185 /// the integer representation of enums.
23186 pub fn name(&self) -> std::option::Option<&str> {
23187 match self {
23188 Self::Unspecified => std::option::Option::Some("ATTACK_VECTOR_UNSPECIFIED"),
23189 Self::Network => std::option::Option::Some("ATTACK_VECTOR_NETWORK"),
23190 Self::Adjacent => std::option::Option::Some("ATTACK_VECTOR_ADJACENT"),
23191 Self::Local => std::option::Option::Some("ATTACK_VECTOR_LOCAL"),
23192 Self::Physical => std::option::Option::Some("ATTACK_VECTOR_PHYSICAL"),
23193 Self::UnknownValue(u) => u.0.name(),
23194 }
23195 }
23196 }
23197
23198 impl std::default::Default for AttackVector {
23199 fn default() -> Self {
23200 use std::convert::From;
23201 Self::from(0)
23202 }
23203 }
23204
23205 impl std::fmt::Display for AttackVector {
23206 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23207 wkt::internal::display_enum(f, self.name(), self.value())
23208 }
23209 }
23210
23211 impl std::convert::From<i32> for AttackVector {
23212 fn from(value: i32) -> Self {
23213 match value {
23214 0 => Self::Unspecified,
23215 1 => Self::Network,
23216 2 => Self::Adjacent,
23217 3 => Self::Local,
23218 4 => Self::Physical,
23219 _ => Self::UnknownValue(attack_vector::UnknownValue(
23220 wkt::internal::UnknownEnumValue::Integer(value),
23221 )),
23222 }
23223 }
23224 }
23225
23226 impl std::convert::From<&str> for AttackVector {
23227 fn from(value: &str) -> Self {
23228 use std::string::ToString;
23229 match value {
23230 "ATTACK_VECTOR_UNSPECIFIED" => Self::Unspecified,
23231 "ATTACK_VECTOR_NETWORK" => Self::Network,
23232 "ATTACK_VECTOR_ADJACENT" => Self::Adjacent,
23233 "ATTACK_VECTOR_LOCAL" => Self::Local,
23234 "ATTACK_VECTOR_PHYSICAL" => Self::Physical,
23235 _ => Self::UnknownValue(attack_vector::UnknownValue(
23236 wkt::internal::UnknownEnumValue::String(value.to_string()),
23237 )),
23238 }
23239 }
23240 }
23241
23242 impl serde::ser::Serialize for AttackVector {
23243 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23244 where
23245 S: serde::Serializer,
23246 {
23247 match self {
23248 Self::Unspecified => serializer.serialize_i32(0),
23249 Self::Network => serializer.serialize_i32(1),
23250 Self::Adjacent => serializer.serialize_i32(2),
23251 Self::Local => serializer.serialize_i32(3),
23252 Self::Physical => serializer.serialize_i32(4),
23253 Self::UnknownValue(u) => u.0.serialize(serializer),
23254 }
23255 }
23256 }
23257
23258 impl<'de> serde::de::Deserialize<'de> for AttackVector {
23259 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23260 where
23261 D: serde::Deserializer<'de>,
23262 {
23263 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackVector>::new(
23264 ".google.cloud.securitycenter.v2.Cvssv3.AttackVector",
23265 ))
23266 }
23267 }
23268
23269 /// This metric describes the conditions beyond the attacker's control that
23270 /// must exist in order to exploit the vulnerability.
23271 ///
23272 /// # Working with unknown values
23273 ///
23274 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23275 /// additional enum variants at any time. Adding new variants is not considered
23276 /// a breaking change. Applications should write their code in anticipation of:
23277 ///
23278 /// - New values appearing in future releases of the client library, **and**
23279 /// - New values received dynamically, without application changes.
23280 ///
23281 /// Please consult the [Working with enums] section in the user guide for some
23282 /// guidelines.
23283 ///
23284 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23285 #[derive(Clone, Debug, PartialEq)]
23286 #[non_exhaustive]
23287 pub enum AttackComplexity {
23288 /// Invalid value.
23289 Unspecified,
23290 /// Specialized access conditions or extenuating circumstances do not exist.
23291 /// An attacker can expect repeatable success when attacking the vulnerable
23292 /// component.
23293 Low,
23294 /// A successful attack depends on conditions beyond the attacker's control.
23295 /// That is, a successful attack cannot be accomplished at will, but requires
23296 /// the attacker to invest in some measurable amount of effort in preparation
23297 /// or execution against the vulnerable component before a successful attack
23298 /// can be expected.
23299 High,
23300 /// If set, the enum was initialized with an unknown value.
23301 ///
23302 /// Applications can examine the value using [AttackComplexity::value] or
23303 /// [AttackComplexity::name].
23304 UnknownValue(attack_complexity::UnknownValue),
23305 }
23306
23307 #[doc(hidden)]
23308 pub mod attack_complexity {
23309 #[allow(unused_imports)]
23310 use super::*;
23311 #[derive(Clone, Debug, PartialEq)]
23312 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23313 }
23314
23315 impl AttackComplexity {
23316 /// Gets the enum value.
23317 ///
23318 /// Returns `None` if the enum contains an unknown value deserialized from
23319 /// the string representation of enums.
23320 pub fn value(&self) -> std::option::Option<i32> {
23321 match self {
23322 Self::Unspecified => std::option::Option::Some(0),
23323 Self::Low => std::option::Option::Some(1),
23324 Self::High => std::option::Option::Some(2),
23325 Self::UnknownValue(u) => u.0.value(),
23326 }
23327 }
23328
23329 /// Gets the enum value as a string.
23330 ///
23331 /// Returns `None` if the enum contains an unknown value deserialized from
23332 /// the integer representation of enums.
23333 pub fn name(&self) -> std::option::Option<&str> {
23334 match self {
23335 Self::Unspecified => std::option::Option::Some("ATTACK_COMPLEXITY_UNSPECIFIED"),
23336 Self::Low => std::option::Option::Some("ATTACK_COMPLEXITY_LOW"),
23337 Self::High => std::option::Option::Some("ATTACK_COMPLEXITY_HIGH"),
23338 Self::UnknownValue(u) => u.0.name(),
23339 }
23340 }
23341 }
23342
23343 impl std::default::Default for AttackComplexity {
23344 fn default() -> Self {
23345 use std::convert::From;
23346 Self::from(0)
23347 }
23348 }
23349
23350 impl std::fmt::Display for AttackComplexity {
23351 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23352 wkt::internal::display_enum(f, self.name(), self.value())
23353 }
23354 }
23355
23356 impl std::convert::From<i32> for AttackComplexity {
23357 fn from(value: i32) -> Self {
23358 match value {
23359 0 => Self::Unspecified,
23360 1 => Self::Low,
23361 2 => Self::High,
23362 _ => Self::UnknownValue(attack_complexity::UnknownValue(
23363 wkt::internal::UnknownEnumValue::Integer(value),
23364 )),
23365 }
23366 }
23367 }
23368
23369 impl std::convert::From<&str> for AttackComplexity {
23370 fn from(value: &str) -> Self {
23371 use std::string::ToString;
23372 match value {
23373 "ATTACK_COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
23374 "ATTACK_COMPLEXITY_LOW" => Self::Low,
23375 "ATTACK_COMPLEXITY_HIGH" => Self::High,
23376 _ => Self::UnknownValue(attack_complexity::UnknownValue(
23377 wkt::internal::UnknownEnumValue::String(value.to_string()),
23378 )),
23379 }
23380 }
23381 }
23382
23383 impl serde::ser::Serialize for AttackComplexity {
23384 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23385 where
23386 S: serde::Serializer,
23387 {
23388 match self {
23389 Self::Unspecified => serializer.serialize_i32(0),
23390 Self::Low => serializer.serialize_i32(1),
23391 Self::High => serializer.serialize_i32(2),
23392 Self::UnknownValue(u) => u.0.serialize(serializer),
23393 }
23394 }
23395 }
23396
23397 impl<'de> serde::de::Deserialize<'de> for AttackComplexity {
23398 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23399 where
23400 D: serde::Deserializer<'de>,
23401 {
23402 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackComplexity>::new(
23403 ".google.cloud.securitycenter.v2.Cvssv3.AttackComplexity",
23404 ))
23405 }
23406 }
23407
23408 /// This metric describes the level of privileges an attacker must possess
23409 /// before successfully exploiting the vulnerability.
23410 ///
23411 /// # Working with unknown values
23412 ///
23413 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23414 /// additional enum variants at any time. Adding new variants is not considered
23415 /// a breaking change. Applications should write their code in anticipation of:
23416 ///
23417 /// - New values appearing in future releases of the client library, **and**
23418 /// - New values received dynamically, without application changes.
23419 ///
23420 /// Please consult the [Working with enums] section in the user guide for some
23421 /// guidelines.
23422 ///
23423 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23424 #[derive(Clone, Debug, PartialEq)]
23425 #[non_exhaustive]
23426 pub enum PrivilegesRequired {
23427 /// Invalid value.
23428 Unspecified,
23429 /// The attacker is unauthorized prior to attack, and therefore does not
23430 /// require any access to settings or files of the vulnerable system to
23431 /// carry out an attack.
23432 None,
23433 /// The attacker requires privileges that provide basic user capabilities
23434 /// that could normally affect only settings and files owned by a user.
23435 /// Alternatively, an attacker with Low privileges has the ability to access
23436 /// only non-sensitive resources.
23437 Low,
23438 /// The attacker requires privileges that provide significant (e.g.,
23439 /// administrative) control over the vulnerable component allowing access to
23440 /// component-wide settings and files.
23441 High,
23442 /// If set, the enum was initialized with an unknown value.
23443 ///
23444 /// Applications can examine the value using [PrivilegesRequired::value] or
23445 /// [PrivilegesRequired::name].
23446 UnknownValue(privileges_required::UnknownValue),
23447 }
23448
23449 #[doc(hidden)]
23450 pub mod privileges_required {
23451 #[allow(unused_imports)]
23452 use super::*;
23453 #[derive(Clone, Debug, PartialEq)]
23454 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23455 }
23456
23457 impl PrivilegesRequired {
23458 /// Gets the enum value.
23459 ///
23460 /// Returns `None` if the enum contains an unknown value deserialized from
23461 /// the string representation of enums.
23462 pub fn value(&self) -> std::option::Option<i32> {
23463 match self {
23464 Self::Unspecified => std::option::Option::Some(0),
23465 Self::None => std::option::Option::Some(1),
23466 Self::Low => std::option::Option::Some(2),
23467 Self::High => std::option::Option::Some(3),
23468 Self::UnknownValue(u) => u.0.value(),
23469 }
23470 }
23471
23472 /// Gets the enum value as a string.
23473 ///
23474 /// Returns `None` if the enum contains an unknown value deserialized from
23475 /// the integer representation of enums.
23476 pub fn name(&self) -> std::option::Option<&str> {
23477 match self {
23478 Self::Unspecified => std::option::Option::Some("PRIVILEGES_REQUIRED_UNSPECIFIED"),
23479 Self::None => std::option::Option::Some("PRIVILEGES_REQUIRED_NONE"),
23480 Self::Low => std::option::Option::Some("PRIVILEGES_REQUIRED_LOW"),
23481 Self::High => std::option::Option::Some("PRIVILEGES_REQUIRED_HIGH"),
23482 Self::UnknownValue(u) => u.0.name(),
23483 }
23484 }
23485 }
23486
23487 impl std::default::Default for PrivilegesRequired {
23488 fn default() -> Self {
23489 use std::convert::From;
23490 Self::from(0)
23491 }
23492 }
23493
23494 impl std::fmt::Display for PrivilegesRequired {
23495 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23496 wkt::internal::display_enum(f, self.name(), self.value())
23497 }
23498 }
23499
23500 impl std::convert::From<i32> for PrivilegesRequired {
23501 fn from(value: i32) -> Self {
23502 match value {
23503 0 => Self::Unspecified,
23504 1 => Self::None,
23505 2 => Self::Low,
23506 3 => Self::High,
23507 _ => Self::UnknownValue(privileges_required::UnknownValue(
23508 wkt::internal::UnknownEnumValue::Integer(value),
23509 )),
23510 }
23511 }
23512 }
23513
23514 impl std::convert::From<&str> for PrivilegesRequired {
23515 fn from(value: &str) -> Self {
23516 use std::string::ToString;
23517 match value {
23518 "PRIVILEGES_REQUIRED_UNSPECIFIED" => Self::Unspecified,
23519 "PRIVILEGES_REQUIRED_NONE" => Self::None,
23520 "PRIVILEGES_REQUIRED_LOW" => Self::Low,
23521 "PRIVILEGES_REQUIRED_HIGH" => Self::High,
23522 _ => Self::UnknownValue(privileges_required::UnknownValue(
23523 wkt::internal::UnknownEnumValue::String(value.to_string()),
23524 )),
23525 }
23526 }
23527 }
23528
23529 impl serde::ser::Serialize for PrivilegesRequired {
23530 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23531 where
23532 S: serde::Serializer,
23533 {
23534 match self {
23535 Self::Unspecified => serializer.serialize_i32(0),
23536 Self::None => serializer.serialize_i32(1),
23537 Self::Low => serializer.serialize_i32(2),
23538 Self::High => serializer.serialize_i32(3),
23539 Self::UnknownValue(u) => u.0.serialize(serializer),
23540 }
23541 }
23542 }
23543
23544 impl<'de> serde::de::Deserialize<'de> for PrivilegesRequired {
23545 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23546 where
23547 D: serde::Deserializer<'de>,
23548 {
23549 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrivilegesRequired>::new(
23550 ".google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired",
23551 ))
23552 }
23553 }
23554
23555 /// This metric captures the requirement for a human user, other than the
23556 /// attacker, to participate in the successful compromise of the vulnerable
23557 /// component.
23558 ///
23559 /// # Working with unknown values
23560 ///
23561 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23562 /// additional enum variants at any time. Adding new variants is not considered
23563 /// a breaking change. Applications should write their code in anticipation of:
23564 ///
23565 /// - New values appearing in future releases of the client library, **and**
23566 /// - New values received dynamically, without application changes.
23567 ///
23568 /// Please consult the [Working with enums] section in the user guide for some
23569 /// guidelines.
23570 ///
23571 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23572 #[derive(Clone, Debug, PartialEq)]
23573 #[non_exhaustive]
23574 pub enum UserInteraction {
23575 /// Invalid value.
23576 Unspecified,
23577 /// The vulnerable system can be exploited without interaction from any user.
23578 None,
23579 /// Successful exploitation of this vulnerability requires a user to take
23580 /// some action before the vulnerability can be exploited.
23581 Required,
23582 /// If set, the enum was initialized with an unknown value.
23583 ///
23584 /// Applications can examine the value using [UserInteraction::value] or
23585 /// [UserInteraction::name].
23586 UnknownValue(user_interaction::UnknownValue),
23587 }
23588
23589 #[doc(hidden)]
23590 pub mod user_interaction {
23591 #[allow(unused_imports)]
23592 use super::*;
23593 #[derive(Clone, Debug, PartialEq)]
23594 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23595 }
23596
23597 impl UserInteraction {
23598 /// Gets the enum value.
23599 ///
23600 /// Returns `None` if the enum contains an unknown value deserialized from
23601 /// the string representation of enums.
23602 pub fn value(&self) -> std::option::Option<i32> {
23603 match self {
23604 Self::Unspecified => std::option::Option::Some(0),
23605 Self::None => std::option::Option::Some(1),
23606 Self::Required => std::option::Option::Some(2),
23607 Self::UnknownValue(u) => u.0.value(),
23608 }
23609 }
23610
23611 /// Gets the enum value as a string.
23612 ///
23613 /// Returns `None` if the enum contains an unknown value deserialized from
23614 /// the integer representation of enums.
23615 pub fn name(&self) -> std::option::Option<&str> {
23616 match self {
23617 Self::Unspecified => std::option::Option::Some("USER_INTERACTION_UNSPECIFIED"),
23618 Self::None => std::option::Option::Some("USER_INTERACTION_NONE"),
23619 Self::Required => std::option::Option::Some("USER_INTERACTION_REQUIRED"),
23620 Self::UnknownValue(u) => u.0.name(),
23621 }
23622 }
23623 }
23624
23625 impl std::default::Default for UserInteraction {
23626 fn default() -> Self {
23627 use std::convert::From;
23628 Self::from(0)
23629 }
23630 }
23631
23632 impl std::fmt::Display for UserInteraction {
23633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23634 wkt::internal::display_enum(f, self.name(), self.value())
23635 }
23636 }
23637
23638 impl std::convert::From<i32> for UserInteraction {
23639 fn from(value: i32) -> Self {
23640 match value {
23641 0 => Self::Unspecified,
23642 1 => Self::None,
23643 2 => Self::Required,
23644 _ => Self::UnknownValue(user_interaction::UnknownValue(
23645 wkt::internal::UnknownEnumValue::Integer(value),
23646 )),
23647 }
23648 }
23649 }
23650
23651 impl std::convert::From<&str> for UserInteraction {
23652 fn from(value: &str) -> Self {
23653 use std::string::ToString;
23654 match value {
23655 "USER_INTERACTION_UNSPECIFIED" => Self::Unspecified,
23656 "USER_INTERACTION_NONE" => Self::None,
23657 "USER_INTERACTION_REQUIRED" => Self::Required,
23658 _ => Self::UnknownValue(user_interaction::UnknownValue(
23659 wkt::internal::UnknownEnumValue::String(value.to_string()),
23660 )),
23661 }
23662 }
23663 }
23664
23665 impl serde::ser::Serialize for UserInteraction {
23666 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23667 where
23668 S: serde::Serializer,
23669 {
23670 match self {
23671 Self::Unspecified => serializer.serialize_i32(0),
23672 Self::None => serializer.serialize_i32(1),
23673 Self::Required => serializer.serialize_i32(2),
23674 Self::UnknownValue(u) => u.0.serialize(serializer),
23675 }
23676 }
23677 }
23678
23679 impl<'de> serde::de::Deserialize<'de> for UserInteraction {
23680 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23681 where
23682 D: serde::Deserializer<'de>,
23683 {
23684 deserializer.deserialize_any(wkt::internal::EnumVisitor::<UserInteraction>::new(
23685 ".google.cloud.securitycenter.v2.Cvssv3.UserInteraction",
23686 ))
23687 }
23688 }
23689
23690 /// The Scope metric captures whether a vulnerability in one vulnerable
23691 /// component impacts resources in components beyond its security scope.
23692 ///
23693 /// # Working with unknown values
23694 ///
23695 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23696 /// additional enum variants at any time. Adding new variants is not considered
23697 /// a breaking change. Applications should write their code in anticipation of:
23698 ///
23699 /// - New values appearing in future releases of the client library, **and**
23700 /// - New values received dynamically, without application changes.
23701 ///
23702 /// Please consult the [Working with enums] section in the user guide for some
23703 /// guidelines.
23704 ///
23705 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23706 #[derive(Clone, Debug, PartialEq)]
23707 #[non_exhaustive]
23708 pub enum Scope {
23709 /// Invalid value.
23710 Unspecified,
23711 /// An exploited vulnerability can only affect resources managed by the same
23712 /// security authority.
23713 Unchanged,
23714 /// An exploited vulnerability can affect resources beyond the security scope
23715 /// managed by the security authority of the vulnerable component.
23716 Changed,
23717 /// If set, the enum was initialized with an unknown value.
23718 ///
23719 /// Applications can examine the value using [Scope::value] or
23720 /// [Scope::name].
23721 UnknownValue(scope::UnknownValue),
23722 }
23723
23724 #[doc(hidden)]
23725 pub mod scope {
23726 #[allow(unused_imports)]
23727 use super::*;
23728 #[derive(Clone, Debug, PartialEq)]
23729 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23730 }
23731
23732 impl Scope {
23733 /// Gets the enum value.
23734 ///
23735 /// Returns `None` if the enum contains an unknown value deserialized from
23736 /// the string representation of enums.
23737 pub fn value(&self) -> std::option::Option<i32> {
23738 match self {
23739 Self::Unspecified => std::option::Option::Some(0),
23740 Self::Unchanged => std::option::Option::Some(1),
23741 Self::Changed => std::option::Option::Some(2),
23742 Self::UnknownValue(u) => u.0.value(),
23743 }
23744 }
23745
23746 /// Gets the enum value as a string.
23747 ///
23748 /// Returns `None` if the enum contains an unknown value deserialized from
23749 /// the integer representation of enums.
23750 pub fn name(&self) -> std::option::Option<&str> {
23751 match self {
23752 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
23753 Self::Unchanged => std::option::Option::Some("SCOPE_UNCHANGED"),
23754 Self::Changed => std::option::Option::Some("SCOPE_CHANGED"),
23755 Self::UnknownValue(u) => u.0.name(),
23756 }
23757 }
23758 }
23759
23760 impl std::default::Default for Scope {
23761 fn default() -> Self {
23762 use std::convert::From;
23763 Self::from(0)
23764 }
23765 }
23766
23767 impl std::fmt::Display for Scope {
23768 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23769 wkt::internal::display_enum(f, self.name(), self.value())
23770 }
23771 }
23772
23773 impl std::convert::From<i32> for Scope {
23774 fn from(value: i32) -> Self {
23775 match value {
23776 0 => Self::Unspecified,
23777 1 => Self::Unchanged,
23778 2 => Self::Changed,
23779 _ => Self::UnknownValue(scope::UnknownValue(
23780 wkt::internal::UnknownEnumValue::Integer(value),
23781 )),
23782 }
23783 }
23784 }
23785
23786 impl std::convert::From<&str> for Scope {
23787 fn from(value: &str) -> Self {
23788 use std::string::ToString;
23789 match value {
23790 "SCOPE_UNSPECIFIED" => Self::Unspecified,
23791 "SCOPE_UNCHANGED" => Self::Unchanged,
23792 "SCOPE_CHANGED" => Self::Changed,
23793 _ => Self::UnknownValue(scope::UnknownValue(
23794 wkt::internal::UnknownEnumValue::String(value.to_string()),
23795 )),
23796 }
23797 }
23798 }
23799
23800 impl serde::ser::Serialize for Scope {
23801 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23802 where
23803 S: serde::Serializer,
23804 {
23805 match self {
23806 Self::Unspecified => serializer.serialize_i32(0),
23807 Self::Unchanged => serializer.serialize_i32(1),
23808 Self::Changed => serializer.serialize_i32(2),
23809 Self::UnknownValue(u) => u.0.serialize(serializer),
23810 }
23811 }
23812 }
23813
23814 impl<'de> serde::de::Deserialize<'de> for Scope {
23815 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23816 where
23817 D: serde::Deserializer<'de>,
23818 {
23819 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
23820 ".google.cloud.securitycenter.v2.Cvssv3.Scope",
23821 ))
23822 }
23823 }
23824
23825 /// The Impact metrics capture the effects of a successfully exploited
23826 /// vulnerability on the component that suffers the worst outcome that is most
23827 /// directly and predictably associated with the attack.
23828 ///
23829 /// # Working with unknown values
23830 ///
23831 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23832 /// additional enum variants at any time. Adding new variants is not considered
23833 /// a breaking change. Applications should write their code in anticipation of:
23834 ///
23835 /// - New values appearing in future releases of the client library, **and**
23836 /// - New values received dynamically, without application changes.
23837 ///
23838 /// Please consult the [Working with enums] section in the user guide for some
23839 /// guidelines.
23840 ///
23841 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23842 #[derive(Clone, Debug, PartialEq)]
23843 #[non_exhaustive]
23844 pub enum Impact {
23845 /// Invalid value.
23846 Unspecified,
23847 /// High impact.
23848 High,
23849 /// Low impact.
23850 Low,
23851 /// No impact.
23852 None,
23853 /// If set, the enum was initialized with an unknown value.
23854 ///
23855 /// Applications can examine the value using [Impact::value] or
23856 /// [Impact::name].
23857 UnknownValue(impact::UnknownValue),
23858 }
23859
23860 #[doc(hidden)]
23861 pub mod impact {
23862 #[allow(unused_imports)]
23863 use super::*;
23864 #[derive(Clone, Debug, PartialEq)]
23865 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23866 }
23867
23868 impl Impact {
23869 /// Gets the enum value.
23870 ///
23871 /// Returns `None` if the enum contains an unknown value deserialized from
23872 /// the string representation of enums.
23873 pub fn value(&self) -> std::option::Option<i32> {
23874 match self {
23875 Self::Unspecified => std::option::Option::Some(0),
23876 Self::High => std::option::Option::Some(1),
23877 Self::Low => std::option::Option::Some(2),
23878 Self::None => std::option::Option::Some(3),
23879 Self::UnknownValue(u) => u.0.value(),
23880 }
23881 }
23882
23883 /// Gets the enum value as a string.
23884 ///
23885 /// Returns `None` if the enum contains an unknown value deserialized from
23886 /// the integer representation of enums.
23887 pub fn name(&self) -> std::option::Option<&str> {
23888 match self {
23889 Self::Unspecified => std::option::Option::Some("IMPACT_UNSPECIFIED"),
23890 Self::High => std::option::Option::Some("IMPACT_HIGH"),
23891 Self::Low => std::option::Option::Some("IMPACT_LOW"),
23892 Self::None => std::option::Option::Some("IMPACT_NONE"),
23893 Self::UnknownValue(u) => u.0.name(),
23894 }
23895 }
23896 }
23897
23898 impl std::default::Default for Impact {
23899 fn default() -> Self {
23900 use std::convert::From;
23901 Self::from(0)
23902 }
23903 }
23904
23905 impl std::fmt::Display for Impact {
23906 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23907 wkt::internal::display_enum(f, self.name(), self.value())
23908 }
23909 }
23910
23911 impl std::convert::From<i32> for Impact {
23912 fn from(value: i32) -> Self {
23913 match value {
23914 0 => Self::Unspecified,
23915 1 => Self::High,
23916 2 => Self::Low,
23917 3 => Self::None,
23918 _ => Self::UnknownValue(impact::UnknownValue(
23919 wkt::internal::UnknownEnumValue::Integer(value),
23920 )),
23921 }
23922 }
23923 }
23924
23925 impl std::convert::From<&str> for Impact {
23926 fn from(value: &str) -> Self {
23927 use std::string::ToString;
23928 match value {
23929 "IMPACT_UNSPECIFIED" => Self::Unspecified,
23930 "IMPACT_HIGH" => Self::High,
23931 "IMPACT_LOW" => Self::Low,
23932 "IMPACT_NONE" => Self::None,
23933 _ => Self::UnknownValue(impact::UnknownValue(
23934 wkt::internal::UnknownEnumValue::String(value.to_string()),
23935 )),
23936 }
23937 }
23938 }
23939
23940 impl serde::ser::Serialize for Impact {
23941 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23942 where
23943 S: serde::Serializer,
23944 {
23945 match self {
23946 Self::Unspecified => serializer.serialize_i32(0),
23947 Self::High => serializer.serialize_i32(1),
23948 Self::Low => serializer.serialize_i32(2),
23949 Self::None => serializer.serialize_i32(3),
23950 Self::UnknownValue(u) => u.0.serialize(serializer),
23951 }
23952 }
23953 }
23954
23955 impl<'de> serde::de::Deserialize<'de> for Impact {
23956 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23957 where
23958 D: serde::Deserializer<'de>,
23959 {
23960 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Impact>::new(
23961 ".google.cloud.securitycenter.v2.Cvssv3.Impact",
23962 ))
23963 }
23964 }
23965}
23966
23967/// Package is a generic definition of a package.
23968#[derive(Clone, Default, PartialEq)]
23969#[non_exhaustive]
23970pub struct Package {
23971 /// The name of the package where the vulnerability was detected.
23972 pub package_name: std::string::String,
23973
23974 /// The CPE URI where the vulnerability was detected.
23975 pub cpe_uri: std::string::String,
23976
23977 /// Type of package, for example, os, maven, or go.
23978 pub package_type: std::string::String,
23979
23980 /// The version of the package.
23981 pub package_version: std::string::String,
23982
23983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23984}
23985
23986impl Package {
23987 pub fn new() -> Self {
23988 std::default::Default::default()
23989 }
23990
23991 /// Sets the value of [package_name][crate::model::Package::package_name].
23992 ///
23993 /// # Example
23994 /// ```ignore,no_run
23995 /// # use google_cloud_securitycenter_v2::model::Package;
23996 /// let x = Package::new().set_package_name("example");
23997 /// ```
23998 pub fn set_package_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23999 self.package_name = v.into();
24000 self
24001 }
24002
24003 /// Sets the value of [cpe_uri][crate::model::Package::cpe_uri].
24004 ///
24005 /// # Example
24006 /// ```ignore,no_run
24007 /// # use google_cloud_securitycenter_v2::model::Package;
24008 /// let x = Package::new().set_cpe_uri("example");
24009 /// ```
24010 pub fn set_cpe_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24011 self.cpe_uri = v.into();
24012 self
24013 }
24014
24015 /// Sets the value of [package_type][crate::model::Package::package_type].
24016 ///
24017 /// # Example
24018 /// ```ignore,no_run
24019 /// # use google_cloud_securitycenter_v2::model::Package;
24020 /// let x = Package::new().set_package_type("example");
24021 /// ```
24022 pub fn set_package_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24023 self.package_type = v.into();
24024 self
24025 }
24026
24027 /// Sets the value of [package_version][crate::model::Package::package_version].
24028 ///
24029 /// # Example
24030 /// ```ignore,no_run
24031 /// # use google_cloud_securitycenter_v2::model::Package;
24032 /// let x = Package::new().set_package_version("example");
24033 /// ```
24034 pub fn set_package_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24035 self.package_version = v.into();
24036 self
24037 }
24038}
24039
24040impl wkt::message::Message for Package {
24041 fn typename() -> &'static str {
24042 "type.googleapis.com/google.cloud.securitycenter.v2.Package"
24043 }
24044}
24045
24046/// SecurityBulletin are notifications of vulnerabilities of Google products.
24047#[derive(Clone, Default, PartialEq)]
24048#[non_exhaustive]
24049pub struct SecurityBulletin {
24050 /// ID of the bulletin corresponding to the vulnerability.
24051 pub bulletin_id: std::string::String,
24052
24053 /// Submission time of this Security Bulletin.
24054 pub submission_time: std::option::Option<wkt::Timestamp>,
24055
24056 /// This represents a version that the cluster receiving this notification
24057 /// should be upgraded to, based on its current version. For example, 1.15.0
24058 pub suggested_upgrade_version: std::string::String,
24059
24060 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24061}
24062
24063impl SecurityBulletin {
24064 pub fn new() -> Self {
24065 std::default::Default::default()
24066 }
24067
24068 /// Sets the value of [bulletin_id][crate::model::SecurityBulletin::bulletin_id].
24069 ///
24070 /// # Example
24071 /// ```ignore,no_run
24072 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24073 /// let x = SecurityBulletin::new().set_bulletin_id("example");
24074 /// ```
24075 pub fn set_bulletin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24076 self.bulletin_id = v.into();
24077 self
24078 }
24079
24080 /// Sets the value of [submission_time][crate::model::SecurityBulletin::submission_time].
24081 ///
24082 /// # Example
24083 /// ```ignore,no_run
24084 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24085 /// use wkt::Timestamp;
24086 /// let x = SecurityBulletin::new().set_submission_time(Timestamp::default()/* use setters */);
24087 /// ```
24088 pub fn set_submission_time<T>(mut self, v: T) -> Self
24089 where
24090 T: std::convert::Into<wkt::Timestamp>,
24091 {
24092 self.submission_time = std::option::Option::Some(v.into());
24093 self
24094 }
24095
24096 /// Sets or clears the value of [submission_time][crate::model::SecurityBulletin::submission_time].
24097 ///
24098 /// # Example
24099 /// ```ignore,no_run
24100 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24101 /// use wkt::Timestamp;
24102 /// let x = SecurityBulletin::new().set_or_clear_submission_time(Some(Timestamp::default()/* use setters */));
24103 /// let x = SecurityBulletin::new().set_or_clear_submission_time(None::<Timestamp>);
24104 /// ```
24105 pub fn set_or_clear_submission_time<T>(mut self, v: std::option::Option<T>) -> Self
24106 where
24107 T: std::convert::Into<wkt::Timestamp>,
24108 {
24109 self.submission_time = v.map(|x| x.into());
24110 self
24111 }
24112
24113 /// Sets the value of [suggested_upgrade_version][crate::model::SecurityBulletin::suggested_upgrade_version].
24114 ///
24115 /// # Example
24116 /// ```ignore,no_run
24117 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24118 /// let x = SecurityBulletin::new().set_suggested_upgrade_version("example");
24119 /// ```
24120 pub fn set_suggested_upgrade_version<T: std::convert::Into<std::string::String>>(
24121 mut self,
24122 v: T,
24123 ) -> Self {
24124 self.suggested_upgrade_version = v.into();
24125 self
24126 }
24127}
24128
24129impl wkt::message::Message for SecurityBulletin {
24130 fn typename() -> &'static str {
24131 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityBulletin"
24132 }
24133}
24134
24135/// CWE stands for Common Weakness Enumeration. Information about this weakness,
24136/// as described by [CWE](https://cwe.mitre.org/).
24137#[derive(Clone, Default, PartialEq)]
24138#[non_exhaustive]
24139pub struct Cwe {
24140 /// The CWE identifier, e.g. CWE-94
24141 pub id: std::string::String,
24142
24143 /// Any reference to the details on the CWE, for example,
24144 /// <https://cwe.mitre.org/data/definitions/94.html>
24145 pub references: std::vec::Vec<crate::model::Reference>,
24146
24147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24148}
24149
24150impl Cwe {
24151 pub fn new() -> Self {
24152 std::default::Default::default()
24153 }
24154
24155 /// Sets the value of [id][crate::model::Cwe::id].
24156 ///
24157 /// # Example
24158 /// ```ignore,no_run
24159 /// # use google_cloud_securitycenter_v2::model::Cwe;
24160 /// let x = Cwe::new().set_id("example");
24161 /// ```
24162 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24163 self.id = v.into();
24164 self
24165 }
24166
24167 /// Sets the value of [references][crate::model::Cwe::references].
24168 ///
24169 /// # Example
24170 /// ```ignore,no_run
24171 /// # use google_cloud_securitycenter_v2::model::Cwe;
24172 /// use google_cloud_securitycenter_v2::model::Reference;
24173 /// let x = Cwe::new()
24174 /// .set_references([
24175 /// Reference::default()/* use setters */,
24176 /// Reference::default()/* use (different) setters */,
24177 /// ]);
24178 /// ```
24179 pub fn set_references<T, V>(mut self, v: T) -> Self
24180 where
24181 T: std::iter::IntoIterator<Item = V>,
24182 V: std::convert::Into<crate::model::Reference>,
24183 {
24184 use std::iter::Iterator;
24185 self.references = v.into_iter().map(|i| i.into()).collect();
24186 self
24187 }
24188}
24189
24190impl wkt::message::Message for Cwe {
24191 fn typename() -> &'static str {
24192 "type.googleapis.com/google.cloud.securitycenter.v2.Cwe"
24193 }
24194}
24195
24196/// JobState represents the state of the job.
24197///
24198/// # Working with unknown values
24199///
24200/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24201/// additional enum variants at any time. Adding new variants is not considered
24202/// a breaking change. Applications should write their code in anticipation of:
24203///
24204/// - New values appearing in future releases of the client library, **and**
24205/// - New values received dynamically, without application changes.
24206///
24207/// Please consult the [Working with enums] section in the user guide for some
24208/// guidelines.
24209///
24210/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24211#[derive(Clone, Debug, PartialEq)]
24212#[non_exhaustive]
24213pub enum JobState {
24214 /// Unspecified represents an unknown state and should not be used.
24215 Unspecified,
24216 /// Job is scheduled and pending for run
24217 Pending,
24218 /// Job in progress
24219 Running,
24220 /// Job has completed with success
24221 Succeeded,
24222 /// Job has completed but with failure
24223 Failed,
24224 /// If set, the enum was initialized with an unknown value.
24225 ///
24226 /// Applications can examine the value using [JobState::value] or
24227 /// [JobState::name].
24228 UnknownValue(job_state::UnknownValue),
24229}
24230
24231#[doc(hidden)]
24232pub mod job_state {
24233 #[allow(unused_imports)]
24234 use super::*;
24235 #[derive(Clone, Debug, PartialEq)]
24236 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24237}
24238
24239impl JobState {
24240 /// Gets the enum value.
24241 ///
24242 /// Returns `None` if the enum contains an unknown value deserialized from
24243 /// the string representation of enums.
24244 pub fn value(&self) -> std::option::Option<i32> {
24245 match self {
24246 Self::Unspecified => std::option::Option::Some(0),
24247 Self::Pending => std::option::Option::Some(1),
24248 Self::Running => std::option::Option::Some(2),
24249 Self::Succeeded => std::option::Option::Some(3),
24250 Self::Failed => std::option::Option::Some(4),
24251 Self::UnknownValue(u) => u.0.value(),
24252 }
24253 }
24254
24255 /// Gets the enum value as a string.
24256 ///
24257 /// Returns `None` if the enum contains an unknown value deserialized from
24258 /// the integer representation of enums.
24259 pub fn name(&self) -> std::option::Option<&str> {
24260 match self {
24261 Self::Unspecified => std::option::Option::Some("JOB_STATE_UNSPECIFIED"),
24262 Self::Pending => std::option::Option::Some("PENDING"),
24263 Self::Running => std::option::Option::Some("RUNNING"),
24264 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
24265 Self::Failed => std::option::Option::Some("FAILED"),
24266 Self::UnknownValue(u) => u.0.name(),
24267 }
24268 }
24269}
24270
24271impl std::default::Default for JobState {
24272 fn default() -> Self {
24273 use std::convert::From;
24274 Self::from(0)
24275 }
24276}
24277
24278impl std::fmt::Display for JobState {
24279 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24280 wkt::internal::display_enum(f, self.name(), self.value())
24281 }
24282}
24283
24284impl std::convert::From<i32> for JobState {
24285 fn from(value: i32) -> Self {
24286 match value {
24287 0 => Self::Unspecified,
24288 1 => Self::Pending,
24289 2 => Self::Running,
24290 3 => Self::Succeeded,
24291 4 => Self::Failed,
24292 _ => Self::UnknownValue(job_state::UnknownValue(
24293 wkt::internal::UnknownEnumValue::Integer(value),
24294 )),
24295 }
24296 }
24297}
24298
24299impl std::convert::From<&str> for JobState {
24300 fn from(value: &str) -> Self {
24301 use std::string::ToString;
24302 match value {
24303 "JOB_STATE_UNSPECIFIED" => Self::Unspecified,
24304 "PENDING" => Self::Pending,
24305 "RUNNING" => Self::Running,
24306 "SUCCEEDED" => Self::Succeeded,
24307 "FAILED" => Self::Failed,
24308 _ => Self::UnknownValue(job_state::UnknownValue(
24309 wkt::internal::UnknownEnumValue::String(value.to_string()),
24310 )),
24311 }
24312 }
24313}
24314
24315impl serde::ser::Serialize for JobState {
24316 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24317 where
24318 S: serde::Serializer,
24319 {
24320 match self {
24321 Self::Unspecified => serializer.serialize_i32(0),
24322 Self::Pending => serializer.serialize_i32(1),
24323 Self::Running => serializer.serialize_i32(2),
24324 Self::Succeeded => serializer.serialize_i32(3),
24325 Self::Failed => serializer.serialize_i32(4),
24326 Self::UnknownValue(u) => u.0.serialize(serializer),
24327 }
24328 }
24329}
24330
24331impl<'de> serde::de::Deserialize<'de> for JobState {
24332 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24333 where
24334 D: serde::Deserializer<'de>,
24335 {
24336 deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobState>::new(
24337 ".google.cloud.securitycenter.v2.JobState",
24338 ))
24339 }
24340}
24341
24342/// The cloud provider the finding pertains to.
24343///
24344/// # Working with unknown values
24345///
24346/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24347/// additional enum variants at any time. Adding new variants is not considered
24348/// a breaking change. Applications should write their code in anticipation of:
24349///
24350/// - New values appearing in future releases of the client library, **and**
24351/// - New values received dynamically, without application changes.
24352///
24353/// Please consult the [Working with enums] section in the user guide for some
24354/// guidelines.
24355///
24356/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24357#[derive(Clone, Debug, PartialEq)]
24358#[non_exhaustive]
24359pub enum CloudProvider {
24360 /// The cloud provider is unspecified.
24361 Unspecified,
24362 /// The cloud provider is Google Cloud.
24363 GoogleCloudPlatform,
24364 /// The cloud provider is Amazon Web Services.
24365 AmazonWebServices,
24366 /// The cloud provider is Microsoft Azure.
24367 MicrosoftAzure,
24368 /// If set, the enum was initialized with an unknown value.
24369 ///
24370 /// Applications can examine the value using [CloudProvider::value] or
24371 /// [CloudProvider::name].
24372 UnknownValue(cloud_provider::UnknownValue),
24373}
24374
24375#[doc(hidden)]
24376pub mod cloud_provider {
24377 #[allow(unused_imports)]
24378 use super::*;
24379 #[derive(Clone, Debug, PartialEq)]
24380 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24381}
24382
24383impl CloudProvider {
24384 /// Gets the enum value.
24385 ///
24386 /// Returns `None` if the enum contains an unknown value deserialized from
24387 /// the string representation of enums.
24388 pub fn value(&self) -> std::option::Option<i32> {
24389 match self {
24390 Self::Unspecified => std::option::Option::Some(0),
24391 Self::GoogleCloudPlatform => std::option::Option::Some(1),
24392 Self::AmazonWebServices => std::option::Option::Some(2),
24393 Self::MicrosoftAzure => std::option::Option::Some(3),
24394 Self::UnknownValue(u) => u.0.value(),
24395 }
24396 }
24397
24398 /// Gets the enum value as a string.
24399 ///
24400 /// Returns `None` if the enum contains an unknown value deserialized from
24401 /// the integer representation of enums.
24402 pub fn name(&self) -> std::option::Option<&str> {
24403 match self {
24404 Self::Unspecified => std::option::Option::Some("CLOUD_PROVIDER_UNSPECIFIED"),
24405 Self::GoogleCloudPlatform => std::option::Option::Some("GOOGLE_CLOUD_PLATFORM"),
24406 Self::AmazonWebServices => std::option::Option::Some("AMAZON_WEB_SERVICES"),
24407 Self::MicrosoftAzure => std::option::Option::Some("MICROSOFT_AZURE"),
24408 Self::UnknownValue(u) => u.0.name(),
24409 }
24410 }
24411}
24412
24413impl std::default::Default for CloudProvider {
24414 fn default() -> Self {
24415 use std::convert::From;
24416 Self::from(0)
24417 }
24418}
24419
24420impl std::fmt::Display for CloudProvider {
24421 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24422 wkt::internal::display_enum(f, self.name(), self.value())
24423 }
24424}
24425
24426impl std::convert::From<i32> for CloudProvider {
24427 fn from(value: i32) -> Self {
24428 match value {
24429 0 => Self::Unspecified,
24430 1 => Self::GoogleCloudPlatform,
24431 2 => Self::AmazonWebServices,
24432 3 => Self::MicrosoftAzure,
24433 _ => Self::UnknownValue(cloud_provider::UnknownValue(
24434 wkt::internal::UnknownEnumValue::Integer(value),
24435 )),
24436 }
24437 }
24438}
24439
24440impl std::convert::From<&str> for CloudProvider {
24441 fn from(value: &str) -> Self {
24442 use std::string::ToString;
24443 match value {
24444 "CLOUD_PROVIDER_UNSPECIFIED" => Self::Unspecified,
24445 "GOOGLE_CLOUD_PLATFORM" => Self::GoogleCloudPlatform,
24446 "AMAZON_WEB_SERVICES" => Self::AmazonWebServices,
24447 "MICROSOFT_AZURE" => Self::MicrosoftAzure,
24448 _ => Self::UnknownValue(cloud_provider::UnknownValue(
24449 wkt::internal::UnknownEnumValue::String(value.to_string()),
24450 )),
24451 }
24452 }
24453}
24454
24455impl serde::ser::Serialize for CloudProvider {
24456 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24457 where
24458 S: serde::Serializer,
24459 {
24460 match self {
24461 Self::Unspecified => serializer.serialize_i32(0),
24462 Self::GoogleCloudPlatform => serializer.serialize_i32(1),
24463 Self::AmazonWebServices => serializer.serialize_i32(2),
24464 Self::MicrosoftAzure => serializer.serialize_i32(3),
24465 Self::UnknownValue(u) => u.0.serialize(serializer),
24466 }
24467 }
24468}
24469
24470impl<'de> serde::de::Deserialize<'de> for CloudProvider {
24471 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24472 where
24473 D: serde::Deserializer<'de>,
24474 {
24475 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudProvider>::new(
24476 ".google.cloud.securitycenter.v2.CloudProvider",
24477 ))
24478 }
24479}
24480
24481/// Value enum to map to a resource
24482///
24483/// # Working with unknown values
24484///
24485/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24486/// additional enum variants at any time. Adding new variants is not considered
24487/// a breaking change. Applications should write their code in anticipation of:
24488///
24489/// - New values appearing in future releases of the client library, **and**
24490/// - New values received dynamically, without application changes.
24491///
24492/// Please consult the [Working with enums] section in the user guide for some
24493/// guidelines.
24494///
24495/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24496#[derive(Clone, Debug, PartialEq)]
24497#[non_exhaustive]
24498pub enum ResourceValue {
24499 /// Unspecific value
24500 Unspecified,
24501 /// High resource value
24502 High,
24503 /// Medium resource value
24504 Medium,
24505 /// Low resource value
24506 Low,
24507 /// No resource value, e.g. ignore these resources
24508 None,
24509 /// If set, the enum was initialized with an unknown value.
24510 ///
24511 /// Applications can examine the value using [ResourceValue::value] or
24512 /// [ResourceValue::name].
24513 UnknownValue(resource_value::UnknownValue),
24514}
24515
24516#[doc(hidden)]
24517pub mod resource_value {
24518 #[allow(unused_imports)]
24519 use super::*;
24520 #[derive(Clone, Debug, PartialEq)]
24521 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24522}
24523
24524impl ResourceValue {
24525 /// Gets the enum value.
24526 ///
24527 /// Returns `None` if the enum contains an unknown value deserialized from
24528 /// the string representation of enums.
24529 pub fn value(&self) -> std::option::Option<i32> {
24530 match self {
24531 Self::Unspecified => std::option::Option::Some(0),
24532 Self::High => std::option::Option::Some(1),
24533 Self::Medium => std::option::Option::Some(2),
24534 Self::Low => std::option::Option::Some(3),
24535 Self::None => std::option::Option::Some(4),
24536 Self::UnknownValue(u) => u.0.value(),
24537 }
24538 }
24539
24540 /// Gets the enum value as a string.
24541 ///
24542 /// Returns `None` if the enum contains an unknown value deserialized from
24543 /// the integer representation of enums.
24544 pub fn name(&self) -> std::option::Option<&str> {
24545 match self {
24546 Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
24547 Self::High => std::option::Option::Some("HIGH"),
24548 Self::Medium => std::option::Option::Some("MEDIUM"),
24549 Self::Low => std::option::Option::Some("LOW"),
24550 Self::None => std::option::Option::Some("NONE"),
24551 Self::UnknownValue(u) => u.0.name(),
24552 }
24553 }
24554}
24555
24556impl std::default::Default for ResourceValue {
24557 fn default() -> Self {
24558 use std::convert::From;
24559 Self::from(0)
24560 }
24561}
24562
24563impl std::fmt::Display for ResourceValue {
24564 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24565 wkt::internal::display_enum(f, self.name(), self.value())
24566 }
24567}
24568
24569impl std::convert::From<i32> for ResourceValue {
24570 fn from(value: i32) -> Self {
24571 match value {
24572 0 => Self::Unspecified,
24573 1 => Self::High,
24574 2 => Self::Medium,
24575 3 => Self::Low,
24576 4 => Self::None,
24577 _ => Self::UnknownValue(resource_value::UnknownValue(
24578 wkt::internal::UnknownEnumValue::Integer(value),
24579 )),
24580 }
24581 }
24582}
24583
24584impl std::convert::From<&str> for ResourceValue {
24585 fn from(value: &str) -> Self {
24586 use std::string::ToString;
24587 match value {
24588 "RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
24589 "HIGH" => Self::High,
24590 "MEDIUM" => Self::Medium,
24591 "LOW" => Self::Low,
24592 "NONE" => Self::None,
24593 _ => Self::UnknownValue(resource_value::UnknownValue(
24594 wkt::internal::UnknownEnumValue::String(value.to_string()),
24595 )),
24596 }
24597 }
24598}
24599
24600impl serde::ser::Serialize for ResourceValue {
24601 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24602 where
24603 S: serde::Serializer,
24604 {
24605 match self {
24606 Self::Unspecified => serializer.serialize_i32(0),
24607 Self::High => serializer.serialize_i32(1),
24608 Self::Medium => serializer.serialize_i32(2),
24609 Self::Low => serializer.serialize_i32(3),
24610 Self::None => serializer.serialize_i32(4),
24611 Self::UnknownValue(u) => u.0.serialize(serializer),
24612 }
24613 }
24614}
24615
24616impl<'de> serde::de::Deserialize<'de> for ResourceValue {
24617 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24618 where
24619 D: serde::Deserializer<'de>,
24620 {
24621 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
24622 ".google.cloud.securitycenter.v2.ResourceValue",
24623 ))
24624 }
24625}