#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_iam_v1;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Access {
pub principal_email: std::string::String,
pub caller_ip: std::string::String,
pub caller_ip_geo: std::option::Option<crate::model::Geolocation>,
pub user_agent_family: std::string::String,
pub user_agent: std::string::String,
pub service_name: std::string::String,
pub method_name: std::string::String,
pub principal_subject: std::string::String,
pub service_account_key_name: std::string::String,
pub service_account_delegation_info: std::vec::Vec<crate::model::ServiceAccountDelegationInfo>,
pub user_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Access {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.principal_email = v.into();
self
}
pub fn set_caller_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.caller_ip = v.into();
self
}
pub fn set_caller_ip_geo<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Geolocation>,
{
self.caller_ip_geo = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_caller_ip_geo<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Geolocation>,
{
self.caller_ip_geo = v.map(|x| x.into());
self
}
pub fn set_user_agent_family<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.user_agent_family = v.into();
self
}
pub fn set_user_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user_agent = v.into();
self
}
pub fn set_service_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_name = v.into();
self
}
pub fn set_method_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.method_name = v.into();
self
}
pub fn set_principal_subject<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.principal_subject = v.into();
self
}
pub fn set_service_account_key_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_account_key_name = v.into();
self
}
pub fn set_service_account_delegation_info<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ServiceAccountDelegationInfo>,
{
use std::iter::Iterator;
self.service_account_delegation_info = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_user_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user_name = v.into();
self
}
}
impl wkt::message::Message for Access {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Access"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceAccountDelegationInfo {
pub principal_email: std::string::String,
pub principal_subject: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceAccountDelegationInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.principal_email = v.into();
self
}
pub fn set_principal_subject<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.principal_subject = v.into();
self
}
}
impl wkt::message::Message for ServiceAccountDelegationInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ServiceAccountDelegationInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Geolocation {
pub region_code: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Geolocation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_region_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region_code = v.into();
self
}
}
impl wkt::message::Message for Geolocation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Geolocation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AffectedResources {
pub count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AffectedResources {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
}
impl wkt::message::Message for AffectedResources {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AffectedResources"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AiModel {
pub name: std::string::String,
pub domain: std::string::String,
pub library: std::string::String,
pub location: std::string::String,
pub publisher: std::string::String,
pub deployment_platform: crate::model::ai_model::DeploymentPlatform,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AiModel {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.domain = v.into();
self
}
pub fn set_library<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.library = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
pub fn set_publisher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.publisher = v.into();
self
}
pub fn set_deployment_platform<
T: std::convert::Into<crate::model::ai_model::DeploymentPlatform>,
>(
mut self,
v: T,
) -> Self {
self.deployment_platform = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for AiModel {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AiModel"
}
}
pub mod ai_model {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DeploymentPlatform {
Unspecified,
VertexAi,
Gke,
Gce,
FineTunedModel,
UnknownValue(deployment_platform::UnknownValue),
}
#[doc(hidden)]
pub mod deployment_platform {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DeploymentPlatform {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::VertexAi => std::option::Option::Some(1),
Self::Gke => std::option::Option::Some(2),
Self::Gce => std::option::Option::Some(3),
Self::FineTunedModel => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DEPLOYMENT_PLATFORM_UNSPECIFIED"),
Self::VertexAi => std::option::Option::Some("VERTEX_AI"),
Self::Gke => std::option::Option::Some("GKE"),
Self::Gce => std::option::Option::Some("GCE"),
Self::FineTunedModel => std::option::Option::Some("FINE_TUNED_MODEL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DeploymentPlatform {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DeploymentPlatform {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DeploymentPlatform {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::VertexAi,
2 => Self::Gke,
3 => Self::Gce,
4 => Self::FineTunedModel,
_ => Self::UnknownValue(deployment_platform::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DeploymentPlatform {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DEPLOYMENT_PLATFORM_UNSPECIFIED" => Self::Unspecified,
"VERTEX_AI" => Self::VertexAi,
"GKE" => Self::Gke,
"GCE" => Self::Gce,
"FINE_TUNED_MODEL" => Self::FineTunedModel,
_ => Self::UnknownValue(deployment_platform::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DeploymentPlatform {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::VertexAi => serializer.serialize_i32(1),
Self::Gke => serializer.serialize_i32(2),
Self::Gce => serializer.serialize_i32(3),
Self::FineTunedModel => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DeploymentPlatform {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentPlatform>::new(
".google.cloud.securitycenter.v2.AiModel.DeploymentPlatform",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Application {
pub base_uri: std::string::String,
pub full_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Application {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_base_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.base_uri = v.into();
self
}
pub fn set_full_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.full_uri = v.into();
self
}
}
impl wkt::message::Message for Application {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Application"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttackExposure {
pub score: f64,
pub latest_calculation_time: std::option::Option<wkt::Timestamp>,
pub attack_exposure_result: std::string::String,
pub state: crate::model::attack_exposure::State,
pub exposed_high_value_resources_count: i32,
pub exposed_medium_value_resources_count: i32,
pub exposed_low_value_resources_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AttackExposure {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.score = v.into();
self
}
pub fn set_latest_calculation_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_calculation_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_latest_calculation_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.latest_calculation_time = v.map(|x| x.into());
self
}
pub fn set_attack_exposure_result<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.attack_exposure_result = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::attack_exposure::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_exposed_high_value_resources_count<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.exposed_high_value_resources_count = v.into();
self
}
pub fn set_exposed_medium_value_resources_count<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.exposed_medium_value_resources_count = v.into();
self
}
pub fn set_exposed_low_value_resources_count<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.exposed_low_value_resources_count = v.into();
self
}
}
impl wkt::message::Message for AttackExposure {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AttackExposure"
}
}
pub mod attack_exposure {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Calculated,
NotCalculated,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Calculated => std::option::Option::Some(1),
Self::NotCalculated => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Calculated => std::option::Option::Some("CALCULATED"),
Self::NotCalculated => std::option::Option::Some("NOT_CALCULATED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Calculated,
2 => Self::NotCalculated,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"CALCULATED" => Self::Calculated,
"NOT_CALCULATED" => Self::NotCalculated,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Calculated => serializer.serialize_i32(1),
Self::NotCalculated => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.securitycenter.v2.AttackExposure.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttackPath {
pub name: std::string::String,
pub path_nodes: std::vec::Vec<crate::model::attack_path::AttackPathNode>,
pub edges: std::vec::Vec<crate::model::attack_path::AttackPathEdge>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AttackPath {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_path_nodes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::attack_path::AttackPathNode>,
{
use std::iter::Iterator;
self.path_nodes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_edges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::attack_path::AttackPathEdge>,
{
use std::iter::Iterator;
self.edges = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AttackPath {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AttackPath"
}
}
pub mod attack_path {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttackPathNode {
pub resource: std::string::String,
pub resource_type: std::string::String,
pub display_name: std::string::String,
pub associated_findings:
std::vec::Vec<crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding>,
pub uuid: std::string::String,
pub attack_steps:
std::vec::Vec<crate::model::attack_path::attack_path_node::AttackStepNode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AttackPathNode {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
pub fn set_resource_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_type = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
pub fn set_associated_findings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<
crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding,
>,
{
use std::iter::Iterator;
self.associated_findings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uuid = v.into();
self
}
pub fn set_attack_steps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::attack_path::attack_path_node::AttackStepNode>,
{
use std::iter::Iterator;
self.attack_steps = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AttackPathNode {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode"
}
}
pub mod attack_path_node {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PathNodeAssociatedFinding {
pub canonical_finding: std::string::String,
pub finding_category: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PathNodeAssociatedFinding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_canonical_finding<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.canonical_finding = v.into();
self
}
pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.finding_category = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for PathNodeAssociatedFinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttackStepNode {
pub uuid: std::string::String,
pub r#type: crate::model::attack_path::attack_path_node::NodeType,
pub display_name: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AttackStepNode {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uuid = v.into();
self
}
pub fn set_type<
T: std::convert::Into<crate::model::attack_path::attack_path_node::NodeType>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.description = v.into();
self
}
}
impl wkt::message::Message for AttackStepNode {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NodeType {
Unspecified,
And,
Or,
Defense,
Attacker,
UnknownValue(node_type::UnknownValue),
}
#[doc(hidden)]
pub mod node_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl NodeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::And => std::option::Option::Some(1),
Self::Or => std::option::Option::Some(2),
Self::Defense => std::option::Option::Some(3),
Self::Attacker => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("NODE_TYPE_UNSPECIFIED"),
Self::And => std::option::Option::Some("NODE_TYPE_AND"),
Self::Or => std::option::Option::Some("NODE_TYPE_OR"),
Self::Defense => std::option::Option::Some("NODE_TYPE_DEFENSE"),
Self::Attacker => std::option::Option::Some("NODE_TYPE_ATTACKER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for NodeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for NodeType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for NodeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::And,
2 => Self::Or,
3 => Self::Defense,
4 => Self::Attacker,
_ => Self::UnknownValue(node_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for NodeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
"NODE_TYPE_AND" => Self::And,
"NODE_TYPE_OR" => Self::Or,
"NODE_TYPE_DEFENSE" => Self::Defense,
"NODE_TYPE_ATTACKER" => Self::Attacker,
_ => Self::UnknownValue(node_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for NodeType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::And => serializer.serialize_i32(1),
Self::Or => serializer.serialize_i32(2),
Self::Defense => serializer.serialize_i32(3),
Self::Attacker => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for NodeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeType>::new(
".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttackPathEdge {
pub source: std::string::String,
pub destination: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AttackPathEdge {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = v.into();
self
}
pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.destination = v.into();
self
}
}
impl wkt::message::Message for AttackPathEdge {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathEdge"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackupDisasterRecovery {
pub backup_template: std::string::String,
pub policies: std::vec::Vec<std::string::String>,
pub host: std::string::String,
pub applications: std::vec::Vec<std::string::String>,
pub storage_pool: std::string::String,
pub policy_options: std::vec::Vec<std::string::String>,
pub profile: std::string::String,
pub appliance: std::string::String,
pub backup_type: std::string::String,
pub backup_create_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BackupDisasterRecovery {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_backup_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_template = v.into();
self
}
pub fn set_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.policies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.host = v.into();
self
}
pub fn set_applications<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.applications = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.storage_pool = v.into();
self
}
pub fn set_policy_options<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.policy_options = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.profile = v.into();
self
}
pub fn set_appliance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.appliance = v.into();
self
}
pub fn set_backup_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.backup_type = v.into();
self
}
pub fn set_backup_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.backup_create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.backup_create_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BackupDisasterRecovery {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.BackupDisasterRecovery"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryExport {
pub name: std::string::String,
pub description: std::string::String,
pub filter: std::string::String,
pub dataset: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub most_recent_editor: std::string::String,
pub principal: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryExport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dataset = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.most_recent_editor = v.into();
self
}
pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.principal = v.into();
self
}
}
impl wkt::message::Message for BigQueryExport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.BigQueryExport"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Chokepoint {
pub related_findings: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Chokepoint {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_related_findings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.related_findings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Chokepoint {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Chokepoint"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudArmor {
pub security_policy: std::option::Option<crate::model::SecurityPolicy>,
pub requests: std::option::Option<crate::model::Requests>,
pub adaptive_protection: std::option::Option<crate::model::AdaptiveProtection>,
pub attack: std::option::Option<crate::model::Attack>,
pub threat_vector: std::string::String,
pub duration: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudArmor {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_security_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecurityPolicy>,
{
self.security_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecurityPolicy>,
{
self.security_policy = v.map(|x| x.into());
self
}
pub fn set_requests<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Requests>,
{
self.requests = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_requests<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Requests>,
{
self.requests = v.map(|x| x.into());
self
}
pub fn set_adaptive_protection<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AdaptiveProtection>,
{
self.adaptive_protection = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_adaptive_protection<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AdaptiveProtection>,
{
self.adaptive_protection = v.map(|x| x.into());
self
}
pub fn set_attack<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Attack>,
{
self.attack = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_attack<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Attack>,
{
self.attack = v.map(|x| x.into());
self
}
pub fn set_threat_vector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.threat_vector = v.into();
self
}
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CloudArmor {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CloudArmor"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecurityPolicy {
pub name: std::string::String,
pub r#type: std::string::String,
pub preview: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecurityPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_preview<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.preview = v.into();
self
}
}
impl wkt::message::Message for SecurityPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.SecurityPolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Requests {
pub ratio: f64,
pub short_term_allowed: i32,
pub long_term_allowed: i32,
pub long_term_denied: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Requests {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.ratio = v.into();
self
}
pub fn set_short_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.short_term_allowed = v.into();
self
}
pub fn set_long_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.long_term_allowed = v.into();
self
}
pub fn set_long_term_denied<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.long_term_denied = v.into();
self
}
}
impl wkt::message::Message for Requests {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Requests"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdaptiveProtection {
pub confidence: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdaptiveProtection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_confidence<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
}
impl wkt::message::Message for AdaptiveProtection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AdaptiveProtection"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Attack {
pub volume_pps_long: i64,
pub volume_bps_long: i64,
pub classification: std::string::String,
#[deprecated]
pub volume_pps: i32,
#[deprecated]
pub volume_bps: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Attack {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_volume_pps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.volume_pps_long = v.into();
self
}
pub fn set_volume_bps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.volume_bps_long = v.into();
self
}
pub fn set_classification<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.classification = v.into();
self
}
#[deprecated]
pub fn set_volume_pps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.volume_pps = v.into();
self
}
#[deprecated]
pub fn set_volume_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.volume_bps = v.into();
self
}
}
impl wkt::message::Message for Attack {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Attack"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudDlpDataProfile {
pub data_profile: std::string::String,
pub parent_type: crate::model::cloud_dlp_data_profile::ParentType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudDlpDataProfile {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_profile = v.into();
self
}
pub fn set_parent_type<
T: std::convert::Into<crate::model::cloud_dlp_data_profile::ParentType>,
>(
mut self,
v: T,
) -> Self {
self.parent_type = v.into();
self
}
}
impl wkt::message::Message for CloudDlpDataProfile {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpDataProfile"
}
}
pub mod cloud_dlp_data_profile {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ParentType {
Unspecified,
Organization,
Project,
UnknownValue(parent_type::UnknownValue),
}
#[doc(hidden)]
pub mod parent_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ParentType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Organization => std::option::Option::Some(1),
Self::Project => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PARENT_TYPE_UNSPECIFIED"),
Self::Organization => std::option::Option::Some("ORGANIZATION"),
Self::Project => std::option::Option::Some("PROJECT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ParentType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ParentType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ParentType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Organization,
2 => Self::Project,
_ => Self::UnknownValue(parent_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ParentType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PARENT_TYPE_UNSPECIFIED" => Self::Unspecified,
"ORGANIZATION" => Self::Organization,
"PROJECT" => Self::Project,
_ => Self::UnknownValue(parent_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ParentType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Organization => serializer.serialize_i32(1),
Self::Project => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ParentType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ParentType>::new(
".google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudDlpInspection {
pub inspect_job: std::string::String,
pub info_type: std::string::String,
pub info_type_count: i64,
pub full_scan: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudDlpInspection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_inspect_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.inspect_job = v.into();
self
}
pub fn set_info_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.info_type = v.into();
self
}
pub fn set_info_type_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.info_type_count = v.into();
self
}
pub fn set_full_scan<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.full_scan = v.into();
self
}
}
impl wkt::message::Message for CloudDlpInspection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpInspection"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Compliance {
pub standard: std::string::String,
pub version: std::string::String,
pub ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Compliance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_standard<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.standard = v.into();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Compliance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Compliance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Connection {
pub destination_ip: std::string::String,
pub destination_port: i32,
pub source_ip: std::string::String,
pub source_port: i32,
pub protocol: crate::model::connection::Protocol,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Connection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.destination_ip = v.into();
self
}
pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.destination_port = v.into();
self
}
pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_ip = v.into();
self
}
pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.source_port = v.into();
self
}
pub fn set_protocol<T: std::convert::Into<crate::model::connection::Protocol>>(
mut self,
v: T,
) -> Self {
self.protocol = v.into();
self
}
}
impl wkt::message::Message for Connection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Connection"
}
}
pub mod connection {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Protocol {
Unspecified,
Icmp,
Tcp,
Udp,
Gre,
Esp,
UnknownValue(protocol::UnknownValue),
}
#[doc(hidden)]
pub mod protocol {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Protocol {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Icmp => std::option::Option::Some(1),
Self::Tcp => std::option::Option::Some(6),
Self::Udp => std::option::Option::Some(17),
Self::Gre => std::option::Option::Some(47),
Self::Esp => std::option::Option::Some(50),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
Self::Icmp => std::option::Option::Some("ICMP"),
Self::Tcp => std::option::Option::Some("TCP"),
Self::Udp => std::option::Option::Some("UDP"),
Self::Gre => std::option::Option::Some("GRE"),
Self::Esp => std::option::Option::Some("ESP"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Protocol {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Protocol {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Protocol {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Icmp,
6 => Self::Tcp,
17 => Self::Udp,
47 => Self::Gre,
50 => Self::Esp,
_ => Self::UnknownValue(protocol::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Protocol {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PROTOCOL_UNSPECIFIED" => Self::Unspecified,
"ICMP" => Self::Icmp,
"TCP" => Self::Tcp,
"UDP" => Self::Udp,
"GRE" => Self::Gre,
"ESP" => Self::Esp,
_ => Self::UnknownValue(protocol::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Protocol {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Icmp => serializer.serialize_i32(1),
Self::Tcp => serializer.serialize_i32(6),
Self::Udp => serializer.serialize_i32(17),
Self::Gre => serializer.serialize_i32(47),
Self::Esp => serializer.serialize_i32(50),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Protocol {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
".google.cloud.securitycenter.v2.Connection.Protocol",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContactDetails {
pub contacts: std::vec::Vec<crate::model::Contact>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContactDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_contacts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Contact>,
{
use std::iter::Iterator;
self.contacts = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ContactDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ContactDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Contact {
pub email: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Contact {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.email = v.into();
self
}
}
impl wkt::message::Message for Contact {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Contact"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Container {
pub name: std::string::String,
pub uri: std::string::String,
pub image_id: std::string::String,
pub labels: std::vec::Vec<crate::model::Label>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Container {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_image_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_id = v.into();
self
}
pub fn set_labels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Label>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Container {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Container"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataAccessEvent {
pub event_id: std::string::String,
pub principal_email: std::string::String,
pub operation: crate::model::data_access_event::Operation,
pub event_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataAccessEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.event_id = v.into();
self
}
pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.principal_email = v.into();
self
}
pub fn set_operation<T: std::convert::Into<crate::model::data_access_event::Operation>>(
mut self,
v: T,
) -> Self {
self.operation = v.into();
self
}
pub fn set_event_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataAccessEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.DataAccessEvent"
}
}
pub mod data_access_event {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Operation {
Unspecified,
Read,
Move,
Copy,
UnknownValue(operation::UnknownValue),
}
#[doc(hidden)]
pub mod operation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Operation {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Read => std::option::Option::Some(1),
Self::Move => std::option::Option::Some(2),
Self::Copy => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
Self::Read => std::option::Option::Some("READ"),
Self::Move => std::option::Option::Some("MOVE"),
Self::Copy => std::option::Option::Some("COPY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Operation {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Operation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Operation {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Read,
2 => Self::Move,
3 => Self::Copy,
_ => Self::UnknownValue(operation::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Operation {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OPERATION_UNSPECIFIED" => Self::Unspecified,
"READ" => Self::Read,
"MOVE" => Self::Move,
"COPY" => Self::Copy,
_ => Self::UnknownValue(operation::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Operation {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Read => serializer.serialize_i32(1),
Self::Move => serializer.serialize_i32(2),
Self::Copy => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Operation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
".google.cloud.securitycenter.v2.DataAccessEvent.Operation",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataFlowEvent {
pub event_id: std::string::String,
pub principal_email: std::string::String,
pub operation: crate::model::data_flow_event::Operation,
pub violated_location: std::string::String,
pub event_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataFlowEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.event_id = v.into();
self
}
pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.principal_email = v.into();
self
}
pub fn set_operation<T: std::convert::Into<crate::model::data_flow_event::Operation>>(
mut self,
v: T,
) -> Self {
self.operation = v.into();
self
}
pub fn set_violated_location<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.violated_location = v.into();
self
}
pub fn set_event_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataFlowEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.DataFlowEvent"
}
}
pub mod data_flow_event {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Operation {
Unspecified,
Read,
Move,
Copy,
UnknownValue(operation::UnknownValue),
}
#[doc(hidden)]
pub mod operation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Operation {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Read => std::option::Option::Some(1),
Self::Move => std::option::Option::Some(2),
Self::Copy => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
Self::Read => std::option::Option::Some("READ"),
Self::Move => std::option::Option::Some("MOVE"),
Self::Copy => std::option::Option::Some("COPY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Operation {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Operation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Operation {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Read,
2 => Self::Move,
3 => Self::Copy,
_ => Self::UnknownValue(operation::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Operation {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OPERATION_UNSPECIFIED" => Self::Unspecified,
"READ" => Self::Read,
"MOVE" => Self::Move,
"COPY" => Self::Copy,
_ => Self::UnknownValue(operation::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Operation {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Read => serializer.serialize_i32(1),
Self::Move => serializer.serialize_i32(2),
Self::Copy => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Operation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
".google.cloud.securitycenter.v2.DataFlowEvent.Operation",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataRetentionDeletionEvent {
pub event_detection_time: std::option::Option<wkt::Timestamp>,
pub data_object_count: i64,
pub max_retention_allowed: std::option::Option<wkt::Duration>,
pub event_type: crate::model::data_retention_deletion_event::EventType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataRetentionDeletionEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_event_detection_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_detection_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_event_detection_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_detection_time = v.map(|x| x.into());
self
}
pub fn set_data_object_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.data_object_count = v.into();
self
}
pub fn set_max_retention_allowed<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_retention_allowed = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_max_retention_allowed<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.max_retention_allowed = v.map(|x| x.into());
self
}
pub fn set_event_type<
T: std::convert::Into<crate::model::data_retention_deletion_event::EventType>,
>(
mut self,
v: T,
) -> Self {
self.event_type = v.into();
self
}
}
impl wkt::message::Message for DataRetentionDeletionEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.DataRetentionDeletionEvent"
}
}
pub mod data_retention_deletion_event {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EventType {
Unspecified,
MaxTtlExceeded,
UnknownValue(event_type::UnknownValue),
}
#[doc(hidden)]
pub mod event_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EventType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::MaxTtlExceeded => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
Self::MaxTtlExceeded => std::option::Option::Some("EVENT_TYPE_MAX_TTL_EXCEEDED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EventType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EventType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EventType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::MaxTtlExceeded,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EventType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
"EVENT_TYPE_MAX_TTL_EXCEEDED" => Self::MaxTtlExceeded,
_ => Self::UnknownValue(event_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EventType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::MaxTtlExceeded => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EventType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
".google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Database {
pub name: std::string::String,
pub display_name: std::string::String,
pub user_name: std::string::String,
pub query: std::string::String,
pub grantees: std::vec::Vec<std::string::String>,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Database {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_user_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.user_name = v.into();
self
}
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
pub fn set_grantees<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.grantees = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for Database {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Database"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Disk {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Disk {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for Disk {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Disk"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Exfiltration {
pub sources: std::vec::Vec<crate::model::ExfilResource>,
pub targets: std::vec::Vec<crate::model::ExfilResource>,
pub total_exfiltrated_bytes: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Exfiltration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ExfilResource>,
{
use std::iter::Iterator;
self.sources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_targets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ExfilResource>,
{
use std::iter::Iterator;
self.targets = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_total_exfiltrated_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_exfiltrated_bytes = v.into();
self
}
}
impl wkt::message::Message for Exfiltration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Exfiltration"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExfilResource {
pub name: std::string::String,
pub components: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExfilResource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_components<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.components = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ExfilResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ExfilResource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExternalSystem {
pub name: std::string::String,
pub assignees: std::vec::Vec<std::string::String>,
pub external_uid: std::string::String,
pub status: std::string::String,
pub external_system_update_time: std::option::Option<wkt::Timestamp>,
pub case_uri: std::string::String,
pub case_priority: std::string::String,
pub case_sla: std::option::Option<wkt::Timestamp>,
pub case_create_time: std::option::Option<wkt::Timestamp>,
pub case_close_time: std::option::Option<wkt::Timestamp>,
pub ticket_info: std::option::Option<crate::model::external_system::TicketInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExternalSystem {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_assignees<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.assignees = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_external_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.external_uid = v.into();
self
}
pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status = v.into();
self
}
pub fn set_external_system_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.external_system_update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_external_system_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.external_system_update_time = v.map(|x| x.into());
self
}
pub fn set_case_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.case_uri = v.into();
self
}
pub fn set_case_priority<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.case_priority = v.into();
self
}
pub fn set_case_sla<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.case_sla = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_case_sla<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.case_sla = v.map(|x| x.into());
self
}
pub fn set_case_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.case_create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_case_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.case_create_time = v.map(|x| x.into());
self
}
pub fn set_case_close_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.case_close_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_case_close_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.case_close_time = v.map(|x| x.into());
self
}
pub fn set_ticket_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::external_system::TicketInfo>,
{
self.ticket_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ticket_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::external_system::TicketInfo>,
{
self.ticket_info = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExternalSystem {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem"
}
}
pub mod external_system {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TicketInfo {
pub id: std::string::String,
pub assignee: std::string::String,
pub description: std::string::String,
pub uri: std::string::String,
pub status: std::string::String,
pub update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TicketInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_assignee<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.assignee = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status = v.into();
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TicketInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem.TicketInfo"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct File {
pub path: std::string::String,
pub size: i64,
pub sha256: std::string::String,
pub hashed_size: i64,
pub partially_hashed: bool,
pub contents: std::string::String,
pub disk_path: std::option::Option<crate::model::file::DiskPath>,
pub operations: std::vec::Vec<crate::model::file::FileOperation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl File {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.size = v.into();
self
}
pub fn set_sha256<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sha256 = v.into();
self
}
pub fn set_hashed_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.hashed_size = v.into();
self
}
pub fn set_partially_hashed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.partially_hashed = v.into();
self
}
pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.contents = v.into();
self
}
pub fn set_disk_path<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::file::DiskPath>,
{
self.disk_path = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk_path<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::file::DiskPath>,
{
self.disk_path = v.map(|x| x.into());
self
}
pub fn set_operations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::file::FileOperation>,
{
use std::iter::Iterator;
self.operations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for File {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.File"
}
}
pub mod file {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiskPath {
pub partition_uuid: std::string::String,
pub relative_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DiskPath {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_partition_uuid<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.partition_uuid = v.into();
self
}
pub fn set_relative_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.relative_path = v.into();
self
}
}
impl wkt::message::Message for DiskPath {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.File.DiskPath"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FileOperation {
pub r#type: crate::model::file::file_operation::OperationType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FileOperation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<
T: std::convert::Into<crate::model::file::file_operation::OperationType>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for FileOperation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.File.FileOperation"
}
}
pub mod file_operation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OperationType {
Unspecified,
Open,
Read,
Rename,
Write,
Execute,
UnknownValue(operation_type::UnknownValue),
}
#[doc(hidden)]
pub mod operation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OperationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Open => std::option::Option::Some(1),
Self::Read => std::option::Option::Some(2),
Self::Rename => std::option::Option::Some(3),
Self::Write => std::option::Option::Some(4),
Self::Execute => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
Self::Open => std::option::Option::Some("OPEN"),
Self::Read => std::option::Option::Some("READ"),
Self::Rename => std::option::Option::Some("RENAME"),
Self::Write => std::option::Option::Some("WRITE"),
Self::Execute => std::option::Option::Some("EXECUTE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OperationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OperationType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for OperationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Open,
2 => Self::Read,
3 => Self::Rename,
4 => Self::Write,
5 => Self::Execute,
_ => Self::UnknownValue(operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OperationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"OPEN" => Self::Open,
"READ" => Self::Read,
"RENAME" => Self::Rename,
"WRITE" => Self::Write,
"EXECUTE" => Self::Execute,
_ => Self::UnknownValue(operation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OperationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Open => serializer.serialize_i32(1),
Self::Read => serializer.serialize_i32(2),
Self::Rename => serializer.serialize_i32(3),
Self::Write => serializer.serialize_i32(4),
Self::Execute => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OperationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
".google.cloud.securitycenter.v2.File.FileOperation.OperationType",
))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Finding {
pub name: std::string::String,
pub canonical_name: std::string::String,
pub parent: std::string::String,
pub resource_name: std::string::String,
pub state: crate::model::finding::State,
pub category: std::string::String,
pub external_uri: std::string::String,
pub source_properties: std::collections::HashMap<std::string::String, wkt::Value>,
pub security_marks: std::option::Option<crate::model::SecurityMarks>,
pub event_time: std::option::Option<wkt::Timestamp>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub severity: crate::model::finding::Severity,
pub mute: crate::model::finding::Mute,
pub mute_info: std::option::Option<crate::model::finding::MuteInfo>,
pub finding_class: crate::model::finding::FindingClass,
pub indicator: std::option::Option<crate::model::Indicator>,
pub vulnerability: std::option::Option<crate::model::Vulnerability>,
pub mute_update_time: std::option::Option<wkt::Timestamp>,
pub external_systems:
std::collections::HashMap<std::string::String, crate::model::ExternalSystem>,
pub mitre_attack: std::option::Option<crate::model::MitreAttack>,
pub access: std::option::Option<crate::model::Access>,
pub connections: std::vec::Vec<crate::model::Connection>,
pub mute_initiator: std::string::String,
pub processes: std::vec::Vec<crate::model::Process>,
pub contacts: std::collections::HashMap<std::string::String, crate::model::ContactDetails>,
pub compliances: std::vec::Vec<crate::model::Compliance>,
pub parent_display_name: std::string::String,
pub description: std::string::String,
pub exfiltration: std::option::Option<crate::model::Exfiltration>,
pub iam_bindings: std::vec::Vec<crate::model::IamBinding>,
pub next_steps: std::string::String,
pub module_name: std::string::String,
pub containers: std::vec::Vec<crate::model::Container>,
pub kubernetes: std::option::Option<crate::model::Kubernetes>,
pub database: std::option::Option<crate::model::Database>,
pub attack_exposure: std::option::Option<crate::model::AttackExposure>,
pub files: std::vec::Vec<crate::model::File>,
pub cloud_dlp_inspection: std::option::Option<crate::model::CloudDlpInspection>,
pub cloud_dlp_data_profile: std::option::Option<crate::model::CloudDlpDataProfile>,
pub kernel_rootkit: std::option::Option<crate::model::KernelRootkit>,
pub org_policies: std::vec::Vec<crate::model::OrgPolicy>,
pub job: std::option::Option<crate::model::Job>,
pub application: std::option::Option<crate::model::Application>,
pub ip_rules: std::option::Option<crate::model::IpRules>,
pub backup_disaster_recovery: std::option::Option<crate::model::BackupDisasterRecovery>,
pub security_posture: std::option::Option<crate::model::SecurityPosture>,
pub log_entries: std::vec::Vec<crate::model::LogEntry>,
pub load_balancers: std::vec::Vec<crate::model::LoadBalancer>,
pub cloud_armor: std::option::Option<crate::model::CloudArmor>,
pub notebook: std::option::Option<crate::model::Notebook>,
pub toxic_combination: std::option::Option<crate::model::ToxicCombination>,
pub group_memberships: std::vec::Vec<crate::model::GroupMembership>,
pub disk: std::option::Option<crate::model::Disk>,
pub data_access_events: std::vec::Vec<crate::model::DataAccessEvent>,
pub data_flow_events: std::vec::Vec<crate::model::DataFlowEvent>,
pub networks: std::vec::Vec<crate::model::Network>,
pub data_retention_deletion_events: std::vec::Vec<crate::model::DataRetentionDeletionEvent>,
pub affected_resources: std::option::Option<crate::model::AffectedResources>,
pub ai_model: std::option::Option<crate::model::AiModel>,
pub chokepoint: std::option::Option<crate::model::Chokepoint>,
pub vertex_ai: std::option::Option<crate::model::VertexAi>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Finding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.canonical_name = v.into();
self
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource_name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.category = v.into();
self
}
pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.external_uri = v.into();
self
}
pub fn set_source_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<wkt::Value>,
{
use std::iter::Iterator;
self.source_properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_security_marks<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecurityMarks>,
{
self.security_marks = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecurityMarks>,
{
self.security_marks = v.map(|x| x.into());
self
}
pub fn set_event_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = v.map(|x| x.into());
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_severity<T: std::convert::Into<crate::model::finding::Severity>>(
mut self,
v: T,
) -> Self {
self.severity = v.into();
self
}
pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
self.mute = v.into();
self
}
pub fn set_mute_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::finding::MuteInfo>,
{
self.mute_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mute_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::finding::MuteInfo>,
{
self.mute_info = v.map(|x| x.into());
self
}
pub fn set_finding_class<T: std::convert::Into<crate::model::finding::FindingClass>>(
mut self,
v: T,
) -> Self {
self.finding_class = v.into();
self
}
pub fn set_indicator<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Indicator>,
{
self.indicator = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_indicator<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Indicator>,
{
self.indicator = v.map(|x| x.into());
self
}
pub fn set_vulnerability<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Vulnerability>,
{
self.vulnerability = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vulnerability<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Vulnerability>,
{
self.vulnerability = v.map(|x| x.into());
self
}
pub fn set_mute_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.mute_update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mute_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.mute_update_time = v.map(|x| x.into());
self
}
pub fn set_external_systems<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::ExternalSystem>,
{
use std::iter::Iterator;
self.external_systems = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_mitre_attack<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MitreAttack>,
{
self.mitre_attack = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mitre_attack<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MitreAttack>,
{
self.mitre_attack = v.map(|x| x.into());
self
}
pub fn set_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Access>,
{
self.access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Access>,
{
self.access = v.map(|x| x.into());
self
}
pub fn set_connections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Connection>,
{
use std::iter::Iterator;
self.connections = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_mute_initiator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mute_initiator = v.into();
self
}
pub fn set_processes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Process>,
{
use std::iter::Iterator;
self.processes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_contacts<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::ContactDetails>,
{
use std::iter::Iterator;
self.contacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_compliances<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Compliance>,
{
use std::iter::Iterator;
self.compliances = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.parent_display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_exfiltration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Exfiltration>,
{
self.exfiltration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_exfiltration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Exfiltration>,
{
self.exfiltration = v.map(|x| x.into());
self
}
pub fn set_iam_bindings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::IamBinding>,
{
use std::iter::Iterator;
self.iam_bindings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_steps<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_steps = v.into();
self
}
pub fn set_module_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.module_name = v.into();
self
}
pub fn set_containers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Container>,
{
use std::iter::Iterator;
self.containers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_kubernetes<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Kubernetes>,
{
self.kubernetes = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kubernetes<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Kubernetes>,
{
self.kubernetes = v.map(|x| x.into());
self
}
pub fn set_database<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.database = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Database>,
{
self.database = v.map(|x| x.into());
self
}
pub fn set_attack_exposure<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AttackExposure>,
{
self.attack_exposure = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_attack_exposure<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AttackExposure>,
{
self.attack_exposure = v.map(|x| x.into());
self
}
pub fn set_files<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::File>,
{
use std::iter::Iterator;
self.files = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cloud_dlp_inspection<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudDlpInspection>,
{
self.cloud_dlp_inspection = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_dlp_inspection<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudDlpInspection>,
{
self.cloud_dlp_inspection = v.map(|x| x.into());
self
}
pub fn set_cloud_dlp_data_profile<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudDlpDataProfile>,
{
self.cloud_dlp_data_profile = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_dlp_data_profile<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudDlpDataProfile>,
{
self.cloud_dlp_data_profile = v.map(|x| x.into());
self
}
pub fn set_kernel_rootkit<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::KernelRootkit>,
{
self.kernel_rootkit = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_kernel_rootkit<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::KernelRootkit>,
{
self.kernel_rootkit = v.map(|x| x.into());
self
}
pub fn set_org_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::OrgPolicy>,
{
use std::iter::Iterator;
self.org_policies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = v.map(|x| x.into());
self
}
pub fn set_application<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Application>,
{
self.application = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Application>,
{
self.application = v.map(|x| x.into());
self
}
pub fn set_ip_rules<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::IpRules>,
{
self.ip_rules = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ip_rules<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::IpRules>,
{
self.ip_rules = v.map(|x| x.into());
self
}
pub fn set_backup_disaster_recovery<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BackupDisasterRecovery>,
{
self.backup_disaster_recovery = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_backup_disaster_recovery<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BackupDisasterRecovery>,
{
self.backup_disaster_recovery = v.map(|x| x.into());
self
}
pub fn set_security_posture<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecurityPosture>,
{
self.security_posture = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_posture<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecurityPosture>,
{
self.security_posture = v.map(|x| x.into());
self
}
pub fn set_log_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogEntry>,
{
use std::iter::Iterator;
self.log_entries = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_load_balancers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LoadBalancer>,
{
use std::iter::Iterator;
self.load_balancers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cloud_armor<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudArmor>,
{
self.cloud_armor = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_armor<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudArmor>,
{
self.cloud_armor = v.map(|x| x.into());
self
}
pub fn set_notebook<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Notebook>,
{
self.notebook = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_notebook<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Notebook>,
{
self.notebook = v.map(|x| x.into());
self
}
pub fn set_toxic_combination<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ToxicCombination>,
{
self.toxic_combination = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_toxic_combination<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ToxicCombination>,
{
self.toxic_combination = v.map(|x| x.into());
self
}
pub fn set_group_memberships<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GroupMembership>,
{
use std::iter::Iterator;
self.group_memberships = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_disk<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Disk>,
{
self.disk = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_disk<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Disk>,
{
self.disk = v.map(|x| x.into());
self
}
pub fn set_data_access_events<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataAccessEvent>,
{
use std::iter::Iterator;
self.data_access_events = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_data_flow_events<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataFlowEvent>,
{
use std::iter::Iterator;
self.data_flow_events = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_networks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Network>,
{
use std::iter::Iterator;
self.networks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_data_retention_deletion_events<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataRetentionDeletionEvent>,
{
use std::iter::Iterator;
self.data_retention_deletion_events = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_affected_resources<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AffectedResources>,
{
self.affected_resources = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_affected_resources<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AffectedResources>,
{
self.affected_resources = v.map(|x| x.into());
self
}
pub fn set_ai_model<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AiModel>,
{
self.ai_model = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ai_model<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AiModel>,
{
self.ai_model = v.map(|x| x.into());
self
}
pub fn set_chokepoint<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Chokepoint>,
{
self.chokepoint = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_chokepoint<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Chokepoint>,
{
self.chokepoint = v.map(|x| x.into());
self
}
pub fn set_vertex_ai<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VertexAi>,
{
self.vertex_ai = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vertex_ai<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VertexAi>,
{
self.vertex_ai = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Finding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Finding"
}
}
pub mod finding {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MuteInfo {
pub static_mute: std::option::Option<crate::model::finding::mute_info::StaticMute>,
pub dynamic_mute_records:
std::vec::Vec<crate::model::finding::mute_info::DynamicMuteRecord>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MuteInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_static_mute<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
{
self.static_mute = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_static_mute<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
{
self.static_mute = v.map(|x| x.into());
self
}
pub fn set_dynamic_mute_records<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::finding::mute_info::DynamicMuteRecord>,
{
use std::iter::Iterator;
self.dynamic_mute_records = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MuteInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo"
}
}
pub mod mute_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StaticMute {
pub state: crate::model::finding::Mute,
pub apply_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StaticMute {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::finding::Mute>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_apply_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.apply_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_apply_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.apply_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for StaticMute {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DynamicMuteRecord {
pub mute_config: std::string::String,
pub match_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DynamicMuteRecord {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_mute_config<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.mute_config = v.into();
self
}
pub fn set_match_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.match_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_match_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.match_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DynamicMuteRecord {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord"
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Inactive,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::Inactive => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Inactive => std::option::Option::Some("INACTIVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::Inactive,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"INACTIVE" => Self::Inactive,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Active => serializer.serialize_i32(1),
Self::Inactive => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.securitycenter.v2.Finding.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Severity {
Unspecified,
Critical,
High,
Medium,
Low,
UnknownValue(severity::UnknownValue),
}
#[doc(hidden)]
pub mod severity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Severity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Critical => std::option::Option::Some(1),
Self::High => std::option::Option::Some(2),
Self::Medium => std::option::Option::Some(3),
Self::Low => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
Self::Critical => std::option::Option::Some("CRITICAL"),
Self::High => std::option::Option::Some("HIGH"),
Self::Medium => std::option::Option::Some("MEDIUM"),
Self::Low => std::option::Option::Some("LOW"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Severity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Severity {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Severity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Critical,
2 => Self::High,
3 => Self::Medium,
4 => Self::Low,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Severity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SEVERITY_UNSPECIFIED" => Self::Unspecified,
"CRITICAL" => Self::Critical,
"HIGH" => Self::High,
"MEDIUM" => Self::Medium,
"LOW" => Self::Low,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Severity {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Critical => serializer.serialize_i32(1),
Self::High => serializer.serialize_i32(2),
Self::Medium => serializer.serialize_i32(3),
Self::Low => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Severity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
".google.cloud.securitycenter.v2.Finding.Severity",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mute {
Unspecified,
Muted,
Unmuted,
Undefined,
UnknownValue(mute::UnknownValue),
}
#[doc(hidden)]
pub mod mute {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Mute {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Muted => std::option::Option::Some(1),
Self::Unmuted => std::option::Option::Some(2),
Self::Undefined => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MUTE_UNSPECIFIED"),
Self::Muted => std::option::Option::Some("MUTED"),
Self::Unmuted => std::option::Option::Some("UNMUTED"),
Self::Undefined => std::option::Option::Some("UNDEFINED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Mute {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Mute {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Mute {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Muted,
2 => Self::Unmuted,
3 => Self::Undefined,
_ => Self::UnknownValue(mute::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Mute {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MUTE_UNSPECIFIED" => Self::Unspecified,
"MUTED" => Self::Muted,
"UNMUTED" => Self::Unmuted,
"UNDEFINED" => Self::Undefined,
_ => Self::UnknownValue(mute::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Mute {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Muted => serializer.serialize_i32(1),
Self::Unmuted => serializer.serialize_i32(2),
Self::Undefined => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Mute {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mute>::new(
".google.cloud.securitycenter.v2.Finding.Mute",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FindingClass {
Unspecified,
Threat,
Vulnerability,
Misconfiguration,
Observation,
SccError,
PostureViolation,
ToxicCombination,
SensitiveDataRisk,
Chokepoint,
UnknownValue(finding_class::UnknownValue),
}
#[doc(hidden)]
pub mod finding_class {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FindingClass {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Threat => std::option::Option::Some(1),
Self::Vulnerability => std::option::Option::Some(2),
Self::Misconfiguration => std::option::Option::Some(3),
Self::Observation => std::option::Option::Some(4),
Self::SccError => std::option::Option::Some(5),
Self::PostureViolation => std::option::Option::Some(6),
Self::ToxicCombination => std::option::Option::Some(7),
Self::SensitiveDataRisk => std::option::Option::Some(8),
Self::Chokepoint => std::option::Option::Some(9),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FINDING_CLASS_UNSPECIFIED"),
Self::Threat => std::option::Option::Some("THREAT"),
Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
Self::Misconfiguration => std::option::Option::Some("MISCONFIGURATION"),
Self::Observation => std::option::Option::Some("OBSERVATION"),
Self::SccError => std::option::Option::Some("SCC_ERROR"),
Self::PostureViolation => std::option::Option::Some("POSTURE_VIOLATION"),
Self::ToxicCombination => std::option::Option::Some("TOXIC_COMBINATION"),
Self::SensitiveDataRisk => std::option::Option::Some("SENSITIVE_DATA_RISK"),
Self::Chokepoint => std::option::Option::Some("CHOKEPOINT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FindingClass {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FindingClass {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FindingClass {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Threat,
2 => Self::Vulnerability,
3 => Self::Misconfiguration,
4 => Self::Observation,
5 => Self::SccError,
6 => Self::PostureViolation,
7 => Self::ToxicCombination,
8 => Self::SensitiveDataRisk,
9 => Self::Chokepoint,
_ => Self::UnknownValue(finding_class::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FindingClass {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FINDING_CLASS_UNSPECIFIED" => Self::Unspecified,
"THREAT" => Self::Threat,
"VULNERABILITY" => Self::Vulnerability,
"MISCONFIGURATION" => Self::Misconfiguration,
"OBSERVATION" => Self::Observation,
"SCC_ERROR" => Self::SccError,
"POSTURE_VIOLATION" => Self::PostureViolation,
"TOXIC_COMBINATION" => Self::ToxicCombination,
"SENSITIVE_DATA_RISK" => Self::SensitiveDataRisk,
"CHOKEPOINT" => Self::Chokepoint,
_ => Self::UnknownValue(finding_class::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FindingClass {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Threat => serializer.serialize_i32(1),
Self::Vulnerability => serializer.serialize_i32(2),
Self::Misconfiguration => serializer.serialize_i32(3),
Self::Observation => serializer.serialize_i32(4),
Self::SccError => serializer.serialize_i32(5),
Self::PostureViolation => serializer.serialize_i32(6),
Self::ToxicCombination => serializer.serialize_i32(7),
Self::SensitiveDataRisk => serializer.serialize_i32(8),
Self::Chokepoint => serializer.serialize_i32(9),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FindingClass {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingClass>::new(
".google.cloud.securitycenter.v2.Finding.FindingClass",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Folder {
pub resource_folder: std::string::String,
pub resource_folder_display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Folder {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource_folder = v.into();
self
}
pub fn set_resource_folder_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_folder_display_name = v.into();
self
}
}
impl wkt::message::Message for Folder {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Folder"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GroupMembership {
pub group_type: crate::model::group_membership::GroupType,
pub group_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GroupMembership {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_group_type<T: std::convert::Into<crate::model::group_membership::GroupType>>(
mut self,
v: T,
) -> Self {
self.group_type = v.into();
self
}
pub fn set_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group_id = v.into();
self
}
}
impl wkt::message::Message for GroupMembership {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GroupMembership"
}
}
pub mod group_membership {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum GroupType {
Unspecified,
ToxicCombination,
Chokepoint,
UnknownValue(group_type::UnknownValue),
}
#[doc(hidden)]
pub mod group_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl GroupType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ToxicCombination => std::option::Option::Some(1),
Self::Chokepoint => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("GROUP_TYPE_UNSPECIFIED"),
Self::ToxicCombination => std::option::Option::Some("GROUP_TYPE_TOXIC_COMBINATION"),
Self::Chokepoint => std::option::Option::Some("GROUP_TYPE_CHOKEPOINT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for GroupType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for GroupType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for GroupType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ToxicCombination,
3 => Self::Chokepoint,
_ => Self::UnknownValue(group_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for GroupType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"GROUP_TYPE_UNSPECIFIED" => Self::Unspecified,
"GROUP_TYPE_TOXIC_COMBINATION" => Self::ToxicCombination,
"GROUP_TYPE_CHOKEPOINT" => Self::Chokepoint,
_ => Self::UnknownValue(group_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for GroupType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ToxicCombination => serializer.serialize_i32(1),
Self::Chokepoint => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for GroupType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<GroupType>::new(
".google.cloud.securitycenter.v2.GroupMembership.GroupType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IamBinding {
pub action: crate::model::iam_binding::Action,
pub role: std::string::String,
pub member: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IamBinding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_action<T: std::convert::Into<crate::model::iam_binding::Action>>(
mut self,
v: T,
) -> Self {
self.action = v.into();
self
}
pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.role = v.into();
self
}
pub fn set_member<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.member = v.into();
self
}
}
impl wkt::message::Message for IamBinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.IamBinding"
}
}
pub mod iam_binding {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Action {
Unspecified,
Add,
Remove,
UnknownValue(action::UnknownValue),
}
#[doc(hidden)]
pub mod action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Action {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Add => std::option::Option::Some(1),
Self::Remove => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
Self::Add => std::option::Option::Some("ADD"),
Self::Remove => std::option::Option::Some("REMOVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Action {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Action {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Action {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Add,
2 => Self::Remove,
_ => Self::UnknownValue(action::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Action {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ACTION_UNSPECIFIED" => Self::Unspecified,
"ADD" => Self::Add,
"REMOVE" => Self::Remove,
_ => Self::UnknownValue(action::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Action {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Add => serializer.serialize_i32(1),
Self::Remove => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Action {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
".google.cloud.securitycenter.v2.IamBinding.Action",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Indicator {
pub ip_addresses: std::vec::Vec<std::string::String>,
pub domains: std::vec::Vec<std::string::String>,
pub signatures: std::vec::Vec<crate::model::indicator::ProcessSignature>,
pub uris: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Indicator {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_domains<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.domains = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_signatures<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::indicator::ProcessSignature>,
{
use std::iter::Iterator;
self.signatures = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.uris = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Indicator {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Indicator"
}
}
pub mod indicator {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProcessSignature {
pub signature_type: crate::model::indicator::process_signature::SignatureType,
pub signature: std::option::Option<crate::model::indicator::process_signature::Signature>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ProcessSignature {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_signature_type<
T: std::convert::Into<crate::model::indicator::process_signature::SignatureType>,
>(
mut self,
v: T,
) -> Self {
self.signature_type = v.into();
self
}
pub fn set_signature<
T: std::convert::Into<
std::option::Option<crate::model::indicator::process_signature::Signature>,
>,
>(
mut self,
v: T,
) -> Self {
self.signature = v.into();
self
}
pub fn memory_hash_signature(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
> {
#[allow(unreachable_patterns)]
self.signature.as_ref().and_then(|v| match v {
crate::model::indicator::process_signature::Signature::MemoryHashSignature(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_memory_hash_signature<
T: std::convert::Into<
std::boxed::Box<
crate::model::indicator::process_signature::MemoryHashSignature,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.signature = std::option::Option::Some(
crate::model::indicator::process_signature::Signature::MemoryHashSignature(
v.into(),
),
);
self
}
pub fn yara_rule_signature(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
> {
#[allow(unreachable_patterns)]
self.signature.as_ref().and_then(|v| match v {
crate::model::indicator::process_signature::Signature::YaraRuleSignature(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_yara_rule_signature<
T: std::convert::Into<
std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
>,
>(
mut self,
v: T,
) -> Self {
self.signature = std::option::Option::Some(
crate::model::indicator::process_signature::Signature::YaraRuleSignature(v.into()),
);
self
}
}
impl wkt::message::Message for ProcessSignature {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature"
}
}
pub mod process_signature {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MemoryHashSignature {
pub binary_family: std::string::String,
pub detections: std::vec::Vec<
crate::model::indicator::process_signature::memory_hash_signature::Detection,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MemoryHashSignature {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_binary_family<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.binary_family = v.into();
self
}
pub fn set_detections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::indicator::process_signature::memory_hash_signature::Detection>
{
use std::iter::Iterator;
self.detections = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MemoryHashSignature {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature"
}
}
pub mod memory_hash_signature {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Detection {
pub binary: std::string::String,
pub percent_pages_matched: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Detection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_binary<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.binary = v.into();
self
}
pub fn set_percent_pages_matched<T: std::convert::Into<f64>>(
mut self,
v: T,
) -> Self {
self.percent_pages_matched = v.into();
self
}
}
impl wkt::message::Message for Detection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct YaraRuleSignature {
pub yara_rule: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl YaraRuleSignature {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_yara_rule<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.yara_rule = v.into();
self
}
}
impl wkt::message::Message for YaraRuleSignature {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SignatureType {
Unspecified,
Process,
File,
UnknownValue(signature_type::UnknownValue),
}
#[doc(hidden)]
pub mod signature_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SignatureType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Process => std::option::Option::Some(1),
Self::File => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SIGNATURE_TYPE_UNSPECIFIED"),
Self::Process => std::option::Option::Some("SIGNATURE_TYPE_PROCESS"),
Self::File => std::option::Option::Some("SIGNATURE_TYPE_FILE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SignatureType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SignatureType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SignatureType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Process,
2 => Self::File,
_ => Self::UnknownValue(signature_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SignatureType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SIGNATURE_TYPE_UNSPECIFIED" => Self::Unspecified,
"SIGNATURE_TYPE_PROCESS" => Self::Process,
"SIGNATURE_TYPE_FILE" => Self::File,
_ => Self::UnknownValue(signature_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SignatureType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Process => serializer.serialize_i32(1),
Self::File => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SignatureType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignatureType>::new(
".google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Signature {
MemoryHashSignature(
std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
),
YaraRuleSignature(
std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
),
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IpRules {
pub direction: crate::model::ip_rules::Direction,
pub source_ip_ranges: std::vec::Vec<std::string::String>,
pub destination_ip_ranges: std::vec::Vec<std::string::String>,
pub exposed_services: std::vec::Vec<std::string::String>,
pub rules: std::option::Option<crate::model::ip_rules::Rules>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IpRules {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_direction<T: std::convert::Into<crate::model::ip_rules::Direction>>(
mut self,
v: T,
) -> Self {
self.direction = v.into();
self
}
pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_exposed_services<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.exposed_services = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_rules<T: std::convert::Into<std::option::Option<crate::model::ip_rules::Rules>>>(
mut self,
v: T,
) -> Self {
self.rules = v.into();
self
}
pub fn allowed(&self) -> std::option::Option<&std::boxed::Box<crate::model::Allowed>> {
#[allow(unreachable_patterns)]
self.rules.as_ref().and_then(|v| match v {
crate::model::ip_rules::Rules::Allowed(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_allowed<T: std::convert::Into<std::boxed::Box<crate::model::Allowed>>>(
mut self,
v: T,
) -> Self {
self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Allowed(v.into()));
self
}
pub fn denied(&self) -> std::option::Option<&std::boxed::Box<crate::model::Denied>> {
#[allow(unreachable_patterns)]
self.rules.as_ref().and_then(|v| match v {
crate::model::ip_rules::Rules::Denied(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_denied<T: std::convert::Into<std::boxed::Box<crate::model::Denied>>>(
mut self,
v: T,
) -> Self {
self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Denied(v.into()));
self
}
}
impl wkt::message::Message for IpRules {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.IpRules"
}
}
pub mod ip_rules {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Direction {
Unspecified,
Ingress,
Egress,
UnknownValue(direction::UnknownValue),
}
#[doc(hidden)]
pub mod direction {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Direction {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ingress => std::option::Option::Some(1),
Self::Egress => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
Self::Ingress => std::option::Option::Some("INGRESS"),
Self::Egress => std::option::Option::Some("EGRESS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Direction {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Direction {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Direction {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ingress,
2 => Self::Egress,
_ => Self::UnknownValue(direction::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Direction {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DIRECTION_UNSPECIFIED" => Self::Unspecified,
"INGRESS" => Self::Ingress,
"EGRESS" => Self::Egress,
_ => Self::UnknownValue(direction::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Direction {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Ingress => serializer.serialize_i32(1),
Self::Egress => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Direction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
".google.cloud.securitycenter.v2.IpRules.Direction",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Rules {
Allowed(std::boxed::Box<crate::model::Allowed>),
Denied(std::boxed::Box<crate::model::Denied>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IpRule {
pub protocol: std::string::String,
pub port_ranges: std::vec::Vec<crate::model::ip_rule::PortRange>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IpRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.protocol = v.into();
self
}
pub fn set_port_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ip_rule::PortRange>,
{
use std::iter::Iterator;
self.port_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for IpRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.IpRule"
}
}
pub mod ip_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PortRange {
pub min: i64,
pub max: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PortRange {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.min = v.into();
self
}
pub fn set_max<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.max = v.into();
self
}
}
impl wkt::message::Message for PortRange {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.IpRule.PortRange"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Allowed {
pub ip_rules: std::vec::Vec<crate::model::IpRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Allowed {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::IpRule>,
{
use std::iter::Iterator;
self.ip_rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Allowed {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Allowed"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Denied {
pub ip_rules: std::vec::Vec<crate::model::IpRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Denied {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::IpRule>,
{
use std::iter::Iterator;
self.ip_rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Denied {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Denied"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Job {
pub name: std::string::String,
pub state: crate::model::JobState,
pub error_code: i32,
pub location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Job {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::JobState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_error_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.error_code = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
}
impl wkt::message::Message for Job {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Job"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KernelRootkit {
pub name: std::string::String,
pub unexpected_code_modification: bool,
pub unexpected_read_only_data_modification: bool,
pub unexpected_ftrace_handler: bool,
pub unexpected_kprobe_handler: bool,
pub unexpected_kernel_code_pages: bool,
pub unexpected_system_call_handler: bool,
pub unexpected_interrupt_handler: bool,
pub unexpected_processes_in_runqueue: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KernelRootkit {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_unexpected_code_modification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unexpected_code_modification = v.into();
self
}
pub fn set_unexpected_read_only_data_modification<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.unexpected_read_only_data_modification = v.into();
self
}
pub fn set_unexpected_ftrace_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unexpected_ftrace_handler = v.into();
self
}
pub fn set_unexpected_kprobe_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unexpected_kprobe_handler = v.into();
self
}
pub fn set_unexpected_kernel_code_pages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unexpected_kernel_code_pages = v.into();
self
}
pub fn set_unexpected_system_call_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unexpected_system_call_handler = v.into();
self
}
pub fn set_unexpected_interrupt_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unexpected_interrupt_handler = v.into();
self
}
pub fn set_unexpected_processes_in_runqueue<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.unexpected_processes_in_runqueue = v.into();
self
}
}
impl wkt::message::Message for KernelRootkit {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.KernelRootkit"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Kubernetes {
pub pods: std::vec::Vec<crate::model::kubernetes::Pod>,
pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
pub node_pools: std::vec::Vec<crate::model::kubernetes::NodePool>,
pub roles: std::vec::Vec<crate::model::kubernetes::Role>,
pub bindings: std::vec::Vec<crate::model::kubernetes::Binding>,
pub access_reviews: std::vec::Vec<crate::model::kubernetes::AccessReview>,
pub objects: std::vec::Vec<crate::model::kubernetes::Object>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Kubernetes {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pods<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::kubernetes::Pod>,
{
use std::iter::Iterator;
self.pods = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_nodes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::kubernetes::Node>,
{
use std::iter::Iterator;
self.nodes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_node_pools<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::kubernetes::NodePool>,
{
use std::iter::Iterator;
self.node_pools = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::kubernetes::Role>,
{
use std::iter::Iterator;
self.roles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_bindings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::kubernetes::Binding>,
{
use std::iter::Iterator;
self.bindings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_access_reviews<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::kubernetes::AccessReview>,
{
use std::iter::Iterator;
self.access_reviews = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_objects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::kubernetes::Object>,
{
use std::iter::Iterator;
self.objects = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Kubernetes {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes"
}
}
pub mod kubernetes {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Pod {
pub ns: std::string::String,
pub name: std::string::String,
pub labels: std::vec::Vec<crate::model::Label>,
pub containers: std::vec::Vec<crate::model::Container>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Pod {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ns = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_labels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Label>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_containers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Container>,
{
use std::iter::Iterator;
self.containers = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Pod {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Pod"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Node {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Node {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for Node {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Node"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NodePool {
pub name: std::string::String,
pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NodePool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_nodes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::kubernetes::Node>,
{
use std::iter::Iterator;
self.nodes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NodePool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.NodePool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Role {
pub kind: crate::model::kubernetes::role::Kind,
pub ns: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Role {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::role::Kind>>(
mut self,
v: T,
) -> Self {
self.kind = v.into();
self
}
pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ns = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for Role {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Role"
}
}
pub mod role {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Kind {
Unspecified,
Role,
ClusterRole,
UnknownValue(kind::UnknownValue),
}
#[doc(hidden)]
pub mod kind {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Kind {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Role => std::option::Option::Some(1),
Self::ClusterRole => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
Self::Role => std::option::Option::Some("ROLE"),
Self::ClusterRole => std::option::Option::Some("CLUSTER_ROLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Kind {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Kind {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Kind {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Role,
2 => Self::ClusterRole,
_ => Self::UnknownValue(kind::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Kind {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"KIND_UNSPECIFIED" => Self::Unspecified,
"ROLE" => Self::Role,
"CLUSTER_ROLE" => Self::ClusterRole,
_ => Self::UnknownValue(kind::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Kind {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Role => serializer.serialize_i32(1),
Self::ClusterRole => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Kind {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
".google.cloud.securitycenter.v2.Kubernetes.Role.Kind",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Binding {
pub ns: std::string::String,
pub name: std::string::String,
pub role: std::option::Option<crate::model::kubernetes::Role>,
pub subjects: std::vec::Vec<crate::model::kubernetes::Subject>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Binding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ns = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_role<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::kubernetes::Role>,
{
self.role = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::kubernetes::Role>,
{
self.role = v.map(|x| x.into());
self
}
pub fn set_subjects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::kubernetes::Subject>,
{
use std::iter::Iterator;
self.subjects = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Binding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Binding"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Subject {
pub kind: crate::model::kubernetes::subject::AuthType,
pub ns: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Subject {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::subject::AuthType>>(
mut self,
v: T,
) -> Self {
self.kind = v.into();
self
}
pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ns = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for Subject {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Subject"
}
}
pub mod subject {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuthType {
Unspecified,
User,
Serviceaccount,
Group,
UnknownValue(auth_type::UnknownValue),
}
#[doc(hidden)]
pub mod auth_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AuthType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::User => std::option::Option::Some(1),
Self::Serviceaccount => std::option::Option::Some(2),
Self::Group => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("AUTH_TYPE_UNSPECIFIED"),
Self::User => std::option::Option::Some("USER"),
Self::Serviceaccount => std::option::Option::Some("SERVICEACCOUNT"),
Self::Group => std::option::Option::Some("GROUP"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AuthType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AuthType {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AuthType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::User,
2 => Self::Serviceaccount,
3 => Self::Group,
_ => Self::UnknownValue(auth_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AuthType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
"USER" => Self::User,
"SERVICEACCOUNT" => Self::Serviceaccount,
"GROUP" => Self::Group,
_ => Self::UnknownValue(auth_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AuthType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::User => serializer.serialize_i32(1),
Self::Serviceaccount => serializer.serialize_i32(2),
Self::Group => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AuthType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
".google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessReview {
pub group: std::string::String,
pub ns: std::string::String,
pub name: std::string::String,
pub resource: std::string::String,
pub subresource: std::string::String,
pub verb: std::string::String,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessReview {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group = v.into();
self
}
pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ns = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
pub fn set_subresource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subresource = v.into();
self
}
pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.verb = v.into();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for AccessReview {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.AccessReview"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Object {
pub group: std::string::String,
pub kind: std::string::String,
pub ns: std::string::String,
pub name: std::string::String,
pub containers: std::vec::Vec<crate::model::Container>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Object {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ns = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_containers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Container>,
{
use std::iter::Iterator;
self.containers = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Object {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Object"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Label {
pub name: std::string::String,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Label {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for Label {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Label"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LoadBalancer {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LoadBalancer {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for LoadBalancer {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.LoadBalancer"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogEntry {
pub log_entry: std::option::Option<crate::model::log_entry::LogEntry>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_log_entry<
T: std::convert::Into<std::option::Option<crate::model::log_entry::LogEntry>>,
>(
mut self,
v: T,
) -> Self {
self.log_entry = v.into();
self
}
pub fn cloud_logging_entry(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CloudLoggingEntry>> {
#[allow(unreachable_patterns)]
self.log_entry.as_ref().and_then(|v| match v {
crate::model::log_entry::LogEntry::CloudLoggingEntry(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_cloud_logging_entry<
T: std::convert::Into<std::boxed::Box<crate::model::CloudLoggingEntry>>,
>(
mut self,
v: T,
) -> Self {
self.log_entry = std::option::Option::Some(
crate::model::log_entry::LogEntry::CloudLoggingEntry(v.into()),
);
self
}
}
impl wkt::message::Message for LogEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.LogEntry"
}
}
pub mod log_entry {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LogEntry {
CloudLoggingEntry(std::boxed::Box<crate::model::CloudLoggingEntry>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudLoggingEntry {
pub insert_id: std::string::String,
pub log_id: std::string::String,
pub resource_container: std::string::String,
pub timestamp: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudLoggingEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_insert_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.insert_id = v.into();
self
}
pub fn set_log_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_id = v.into();
self
}
pub fn set_resource_container<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_container = v.into();
self
}
pub fn set_timestamp<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.timestamp = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.timestamp = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CloudLoggingEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CloudLoggingEntry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MitreAttack {
pub primary_tactic: crate::model::mitre_attack::Tactic,
pub primary_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
pub additional_tactics: std::vec::Vec<crate::model::mitre_attack::Tactic>,
pub additional_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MitreAttack {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_primary_tactic<T: std::convert::Into<crate::model::mitre_attack::Tactic>>(
mut self,
v: T,
) -> Self {
self.primary_tactic = v.into();
self
}
pub fn set_primary_techniques<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::mitre_attack::Technique>,
{
use std::iter::Iterator;
self.primary_techniques = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_additional_tactics<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::mitre_attack::Tactic>,
{
use std::iter::Iterator;
self.additional_tactics = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_additional_techniques<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::mitre_attack::Technique>,
{
use std::iter::Iterator;
self.additional_techniques = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for MitreAttack {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.MitreAttack"
}
}
pub mod mitre_attack {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Tactic {
Unspecified,
Reconnaissance,
ResourceDevelopment,
InitialAccess,
Execution,
Persistence,
PrivilegeEscalation,
DefenseEvasion,
CredentialAccess,
Discovery,
LateralMovement,
Collection,
CommandAndControl,
Exfiltration,
Impact,
UnknownValue(tactic::UnknownValue),
}
#[doc(hidden)]
pub mod tactic {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Tactic {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Reconnaissance => std::option::Option::Some(1),
Self::ResourceDevelopment => std::option::Option::Some(2),
Self::InitialAccess => std::option::Option::Some(5),
Self::Execution => std::option::Option::Some(3),
Self::Persistence => std::option::Option::Some(6),
Self::PrivilegeEscalation => std::option::Option::Some(8),
Self::DefenseEvasion => std::option::Option::Some(7),
Self::CredentialAccess => std::option::Option::Some(9),
Self::Discovery => std::option::Option::Some(10),
Self::LateralMovement => std::option::Option::Some(11),
Self::Collection => std::option::Option::Some(12),
Self::CommandAndControl => std::option::Option::Some(4),
Self::Exfiltration => std::option::Option::Some(13),
Self::Impact => std::option::Option::Some(14),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TACTIC_UNSPECIFIED"),
Self::Reconnaissance => std::option::Option::Some("RECONNAISSANCE"),
Self::ResourceDevelopment => std::option::Option::Some("RESOURCE_DEVELOPMENT"),
Self::InitialAccess => std::option::Option::Some("INITIAL_ACCESS"),
Self::Execution => std::option::Option::Some("EXECUTION"),
Self::Persistence => std::option::Option::Some("PERSISTENCE"),
Self::PrivilegeEscalation => std::option::Option::Some("PRIVILEGE_ESCALATION"),
Self::DefenseEvasion => std::option::Option::Some("DEFENSE_EVASION"),
Self::CredentialAccess => std::option::Option::Some("CREDENTIAL_ACCESS"),
Self::Discovery => std::option::Option::Some("DISCOVERY"),
Self::LateralMovement => std::option::Option::Some("LATERAL_MOVEMENT"),
Self::Collection => std::option::Option::Some("COLLECTION"),
Self::CommandAndControl => std::option::Option::Some("COMMAND_AND_CONTROL"),
Self::Exfiltration => std::option::Option::Some("EXFILTRATION"),
Self::Impact => std::option::Option::Some("IMPACT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Tactic {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Tactic {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Tactic {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Reconnaissance,
2 => Self::ResourceDevelopment,
3 => Self::Execution,
4 => Self::CommandAndControl,
5 => Self::InitialAccess,
6 => Self::Persistence,
7 => Self::DefenseEvasion,
8 => Self::PrivilegeEscalation,
9 => Self::CredentialAccess,
10 => Self::Discovery,
11 => Self::LateralMovement,
12 => Self::Collection,
13 => Self::Exfiltration,
14 => Self::Impact,
_ => Self::UnknownValue(tactic::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Tactic {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TACTIC_UNSPECIFIED" => Self::Unspecified,
"RECONNAISSANCE" => Self::Reconnaissance,
"RESOURCE_DEVELOPMENT" => Self::ResourceDevelopment,
"INITIAL_ACCESS" => Self::InitialAccess,
"EXECUTION" => Self::Execution,
"PERSISTENCE" => Self::Persistence,
"PRIVILEGE_ESCALATION" => Self::PrivilegeEscalation,
"DEFENSE_EVASION" => Self::DefenseEvasion,
"CREDENTIAL_ACCESS" => Self::CredentialAccess,
"DISCOVERY" => Self::Discovery,
"LATERAL_MOVEMENT" => Self::LateralMovement,
"COLLECTION" => Self::Collection,
"COMMAND_AND_CONTROL" => Self::CommandAndControl,
"EXFILTRATION" => Self::Exfiltration,
"IMPACT" => Self::Impact,
_ => Self::UnknownValue(tactic::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Tactic {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Reconnaissance => serializer.serialize_i32(1),
Self::ResourceDevelopment => serializer.serialize_i32(2),
Self::InitialAccess => serializer.serialize_i32(5),
Self::Execution => serializer.serialize_i32(3),
Self::Persistence => serializer.serialize_i32(6),
Self::PrivilegeEscalation => serializer.serialize_i32(8),
Self::DefenseEvasion => serializer.serialize_i32(7),
Self::CredentialAccess => serializer.serialize_i32(9),
Self::Discovery => serializer.serialize_i32(10),
Self::LateralMovement => serializer.serialize_i32(11),
Self::Collection => serializer.serialize_i32(12),
Self::CommandAndControl => serializer.serialize_i32(4),
Self::Exfiltration => serializer.serialize_i32(13),
Self::Impact => serializer.serialize_i32(14),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Tactic {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tactic>::new(
".google.cloud.securitycenter.v2.MitreAttack.Tactic",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Technique {
Unspecified,
DataObfuscation,
DataObfuscationSteganography,
OsCredentialDumping,
OsCredentialDumpingProcFilesystem,
OsCredentialDumpingEtcPasswordAndEtcShadow,
DataFromLocalSystem,
AutomatedExfiltration,
ObfuscatedFilesOrInfo,
Steganography,
CompileAfterDelivery,
CommandObfuscation,
ScheduledTransfer,
SystemOwnerUserDiscovery,
Masquerading,
MatchLegitimateNameOrLocation,
BootOrLogonInitializationScripts,
StartupItems,
NetworkServiceDiscovery,
ScheduledTaskJob,
ScheduledTaskJobCron,
ContainerOrchestrationJob,
ProcessInjection,
InputCapture,
InputCaptureKeylogging,
ProcessDiscovery,
CommandAndScriptingInterpreter,
UnixShell,
Python,
ExploitationForPrivilegeEscalation,
PermissionGroupsDiscovery,
CloudGroups,
IndicatorRemoval,
IndicatorRemovalClearLinuxOrMacSystemLogs,
IndicatorRemovalClearCommandHistory,
IndicatorRemovalFileDeletion,
IndicatorRemovalTimestomp,
IndicatorRemovalClearMailboxData,
ApplicationLayerProtocol,
Dns,
SoftwareDeploymentTools,
ValidAccounts,
DefaultAccounts,
LocalAccounts,
CloudAccounts,
FileAndDirectoryDiscovery,
AccountDiscoveryLocalAccount,
Proxy,
ExternalProxy,
MultiHopProxy,
AccountManipulation,
AdditionalCloudCredentials,
AdditionalCloudRoles,
SshAuthorizedKeys,
AdditionalContainerClusterRoles,
MultiStageChannels,
IngressToolTransfer,
NativeApi,
BruteForce,
AutomatedCollection,
SharedModules,
DataEncoding,
StandardEncoding,
AccessTokenManipulation,
TokenImpersonationOrTheft,
CreateAccount,
LocalAccount,
DeobfuscateDecodeFilesOrInfo,
ExploitPublicFacingApplication,
SupplyChainCompromise,
CompromiseSoftwareDependenciesAndDevelopmentTools,
ExploitationForClientExecution,
UserExecution,
LinuxAndMacFileAndDirectoryPermissionsModification,
DomainPolicyModification,
DataDestruction,
DataEncryptedForImpact,
ServiceStop,
InhibitSystemRecovery,
FirmwareCorruption,
ResourceHijacking,
NetworkDenialOfService,
CloudServiceDiscovery,
StealApplicationAccessToken,
AccountAccessRemoval,
TransferDataToCloudAccount,
StealWebSessionCookie,
CreateOrModifySystemProcess,
EventTriggeredExecution,
BootOrLogonAutostartExecution,
KernelModulesAndExtensions,
ShortcutModification,
AbuseElevationControlMechanism,
AbuseElevationControlMechanismSetuidAndSetgid,
AbuseElevationControlMechanismSudoAndSudoCaching,
UnsecuredCredentials,
CredentialsInFiles,
BashHistory,
PrivateKeys,
SubvertTrustControl,
InstallRootCertificate,
CompromiseHostSoftwareBinary,
CredentialsFromPasswordStores,
ModifyAuthenticationProcess,
PluggableAuthenticationModules,
MultiFactorAuthentication,
ImpairDefenses,
DisableOrModifyTools,
IndicatorBlocking,
DisableOrModifyLinuxAuditSystem,
HideArtifacts,
HiddenFilesAndDirectories,
HiddenUsers,
ExfiltrationOverWebService,
ExfiltrationToCloudStorage,
DynamicResolution,
LateralToolTransfer,
HijackExecutionFlow,
HijackExecutionFlowDynamicLinkerHijacking,
ModifyCloudComputeInfrastructure,
CreateSnapshot,
CloudInfrastructureDiscovery,
DevelopCapabilities,
DevelopCapabilitiesMalware,
ObtainCapabilities,
ObtainCapabilitiesMalware,
ObtainCapabilitiesVulnerabilities,
ActiveScanning,
ScanningIpBlocks,
StageCapabilities,
UploadMalware,
ContainerAdministrationCommand,
DeployContainer,
EscapeToHost,
ContainerAndResourceDiscovery,
ReflectiveCodeLoading,
StealOrForgeAuthenticationCertificates,
FinancialTheft,
UnknownValue(technique::UnknownValue),
}
#[doc(hidden)]
pub mod technique {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Technique {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DataObfuscation => std::option::Option::Some(70),
Self::DataObfuscationSteganography => std::option::Option::Some(71),
Self::OsCredentialDumping => std::option::Option::Some(114),
Self::OsCredentialDumpingProcFilesystem => std::option::Option::Some(115),
Self::OsCredentialDumpingEtcPasswordAndEtcShadow => std::option::Option::Some(122),
Self::DataFromLocalSystem => std::option::Option::Some(117),
Self::AutomatedExfiltration => std::option::Option::Some(68),
Self::ObfuscatedFilesOrInfo => std::option::Option::Some(72),
Self::Steganography => std::option::Option::Some(73),
Self::CompileAfterDelivery => std::option::Option::Some(74),
Self::CommandObfuscation => std::option::Option::Some(75),
Self::ScheduledTransfer => std::option::Option::Some(120),
Self::SystemOwnerUserDiscovery => std::option::Option::Some(118),
Self::Masquerading => std::option::Option::Some(49),
Self::MatchLegitimateNameOrLocation => std::option::Option::Some(50),
Self::BootOrLogonInitializationScripts => std::option::Option::Some(37),
Self::StartupItems => std::option::Option::Some(38),
Self::NetworkServiceDiscovery => std::option::Option::Some(32),
Self::ScheduledTaskJob => std::option::Option::Some(89),
Self::ScheduledTaskJobCron => std::option::Option::Some(119),
Self::ContainerOrchestrationJob => std::option::Option::Some(90),
Self::ProcessInjection => std::option::Option::Some(93),
Self::InputCapture => std::option::Option::Some(103),
Self::InputCaptureKeylogging => std::option::Option::Some(104),
Self::ProcessDiscovery => std::option::Option::Some(56),
Self::CommandAndScriptingInterpreter => std::option::Option::Some(6),
Self::UnixShell => std::option::Option::Some(7),
Self::Python => std::option::Option::Some(59),
Self::ExploitationForPrivilegeEscalation => std::option::Option::Some(63),
Self::PermissionGroupsDiscovery => std::option::Option::Some(18),
Self::CloudGroups => std::option::Option::Some(19),
Self::IndicatorRemoval => std::option::Option::Some(123),
Self::IndicatorRemovalClearLinuxOrMacSystemLogs => std::option::Option::Some(124),
Self::IndicatorRemovalClearCommandHistory => std::option::Option::Some(125),
Self::IndicatorRemovalFileDeletion => std::option::Option::Some(64),
Self::IndicatorRemovalTimestomp => std::option::Option::Some(128),
Self::IndicatorRemovalClearMailboxData => std::option::Option::Some(126),
Self::ApplicationLayerProtocol => std::option::Option::Some(45),
Self::Dns => std::option::Option::Some(46),
Self::SoftwareDeploymentTools => std::option::Option::Some(47),
Self::ValidAccounts => std::option::Option::Some(14),
Self::DefaultAccounts => std::option::Option::Some(35),
Self::LocalAccounts => std::option::Option::Some(15),
Self::CloudAccounts => std::option::Option::Some(16),
Self::FileAndDirectoryDiscovery => std::option::Option::Some(121),
Self::AccountDiscoveryLocalAccount => std::option::Option::Some(116),
Self::Proxy => std::option::Option::Some(9),
Self::ExternalProxy => std::option::Option::Some(10),
Self::MultiHopProxy => std::option::Option::Some(11),
Self::AccountManipulation => std::option::Option::Some(22),
Self::AdditionalCloudCredentials => std::option::Option::Some(40),
Self::AdditionalCloudRoles => std::option::Option::Some(67),
Self::SshAuthorizedKeys => std::option::Option::Some(23),
Self::AdditionalContainerClusterRoles => std::option::Option::Some(58),
Self::MultiStageChannels => std::option::Option::Some(76),
Self::IngressToolTransfer => std::option::Option::Some(3),
Self::NativeApi => std::option::Option::Some(4),
Self::BruteForce => std::option::Option::Some(44),
Self::AutomatedCollection => std::option::Option::Some(94),
Self::SharedModules => std::option::Option::Some(5),
Self::DataEncoding => std::option::Option::Some(77),
Self::StandardEncoding => std::option::Option::Some(78),
Self::AccessTokenManipulation => std::option::Option::Some(33),
Self::TokenImpersonationOrTheft => std::option::Option::Some(39),
Self::CreateAccount => std::option::Option::Some(79),
Self::LocalAccount => std::option::Option::Some(80),
Self::DeobfuscateDecodeFilesOrInfo => std::option::Option::Some(95),
Self::ExploitPublicFacingApplication => std::option::Option::Some(27),
Self::SupplyChainCompromise => std::option::Option::Some(129),
Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
std::option::Option::Some(130)
}
Self::ExploitationForClientExecution => std::option::Option::Some(134),
Self::UserExecution => std::option::Option::Some(69),
Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
std::option::Option::Some(135)
}
Self::DomainPolicyModification => std::option::Option::Some(30),
Self::DataDestruction => std::option::Option::Some(29),
Self::DataEncryptedForImpact => std::option::Option::Some(132),
Self::ServiceStop => std::option::Option::Some(52),
Self::InhibitSystemRecovery => std::option::Option::Some(36),
Self::FirmwareCorruption => std::option::Option::Some(81),
Self::ResourceHijacking => std::option::Option::Some(8),
Self::NetworkDenialOfService => std::option::Option::Some(17),
Self::CloudServiceDiscovery => std::option::Option::Some(48),
Self::StealApplicationAccessToken => std::option::Option::Some(42),
Self::AccountAccessRemoval => std::option::Option::Some(51),
Self::TransferDataToCloudAccount => std::option::Option::Some(91),
Self::StealWebSessionCookie => std::option::Option::Some(25),
Self::CreateOrModifySystemProcess => std::option::Option::Some(24),
Self::EventTriggeredExecution => std::option::Option::Some(65),
Self::BootOrLogonAutostartExecution => std::option::Option::Some(82),
Self::KernelModulesAndExtensions => std::option::Option::Some(83),
Self::ShortcutModification => std::option::Option::Some(127),
Self::AbuseElevationControlMechanism => std::option::Option::Some(34),
Self::AbuseElevationControlMechanismSetuidAndSetgid => {
std::option::Option::Some(136)
}
Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
std::option::Option::Some(109)
}
Self::UnsecuredCredentials => std::option::Option::Some(13),
Self::CredentialsInFiles => std::option::Option::Some(105),
Self::BashHistory => std::option::Option::Some(96),
Self::PrivateKeys => std::option::Option::Some(97),
Self::SubvertTrustControl => std::option::Option::Some(106),
Self::InstallRootCertificate => std::option::Option::Some(107),
Self::CompromiseHostSoftwareBinary => std::option::Option::Some(84),
Self::CredentialsFromPasswordStores => std::option::Option::Some(98),
Self::ModifyAuthenticationProcess => std::option::Option::Some(28),
Self::PluggableAuthenticationModules => std::option::Option::Some(108),
Self::MultiFactorAuthentication => std::option::Option::Some(137),
Self::ImpairDefenses => std::option::Option::Some(31),
Self::DisableOrModifyTools => std::option::Option::Some(55),
Self::IndicatorBlocking => std::option::Option::Some(110),
Self::DisableOrModifyLinuxAuditSystem => std::option::Option::Some(111),
Self::HideArtifacts => std::option::Option::Some(85),
Self::HiddenFilesAndDirectories => std::option::Option::Some(86),
Self::HiddenUsers => std::option::Option::Some(87),
Self::ExfiltrationOverWebService => std::option::Option::Some(20),
Self::ExfiltrationToCloudStorage => std::option::Option::Some(21),
Self::DynamicResolution => std::option::Option::Some(12),
Self::LateralToolTransfer => std::option::Option::Some(41),
Self::HijackExecutionFlow => std::option::Option::Some(112),
Self::HijackExecutionFlowDynamicLinkerHijacking => std::option::Option::Some(113),
Self::ModifyCloudComputeInfrastructure => std::option::Option::Some(26),
Self::CreateSnapshot => std::option::Option::Some(54),
Self::CloudInfrastructureDiscovery => std::option::Option::Some(53),
Self::DevelopCapabilities => std::option::Option::Some(99),
Self::DevelopCapabilitiesMalware => std::option::Option::Some(100),
Self::ObtainCapabilities => std::option::Option::Some(43),
Self::ObtainCapabilitiesMalware => std::option::Option::Some(101),
Self::ObtainCapabilitiesVulnerabilities => std::option::Option::Some(133),
Self::ActiveScanning => std::option::Option::Some(1),
Self::ScanningIpBlocks => std::option::Option::Some(2),
Self::StageCapabilities => std::option::Option::Some(88),
Self::UploadMalware => std::option::Option::Some(102),
Self::ContainerAdministrationCommand => std::option::Option::Some(60),
Self::DeployContainer => std::option::Option::Some(66),
Self::EscapeToHost => std::option::Option::Some(61),
Self::ContainerAndResourceDiscovery => std::option::Option::Some(57),
Self::ReflectiveCodeLoading => std::option::Option::Some(92),
Self::StealOrForgeAuthenticationCertificates => std::option::Option::Some(62),
Self::FinancialTheft => std::option::Option::Some(131),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TECHNIQUE_UNSPECIFIED"),
Self::DataObfuscation => std::option::Option::Some("DATA_OBFUSCATION"),
Self::DataObfuscationSteganography => {
std::option::Option::Some("DATA_OBFUSCATION_STEGANOGRAPHY")
}
Self::OsCredentialDumping => std::option::Option::Some("OS_CREDENTIAL_DUMPING"),
Self::OsCredentialDumpingProcFilesystem => {
std::option::Option::Some("OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM")
}
Self::OsCredentialDumpingEtcPasswordAndEtcShadow => {
std::option::Option::Some("OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW")
}
Self::DataFromLocalSystem => std::option::Option::Some("DATA_FROM_LOCAL_SYSTEM"),
Self::AutomatedExfiltration => std::option::Option::Some("AUTOMATED_EXFILTRATION"),
Self::ObfuscatedFilesOrInfo => {
std::option::Option::Some("OBFUSCATED_FILES_OR_INFO")
}
Self::Steganography => std::option::Option::Some("STEGANOGRAPHY"),
Self::CompileAfterDelivery => std::option::Option::Some("COMPILE_AFTER_DELIVERY"),
Self::CommandObfuscation => std::option::Option::Some("COMMAND_OBFUSCATION"),
Self::ScheduledTransfer => std::option::Option::Some("SCHEDULED_TRANSFER"),
Self::SystemOwnerUserDiscovery => {
std::option::Option::Some("SYSTEM_OWNER_USER_DISCOVERY")
}
Self::Masquerading => std::option::Option::Some("MASQUERADING"),
Self::MatchLegitimateNameOrLocation => {
std::option::Option::Some("MATCH_LEGITIMATE_NAME_OR_LOCATION")
}
Self::BootOrLogonInitializationScripts => {
std::option::Option::Some("BOOT_OR_LOGON_INITIALIZATION_SCRIPTS")
}
Self::StartupItems => std::option::Option::Some("STARTUP_ITEMS"),
Self::NetworkServiceDiscovery => {
std::option::Option::Some("NETWORK_SERVICE_DISCOVERY")
}
Self::ScheduledTaskJob => std::option::Option::Some("SCHEDULED_TASK_JOB"),
Self::ScheduledTaskJobCron => std::option::Option::Some("SCHEDULED_TASK_JOB_CRON"),
Self::ContainerOrchestrationJob => {
std::option::Option::Some("CONTAINER_ORCHESTRATION_JOB")
}
Self::ProcessInjection => std::option::Option::Some("PROCESS_INJECTION"),
Self::InputCapture => std::option::Option::Some("INPUT_CAPTURE"),
Self::InputCaptureKeylogging => {
std::option::Option::Some("INPUT_CAPTURE_KEYLOGGING")
}
Self::ProcessDiscovery => std::option::Option::Some("PROCESS_DISCOVERY"),
Self::CommandAndScriptingInterpreter => {
std::option::Option::Some("COMMAND_AND_SCRIPTING_INTERPRETER")
}
Self::UnixShell => std::option::Option::Some("UNIX_SHELL"),
Self::Python => std::option::Option::Some("PYTHON"),
Self::ExploitationForPrivilegeEscalation => {
std::option::Option::Some("EXPLOITATION_FOR_PRIVILEGE_ESCALATION")
}
Self::PermissionGroupsDiscovery => {
std::option::Option::Some("PERMISSION_GROUPS_DISCOVERY")
}
Self::CloudGroups => std::option::Option::Some("CLOUD_GROUPS"),
Self::IndicatorRemoval => std::option::Option::Some("INDICATOR_REMOVAL"),
Self::IndicatorRemovalClearLinuxOrMacSystemLogs => {
std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS")
}
Self::IndicatorRemovalClearCommandHistory => {
std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY")
}
Self::IndicatorRemovalFileDeletion => {
std::option::Option::Some("INDICATOR_REMOVAL_FILE_DELETION")
}
Self::IndicatorRemovalTimestomp => {
std::option::Option::Some("INDICATOR_REMOVAL_TIMESTOMP")
}
Self::IndicatorRemovalClearMailboxData => {
std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA")
}
Self::ApplicationLayerProtocol => {
std::option::Option::Some("APPLICATION_LAYER_PROTOCOL")
}
Self::Dns => std::option::Option::Some("DNS"),
Self::SoftwareDeploymentTools => {
std::option::Option::Some("SOFTWARE_DEPLOYMENT_TOOLS")
}
Self::ValidAccounts => std::option::Option::Some("VALID_ACCOUNTS"),
Self::DefaultAccounts => std::option::Option::Some("DEFAULT_ACCOUNTS"),
Self::LocalAccounts => std::option::Option::Some("LOCAL_ACCOUNTS"),
Self::CloudAccounts => std::option::Option::Some("CLOUD_ACCOUNTS"),
Self::FileAndDirectoryDiscovery => {
std::option::Option::Some("FILE_AND_DIRECTORY_DISCOVERY")
}
Self::AccountDiscoveryLocalAccount => {
std::option::Option::Some("ACCOUNT_DISCOVERY_LOCAL_ACCOUNT")
}
Self::Proxy => std::option::Option::Some("PROXY"),
Self::ExternalProxy => std::option::Option::Some("EXTERNAL_PROXY"),
Self::MultiHopProxy => std::option::Option::Some("MULTI_HOP_PROXY"),
Self::AccountManipulation => std::option::Option::Some("ACCOUNT_MANIPULATION"),
Self::AdditionalCloudCredentials => {
std::option::Option::Some("ADDITIONAL_CLOUD_CREDENTIALS")
}
Self::AdditionalCloudRoles => std::option::Option::Some("ADDITIONAL_CLOUD_ROLES"),
Self::SshAuthorizedKeys => std::option::Option::Some("SSH_AUTHORIZED_KEYS"),
Self::AdditionalContainerClusterRoles => {
std::option::Option::Some("ADDITIONAL_CONTAINER_CLUSTER_ROLES")
}
Self::MultiStageChannels => std::option::Option::Some("MULTI_STAGE_CHANNELS"),
Self::IngressToolTransfer => std::option::Option::Some("INGRESS_TOOL_TRANSFER"),
Self::NativeApi => std::option::Option::Some("NATIVE_API"),
Self::BruteForce => std::option::Option::Some("BRUTE_FORCE"),
Self::AutomatedCollection => std::option::Option::Some("AUTOMATED_COLLECTION"),
Self::SharedModules => std::option::Option::Some("SHARED_MODULES"),
Self::DataEncoding => std::option::Option::Some("DATA_ENCODING"),
Self::StandardEncoding => std::option::Option::Some("STANDARD_ENCODING"),
Self::AccessTokenManipulation => {
std::option::Option::Some("ACCESS_TOKEN_MANIPULATION")
}
Self::TokenImpersonationOrTheft => {
std::option::Option::Some("TOKEN_IMPERSONATION_OR_THEFT")
}
Self::CreateAccount => std::option::Option::Some("CREATE_ACCOUNT"),
Self::LocalAccount => std::option::Option::Some("LOCAL_ACCOUNT"),
Self::DeobfuscateDecodeFilesOrInfo => {
std::option::Option::Some("DEOBFUSCATE_DECODE_FILES_OR_INFO")
}
Self::ExploitPublicFacingApplication => {
std::option::Option::Some("EXPLOIT_PUBLIC_FACING_APPLICATION")
}
Self::SupplyChainCompromise => std::option::Option::Some("SUPPLY_CHAIN_COMPROMISE"),
Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
std::option::Option::Some(
"COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS",
)
}
Self::ExploitationForClientExecution => {
std::option::Option::Some("EXPLOITATION_FOR_CLIENT_EXECUTION")
}
Self::UserExecution => std::option::Option::Some("USER_EXECUTION"),
Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
std::option::Option::Some(
"LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION",
)
}
Self::DomainPolicyModification => {
std::option::Option::Some("DOMAIN_POLICY_MODIFICATION")
}
Self::DataDestruction => std::option::Option::Some("DATA_DESTRUCTION"),
Self::DataEncryptedForImpact => {
std::option::Option::Some("DATA_ENCRYPTED_FOR_IMPACT")
}
Self::ServiceStop => std::option::Option::Some("SERVICE_STOP"),
Self::InhibitSystemRecovery => std::option::Option::Some("INHIBIT_SYSTEM_RECOVERY"),
Self::FirmwareCorruption => std::option::Option::Some("FIRMWARE_CORRUPTION"),
Self::ResourceHijacking => std::option::Option::Some("RESOURCE_HIJACKING"),
Self::NetworkDenialOfService => {
std::option::Option::Some("NETWORK_DENIAL_OF_SERVICE")
}
Self::CloudServiceDiscovery => std::option::Option::Some("CLOUD_SERVICE_DISCOVERY"),
Self::StealApplicationAccessToken => {
std::option::Option::Some("STEAL_APPLICATION_ACCESS_TOKEN")
}
Self::AccountAccessRemoval => std::option::Option::Some("ACCOUNT_ACCESS_REMOVAL"),
Self::TransferDataToCloudAccount => {
std::option::Option::Some("TRANSFER_DATA_TO_CLOUD_ACCOUNT")
}
Self::StealWebSessionCookie => {
std::option::Option::Some("STEAL_WEB_SESSION_COOKIE")
}
Self::CreateOrModifySystemProcess => {
std::option::Option::Some("CREATE_OR_MODIFY_SYSTEM_PROCESS")
}
Self::EventTriggeredExecution => {
std::option::Option::Some("EVENT_TRIGGERED_EXECUTION")
}
Self::BootOrLogonAutostartExecution => {
std::option::Option::Some("BOOT_OR_LOGON_AUTOSTART_EXECUTION")
}
Self::KernelModulesAndExtensions => {
std::option::Option::Some("KERNEL_MODULES_AND_EXTENSIONS")
}
Self::ShortcutModification => std::option::Option::Some("SHORTCUT_MODIFICATION"),
Self::AbuseElevationControlMechanism => {
std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM")
}
Self::AbuseElevationControlMechanismSetuidAndSetgid => {
std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID")
}
Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
std::option::Option::Some(
"ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING",
)
}
Self::UnsecuredCredentials => std::option::Option::Some("UNSECURED_CREDENTIALS"),
Self::CredentialsInFiles => std::option::Option::Some("CREDENTIALS_IN_FILES"),
Self::BashHistory => std::option::Option::Some("BASH_HISTORY"),
Self::PrivateKeys => std::option::Option::Some("PRIVATE_KEYS"),
Self::SubvertTrustControl => std::option::Option::Some("SUBVERT_TRUST_CONTROL"),
Self::InstallRootCertificate => {
std::option::Option::Some("INSTALL_ROOT_CERTIFICATE")
}
Self::CompromiseHostSoftwareBinary => {
std::option::Option::Some("COMPROMISE_HOST_SOFTWARE_BINARY")
}
Self::CredentialsFromPasswordStores => {
std::option::Option::Some("CREDENTIALS_FROM_PASSWORD_STORES")
}
Self::ModifyAuthenticationProcess => {
std::option::Option::Some("MODIFY_AUTHENTICATION_PROCESS")
}
Self::PluggableAuthenticationModules => {
std::option::Option::Some("PLUGGABLE_AUTHENTICATION_MODULES")
}
Self::MultiFactorAuthentication => {
std::option::Option::Some("MULTI_FACTOR_AUTHENTICATION")
}
Self::ImpairDefenses => std::option::Option::Some("IMPAIR_DEFENSES"),
Self::DisableOrModifyTools => std::option::Option::Some("DISABLE_OR_MODIFY_TOOLS"),
Self::IndicatorBlocking => std::option::Option::Some("INDICATOR_BLOCKING"),
Self::DisableOrModifyLinuxAuditSystem => {
std::option::Option::Some("DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM")
}
Self::HideArtifacts => std::option::Option::Some("HIDE_ARTIFACTS"),
Self::HiddenFilesAndDirectories => {
std::option::Option::Some("HIDDEN_FILES_AND_DIRECTORIES")
}
Self::HiddenUsers => std::option::Option::Some("HIDDEN_USERS"),
Self::ExfiltrationOverWebService => {
std::option::Option::Some("EXFILTRATION_OVER_WEB_SERVICE")
}
Self::ExfiltrationToCloudStorage => {
std::option::Option::Some("EXFILTRATION_TO_CLOUD_STORAGE")
}
Self::DynamicResolution => std::option::Option::Some("DYNAMIC_RESOLUTION"),
Self::LateralToolTransfer => std::option::Option::Some("LATERAL_TOOL_TRANSFER"),
Self::HijackExecutionFlow => std::option::Option::Some("HIJACK_EXECUTION_FLOW"),
Self::HijackExecutionFlowDynamicLinkerHijacking => {
std::option::Option::Some("HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING")
}
Self::ModifyCloudComputeInfrastructure => {
std::option::Option::Some("MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE")
}
Self::CreateSnapshot => std::option::Option::Some("CREATE_SNAPSHOT"),
Self::CloudInfrastructureDiscovery => {
std::option::Option::Some("CLOUD_INFRASTRUCTURE_DISCOVERY")
}
Self::DevelopCapabilities => std::option::Option::Some("DEVELOP_CAPABILITIES"),
Self::DevelopCapabilitiesMalware => {
std::option::Option::Some("DEVELOP_CAPABILITIES_MALWARE")
}
Self::ObtainCapabilities => std::option::Option::Some("OBTAIN_CAPABILITIES"),
Self::ObtainCapabilitiesMalware => {
std::option::Option::Some("OBTAIN_CAPABILITIES_MALWARE")
}
Self::ObtainCapabilitiesVulnerabilities => {
std::option::Option::Some("OBTAIN_CAPABILITIES_VULNERABILITIES")
}
Self::ActiveScanning => std::option::Option::Some("ACTIVE_SCANNING"),
Self::ScanningIpBlocks => std::option::Option::Some("SCANNING_IP_BLOCKS"),
Self::StageCapabilities => std::option::Option::Some("STAGE_CAPABILITIES"),
Self::UploadMalware => std::option::Option::Some("UPLOAD_MALWARE"),
Self::ContainerAdministrationCommand => {
std::option::Option::Some("CONTAINER_ADMINISTRATION_COMMAND")
}
Self::DeployContainer => std::option::Option::Some("DEPLOY_CONTAINER"),
Self::EscapeToHost => std::option::Option::Some("ESCAPE_TO_HOST"),
Self::ContainerAndResourceDiscovery => {
std::option::Option::Some("CONTAINER_AND_RESOURCE_DISCOVERY")
}
Self::ReflectiveCodeLoading => std::option::Option::Some("REFLECTIVE_CODE_LOADING"),
Self::StealOrForgeAuthenticationCertificates => {
std::option::Option::Some("STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES")
}
Self::FinancialTheft => std::option::Option::Some("FINANCIAL_THEFT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Technique {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Technique {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Technique {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ActiveScanning,
2 => Self::ScanningIpBlocks,
3 => Self::IngressToolTransfer,
4 => Self::NativeApi,
5 => Self::SharedModules,
6 => Self::CommandAndScriptingInterpreter,
7 => Self::UnixShell,
8 => Self::ResourceHijacking,
9 => Self::Proxy,
10 => Self::ExternalProxy,
11 => Self::MultiHopProxy,
12 => Self::DynamicResolution,
13 => Self::UnsecuredCredentials,
14 => Self::ValidAccounts,
15 => Self::LocalAccounts,
16 => Self::CloudAccounts,
17 => Self::NetworkDenialOfService,
18 => Self::PermissionGroupsDiscovery,
19 => Self::CloudGroups,
20 => Self::ExfiltrationOverWebService,
21 => Self::ExfiltrationToCloudStorage,
22 => Self::AccountManipulation,
23 => Self::SshAuthorizedKeys,
24 => Self::CreateOrModifySystemProcess,
25 => Self::StealWebSessionCookie,
26 => Self::ModifyCloudComputeInfrastructure,
27 => Self::ExploitPublicFacingApplication,
28 => Self::ModifyAuthenticationProcess,
29 => Self::DataDestruction,
30 => Self::DomainPolicyModification,
31 => Self::ImpairDefenses,
32 => Self::NetworkServiceDiscovery,
33 => Self::AccessTokenManipulation,
34 => Self::AbuseElevationControlMechanism,
35 => Self::DefaultAccounts,
36 => Self::InhibitSystemRecovery,
37 => Self::BootOrLogonInitializationScripts,
38 => Self::StartupItems,
39 => Self::TokenImpersonationOrTheft,
40 => Self::AdditionalCloudCredentials,
41 => Self::LateralToolTransfer,
42 => Self::StealApplicationAccessToken,
43 => Self::ObtainCapabilities,
44 => Self::BruteForce,
45 => Self::ApplicationLayerProtocol,
46 => Self::Dns,
47 => Self::SoftwareDeploymentTools,
48 => Self::CloudServiceDiscovery,
49 => Self::Masquerading,
50 => Self::MatchLegitimateNameOrLocation,
51 => Self::AccountAccessRemoval,
52 => Self::ServiceStop,
53 => Self::CloudInfrastructureDiscovery,
54 => Self::CreateSnapshot,
55 => Self::DisableOrModifyTools,
56 => Self::ProcessDiscovery,
57 => Self::ContainerAndResourceDiscovery,
58 => Self::AdditionalContainerClusterRoles,
59 => Self::Python,
60 => Self::ContainerAdministrationCommand,
61 => Self::EscapeToHost,
62 => Self::StealOrForgeAuthenticationCertificates,
63 => Self::ExploitationForPrivilegeEscalation,
64 => Self::IndicatorRemovalFileDeletion,
65 => Self::EventTriggeredExecution,
66 => Self::DeployContainer,
67 => Self::AdditionalCloudRoles,
68 => Self::AutomatedExfiltration,
69 => Self::UserExecution,
70 => Self::DataObfuscation,
71 => Self::DataObfuscationSteganography,
72 => Self::ObfuscatedFilesOrInfo,
73 => Self::Steganography,
74 => Self::CompileAfterDelivery,
75 => Self::CommandObfuscation,
76 => Self::MultiStageChannels,
77 => Self::DataEncoding,
78 => Self::StandardEncoding,
79 => Self::CreateAccount,
80 => Self::LocalAccount,
81 => Self::FirmwareCorruption,
82 => Self::BootOrLogonAutostartExecution,
83 => Self::KernelModulesAndExtensions,
84 => Self::CompromiseHostSoftwareBinary,
85 => Self::HideArtifacts,
86 => Self::HiddenFilesAndDirectories,
87 => Self::HiddenUsers,
88 => Self::StageCapabilities,
89 => Self::ScheduledTaskJob,
90 => Self::ContainerOrchestrationJob,
91 => Self::TransferDataToCloudAccount,
92 => Self::ReflectiveCodeLoading,
93 => Self::ProcessInjection,
94 => Self::AutomatedCollection,
95 => Self::DeobfuscateDecodeFilesOrInfo,
96 => Self::BashHistory,
97 => Self::PrivateKeys,
98 => Self::CredentialsFromPasswordStores,
99 => Self::DevelopCapabilities,
100 => Self::DevelopCapabilitiesMalware,
101 => Self::ObtainCapabilitiesMalware,
102 => Self::UploadMalware,
103 => Self::InputCapture,
104 => Self::InputCaptureKeylogging,
105 => Self::CredentialsInFiles,
106 => Self::SubvertTrustControl,
107 => Self::InstallRootCertificate,
108 => Self::PluggableAuthenticationModules,
109 => Self::AbuseElevationControlMechanismSudoAndSudoCaching,
110 => Self::IndicatorBlocking,
111 => Self::DisableOrModifyLinuxAuditSystem,
112 => Self::HijackExecutionFlow,
113 => Self::HijackExecutionFlowDynamicLinkerHijacking,
114 => Self::OsCredentialDumping,
115 => Self::OsCredentialDumpingProcFilesystem,
116 => Self::AccountDiscoveryLocalAccount,
117 => Self::DataFromLocalSystem,
118 => Self::SystemOwnerUserDiscovery,
119 => Self::ScheduledTaskJobCron,
120 => Self::ScheduledTransfer,
121 => Self::FileAndDirectoryDiscovery,
122 => Self::OsCredentialDumpingEtcPasswordAndEtcShadow,
123 => Self::IndicatorRemoval,
124 => Self::IndicatorRemovalClearLinuxOrMacSystemLogs,
125 => Self::IndicatorRemovalClearCommandHistory,
126 => Self::IndicatorRemovalClearMailboxData,
127 => Self::ShortcutModification,
128 => Self::IndicatorRemovalTimestomp,
129 => Self::SupplyChainCompromise,
130 => Self::CompromiseSoftwareDependenciesAndDevelopmentTools,
131 => Self::FinancialTheft,
132 => Self::DataEncryptedForImpact,
133 => Self::ObtainCapabilitiesVulnerabilities,
134 => Self::ExploitationForClientExecution,
135 => Self::LinuxAndMacFileAndDirectoryPermissionsModification,
136 => Self::AbuseElevationControlMechanismSetuidAndSetgid,
137 => Self::MultiFactorAuthentication,
_ => Self::UnknownValue(technique::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Technique {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TECHNIQUE_UNSPECIFIED" => Self::Unspecified,
"DATA_OBFUSCATION" => Self::DataObfuscation,
"DATA_OBFUSCATION_STEGANOGRAPHY" => Self::DataObfuscationSteganography,
"OS_CREDENTIAL_DUMPING" => Self::OsCredentialDumping,
"OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM" => Self::OsCredentialDumpingProcFilesystem,
"OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW" => {
Self::OsCredentialDumpingEtcPasswordAndEtcShadow
}
"DATA_FROM_LOCAL_SYSTEM" => Self::DataFromLocalSystem,
"AUTOMATED_EXFILTRATION" => Self::AutomatedExfiltration,
"OBFUSCATED_FILES_OR_INFO" => Self::ObfuscatedFilesOrInfo,
"STEGANOGRAPHY" => Self::Steganography,
"COMPILE_AFTER_DELIVERY" => Self::CompileAfterDelivery,
"COMMAND_OBFUSCATION" => Self::CommandObfuscation,
"SCHEDULED_TRANSFER" => Self::ScheduledTransfer,
"SYSTEM_OWNER_USER_DISCOVERY" => Self::SystemOwnerUserDiscovery,
"MASQUERADING" => Self::Masquerading,
"MATCH_LEGITIMATE_NAME_OR_LOCATION" => Self::MatchLegitimateNameOrLocation,
"BOOT_OR_LOGON_INITIALIZATION_SCRIPTS" => Self::BootOrLogonInitializationScripts,
"STARTUP_ITEMS" => Self::StartupItems,
"NETWORK_SERVICE_DISCOVERY" => Self::NetworkServiceDiscovery,
"SCHEDULED_TASK_JOB" => Self::ScheduledTaskJob,
"SCHEDULED_TASK_JOB_CRON" => Self::ScheduledTaskJobCron,
"CONTAINER_ORCHESTRATION_JOB" => Self::ContainerOrchestrationJob,
"PROCESS_INJECTION" => Self::ProcessInjection,
"INPUT_CAPTURE" => Self::InputCapture,
"INPUT_CAPTURE_KEYLOGGING" => Self::InputCaptureKeylogging,
"PROCESS_DISCOVERY" => Self::ProcessDiscovery,
"COMMAND_AND_SCRIPTING_INTERPRETER" => Self::CommandAndScriptingInterpreter,
"UNIX_SHELL" => Self::UnixShell,
"PYTHON" => Self::Python,
"EXPLOITATION_FOR_PRIVILEGE_ESCALATION" => Self::ExploitationForPrivilegeEscalation,
"PERMISSION_GROUPS_DISCOVERY" => Self::PermissionGroupsDiscovery,
"CLOUD_GROUPS" => Self::CloudGroups,
"INDICATOR_REMOVAL" => Self::IndicatorRemoval,
"INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS" => {
Self::IndicatorRemovalClearLinuxOrMacSystemLogs
}
"INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY" => {
Self::IndicatorRemovalClearCommandHistory
}
"INDICATOR_REMOVAL_FILE_DELETION" => Self::IndicatorRemovalFileDeletion,
"INDICATOR_REMOVAL_TIMESTOMP" => Self::IndicatorRemovalTimestomp,
"INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA" => Self::IndicatorRemovalClearMailboxData,
"APPLICATION_LAYER_PROTOCOL" => Self::ApplicationLayerProtocol,
"DNS" => Self::Dns,
"SOFTWARE_DEPLOYMENT_TOOLS" => Self::SoftwareDeploymentTools,
"VALID_ACCOUNTS" => Self::ValidAccounts,
"DEFAULT_ACCOUNTS" => Self::DefaultAccounts,
"LOCAL_ACCOUNTS" => Self::LocalAccounts,
"CLOUD_ACCOUNTS" => Self::CloudAccounts,
"FILE_AND_DIRECTORY_DISCOVERY" => Self::FileAndDirectoryDiscovery,
"ACCOUNT_DISCOVERY_LOCAL_ACCOUNT" => Self::AccountDiscoveryLocalAccount,
"PROXY" => Self::Proxy,
"EXTERNAL_PROXY" => Self::ExternalProxy,
"MULTI_HOP_PROXY" => Self::MultiHopProxy,
"ACCOUNT_MANIPULATION" => Self::AccountManipulation,
"ADDITIONAL_CLOUD_CREDENTIALS" => Self::AdditionalCloudCredentials,
"ADDITIONAL_CLOUD_ROLES" => Self::AdditionalCloudRoles,
"SSH_AUTHORIZED_KEYS" => Self::SshAuthorizedKeys,
"ADDITIONAL_CONTAINER_CLUSTER_ROLES" => Self::AdditionalContainerClusterRoles,
"MULTI_STAGE_CHANNELS" => Self::MultiStageChannels,
"INGRESS_TOOL_TRANSFER" => Self::IngressToolTransfer,
"NATIVE_API" => Self::NativeApi,
"BRUTE_FORCE" => Self::BruteForce,
"AUTOMATED_COLLECTION" => Self::AutomatedCollection,
"SHARED_MODULES" => Self::SharedModules,
"DATA_ENCODING" => Self::DataEncoding,
"STANDARD_ENCODING" => Self::StandardEncoding,
"ACCESS_TOKEN_MANIPULATION" => Self::AccessTokenManipulation,
"TOKEN_IMPERSONATION_OR_THEFT" => Self::TokenImpersonationOrTheft,
"CREATE_ACCOUNT" => Self::CreateAccount,
"LOCAL_ACCOUNT" => Self::LocalAccount,
"DEOBFUSCATE_DECODE_FILES_OR_INFO" => Self::DeobfuscateDecodeFilesOrInfo,
"EXPLOIT_PUBLIC_FACING_APPLICATION" => Self::ExploitPublicFacingApplication,
"SUPPLY_CHAIN_COMPROMISE" => Self::SupplyChainCompromise,
"COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS" => {
Self::CompromiseSoftwareDependenciesAndDevelopmentTools
}
"EXPLOITATION_FOR_CLIENT_EXECUTION" => Self::ExploitationForClientExecution,
"USER_EXECUTION" => Self::UserExecution,
"LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION" => {
Self::LinuxAndMacFileAndDirectoryPermissionsModification
}
"DOMAIN_POLICY_MODIFICATION" => Self::DomainPolicyModification,
"DATA_DESTRUCTION" => Self::DataDestruction,
"DATA_ENCRYPTED_FOR_IMPACT" => Self::DataEncryptedForImpact,
"SERVICE_STOP" => Self::ServiceStop,
"INHIBIT_SYSTEM_RECOVERY" => Self::InhibitSystemRecovery,
"FIRMWARE_CORRUPTION" => Self::FirmwareCorruption,
"RESOURCE_HIJACKING" => Self::ResourceHijacking,
"NETWORK_DENIAL_OF_SERVICE" => Self::NetworkDenialOfService,
"CLOUD_SERVICE_DISCOVERY" => Self::CloudServiceDiscovery,
"STEAL_APPLICATION_ACCESS_TOKEN" => Self::StealApplicationAccessToken,
"ACCOUNT_ACCESS_REMOVAL" => Self::AccountAccessRemoval,
"TRANSFER_DATA_TO_CLOUD_ACCOUNT" => Self::TransferDataToCloudAccount,
"STEAL_WEB_SESSION_COOKIE" => Self::StealWebSessionCookie,
"CREATE_OR_MODIFY_SYSTEM_PROCESS" => Self::CreateOrModifySystemProcess,
"EVENT_TRIGGERED_EXECUTION" => Self::EventTriggeredExecution,
"BOOT_OR_LOGON_AUTOSTART_EXECUTION" => Self::BootOrLogonAutostartExecution,
"KERNEL_MODULES_AND_EXTENSIONS" => Self::KernelModulesAndExtensions,
"SHORTCUT_MODIFICATION" => Self::ShortcutModification,
"ABUSE_ELEVATION_CONTROL_MECHANISM" => Self::AbuseElevationControlMechanism,
"ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID" => {
Self::AbuseElevationControlMechanismSetuidAndSetgid
}
"ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING" => {
Self::AbuseElevationControlMechanismSudoAndSudoCaching
}
"UNSECURED_CREDENTIALS" => Self::UnsecuredCredentials,
"CREDENTIALS_IN_FILES" => Self::CredentialsInFiles,
"BASH_HISTORY" => Self::BashHistory,
"PRIVATE_KEYS" => Self::PrivateKeys,
"SUBVERT_TRUST_CONTROL" => Self::SubvertTrustControl,
"INSTALL_ROOT_CERTIFICATE" => Self::InstallRootCertificate,
"COMPROMISE_HOST_SOFTWARE_BINARY" => Self::CompromiseHostSoftwareBinary,
"CREDENTIALS_FROM_PASSWORD_STORES" => Self::CredentialsFromPasswordStores,
"MODIFY_AUTHENTICATION_PROCESS" => Self::ModifyAuthenticationProcess,
"PLUGGABLE_AUTHENTICATION_MODULES" => Self::PluggableAuthenticationModules,
"MULTI_FACTOR_AUTHENTICATION" => Self::MultiFactorAuthentication,
"IMPAIR_DEFENSES" => Self::ImpairDefenses,
"DISABLE_OR_MODIFY_TOOLS" => Self::DisableOrModifyTools,
"INDICATOR_BLOCKING" => Self::IndicatorBlocking,
"DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM" => Self::DisableOrModifyLinuxAuditSystem,
"HIDE_ARTIFACTS" => Self::HideArtifacts,
"HIDDEN_FILES_AND_DIRECTORIES" => Self::HiddenFilesAndDirectories,
"HIDDEN_USERS" => Self::HiddenUsers,
"EXFILTRATION_OVER_WEB_SERVICE" => Self::ExfiltrationOverWebService,
"EXFILTRATION_TO_CLOUD_STORAGE" => Self::ExfiltrationToCloudStorage,
"DYNAMIC_RESOLUTION" => Self::DynamicResolution,
"LATERAL_TOOL_TRANSFER" => Self::LateralToolTransfer,
"HIJACK_EXECUTION_FLOW" => Self::HijackExecutionFlow,
"HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING" => {
Self::HijackExecutionFlowDynamicLinkerHijacking
}
"MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE" => Self::ModifyCloudComputeInfrastructure,
"CREATE_SNAPSHOT" => Self::CreateSnapshot,
"CLOUD_INFRASTRUCTURE_DISCOVERY" => Self::CloudInfrastructureDiscovery,
"DEVELOP_CAPABILITIES" => Self::DevelopCapabilities,
"DEVELOP_CAPABILITIES_MALWARE" => Self::DevelopCapabilitiesMalware,
"OBTAIN_CAPABILITIES" => Self::ObtainCapabilities,
"OBTAIN_CAPABILITIES_MALWARE" => Self::ObtainCapabilitiesMalware,
"OBTAIN_CAPABILITIES_VULNERABILITIES" => Self::ObtainCapabilitiesVulnerabilities,
"ACTIVE_SCANNING" => Self::ActiveScanning,
"SCANNING_IP_BLOCKS" => Self::ScanningIpBlocks,
"STAGE_CAPABILITIES" => Self::StageCapabilities,
"UPLOAD_MALWARE" => Self::UploadMalware,
"CONTAINER_ADMINISTRATION_COMMAND" => Self::ContainerAdministrationCommand,
"DEPLOY_CONTAINER" => Self::DeployContainer,
"ESCAPE_TO_HOST" => Self::EscapeToHost,
"CONTAINER_AND_RESOURCE_DISCOVERY" => Self::ContainerAndResourceDiscovery,
"REFLECTIVE_CODE_LOADING" => Self::ReflectiveCodeLoading,
"STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES" => {
Self::StealOrForgeAuthenticationCertificates
}
"FINANCIAL_THEFT" => Self::FinancialTheft,
_ => Self::UnknownValue(technique::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Technique {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DataObfuscation => serializer.serialize_i32(70),
Self::DataObfuscationSteganography => serializer.serialize_i32(71),
Self::OsCredentialDumping => serializer.serialize_i32(114),
Self::OsCredentialDumpingProcFilesystem => serializer.serialize_i32(115),
Self::OsCredentialDumpingEtcPasswordAndEtcShadow => serializer.serialize_i32(122),
Self::DataFromLocalSystem => serializer.serialize_i32(117),
Self::AutomatedExfiltration => serializer.serialize_i32(68),
Self::ObfuscatedFilesOrInfo => serializer.serialize_i32(72),
Self::Steganography => serializer.serialize_i32(73),
Self::CompileAfterDelivery => serializer.serialize_i32(74),
Self::CommandObfuscation => serializer.serialize_i32(75),
Self::ScheduledTransfer => serializer.serialize_i32(120),
Self::SystemOwnerUserDiscovery => serializer.serialize_i32(118),
Self::Masquerading => serializer.serialize_i32(49),
Self::MatchLegitimateNameOrLocation => serializer.serialize_i32(50),
Self::BootOrLogonInitializationScripts => serializer.serialize_i32(37),
Self::StartupItems => serializer.serialize_i32(38),
Self::NetworkServiceDiscovery => serializer.serialize_i32(32),
Self::ScheduledTaskJob => serializer.serialize_i32(89),
Self::ScheduledTaskJobCron => serializer.serialize_i32(119),
Self::ContainerOrchestrationJob => serializer.serialize_i32(90),
Self::ProcessInjection => serializer.serialize_i32(93),
Self::InputCapture => serializer.serialize_i32(103),
Self::InputCaptureKeylogging => serializer.serialize_i32(104),
Self::ProcessDiscovery => serializer.serialize_i32(56),
Self::CommandAndScriptingInterpreter => serializer.serialize_i32(6),
Self::UnixShell => serializer.serialize_i32(7),
Self::Python => serializer.serialize_i32(59),
Self::ExploitationForPrivilegeEscalation => serializer.serialize_i32(63),
Self::PermissionGroupsDiscovery => serializer.serialize_i32(18),
Self::CloudGroups => serializer.serialize_i32(19),
Self::IndicatorRemoval => serializer.serialize_i32(123),
Self::IndicatorRemovalClearLinuxOrMacSystemLogs => serializer.serialize_i32(124),
Self::IndicatorRemovalClearCommandHistory => serializer.serialize_i32(125),
Self::IndicatorRemovalFileDeletion => serializer.serialize_i32(64),
Self::IndicatorRemovalTimestomp => serializer.serialize_i32(128),
Self::IndicatorRemovalClearMailboxData => serializer.serialize_i32(126),
Self::ApplicationLayerProtocol => serializer.serialize_i32(45),
Self::Dns => serializer.serialize_i32(46),
Self::SoftwareDeploymentTools => serializer.serialize_i32(47),
Self::ValidAccounts => serializer.serialize_i32(14),
Self::DefaultAccounts => serializer.serialize_i32(35),
Self::LocalAccounts => serializer.serialize_i32(15),
Self::CloudAccounts => serializer.serialize_i32(16),
Self::FileAndDirectoryDiscovery => serializer.serialize_i32(121),
Self::AccountDiscoveryLocalAccount => serializer.serialize_i32(116),
Self::Proxy => serializer.serialize_i32(9),
Self::ExternalProxy => serializer.serialize_i32(10),
Self::MultiHopProxy => serializer.serialize_i32(11),
Self::AccountManipulation => serializer.serialize_i32(22),
Self::AdditionalCloudCredentials => serializer.serialize_i32(40),
Self::AdditionalCloudRoles => serializer.serialize_i32(67),
Self::SshAuthorizedKeys => serializer.serialize_i32(23),
Self::AdditionalContainerClusterRoles => serializer.serialize_i32(58),
Self::MultiStageChannels => serializer.serialize_i32(76),
Self::IngressToolTransfer => serializer.serialize_i32(3),
Self::NativeApi => serializer.serialize_i32(4),
Self::BruteForce => serializer.serialize_i32(44),
Self::AutomatedCollection => serializer.serialize_i32(94),
Self::SharedModules => serializer.serialize_i32(5),
Self::DataEncoding => serializer.serialize_i32(77),
Self::StandardEncoding => serializer.serialize_i32(78),
Self::AccessTokenManipulation => serializer.serialize_i32(33),
Self::TokenImpersonationOrTheft => serializer.serialize_i32(39),
Self::CreateAccount => serializer.serialize_i32(79),
Self::LocalAccount => serializer.serialize_i32(80),
Self::DeobfuscateDecodeFilesOrInfo => serializer.serialize_i32(95),
Self::ExploitPublicFacingApplication => serializer.serialize_i32(27),
Self::SupplyChainCompromise => serializer.serialize_i32(129),
Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
serializer.serialize_i32(130)
}
Self::ExploitationForClientExecution => serializer.serialize_i32(134),
Self::UserExecution => serializer.serialize_i32(69),
Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
serializer.serialize_i32(135)
}
Self::DomainPolicyModification => serializer.serialize_i32(30),
Self::DataDestruction => serializer.serialize_i32(29),
Self::DataEncryptedForImpact => serializer.serialize_i32(132),
Self::ServiceStop => serializer.serialize_i32(52),
Self::InhibitSystemRecovery => serializer.serialize_i32(36),
Self::FirmwareCorruption => serializer.serialize_i32(81),
Self::ResourceHijacking => serializer.serialize_i32(8),
Self::NetworkDenialOfService => serializer.serialize_i32(17),
Self::CloudServiceDiscovery => serializer.serialize_i32(48),
Self::StealApplicationAccessToken => serializer.serialize_i32(42),
Self::AccountAccessRemoval => serializer.serialize_i32(51),
Self::TransferDataToCloudAccount => serializer.serialize_i32(91),
Self::StealWebSessionCookie => serializer.serialize_i32(25),
Self::CreateOrModifySystemProcess => serializer.serialize_i32(24),
Self::EventTriggeredExecution => serializer.serialize_i32(65),
Self::BootOrLogonAutostartExecution => serializer.serialize_i32(82),
Self::KernelModulesAndExtensions => serializer.serialize_i32(83),
Self::ShortcutModification => serializer.serialize_i32(127),
Self::AbuseElevationControlMechanism => serializer.serialize_i32(34),
Self::AbuseElevationControlMechanismSetuidAndSetgid => {
serializer.serialize_i32(136)
}
Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
serializer.serialize_i32(109)
}
Self::UnsecuredCredentials => serializer.serialize_i32(13),
Self::CredentialsInFiles => serializer.serialize_i32(105),
Self::BashHistory => serializer.serialize_i32(96),
Self::PrivateKeys => serializer.serialize_i32(97),
Self::SubvertTrustControl => serializer.serialize_i32(106),
Self::InstallRootCertificate => serializer.serialize_i32(107),
Self::CompromiseHostSoftwareBinary => serializer.serialize_i32(84),
Self::CredentialsFromPasswordStores => serializer.serialize_i32(98),
Self::ModifyAuthenticationProcess => serializer.serialize_i32(28),
Self::PluggableAuthenticationModules => serializer.serialize_i32(108),
Self::MultiFactorAuthentication => serializer.serialize_i32(137),
Self::ImpairDefenses => serializer.serialize_i32(31),
Self::DisableOrModifyTools => serializer.serialize_i32(55),
Self::IndicatorBlocking => serializer.serialize_i32(110),
Self::DisableOrModifyLinuxAuditSystem => serializer.serialize_i32(111),
Self::HideArtifacts => serializer.serialize_i32(85),
Self::HiddenFilesAndDirectories => serializer.serialize_i32(86),
Self::HiddenUsers => serializer.serialize_i32(87),
Self::ExfiltrationOverWebService => serializer.serialize_i32(20),
Self::ExfiltrationToCloudStorage => serializer.serialize_i32(21),
Self::DynamicResolution => serializer.serialize_i32(12),
Self::LateralToolTransfer => serializer.serialize_i32(41),
Self::HijackExecutionFlow => serializer.serialize_i32(112),
Self::HijackExecutionFlowDynamicLinkerHijacking => serializer.serialize_i32(113),
Self::ModifyCloudComputeInfrastructure => serializer.serialize_i32(26),
Self::CreateSnapshot => serializer.serialize_i32(54),
Self::CloudInfrastructureDiscovery => serializer.serialize_i32(53),
Self::DevelopCapabilities => serializer.serialize_i32(99),
Self::DevelopCapabilitiesMalware => serializer.serialize_i32(100),
Self::ObtainCapabilities => serializer.serialize_i32(43),
Self::ObtainCapabilitiesMalware => serializer.serialize_i32(101),
Self::ObtainCapabilitiesVulnerabilities => serializer.serialize_i32(133),
Self::ActiveScanning => serializer.serialize_i32(1),
Self::ScanningIpBlocks => serializer.serialize_i32(2),
Self::StageCapabilities => serializer.serialize_i32(88),
Self::UploadMalware => serializer.serialize_i32(102),
Self::ContainerAdministrationCommand => serializer.serialize_i32(60),
Self::DeployContainer => serializer.serialize_i32(66),
Self::EscapeToHost => serializer.serialize_i32(61),
Self::ContainerAndResourceDiscovery => serializer.serialize_i32(57),
Self::ReflectiveCodeLoading => serializer.serialize_i32(92),
Self::StealOrForgeAuthenticationCertificates => serializer.serialize_i32(62),
Self::FinancialTheft => serializer.serialize_i32(131),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Technique {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Technique>::new(
".google.cloud.securitycenter.v2.MitreAttack.Technique",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MuteConfig {
pub name: std::string::String,
pub description: std::string::String,
pub filter: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub most_recent_editor: std::string::String,
pub r#type: crate::model::mute_config::MuteConfigType,
pub expiry_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MuteConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.most_recent_editor = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::mute_config::MuteConfigType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_expiry_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expiry_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expiry_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MuteConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.MuteConfig"
}
}
pub mod mute_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MuteConfigType {
Unspecified,
Static,
Dynamic,
UnknownValue(mute_config_type::UnknownValue),
}
#[doc(hidden)]
pub mod mute_config_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MuteConfigType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Static => std::option::Option::Some(1),
Self::Dynamic => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MUTE_CONFIG_TYPE_UNSPECIFIED"),
Self::Static => std::option::Option::Some("STATIC"),
Self::Dynamic => std::option::Option::Some("DYNAMIC"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MuteConfigType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MuteConfigType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MuteConfigType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Static,
2 => Self::Dynamic,
_ => Self::UnknownValue(mute_config_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MuteConfigType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MUTE_CONFIG_TYPE_UNSPECIFIED" => Self::Unspecified,
"STATIC" => Self::Static,
"DYNAMIC" => Self::Dynamic,
_ => Self::UnknownValue(mute_config_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MuteConfigType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Static => serializer.serialize_i32(1),
Self::Dynamic => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MuteConfigType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteConfigType>::new(
".google.cloud.securitycenter.v2.MuteConfig.MuteConfigType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Network {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Network {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for Network {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Network"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Notebook {
pub name: std::string::String,
pub service: std::string::String,
pub last_author: std::string::String,
pub notebook_update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Notebook {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
pub fn set_last_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.last_author = v.into();
self
}
pub fn set_notebook_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.notebook_update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_notebook_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.notebook_update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Notebook {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Notebook"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NotificationConfig {
pub name: std::string::String,
pub description: std::string::String,
pub pubsub_topic: std::string::String,
pub service_account: std::string::String,
pub update_time: std::option::Option<wkt::Timestamp>,
pub notify_config: std::option::Option<crate::model::notification_config::NotifyConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NotificationConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pubsub_topic = v.into();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_notify_config<
T: std::convert::Into<std::option::Option<crate::model::notification_config::NotifyConfig>>,
>(
mut self,
v: T,
) -> Self {
self.notify_config = v.into();
self
}
pub fn streaming_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::notification_config::StreamingConfig>>
{
#[allow(unreachable_patterns)]
self.notify_config.as_ref().and_then(|v| match v {
crate::model::notification_config::NotifyConfig::StreamingConfig(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_streaming_config<
T: std::convert::Into<std::boxed::Box<crate::model::notification_config::StreamingConfig>>,
>(
mut self,
v: T,
) -> Self {
self.notify_config = std::option::Option::Some(
crate::model::notification_config::NotifyConfig::StreamingConfig(v.into()),
);
self
}
}
impl wkt::message::Message for NotificationConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig"
}
}
pub mod notification_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StreamingConfig {
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StreamingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for StreamingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NotifyConfig {
StreamingConfig(std::boxed::Box<crate::model::notification_config::StreamingConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NotificationMessage {
pub notification_config_name: std::string::String,
pub resource: std::option::Option<crate::model::Resource>,
pub event: std::option::Option<crate::model::notification_message::Event>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NotificationMessage {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_notification_config_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.notification_config_name = v.into();
self
}
pub fn set_resource<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Resource>,
{
self.resource = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Resource>,
{
self.resource = v.map(|x| x.into());
self
}
pub fn set_event<
T: std::convert::Into<std::option::Option<crate::model::notification_message::Event>>,
>(
mut self,
v: T,
) -> Self {
self.event = v.into();
self
}
pub fn finding(&self) -> std::option::Option<&std::boxed::Box<crate::model::Finding>> {
#[allow(unreachable_patterns)]
self.event.as_ref().and_then(|v| match v {
crate::model::notification_message::Event::Finding(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_finding<T: std::convert::Into<std::boxed::Box<crate::model::Finding>>>(
mut self,
v: T,
) -> Self {
self.event =
std::option::Option::Some(crate::model::notification_message::Event::Finding(v.into()));
self
}
}
impl wkt::message::Message for NotificationMessage {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.NotificationMessage"
}
}
pub mod notification_message {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Event {
Finding(std::boxed::Box<crate::model::Finding>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OrgPolicy {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OrgPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for OrgPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.OrgPolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Process {
pub name: std::string::String,
pub binary: std::option::Option<crate::model::File>,
pub libraries: std::vec::Vec<crate::model::File>,
pub script: std::option::Option<crate::model::File>,
pub args: std::vec::Vec<std::string::String>,
pub arguments_truncated: bool,
pub env_variables: std::vec::Vec<crate::model::EnvironmentVariable>,
pub env_variables_truncated: bool,
pub pid: i64,
pub parent_pid: i64,
pub user_id: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Process {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_binary<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::File>,
{
self.binary = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_binary<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::File>,
{
self.binary = v.map(|x| x.into());
self
}
pub fn set_libraries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::File>,
{
use std::iter::Iterator;
self.libraries = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_script<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::File>,
{
self.script = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_script<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::File>,
{
self.script = v.map(|x| x.into());
self
}
pub fn set_args<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_arguments_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.arguments_truncated = v.into();
self
}
pub fn set_env_variables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EnvironmentVariable>,
{
use std::iter::Iterator;
self.env_variables = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_env_variables_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.env_variables_truncated = v.into();
self
}
pub fn set_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.pid = v.into();
self
}
pub fn set_parent_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.parent_pid = v.into();
self
}
pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.user_id = v.into();
self
}
}
impl wkt::message::Message for Process {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Process"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnvironmentVariable {
pub name: std::string::String,
pub val: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnvironmentVariable {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_val<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.val = v.into();
self
}
}
impl wkt::message::Message for EnvironmentVariable {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.EnvironmentVariable"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Resource {
pub name: std::string::String,
pub display_name: std::string::String,
pub r#type: std::string::String,
pub cloud_provider: crate::model::CloudProvider,
pub service: std::string::String,
pub location: std::string::String,
pub resource_path: std::option::Option<crate::model::ResourcePath>,
pub resource_path_string: std::string::String,
pub cloud_provider_metadata: std::option::Option<crate::model::resource::CloudProviderMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Resource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
mut self,
v: T,
) -> Self {
self.cloud_provider = v.into();
self
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
pub fn set_resource_path<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResourcePath>,
{
self.resource_path = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResourcePath>,
{
self.resource_path = v.map(|x| x.into());
self
}
pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_path_string = v.into();
self
}
pub fn set_cloud_provider_metadata<
T: std::convert::Into<std::option::Option<crate::model::resource::CloudProviderMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.cloud_provider_metadata = v.into();
self
}
pub fn gcp_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
#[allow(unreachable_patterns)]
self.cloud_provider_metadata.as_ref().and_then(|v| match v {
crate::model::resource::CloudProviderMetadata::GcpMetadata(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_gcp_metadata<T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>>(
mut self,
v: T,
) -> Self {
self.cloud_provider_metadata = std::option::Option::Some(
crate::model::resource::CloudProviderMetadata::GcpMetadata(v.into()),
);
self
}
pub fn aws_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
#[allow(unreachable_patterns)]
self.cloud_provider_metadata.as_ref().and_then(|v| match v {
crate::model::resource::CloudProviderMetadata::AwsMetadata(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_aws_metadata<T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>>(
mut self,
v: T,
) -> Self {
self.cloud_provider_metadata = std::option::Option::Some(
crate::model::resource::CloudProviderMetadata::AwsMetadata(v.into()),
);
self
}
pub fn azure_metadata(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
#[allow(unreachable_patterns)]
self.cloud_provider_metadata.as_ref().and_then(|v| match v {
crate::model::resource::CloudProviderMetadata::AzureMetadata(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_azure_metadata<
T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.cloud_provider_metadata = std::option::Option::Some(
crate::model::resource::CloudProviderMetadata::AzureMetadata(v.into()),
);
self
}
}
impl wkt::message::Message for Resource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Resource"
}
}
pub mod resource {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CloudProviderMetadata {
GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GcpMetadata {
pub project: std::string::String,
pub project_display_name: std::string::String,
pub parent: std::string::String,
pub parent_display_name: std::string::String,
pub folders: std::vec::Vec<crate::model::Folder>,
pub organization: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GcpMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_project_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.project_display_name = v.into();
self
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.parent_display_name = v.into();
self
}
pub fn set_folders<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Folder>,
{
use std::iter::Iterator;
self.folders = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.organization = v.into();
self
}
}
impl wkt::message::Message for GcpMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GcpMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsMetadata {
pub organization: std::option::Option<crate::model::aws_metadata::AwsOrganization>,
pub organizational_units: std::vec::Vec<crate::model::aws_metadata::AwsOrganizationalUnit>,
pub account: std::option::Option<crate::model::aws_metadata::AwsAccount>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_organization<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
{
self.organization = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_organization<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
{
self.organization = v.map(|x| x.into());
self
}
pub fn set_organizational_units<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::aws_metadata::AwsOrganizationalUnit>,
{
use std::iter::Iterator;
self.organizational_units = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_account<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
{
self.account = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_account<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
{
self.account = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AwsMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata"
}
}
pub mod aws_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsOrganization {
pub id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsOrganization {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
}
impl wkt::message::Message for AwsOrganization {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsOrganizationalUnit {
pub id: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsOrganizationalUnit {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for AwsOrganizationalUnit {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AwsAccount {
pub id: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AwsAccount {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for AwsAccount {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsAccount"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureMetadata {
pub management_groups: std::vec::Vec<crate::model::azure_metadata::AzureManagementGroup>,
pub subscription: std::option::Option<crate::model::azure_metadata::AzureSubscription>,
pub resource_group: std::option::Option<crate::model::azure_metadata::AzureResourceGroup>,
pub tenant: std::option::Option<crate::model::azure_metadata::AzureTenant>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_management_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::azure_metadata::AzureManagementGroup>,
{
use std::iter::Iterator;
self.management_groups = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_subscription<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
{
self.subscription = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
{
self.subscription = v.map(|x| x.into());
self
}
pub fn set_resource_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
{
self.resource_group = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
{
self.resource_group = v.map(|x| x.into());
self
}
pub fn set_tenant<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
{
self.tenant = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tenant<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
{
self.tenant = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AzureMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata"
}
}
pub mod azure_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureManagementGroup {
pub id: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureManagementGroup {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for AzureManagementGroup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureSubscription {
pub id: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureSubscription {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for AzureSubscription {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureResourceGroup {
pub id: std::string::String,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureResourceGroup {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for AzureResourceGroup {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AzureTenant {
pub id: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AzureTenant {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for AzureTenant {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureTenant"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourcePath {
pub nodes: std::vec::Vec<crate::model::resource_path::ResourcePathNode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourcePath {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_nodes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::resource_path::ResourcePathNode>,
{
use std::iter::Iterator;
self.nodes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ResourcePath {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath"
}
}
pub mod resource_path {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourcePathNode {
pub node_type: crate::model::resource_path::ResourcePathNodeType,
pub id: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourcePathNode {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_node_type<
T: std::convert::Into<crate::model::resource_path::ResourcePathNodeType>,
>(
mut self,
v: T,
) -> Self {
self.node_type = v.into();
self
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for ResourcePathNode {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResourcePathNodeType {
Unspecified,
GcpOrganization,
GcpFolder,
GcpProject,
AwsOrganization,
AwsOrganizationalUnit,
AwsAccount,
AzureManagementGroup,
AzureSubscription,
AzureResourceGroup,
UnknownValue(resource_path_node_type::UnknownValue),
}
#[doc(hidden)]
pub mod resource_path_node_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ResourcePathNodeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::GcpOrganization => std::option::Option::Some(1),
Self::GcpFolder => std::option::Option::Some(2),
Self::GcpProject => std::option::Option::Some(3),
Self::AwsOrganization => std::option::Option::Some(4),
Self::AwsOrganizationalUnit => std::option::Option::Some(5),
Self::AwsAccount => std::option::Option::Some(6),
Self::AzureManagementGroup => std::option::Option::Some(7),
Self::AzureSubscription => std::option::Option::Some(8),
Self::AzureResourceGroup => std::option::Option::Some(9),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("RESOURCE_PATH_NODE_TYPE_UNSPECIFIED")
}
Self::GcpOrganization => std::option::Option::Some("GCP_ORGANIZATION"),
Self::GcpFolder => std::option::Option::Some("GCP_FOLDER"),
Self::GcpProject => std::option::Option::Some("GCP_PROJECT"),
Self::AwsOrganization => std::option::Option::Some("AWS_ORGANIZATION"),
Self::AwsOrganizationalUnit => std::option::Option::Some("AWS_ORGANIZATIONAL_UNIT"),
Self::AwsAccount => std::option::Option::Some("AWS_ACCOUNT"),
Self::AzureManagementGroup => std::option::Option::Some("AZURE_MANAGEMENT_GROUP"),
Self::AzureSubscription => std::option::Option::Some("AZURE_SUBSCRIPTION"),
Self::AzureResourceGroup => std::option::Option::Some("AZURE_RESOURCE_GROUP"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ResourcePathNodeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ResourcePathNodeType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ResourcePathNodeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::GcpOrganization,
2 => Self::GcpFolder,
3 => Self::GcpProject,
4 => Self::AwsOrganization,
5 => Self::AwsOrganizationalUnit,
6 => Self::AwsAccount,
7 => Self::AzureManagementGroup,
8 => Self::AzureSubscription,
9 => Self::AzureResourceGroup,
_ => Self::UnknownValue(resource_path_node_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ResourcePathNodeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESOURCE_PATH_NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
"GCP_ORGANIZATION" => Self::GcpOrganization,
"GCP_FOLDER" => Self::GcpFolder,
"GCP_PROJECT" => Self::GcpProject,
"AWS_ORGANIZATION" => Self::AwsOrganization,
"AWS_ORGANIZATIONAL_UNIT" => Self::AwsOrganizationalUnit,
"AWS_ACCOUNT" => Self::AwsAccount,
"AZURE_MANAGEMENT_GROUP" => Self::AzureManagementGroup,
"AZURE_SUBSCRIPTION" => Self::AzureSubscription,
"AZURE_RESOURCE_GROUP" => Self::AzureResourceGroup,
_ => Self::UnknownValue(resource_path_node_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ResourcePathNodeType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::GcpOrganization => serializer.serialize_i32(1),
Self::GcpFolder => serializer.serialize_i32(2),
Self::GcpProject => serializer.serialize_i32(3),
Self::AwsOrganization => serializer.serialize_i32(4),
Self::AwsOrganizationalUnit => serializer.serialize_i32(5),
Self::AwsAccount => serializer.serialize_i32(6),
Self::AzureManagementGroup => serializer.serialize_i32(7),
Self::AzureSubscription => serializer.serialize_i32(8),
Self::AzureResourceGroup => serializer.serialize_i32(9),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ResourcePathNodeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourcePathNodeType>::new(
".google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceValueConfig {
pub name: std::string::String,
pub resource_value: crate::model::ResourceValue,
pub tag_values: std::vec::Vec<std::string::String>,
pub resource_type: std::string::String,
pub scope: std::string::String,
pub resource_labels_selector:
std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub cloud_provider: crate::model::CloudProvider,
pub sensitive_data_protection_mapping:
std::option::Option<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceValueConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_resource_value<T: std::convert::Into<crate::model::ResourceValue>>(
mut self,
v: T,
) -> Self {
self.resource_value = v.into();
self
}
pub fn set_tag_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tag_values = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource_type = v.into();
self
}
pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.scope = v.into();
self
}
pub fn set_resource_labels_selector<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.resource_labels_selector = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
mut self,
v: T,
) -> Self {
self.cloud_provider = v.into();
self
}
pub fn set_sensitive_data_protection_mapping<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
{
self.sensitive_data_protection_mapping = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sensitive_data_protection_mapping<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
{
self.sensitive_data_protection_mapping = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResourceValueConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig"
}
}
pub mod resource_value_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SensitiveDataProtectionMapping {
pub high_sensitivity_mapping: crate::model::ResourceValue,
pub medium_sensitivity_mapping: crate::model::ResourceValue,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SensitiveDataProtectionMapping {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_high_sensitivity_mapping<T: std::convert::Into<crate::model::ResourceValue>>(
mut self,
v: T,
) -> Self {
self.high_sensitivity_mapping = v.into();
self
}
pub fn set_medium_sensitivity_mapping<
T: std::convert::Into<crate::model::ResourceValue>,
>(
mut self,
v: T,
) -> Self {
self.medium_sensitivity_mapping = v.into();
self
}
}
impl wkt::message::Message for SensitiveDataProtectionMapping {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecurityMarks {
pub name: std::string::String,
pub marks: std::collections::HashMap<std::string::String, std::string::String>,
pub canonical_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecurityMarks {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_marks<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.marks = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.canonical_name = v.into();
self
}
}
impl wkt::message::Message for SecurityMarks {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.SecurityMarks"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecurityPosture {
pub name: std::string::String,
pub revision_id: std::string::String,
pub posture_deployment_resource: std::string::String,
pub posture_deployment: std::string::String,
pub changed_policy: std::string::String,
pub policy_set: std::string::String,
pub policy: std::string::String,
pub policy_drift_details: std::vec::Vec<crate::model::security_posture::PolicyDriftDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecurityPosture {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.revision_id = v.into();
self
}
pub fn set_posture_deployment_resource<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.posture_deployment_resource = v.into();
self
}
pub fn set_posture_deployment<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.posture_deployment = v.into();
self
}
pub fn set_changed_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.changed_policy = v.into();
self
}
pub fn set_policy_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.policy_set = v.into();
self
}
pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.policy = v.into();
self
}
pub fn set_policy_drift_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::security_posture::PolicyDriftDetails>,
{
use std::iter::Iterator;
self.policy_drift_details = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SecurityPosture {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture"
}
}
pub mod security_posture {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyDriftDetails {
pub field: std::string::String,
pub expected_value: std::string::String,
pub detected_value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyDriftDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field = v.into();
self
}
pub fn set_expected_value<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.expected_value = v.into();
self
}
pub fn set_detected_value<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.detected_value = v.into();
self
}
}
impl wkt::message::Message for PolicyDriftDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchCreateResourceValueConfigsRequest {
pub parent: std::string::String,
pub requests: std::vec::Vec<crate::model::CreateResourceValueConfigRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchCreateResourceValueConfigsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_requests<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CreateResourceValueConfigRequest>,
{
use std::iter::Iterator;
self.requests = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BatchCreateResourceValueConfigsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BatchCreateResourceValueConfigsResponse {
pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BatchCreateResourceValueConfigsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceValueConfig>,
{
use std::iter::Iterator;
self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BatchCreateResourceValueConfigsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkMuteFindingsRequest {
pub parent: std::string::String,
pub filter: std::string::String,
pub mute_state: crate::model::bulk_mute_findings_request::MuteState,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkMuteFindingsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_mute_state<
T: std::convert::Into<crate::model::bulk_mute_findings_request::MuteState>,
>(
mut self,
v: T,
) -> Self {
self.mute_state = v.into();
self
}
}
impl wkt::message::Message for BulkMuteFindingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsRequest"
}
}
pub mod bulk_mute_findings_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MuteState {
Unspecified,
Muted,
Undefined,
UnknownValue(mute_state::UnknownValue),
}
#[doc(hidden)]
pub mod mute_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MuteState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Muted => std::option::Option::Some(1),
Self::Undefined => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MUTE_STATE_UNSPECIFIED"),
Self::Muted => std::option::Option::Some("MUTED"),
Self::Undefined => std::option::Option::Some("UNDEFINED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MuteState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MuteState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MuteState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Muted,
2 => Self::Undefined,
_ => Self::UnknownValue(mute_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MuteState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MUTE_STATE_UNSPECIFIED" => Self::Unspecified,
"MUTED" => Self::Muted,
"UNDEFINED" => Self::Undefined,
_ => Self::UnknownValue(mute_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MuteState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Muted => serializer.serialize_i32(1),
Self::Undefined => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MuteState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteState>::new(
".google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkMuteFindingsResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkMuteFindingsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for BulkMuteFindingsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBigQueryExportRequest {
pub parent: std::string::String,
pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
pub big_query_export_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBigQueryExportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_big_query_export<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BigQueryExport>,
{
self.big_query_export = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BigQueryExport>,
{
self.big_query_export = v.map(|x| x.into());
self
}
pub fn set_big_query_export_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.big_query_export_id = v.into();
self
}
}
impl wkt::message::Message for CreateBigQueryExportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CreateBigQueryExportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateFindingRequest {
pub parent: std::string::String,
pub finding_id: std::string::String,
pub finding: std::option::Option<crate::model::Finding>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateFindingRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_finding_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.finding_id = v.into();
self
}
pub fn set_finding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Finding>,
{
self.finding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Finding>,
{
self.finding = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateFindingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CreateFindingRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMuteConfigRequest {
pub parent: std::string::String,
pub mute_config: std::option::Option<crate::model::MuteConfig>,
pub mute_config_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMuteConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_mute_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MuteConfig>,
{
self.mute_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MuteConfig>,
{
self.mute_config = v.map(|x| x.into());
self
}
pub fn set_mute_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mute_config_id = v.into();
self
}
}
impl wkt::message::Message for CreateMuteConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CreateMuteConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateNotificationConfigRequest {
pub parent: std::string::String,
pub config_id: std::string::String,
pub notification_config: std::option::Option<crate::model::NotificationConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateNotificationConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.config_id = v.into();
self
}
pub fn set_notification_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NotificationConfig>,
{
self.notification_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NotificationConfig>,
{
self.notification_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateNotificationConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CreateNotificationConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateResourceValueConfigRequest {
pub parent: std::string::String,
pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateResourceValueConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_resource_value_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResourceValueConfig>,
{
self.resource_value_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResourceValueConfig>,
{
self.resource_value_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateResourceValueConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CreateResourceValueConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSourceRequest {
pub parent: std::string::String,
pub source: std::option::Option<crate::model::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSourceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_source<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Source>,
{
self.source = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Source>,
{
self.source = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateSourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.CreateSourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBigQueryExportRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteBigQueryExportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteBigQueryExportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.DeleteBigQueryExportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMuteConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteMuteConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteMuteConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.DeleteMuteConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteNotificationConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteNotificationConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteNotificationConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.DeleteNotificationConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteResourceValueConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteResourceValueConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteResourceValueConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryDestination {
pub dataset: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryDestination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dataset = v.into();
self
}
}
impl wkt::message::Message for BigQueryDestination {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.BigQueryDestination"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportFindingsMetadata {
pub export_start_time: std::option::Option<wkt::Timestamp>,
pub destination: std::option::Option<crate::model::export_findings_metadata::Destination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportFindingsMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_export_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.export_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_export_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.export_start_time = v.map(|x| x.into());
self
}
pub fn set_destination<
T: std::convert::Into<
std::option::Option<crate::model::export_findings_metadata::Destination>,
>,
>(
mut self,
v: T,
) -> Self {
self.destination = v.into();
self
}
pub fn big_query_destination(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestination>> {
#[allow(unreachable_patterns)]
self.destination.as_ref().and_then(|v| match v {
crate::model::export_findings_metadata::Destination::BigQueryDestination(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_big_query_destination<
T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestination>>,
>(
mut self,
v: T,
) -> Self {
self.destination = std::option::Option::Some(
crate::model::export_findings_metadata::Destination::BigQueryDestination(v.into()),
);
self
}
}
impl wkt::message::Message for ExportFindingsMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsMetadata"
}
}
pub mod export_findings_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Destination {
BigQueryDestination(std::boxed::Box<crate::model::BigQueryDestination>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportFindingsResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportFindingsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ExportFindingsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBigQueryExportRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetBigQueryExportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetBigQueryExportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GetBigQueryExportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMuteConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMuteConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetMuteConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GetMuteConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetNotificationConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetNotificationConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetNotificationConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GetNotificationConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetResourceValueConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetResourceValueConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetResourceValueConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GetResourceValueConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSourceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSourceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GetSourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GroupFindingsRequest {
pub parent: std::string::String,
pub filter: std::string::String,
pub group_by: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GroupFindingsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group_by = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for GroupFindingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GroupFindingsResponse {
pub group_by_results: std::vec::Vec<crate::model::GroupResult>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GroupFindingsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_group_by_results<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GroupResult>,
{
use std::iter::Iterator;
self.group_by_results = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for GroupFindingsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for GroupFindingsResponse {
type PageItem = crate::model::GroupResult;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.group_by_results
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GroupResult {
pub properties: std::collections::HashMap<std::string::String, wkt::Value>,
pub count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GroupResult {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_properties<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<wkt::Value>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
}
impl wkt::message::Message for GroupResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GroupResult"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAttackPathsRequest {
pub parent: std::string::String,
pub filter: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAttackPathsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListAttackPathsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAttackPathsResponse {
pub attack_paths: std::vec::Vec<crate::model::AttackPath>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAttackPathsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attack_paths<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AttackPath>,
{
use std::iter::Iterator;
self.attack_paths = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListAttackPathsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAttackPathsResponse {
type PageItem = crate::model::AttackPath;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.attack_paths
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSimulationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSimulationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSimulationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GetSimulationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetValuedResourceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetValuedResourceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetValuedResourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.GetValuedResourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBigQueryExportsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBigQueryExportsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListBigQueryExportsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBigQueryExportsResponse {
pub big_query_exports: std::vec::Vec<crate::model::BigQueryExport>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBigQueryExportsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_big_query_exports<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BigQueryExport>,
{
use std::iter::Iterator;
self.big_query_exports = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListBigQueryExportsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListBigQueryExportsResponse {
type PageItem = crate::model::BigQueryExport;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.big_query_exports
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFindingsRequest {
pub parent: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub field_mask: std::option::Option<wkt::FieldMask>,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFindingsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
pub fn set_field_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.field_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.field_mask = v.map(|x| x.into());
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListFindingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFindingsResponse {
pub list_findings_results:
std::vec::Vec<crate::model::list_findings_response::ListFindingsResult>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFindingsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_list_findings_results<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::list_findings_response::ListFindingsResult>,
{
use std::iter::Iterator;
self.list_findings_results = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListFindingsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListFindingsResponse {
type PageItem = crate::model::list_findings_response::ListFindingsResult;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.list_findings_results
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
pub mod list_findings_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFindingsResult {
pub finding: std::option::Option<crate::model::Finding>,
pub resource: std::option::Option<
crate::model::list_findings_response::list_findings_result::Resource,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFindingsResult {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_finding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Finding>,
{
self.finding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Finding>,
{
self.finding = v.map(|x| x.into());
self
}
pub fn set_resource<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::list_findings_response::list_findings_result::Resource,
>,
{
self.resource = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::list_findings_response::list_findings_result::Resource,
>,
{
self.resource = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ListFindingsResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult"
}
}
pub mod list_findings_result {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Resource {
pub name: std::string::String,
pub display_name: std::string::String,
pub r#type: std::string::String,
pub cloud_provider: crate::model::CloudProvider,
pub service: std::string::String,
pub location: std::string::String,
pub resource_path: std::option::Option<crate::model::ResourcePath>,
pub resource_path_string: std::string::String,
pub cloud_provider_metadata: std::option::Option<crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Resource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
mut self,
v: T,
) -> Self {
self.cloud_provider = v.into();
self
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.location = v.into();
self
}
pub fn set_resource_path<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResourcePath>,
{
self.resource_path = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResourcePath>,
{
self.resource_path = v.map(|x| x.into());
self
}
pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_path_string = v.into();
self
}
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
{
self.cloud_provider_metadata = v.into();
self
}
pub fn gcp_metadata(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
#[allow(unreachable_patterns)]
self.cloud_provider_metadata.as_ref().and_then(|v| match v {
crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_gcp_metadata<
T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.cloud_provider_metadata = std::option::Option::Some(
crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(
v.into()
)
);
self
}
pub fn aws_metadata(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
#[allow(unreachable_patterns)]
self.cloud_provider_metadata.as_ref().and_then(|v| match v {
crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_aws_metadata<
T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.cloud_provider_metadata = std::option::Option::Some(
crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(
v.into()
)
);
self
}
pub fn azure_metadata(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
#[allow(unreachable_patterns)]
self.cloud_provider_metadata.as_ref().and_then(|v| match v {
crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_azure_metadata<
T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.cloud_provider_metadata = std::option::Option::Some(
crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(
v.into()
)
);
self
}
}
impl wkt::message::Message for Resource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource"
}
}
pub mod resource {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CloudProviderMetadata {
GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMuteConfigsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMuteConfigsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListMuteConfigsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMuteConfigsResponse {
pub mute_configs: std::vec::Vec<crate::model::MuteConfig>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMuteConfigsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_mute_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MuteConfig>,
{
use std::iter::Iterator;
self.mute_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListMuteConfigsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListMuteConfigsResponse {
type PageItem = crate::model::MuteConfig;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.mute_configs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListNotificationConfigsRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListNotificationConfigsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListNotificationConfigsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListNotificationConfigsResponse {
pub notification_configs: std::vec::Vec<crate::model::NotificationConfig>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListNotificationConfigsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_notification_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NotificationConfig>,
{
use std::iter::Iterator;
self.notification_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListNotificationConfigsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListNotificationConfigsResponse {
type PageItem = crate::model::NotificationConfig;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.notification_configs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListResourceValueConfigsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListResourceValueConfigsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListResourceValueConfigsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListResourceValueConfigsResponse {
pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListResourceValueConfigsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceValueConfig>,
{
use std::iter::Iterator;
self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListResourceValueConfigsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceValueConfigsResponse {
type PageItem = crate::model::ResourceValueConfig;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.resource_value_configs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSourcesRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSourcesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListSourcesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSourcesResponse {
pub sources: std::vec::Vec<crate::model::Source>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSourcesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Source>,
{
use std::iter::Iterator;
self.sources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSourcesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSourcesResponse {
type PageItem = crate::model::Source;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.sources
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListValuedResourcesRequest {
pub parent: std::string::String,
pub filter: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListValuedResourcesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListValuedResourcesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListValuedResourcesResponse {
pub valued_resources: std::vec::Vec<crate::model::ValuedResource>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListValuedResourcesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_valued_resources<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ValuedResource>,
{
use std::iter::Iterator;
self.valued_resources = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for ListValuedResourcesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListValuedResourcesResponse {
type PageItem = crate::model::ValuedResource;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.valued_resources
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SetFindingStateRequest {
pub name: std::string::String,
pub state: crate::model::finding::State,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SetFindingStateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for SetFindingStateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.SetFindingStateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SetMuteRequest {
pub name: std::string::String,
pub mute: crate::model::finding::Mute,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SetMuteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
self.mute = v.into();
self
}
}
impl wkt::message::Message for SetMuteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.SetMuteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBigQueryExportRequest {
pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateBigQueryExportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_big_query_export<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BigQueryExport>,
{
self.big_query_export = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BigQueryExport>,
{
self.big_query_export = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateBigQueryExportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.UpdateBigQueryExportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateExternalSystemRequest {
pub external_system: std::option::Option<crate::model::ExternalSystem>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateExternalSystemRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_external_system<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExternalSystem>,
{
self.external_system = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_external_system<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExternalSystem>,
{
self.external_system = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateExternalSystemRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.UpdateExternalSystemRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateFindingRequest {
pub finding: std::option::Option<crate::model::Finding>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateFindingRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_finding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Finding>,
{
self.finding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Finding>,
{
self.finding = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateFindingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.UpdateFindingRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMuteConfigRequest {
pub mute_config: std::option::Option<crate::model::MuteConfig>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateMuteConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_mute_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MuteConfig>,
{
self.mute_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MuteConfig>,
{
self.mute_config = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateMuteConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.UpdateMuteConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateNotificationConfigRequest {
pub notification_config: std::option::Option<crate::model::NotificationConfig>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateNotificationConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_notification_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NotificationConfig>,
{
self.notification_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NotificationConfig>,
{
self.notification_config = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateNotificationConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.UpdateNotificationConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateResourceValueConfigRequest {
pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateResourceValueConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_value_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResourceValueConfig>,
{
self.resource_value_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResourceValueConfig>,
{
self.resource_value_config = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateResourceValueConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSecurityMarksRequest {
pub security_marks: std::option::Option<crate::model::SecurityMarks>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSecurityMarksRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_security_marks<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecurityMarks>,
{
self.security_marks = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecurityMarks>,
{
self.security_marks = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSecurityMarksRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.UpdateSecurityMarksRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSourceRequest {
pub source: std::option::Option<crate::model::Source>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSourceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Source>,
{
self.source = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Source>,
{
self.source = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSourceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.UpdateSourceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Simulation {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub resource_value_configs_metadata: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
pub cloud_provider: crate::model::CloudProvider,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Simulation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_resource_value_configs_metadata<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
{
use std::iter::Iterator;
self.resource_value_configs_metadata = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
mut self,
v: T,
) -> Self {
self.cloud_provider = v.into();
self
}
}
impl wkt::message::Message for Simulation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Simulation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Source {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub canonical_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Source {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.canonical_name = v.into();
self
}
}
impl wkt::message::Message for Source {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Source"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ToxicCombination {
pub attack_exposure_score: f64,
pub related_findings: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ToxicCombination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attack_exposure_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.attack_exposure_score = v.into();
self
}
pub fn set_related_findings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.related_findings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ToxicCombination {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ToxicCombination"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ValuedResource {
pub name: std::string::String,
pub resource: std::string::String,
pub resource_type: std::string::String,
pub display_name: std::string::String,
pub resource_value: crate::model::valued_resource::ResourceValue,
pub exposed_score: f64,
pub resource_value_configs_used: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ValuedResource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource_type = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_resource_value<
T: std::convert::Into<crate::model::valued_resource::ResourceValue>,
>(
mut self,
v: T,
) -> Self {
self.resource_value = v.into();
self
}
pub fn set_exposed_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.exposed_score = v.into();
self
}
pub fn set_resource_value_configs_used<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
{
use std::iter::Iterator;
self.resource_value_configs_used = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ValuedResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ValuedResource"
}
}
pub mod valued_resource {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResourceValue {
Unspecified,
Low,
Medium,
High,
UnknownValue(resource_value::UnknownValue),
}
#[doc(hidden)]
pub mod resource_value {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ResourceValue {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Low => std::option::Option::Some(1),
Self::Medium => std::option::Option::Some(2),
Self::High => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
Self::Low => std::option::Option::Some("RESOURCE_VALUE_LOW"),
Self::Medium => std::option::Option::Some("RESOURCE_VALUE_MEDIUM"),
Self::High => std::option::Option::Some("RESOURCE_VALUE_HIGH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ResourceValue {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ResourceValue {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ResourceValue {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Low,
2 => Self::Medium,
3 => Self::High,
_ => Self::UnknownValue(resource_value::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ResourceValue {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
"RESOURCE_VALUE_LOW" => Self::Low,
"RESOURCE_VALUE_MEDIUM" => Self::Medium,
"RESOURCE_VALUE_HIGH" => Self::High,
_ => Self::UnknownValue(resource_value::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ResourceValue {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Low => serializer.serialize_i32(1),
Self::Medium => serializer.serialize_i32(2),
Self::High => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ResourceValue {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
".google.cloud.securitycenter.v2.ValuedResource.ResourceValue",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceValueConfigMetadata {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceValueConfigMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for ResourceValueConfigMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfigMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VertexAi {
pub datasets: std::vec::Vec<crate::model::vertex_ai::Dataset>,
pub pipelines: std::vec::Vec<crate::model::vertex_ai::Pipeline>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VertexAi {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_datasets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::vertex_ai::Dataset>,
{
use std::iter::Iterator;
self.datasets = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_pipelines<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::vertex_ai::Pipeline>,
{
use std::iter::Iterator;
self.pipelines = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VertexAi {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.VertexAi"
}
}
pub mod vertex_ai {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Dataset {
pub name: std::string::String,
pub display_name: std::string::String,
pub source: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Dataset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = v.into();
self
}
}
impl wkt::message::Message for Dataset {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Dataset"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Pipeline {
pub name: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Pipeline {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for Pipeline {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Pipeline"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Vulnerability {
pub cve: std::option::Option<crate::model::Cve>,
pub offending_package: std::option::Option<crate::model::Package>,
pub fixed_package: std::option::Option<crate::model::Package>,
pub security_bulletin: std::option::Option<crate::model::SecurityBulletin>,
pub provider_risk_score: i64,
pub reachable: bool,
pub cwes: std::vec::Vec<crate::model::Cwe>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Vulnerability {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cve<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Cve>,
{
self.cve = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cve<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Cve>,
{
self.cve = v.map(|x| x.into());
self
}
pub fn set_offending_package<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Package>,
{
self.offending_package = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_offending_package<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Package>,
{
self.offending_package = v.map(|x| x.into());
self
}
pub fn set_fixed_package<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Package>,
{
self.fixed_package = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_fixed_package<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Package>,
{
self.fixed_package = v.map(|x| x.into());
self
}
pub fn set_security_bulletin<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecurityBulletin>,
{
self.security_bulletin = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_bulletin<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecurityBulletin>,
{
self.security_bulletin = v.map(|x| x.into());
self
}
pub fn set_provider_risk_score<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.provider_risk_score = v.into();
self
}
pub fn set_reachable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reachable = v.into();
self
}
pub fn set_cwes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Cwe>,
{
use std::iter::Iterator;
self.cwes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Vulnerability {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Vulnerability"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Cve {
pub id: std::string::String,
pub references: std::vec::Vec<crate::model::Reference>,
pub cvssv3: std::option::Option<crate::model::Cvssv3>,
pub upstream_fix_available: bool,
pub impact: crate::model::cve::RiskRating,
pub exploitation_activity: crate::model::cve::ExploitationActivity,
pub observed_in_the_wild: bool,
pub zero_day: bool,
pub exploit_release_date: std::option::Option<wkt::Timestamp>,
pub first_exploitation_date: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Cve {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_references<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Reference>,
{
use std::iter::Iterator;
self.references = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cvssv3<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Cvssv3>,
{
self.cvssv3 = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cvssv3<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Cvssv3>,
{
self.cvssv3 = v.map(|x| x.into());
self
}
pub fn set_upstream_fix_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.upstream_fix_available = v.into();
self
}
pub fn set_impact<T: std::convert::Into<crate::model::cve::RiskRating>>(
mut self,
v: T,
) -> Self {
self.impact = v.into();
self
}
pub fn set_exploitation_activity<
T: std::convert::Into<crate::model::cve::ExploitationActivity>,
>(
mut self,
v: T,
) -> Self {
self.exploitation_activity = v.into();
self
}
pub fn set_observed_in_the_wild<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.observed_in_the_wild = v.into();
self
}
pub fn set_zero_day<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.zero_day = v.into();
self
}
pub fn set_exploit_release_date<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.exploit_release_date = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_exploit_release_date<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.exploit_release_date = v.map(|x| x.into());
self
}
pub fn set_first_exploitation_date<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.first_exploitation_date = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_first_exploitation_date<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.first_exploitation_date = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Cve {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Cve"
}
}
pub mod cve {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RiskRating {
Unspecified,
Low,
Medium,
High,
Critical,
UnknownValue(risk_rating::UnknownValue),
}
#[doc(hidden)]
pub mod risk_rating {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RiskRating {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Low => std::option::Option::Some(1),
Self::Medium => std::option::Option::Some(2),
Self::High => std::option::Option::Some(3),
Self::Critical => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RISK_RATING_UNSPECIFIED"),
Self::Low => std::option::Option::Some("LOW"),
Self::Medium => std::option::Option::Some("MEDIUM"),
Self::High => std::option::Option::Some("HIGH"),
Self::Critical => std::option::Option::Some("CRITICAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RiskRating {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RiskRating {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RiskRating {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Low,
2 => Self::Medium,
3 => Self::High,
4 => Self::Critical,
_ => Self::UnknownValue(risk_rating::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RiskRating {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RISK_RATING_UNSPECIFIED" => Self::Unspecified,
"LOW" => Self::Low,
"MEDIUM" => Self::Medium,
"HIGH" => Self::High,
"CRITICAL" => Self::Critical,
_ => Self::UnknownValue(risk_rating::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RiskRating {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Low => serializer.serialize_i32(1),
Self::Medium => serializer.serialize_i32(2),
Self::High => serializer.serialize_i32(3),
Self::Critical => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RiskRating {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RiskRating>::new(
".google.cloud.securitycenter.v2.Cve.RiskRating",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExploitationActivity {
Unspecified,
Wide,
Confirmed,
Available,
Anticipated,
NoKnown,
UnknownValue(exploitation_activity::UnknownValue),
}
#[doc(hidden)]
pub mod exploitation_activity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExploitationActivity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Wide => std::option::Option::Some(1),
Self::Confirmed => std::option::Option::Some(2),
Self::Available => std::option::Option::Some(3),
Self::Anticipated => std::option::Option::Some(4),
Self::NoKnown => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EXPLOITATION_ACTIVITY_UNSPECIFIED"),
Self::Wide => std::option::Option::Some("WIDE"),
Self::Confirmed => std::option::Option::Some("CONFIRMED"),
Self::Available => std::option::Option::Some("AVAILABLE"),
Self::Anticipated => std::option::Option::Some("ANTICIPATED"),
Self::NoKnown => std::option::Option::Some("NO_KNOWN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExploitationActivity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExploitationActivity {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExploitationActivity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Wide,
2 => Self::Confirmed,
3 => Self::Available,
4 => Self::Anticipated,
5 => Self::NoKnown,
_ => Self::UnknownValue(exploitation_activity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExploitationActivity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXPLOITATION_ACTIVITY_UNSPECIFIED" => Self::Unspecified,
"WIDE" => Self::Wide,
"CONFIRMED" => Self::Confirmed,
"AVAILABLE" => Self::Available,
"ANTICIPATED" => Self::Anticipated,
"NO_KNOWN" => Self::NoKnown,
_ => Self::UnknownValue(exploitation_activity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExploitationActivity {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Wide => serializer.serialize_i32(1),
Self::Confirmed => serializer.serialize_i32(2),
Self::Available => serializer.serialize_i32(3),
Self::Anticipated => serializer.serialize_i32(4),
Self::NoKnown => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExploitationActivity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExploitationActivity>::new(
".google.cloud.securitycenter.v2.Cve.ExploitationActivity",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Reference {
pub source: std::string::String,
pub uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Reference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = v.into();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
}
impl wkt::message::Message for Reference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Reference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Cvssv3 {
pub base_score: f64,
pub attack_vector: crate::model::cvssv_3::AttackVector,
pub attack_complexity: crate::model::cvssv_3::AttackComplexity,
pub privileges_required: crate::model::cvssv_3::PrivilegesRequired,
pub user_interaction: crate::model::cvssv_3::UserInteraction,
pub scope: crate::model::cvssv_3::Scope,
pub confidentiality_impact: crate::model::cvssv_3::Impact,
pub integrity_impact: crate::model::cvssv_3::Impact,
pub availability_impact: crate::model::cvssv_3::Impact,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Cvssv3 {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_base_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.base_score = v.into();
self
}
pub fn set_attack_vector<T: std::convert::Into<crate::model::cvssv_3::AttackVector>>(
mut self,
v: T,
) -> Self {
self.attack_vector = v.into();
self
}
pub fn set_attack_complexity<T: std::convert::Into<crate::model::cvssv_3::AttackComplexity>>(
mut self,
v: T,
) -> Self {
self.attack_complexity = v.into();
self
}
pub fn set_privileges_required<
T: std::convert::Into<crate::model::cvssv_3::PrivilegesRequired>,
>(
mut self,
v: T,
) -> Self {
self.privileges_required = v.into();
self
}
pub fn set_user_interaction<T: std::convert::Into<crate::model::cvssv_3::UserInteraction>>(
mut self,
v: T,
) -> Self {
self.user_interaction = v.into();
self
}
pub fn set_scope<T: std::convert::Into<crate::model::cvssv_3::Scope>>(mut self, v: T) -> Self {
self.scope = v.into();
self
}
pub fn set_confidentiality_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
mut self,
v: T,
) -> Self {
self.confidentiality_impact = v.into();
self
}
pub fn set_integrity_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
mut self,
v: T,
) -> Self {
self.integrity_impact = v.into();
self
}
pub fn set_availability_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
mut self,
v: T,
) -> Self {
self.availability_impact = v.into();
self
}
}
impl wkt::message::Message for Cvssv3 {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Cvssv3"
}
}
pub mod cvssv_3 {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AttackVector {
Unspecified,
Network,
Adjacent,
Local,
Physical,
UnknownValue(attack_vector::UnknownValue),
}
#[doc(hidden)]
pub mod attack_vector {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AttackVector {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Network => std::option::Option::Some(1),
Self::Adjacent => std::option::Option::Some(2),
Self::Local => std::option::Option::Some(3),
Self::Physical => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ATTACK_VECTOR_UNSPECIFIED"),
Self::Network => std::option::Option::Some("ATTACK_VECTOR_NETWORK"),
Self::Adjacent => std::option::Option::Some("ATTACK_VECTOR_ADJACENT"),
Self::Local => std::option::Option::Some("ATTACK_VECTOR_LOCAL"),
Self::Physical => std::option::Option::Some("ATTACK_VECTOR_PHYSICAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AttackVector {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AttackVector {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AttackVector {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Network,
2 => Self::Adjacent,
3 => Self::Local,
4 => Self::Physical,
_ => Self::UnknownValue(attack_vector::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AttackVector {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ATTACK_VECTOR_UNSPECIFIED" => Self::Unspecified,
"ATTACK_VECTOR_NETWORK" => Self::Network,
"ATTACK_VECTOR_ADJACENT" => Self::Adjacent,
"ATTACK_VECTOR_LOCAL" => Self::Local,
"ATTACK_VECTOR_PHYSICAL" => Self::Physical,
_ => Self::UnknownValue(attack_vector::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AttackVector {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Network => serializer.serialize_i32(1),
Self::Adjacent => serializer.serialize_i32(2),
Self::Local => serializer.serialize_i32(3),
Self::Physical => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AttackVector {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackVector>::new(
".google.cloud.securitycenter.v2.Cvssv3.AttackVector",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AttackComplexity {
Unspecified,
Low,
High,
UnknownValue(attack_complexity::UnknownValue),
}
#[doc(hidden)]
pub mod attack_complexity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AttackComplexity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Low => std::option::Option::Some(1),
Self::High => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ATTACK_COMPLEXITY_UNSPECIFIED"),
Self::Low => std::option::Option::Some("ATTACK_COMPLEXITY_LOW"),
Self::High => std::option::Option::Some("ATTACK_COMPLEXITY_HIGH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AttackComplexity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AttackComplexity {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AttackComplexity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Low,
2 => Self::High,
_ => Self::UnknownValue(attack_complexity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AttackComplexity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ATTACK_COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
"ATTACK_COMPLEXITY_LOW" => Self::Low,
"ATTACK_COMPLEXITY_HIGH" => Self::High,
_ => Self::UnknownValue(attack_complexity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AttackComplexity {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Low => serializer.serialize_i32(1),
Self::High => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AttackComplexity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackComplexity>::new(
".google.cloud.securitycenter.v2.Cvssv3.AttackComplexity",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PrivilegesRequired {
Unspecified,
None,
Low,
High,
UnknownValue(privileges_required::UnknownValue),
}
#[doc(hidden)]
pub mod privileges_required {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PrivilegesRequired {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::None => std::option::Option::Some(1),
Self::Low => std::option::Option::Some(2),
Self::High => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PRIVILEGES_REQUIRED_UNSPECIFIED"),
Self::None => std::option::Option::Some("PRIVILEGES_REQUIRED_NONE"),
Self::Low => std::option::Option::Some("PRIVILEGES_REQUIRED_LOW"),
Self::High => std::option::Option::Some("PRIVILEGES_REQUIRED_HIGH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PrivilegesRequired {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PrivilegesRequired {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PrivilegesRequired {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::None,
2 => Self::Low,
3 => Self::High,
_ => Self::UnknownValue(privileges_required::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PrivilegesRequired {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PRIVILEGES_REQUIRED_UNSPECIFIED" => Self::Unspecified,
"PRIVILEGES_REQUIRED_NONE" => Self::None,
"PRIVILEGES_REQUIRED_LOW" => Self::Low,
"PRIVILEGES_REQUIRED_HIGH" => Self::High,
_ => Self::UnknownValue(privileges_required::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PrivilegesRequired {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::None => serializer.serialize_i32(1),
Self::Low => serializer.serialize_i32(2),
Self::High => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PrivilegesRequired {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrivilegesRequired>::new(
".google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum UserInteraction {
Unspecified,
None,
Required,
UnknownValue(user_interaction::UnknownValue),
}
#[doc(hidden)]
pub mod user_interaction {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl UserInteraction {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::None => std::option::Option::Some(1),
Self::Required => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("USER_INTERACTION_UNSPECIFIED"),
Self::None => std::option::Option::Some("USER_INTERACTION_NONE"),
Self::Required => std::option::Option::Some("USER_INTERACTION_REQUIRED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for UserInteraction {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for UserInteraction {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for UserInteraction {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::None,
2 => Self::Required,
_ => Self::UnknownValue(user_interaction::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for UserInteraction {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"USER_INTERACTION_UNSPECIFIED" => Self::Unspecified,
"USER_INTERACTION_NONE" => Self::None,
"USER_INTERACTION_REQUIRED" => Self::Required,
_ => Self::UnknownValue(user_interaction::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for UserInteraction {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::None => serializer.serialize_i32(1),
Self::Required => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for UserInteraction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<UserInteraction>::new(
".google.cloud.securitycenter.v2.Cvssv3.UserInteraction",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Scope {
Unspecified,
Unchanged,
Changed,
UnknownValue(scope::UnknownValue),
}
#[doc(hidden)]
pub mod scope {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Scope {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Unchanged => std::option::Option::Some(1),
Self::Changed => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
Self::Unchanged => std::option::Option::Some("SCOPE_UNCHANGED"),
Self::Changed => std::option::Option::Some("SCOPE_CHANGED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Scope {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Scope {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Scope {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Unchanged,
2 => Self::Changed,
_ => Self::UnknownValue(scope::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Scope {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SCOPE_UNSPECIFIED" => Self::Unspecified,
"SCOPE_UNCHANGED" => Self::Unchanged,
"SCOPE_CHANGED" => Self::Changed,
_ => Self::UnknownValue(scope::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Scope {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Unchanged => serializer.serialize_i32(1),
Self::Changed => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Scope {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
".google.cloud.securitycenter.v2.Cvssv3.Scope",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Impact {
Unspecified,
High,
Low,
None,
UnknownValue(impact::UnknownValue),
}
#[doc(hidden)]
pub mod impact {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Impact {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::High => std::option::Option::Some(1),
Self::Low => std::option::Option::Some(2),
Self::None => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("IMPACT_UNSPECIFIED"),
Self::High => std::option::Option::Some("IMPACT_HIGH"),
Self::Low => std::option::Option::Some("IMPACT_LOW"),
Self::None => std::option::Option::Some("IMPACT_NONE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Impact {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Impact {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Impact {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::High,
2 => Self::Low,
3 => Self::None,
_ => Self::UnknownValue(impact::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Impact {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IMPACT_UNSPECIFIED" => Self::Unspecified,
"IMPACT_HIGH" => Self::High,
"IMPACT_LOW" => Self::Low,
"IMPACT_NONE" => Self::None,
_ => Self::UnknownValue(impact::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Impact {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::High => serializer.serialize_i32(1),
Self::Low => serializer.serialize_i32(2),
Self::None => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Impact {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Impact>::new(
".google.cloud.securitycenter.v2.Cvssv3.Impact",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Package {
pub package_name: std::string::String,
pub cpe_uri: std::string::String,
pub package_type: std::string::String,
pub package_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Package {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_package_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.package_name = v.into();
self
}
pub fn set_cpe_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cpe_uri = v.into();
self
}
pub fn set_package_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.package_type = v.into();
self
}
pub fn set_package_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.package_version = v.into();
self
}
}
impl wkt::message::Message for Package {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Package"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecurityBulletin {
pub bulletin_id: std::string::String,
pub submission_time: std::option::Option<wkt::Timestamp>,
pub suggested_upgrade_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecurityBulletin {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bulletin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bulletin_id = v.into();
self
}
pub fn set_submission_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.submission_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_submission_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.submission_time = v.map(|x| x.into());
self
}
pub fn set_suggested_upgrade_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.suggested_upgrade_version = v.into();
self
}
}
impl wkt::message::Message for SecurityBulletin {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.SecurityBulletin"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Cwe {
pub id: std::string::String,
pub references: std::vec::Vec<crate::model::Reference>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Cwe {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_references<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Reference>,
{
use std::iter::Iterator;
self.references = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Cwe {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycenter.v2.Cwe"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum JobState {
Unspecified,
Pending,
Running,
Succeeded,
Failed,
UnknownValue(job_state::UnknownValue),
}
#[doc(hidden)]
pub mod job_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl JobState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Succeeded => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("JOB_STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for JobState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for JobState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for JobState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Running,
3 => Self::Succeeded,
4 => Self::Failed,
_ => Self::UnknownValue(job_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for JobState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"JOB_STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"RUNNING" => Self::Running,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(job_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for JobState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Succeeded => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for JobState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobState>::new(
".google.cloud.securitycenter.v2.JobState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CloudProvider {
Unspecified,
GoogleCloudPlatform,
AmazonWebServices,
MicrosoftAzure,
UnknownValue(cloud_provider::UnknownValue),
}
#[doc(hidden)]
pub mod cloud_provider {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CloudProvider {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::GoogleCloudPlatform => std::option::Option::Some(1),
Self::AmazonWebServices => std::option::Option::Some(2),
Self::MicrosoftAzure => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CLOUD_PROVIDER_UNSPECIFIED"),
Self::GoogleCloudPlatform => std::option::Option::Some("GOOGLE_CLOUD_PLATFORM"),
Self::AmazonWebServices => std::option::Option::Some("AMAZON_WEB_SERVICES"),
Self::MicrosoftAzure => std::option::Option::Some("MICROSOFT_AZURE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CloudProvider {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CloudProvider {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for CloudProvider {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::GoogleCloudPlatform,
2 => Self::AmazonWebServices,
3 => Self::MicrosoftAzure,
_ => Self::UnknownValue(cloud_provider::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CloudProvider {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CLOUD_PROVIDER_UNSPECIFIED" => Self::Unspecified,
"GOOGLE_CLOUD_PLATFORM" => Self::GoogleCloudPlatform,
"AMAZON_WEB_SERVICES" => Self::AmazonWebServices,
"MICROSOFT_AZURE" => Self::MicrosoftAzure,
_ => Self::UnknownValue(cloud_provider::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CloudProvider {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::GoogleCloudPlatform => serializer.serialize_i32(1),
Self::AmazonWebServices => serializer.serialize_i32(2),
Self::MicrosoftAzure => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CloudProvider {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudProvider>::new(
".google.cloud.securitycenter.v2.CloudProvider",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResourceValue {
Unspecified,
High,
Medium,
Low,
None,
UnknownValue(resource_value::UnknownValue),
}
#[doc(hidden)]
pub mod resource_value {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ResourceValue {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::High => std::option::Option::Some(1),
Self::Medium => std::option::Option::Some(2),
Self::Low => std::option::Option::Some(3),
Self::None => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
Self::High => std::option::Option::Some("HIGH"),
Self::Medium => std::option::Option::Some("MEDIUM"),
Self::Low => std::option::Option::Some("LOW"),
Self::None => std::option::Option::Some("NONE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ResourceValue {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ResourceValue {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ResourceValue {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::High,
2 => Self::Medium,
3 => Self::Low,
4 => Self::None,
_ => Self::UnknownValue(resource_value::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ResourceValue {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
"HIGH" => Self::High,
"MEDIUM" => Self::Medium,
"LOW" => Self::Low,
"NONE" => Self::None,
_ => Self::UnknownValue(resource_value::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ResourceValue {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::High => serializer.serialize_i32(1),
Self::Medium => serializer.serialize_i32(2),
Self::Low => serializer.serialize_i32(3),
Self::None => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ResourceValue {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
".google.cloud.securitycenter.v2.ResourceValue",
))
}
}