#![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_location;
extern crate google_cloud_rpc;
extern crate google_cloud_type;
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 SecurityCenterService {
pub name: std::string::String,
pub intended_enablement_state: crate::model::security_center_service::EnablementState,
pub effective_enablement_state: crate::model::security_center_service::EnablementState,
pub modules: std::collections::HashMap<
std::string::String,
crate::model::security_center_service::ModuleSettings,
>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub service_config: std::option::Option<wkt::Struct>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecurityCenterService {
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_intended_enablement_state<
T: std::convert::Into<crate::model::security_center_service::EnablementState>,
>(
mut self,
v: T,
) -> Self {
self.intended_enablement_state = v.into();
self
}
pub fn set_effective_enablement_state<
T: std::convert::Into<crate::model::security_center_service::EnablementState>,
>(
mut self,
v: T,
) -> Self {
self.effective_enablement_state = v.into();
self
}
pub fn set_modules<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::security_center_service::ModuleSettings>,
{
use std::iter::Iterator;
self.modules = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
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_service_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.service_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.service_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SecurityCenterService {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.SecurityCenterService"
}
}
pub mod security_center_service {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ModuleSettings {
pub intended_enablement_state: crate::model::security_center_service::EnablementState,
pub effective_enablement_state: crate::model::security_center_service::EnablementState,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ModuleSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_intended_enablement_state<
T: std::convert::Into<crate::model::security_center_service::EnablementState>,
>(
mut self,
v: T,
) -> Self {
self.intended_enablement_state = v.into();
self
}
pub fn set_effective_enablement_state<
T: std::convert::Into<crate::model::security_center_service::EnablementState>,
>(
mut self,
v: T,
) -> Self {
self.effective_enablement_state = v.into();
self
}
}
impl wkt::message::Message for ModuleSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.SecurityCenterService.ModuleSettings"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EnablementState {
Unspecified,
Inherited,
Enabled,
Disabled,
IngestOnly,
UnknownValue(enablement_state::UnknownValue),
}
#[doc(hidden)]
pub mod enablement_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EnablementState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Inherited => std::option::Option::Some(1),
Self::Enabled => std::option::Option::Some(2),
Self::Disabled => std::option::Option::Some(3),
Self::IngestOnly => 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("ENABLEMENT_STATE_UNSPECIFIED"),
Self::Inherited => std::option::Option::Some("INHERITED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::IngestOnly => std::option::Option::Some("INGEST_ONLY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EnablementState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EnablementState {
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 EnablementState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Inherited,
2 => Self::Enabled,
3 => Self::Disabled,
4 => Self::IngestOnly,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EnablementState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENABLEMENT_STATE_UNSPECIFIED" => Self::Unspecified,
"INHERITED" => Self::Inherited,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
"INGEST_ONLY" => Self::IngestOnly,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EnablementState {
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::Inherited => serializer.serialize_i32(1),
Self::Enabled => serializer.serialize_i32(2),
Self::Disabled => serializer.serialize_i32(3),
Self::IngestOnly => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EnablementState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnablementState>::new(
".google.cloud.securitycentermanagement.v1.SecurityCenterService.EnablementState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EffectiveSecurityHealthAnalyticsCustomModule {
pub name: std::string::String,
pub custom_config: std::option::Option<crate::model::CustomConfig>,
pub enablement_state:
crate::model::effective_security_health_analytics_custom_module::EnablementState,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EffectiveSecurityHealthAnalyticsCustomModule {
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_custom_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomConfig>,
{
self.custom_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomConfig>,
{
self.custom_config = v.map(|x| x.into());
self
}
pub fn set_enablement_state<
T: std::convert::Into<
crate::model::effective_security_health_analytics_custom_module::EnablementState,
>,
>(
mut self,
v: T,
) -> Self {
self.enablement_state = 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 EffectiveSecurityHealthAnalyticsCustomModule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule"
}
}
pub mod effective_security_health_analytics_custom_module {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EnablementState {
Unspecified,
Enabled,
Disabled,
UnknownValue(enablement_state::UnknownValue),
}
#[doc(hidden)]
pub mod enablement_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EnablementState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => 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("ENABLEMENT_STATE_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EnablementState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EnablementState {
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 EnablementState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EnablementState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENABLEMENT_STATE_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EnablementState {
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::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EnablementState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnablementState>::new(
".google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule.EnablementState"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEffectiveSecurityHealthAnalyticsCustomModulesRequest {
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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest {
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 ListEffectiveSecurityHealthAnalyticsCustomModulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEffectiveSecurityHealthAnalyticsCustomModulesResponse {
pub effective_security_health_analytics_custom_modules:
std::vec::Vec<crate::model::EffectiveSecurityHealthAnalyticsCustomModule>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEffectiveSecurityHealthAnalyticsCustomModulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_effective_security_health_analytics_custom_modules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EffectiveSecurityHealthAnalyticsCustomModule>,
{
use std::iter::Iterator;
self.effective_security_health_analytics_custom_modules =
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 ListEffectiveSecurityHealthAnalyticsCustomModulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListEffectiveSecurityHealthAnalyticsCustomModulesResponse
{
type PageItem = crate::model::EffectiveSecurityHealthAnalyticsCustomModule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.effective_security_health_analytics_custom_modules
}
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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEffectiveSecurityHealthAnalyticsCustomModuleRequest {
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 GetEffectiveSecurityHealthAnalyticsCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecurityHealthAnalyticsCustomModule {
pub name: std::string::String,
pub display_name: std::string::String,
pub enablement_state: crate::model::security_health_analytics_custom_module::EnablementState,
pub update_time: std::option::Option<wkt::Timestamp>,
pub last_editor: std::string::String,
pub ancestor_module: std::string::String,
pub custom_config: std::option::Option<crate::model::CustomConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecurityHealthAnalyticsCustomModule {
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_enablement_state<
T: std::convert::Into<crate::model::security_health_analytics_custom_module::EnablementState>,
>(
mut self,
v: T,
) -> Self {
self.enablement_state = 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_last_editor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.last_editor = v.into();
self
}
pub fn set_ancestor_module<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ancestor_module = v.into();
self
}
pub fn set_custom_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomConfig>,
{
self.custom_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomConfig>,
{
self.custom_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SecurityHealthAnalyticsCustomModule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule"
}
}
pub mod security_health_analytics_custom_module {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EnablementState {
Unspecified,
Enabled,
Disabled,
Inherited,
UnknownValue(enablement_state::UnknownValue),
}
#[doc(hidden)]
pub mod enablement_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EnablementState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => std::option::Option::Some(2),
Self::Inherited => 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("ENABLEMENT_STATE_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Inherited => std::option::Option::Some("INHERITED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EnablementState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EnablementState {
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 EnablementState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
3 => Self::Inherited,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EnablementState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENABLEMENT_STATE_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
"INHERITED" => Self::Inherited,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EnablementState {
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::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::Inherited => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EnablementState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnablementState>::new(
".google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule.EnablementState"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomConfig {
pub predicate: std::option::Option<google_cloud_type::model::Expr>,
pub custom_output: std::option::Option<crate::model::custom_config::CustomOutputSpec>,
pub resource_selector: std::option::Option<crate::model::custom_config::ResourceSelector>,
pub severity: crate::model::custom_config::Severity,
pub description: std::string::String,
pub recommendation: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_predicate<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.predicate = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_predicate<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.predicate = v.map(|x| x.into());
self
}
pub fn set_custom_output<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::custom_config::CustomOutputSpec>,
{
self.custom_output = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_output<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::custom_config::CustomOutputSpec>,
{
self.custom_output = v.map(|x| x.into());
self
}
pub fn set_resource_selector<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::custom_config::ResourceSelector>,
{
self.resource_selector = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource_selector<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::custom_config::ResourceSelector>,
{
self.resource_selector = v.map(|x| x.into());
self
}
pub fn set_severity<T: std::convert::Into<crate::model::custom_config::Severity>>(
mut self,
v: T,
) -> Self {
self.severity = 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_recommendation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.recommendation = v.into();
self
}
}
impl wkt::message::Message for CustomConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.CustomConfig"
}
}
pub mod custom_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomOutputSpec {
pub properties: std::vec::Vec<crate::model::custom_config::custom_output_spec::Property>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomOutputSpec {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_properties<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::custom_config::custom_output_spec::Property>,
{
use std::iter::Iterator;
self.properties = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CustomOutputSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.CustomConfig.CustomOutputSpec"
}
}
pub mod custom_output_spec {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Property {
pub name: std::string::String,
pub value_expression: std::option::Option<google_cloud_type::model::Expr>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Property {
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_expression<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.value_expression = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_value_expression<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.value_expression = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Property {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.CustomConfig.CustomOutputSpec.Property"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceSelector {
pub resource_types: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceSelector {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_types<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.resource_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ResourceSelector {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.CustomConfig.ResourceSelector"
}
}
#[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.securitycentermanagement.v1.CustomConfig.Severity",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSecurityHealthAnalyticsCustomModulesRequest {
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 ListSecurityHealthAnalyticsCustomModulesRequest {
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 ListSecurityHealthAnalyticsCustomModulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListSecurityHealthAnalyticsCustomModulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSecurityHealthAnalyticsCustomModulesResponse {
pub security_health_analytics_custom_modules:
std::vec::Vec<crate::model::SecurityHealthAnalyticsCustomModule>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSecurityHealthAnalyticsCustomModulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_security_health_analytics_custom_modules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SecurityHealthAnalyticsCustomModule>,
{
use std::iter::Iterator;
self.security_health_analytics_custom_modules = 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 ListSecurityHealthAnalyticsCustomModulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListSecurityHealthAnalyticsCustomModulesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListSecurityHealthAnalyticsCustomModulesResponse
{
type PageItem = crate::model::SecurityHealthAnalyticsCustomModule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.security_health_analytics_custom_modules
}
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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest {
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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest {
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 ListDescendantSecurityHealthAnalyticsCustomModulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListDescendantSecurityHealthAnalyticsCustomModulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDescendantSecurityHealthAnalyticsCustomModulesResponse {
pub security_health_analytics_custom_modules:
std::vec::Vec<crate::model::SecurityHealthAnalyticsCustomModule>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDescendantSecurityHealthAnalyticsCustomModulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_security_health_analytics_custom_modules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SecurityHealthAnalyticsCustomModule>,
{
use std::iter::Iterator;
self.security_health_analytics_custom_modules = 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 ListDescendantSecurityHealthAnalyticsCustomModulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListDescendantSecurityHealthAnalyticsCustomModulesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListDescendantSecurityHealthAnalyticsCustomModulesResponse
{
type PageItem = crate::model::SecurityHealthAnalyticsCustomModule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.security_health_analytics_custom_modules
}
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 GetSecurityHealthAnalyticsCustomModuleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSecurityHealthAnalyticsCustomModuleRequest {
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 GetSecurityHealthAnalyticsCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.GetSecurityHealthAnalyticsCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSecurityHealthAnalyticsCustomModuleRequest {
pub parent: std::string::String,
pub security_health_analytics_custom_module:
std::option::Option<crate::model::SecurityHealthAnalyticsCustomModule>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSecurityHealthAnalyticsCustomModuleRequest {
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_security_health_analytics_custom_module<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecurityHealthAnalyticsCustomModule>,
{
self.security_health_analytics_custom_module = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_health_analytics_custom_module<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::SecurityHealthAnalyticsCustomModule>,
{
self.security_health_analytics_custom_module = v.map(|x| x.into());
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateSecurityHealthAnalyticsCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.CreateSecurityHealthAnalyticsCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSecurityHealthAnalyticsCustomModuleRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub security_health_analytics_custom_module:
std::option::Option<crate::model::SecurityHealthAnalyticsCustomModule>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSecurityHealthAnalyticsCustomModuleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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
}
pub fn set_security_health_analytics_custom_module<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecurityHealthAnalyticsCustomModule>,
{
self.security_health_analytics_custom_module = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_health_analytics_custom_module<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::SecurityHealthAnalyticsCustomModule>,
{
self.security_health_analytics_custom_module = v.map(|x| x.into());
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateSecurityHealthAnalyticsCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.UpdateSecurityHealthAnalyticsCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSecurityHealthAnalyticsCustomModuleRequest {
pub name: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSecurityHealthAnalyticsCustomModuleRequest {
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_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for DeleteSecurityHealthAnalyticsCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.DeleteSecurityHealthAnalyticsCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SimulateSecurityHealthAnalyticsCustomModuleRequest {
pub parent: std::string::String,
pub custom_config: std::option::Option<crate::model::CustomConfig>,
pub resource: std::option::Option<
crate::model::simulate_security_health_analytics_custom_module_request::SimulatedResource,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SimulateSecurityHealthAnalyticsCustomModuleRequest {
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_custom_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomConfig>,
{
self.custom_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomConfig>,
{
self.custom_config = v.map(|x| x.into());
self
}
pub fn set_resource<T>(mut self, v: T) -> Self
where T: std::convert::Into<crate::model::simulate_security_health_analytics_custom_module_request::SimulatedResource>
{
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::simulate_security_health_analytics_custom_module_request::SimulatedResource>
{
self.resource = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SimulateSecurityHealthAnalyticsCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest"
}
}
pub mod simulate_security_health_analytics_custom_module_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SimulatedResource {
pub resource_type: std::string::String,
pub resource_data: std::option::Option<wkt::Struct>,
pub iam_policy_data: std::option::Option<google_cloud_iam_v1::model::Policy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SimulatedResource {
pub fn new() -> Self {
std::default::Default::default()
}
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_resource_data<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.resource_data = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource_data<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.resource_data = v.map(|x| x.into());
self
}
pub fn set_iam_policy_data<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
{
self.iam_policy_data = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_iam_policy_data<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
{
self.iam_policy_data = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SimulatedResource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SimulatedFinding {
pub name: std::string::String,
pub parent: std::string::String,
pub resource_name: std::string::String,
pub category: std::string::String,
pub state: crate::model::simulated_finding::State,
pub source_properties: std::collections::HashMap<std::string::String, wkt::Value>,
pub event_time: std::option::Option<wkt::Timestamp>,
pub severity: crate::model::simulated_finding::Severity,
pub finding_class: crate::model::simulated_finding::FindingClass,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SimulatedFinding {
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_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_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.category = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::simulated_finding::State>>(
mut self,
v: T,
) -> Self {
self.state = 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_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_severity<T: std::convert::Into<crate::model::simulated_finding::Severity>>(
mut self,
v: T,
) -> Self {
self.severity = v.into();
self
}
pub fn set_finding_class<
T: std::convert::Into<crate::model::simulated_finding::FindingClass>,
>(
mut self,
v: T,
) -> Self {
self.finding_class = v.into();
self
}
}
impl wkt::message::Message for SimulatedFinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.SimulatedFinding"
}
}
pub mod simulated_finding {
#[allow(unused_imports)]
use super::*;
#[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.securitycentermanagement.v1.SimulatedFinding.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.securitycentermanagement.v1.SimulatedFinding.Severity",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FindingClass {
Unspecified,
Threat,
Vulnerability,
Misconfiguration,
Observation,
SccError,
PostureViolation,
ToxicCombination,
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::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::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,
_ => 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,
_ => 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::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.securitycentermanagement.v1.SimulatedFinding.FindingClass",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SimulateSecurityHealthAnalyticsCustomModuleResponse {
pub result: std::option::Option<
crate::model::simulate_security_health_analytics_custom_module_response::SimulatedResult,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SimulateSecurityHealthAnalyticsCustomModuleResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_result<T>(mut self, v: T) -> Self
where T: std::convert::Into<crate::model::simulate_security_health_analytics_custom_module_response::SimulatedResult>
{
self.result = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
where T: std::convert::Into<crate::model::simulate_security_health_analytics_custom_module_response::SimulatedResult>
{
self.result = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SimulateSecurityHealthAnalyticsCustomModuleResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse"
}
}
pub mod simulate_security_health_analytics_custom_module_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SimulatedResult {
pub result: std::option::Option<crate::model::simulate_security_health_analytics_custom_module_response::simulated_result::Result>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SimulatedResult {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_result<T: std::convert::Into<std::option::Option<crate::model::simulate_security_health_analytics_custom_module_response::simulated_result::Result>>>(mut self, v: T) -> Self
{
self.result = v.into();
self
}
pub fn finding(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SimulatedFinding>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::simulate_security_health_analytics_custom_module_response::simulated_result::Result::Finding(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_finding<
T: std::convert::Into<std::boxed::Box<crate::model::SimulatedFinding>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::simulate_security_health_analytics_custom_module_response::simulated_result::Result::Finding(
v.into()
)
);
self
}
pub fn no_violation(&self) -> std::option::Option<&std::boxed::Box<wkt::Empty>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::simulate_security_health_analytics_custom_module_response::simulated_result::Result::NoViolation(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_no_violation<T: std::convert::Into<std::boxed::Box<wkt::Empty>>>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::simulate_security_health_analytics_custom_module_response::simulated_result::Result::NoViolation(
v.into()
)
);
self
}
pub fn error(
&self,
) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>> {
#[allow(unreachable_patterns)]
self.result.as_ref().and_then(|v| match v {
crate::model::simulate_security_health_analytics_custom_module_response::simulated_result::Result::Error(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_error<
T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
>(
mut self,
v: T,
) -> Self {
self.result = std::option::Option::Some(
crate::model::simulate_security_health_analytics_custom_module_response::simulated_result::Result::Error(
v.into()
)
);
self
}
}
impl wkt::message::Message for SimulatedResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleResponse.SimulatedResult"
}
}
pub mod simulated_result {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Result {
Finding(std::boxed::Box<crate::model::SimulatedFinding>),
NoViolation(std::boxed::Box<wkt::Empty>),
Error(std::boxed::Box<google_cloud_rpc::model::Status>),
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EffectiveEventThreatDetectionCustomModule {
pub name: std::string::String,
pub config: std::option::Option<wkt::Struct>,
pub enablement_state:
crate::model::effective_event_threat_detection_custom_module::EnablementState,
pub r#type: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EffectiveEventThreatDetectionCustomModule {
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_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_enablement_state<
T: std::convert::Into<
crate::model::effective_event_threat_detection_custom_module::EnablementState,
>,
>(
mut self,
v: T,
) -> Self {
self.enablement_state = 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_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
}
}
impl wkt::message::Message for EffectiveEventThreatDetectionCustomModule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule"
}
}
pub mod effective_event_threat_detection_custom_module {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EnablementState {
Unspecified,
Enabled,
Disabled,
UnknownValue(enablement_state::UnknownValue),
}
#[doc(hidden)]
pub mod enablement_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EnablementState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => 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("ENABLEMENT_STATE_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EnablementState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EnablementState {
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 EnablementState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EnablementState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENABLEMENT_STATE_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EnablementState {
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::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EnablementState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnablementState>::new(
".google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule.EnablementState"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEffectiveEventThreatDetectionCustomModulesRequest {
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 ListEffectiveEventThreatDetectionCustomModulesRequest {
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 ListEffectiveEventThreatDetectionCustomModulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListEffectiveEventThreatDetectionCustomModulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEffectiveEventThreatDetectionCustomModulesResponse {
pub effective_event_threat_detection_custom_modules:
std::vec::Vec<crate::model::EffectiveEventThreatDetectionCustomModule>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEffectiveEventThreatDetectionCustomModulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_effective_event_threat_detection_custom_modules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EffectiveEventThreatDetectionCustomModule>,
{
use std::iter::Iterator;
self.effective_event_threat_detection_custom_modules =
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 ListEffectiveEventThreatDetectionCustomModulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListEffectiveEventThreatDetectionCustomModulesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListEffectiveEventThreatDetectionCustomModulesResponse
{
type PageItem = crate::model::EffectiveEventThreatDetectionCustomModule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.effective_event_threat_detection_custom_modules
}
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 GetEffectiveEventThreatDetectionCustomModuleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEffectiveEventThreatDetectionCustomModuleRequest {
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 GetEffectiveEventThreatDetectionCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.GetEffectiveEventThreatDetectionCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EventThreatDetectionCustomModule {
pub name: std::string::String,
pub config: std::option::Option<wkt::Struct>,
pub ancestor_module: std::string::String,
pub enablement_state: crate::model::event_threat_detection_custom_module::EnablementState,
pub r#type: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub update_time: std::option::Option<wkt::Timestamp>,
pub last_editor: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EventThreatDetectionCustomModule {
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_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Struct>,
{
self.config = v.map(|x| x.into());
self
}
pub fn set_ancestor_module<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ancestor_module = v.into();
self
}
pub fn set_enablement_state<
T: std::convert::Into<crate::model::event_threat_detection_custom_module::EnablementState>,
>(
mut self,
v: T,
) -> Self {
self.enablement_state = 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_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_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_last_editor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.last_editor = v.into();
self
}
}
impl wkt::message::Message for EventThreatDetectionCustomModule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule"
}
}
pub mod event_threat_detection_custom_module {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EnablementState {
Unspecified,
Enabled,
Disabled,
Inherited,
UnknownValue(enablement_state::UnknownValue),
}
#[doc(hidden)]
pub mod enablement_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EnablementState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Enabled => std::option::Option::Some(1),
Self::Disabled => std::option::Option::Some(2),
Self::Inherited => 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("ENABLEMENT_STATE_UNSPECIFIED"),
Self::Enabled => std::option::Option::Some("ENABLED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Inherited => std::option::Option::Some("INHERITED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EnablementState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EnablementState {
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 EnablementState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Enabled,
2 => Self::Disabled,
3 => Self::Inherited,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EnablementState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENABLEMENT_STATE_UNSPECIFIED" => Self::Unspecified,
"ENABLED" => Self::Enabled,
"DISABLED" => Self::Disabled,
"INHERITED" => Self::Inherited,
_ => Self::UnknownValue(enablement_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EnablementState {
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::Enabled => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::Inherited => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EnablementState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnablementState>::new(
".google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule.EnablementState"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEventThreatDetectionCustomModulesRequest {
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 ListEventThreatDetectionCustomModulesRequest {
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 ListEventThreatDetectionCustomModulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListEventThreatDetectionCustomModulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEventThreatDetectionCustomModulesResponse {
pub event_threat_detection_custom_modules:
std::vec::Vec<crate::model::EventThreatDetectionCustomModule>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEventThreatDetectionCustomModulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_event_threat_detection_custom_modules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EventThreatDetectionCustomModule>,
{
use std::iter::Iterator;
self.event_threat_detection_custom_modules = 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 ListEventThreatDetectionCustomModulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListEventThreatDetectionCustomModulesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListEventThreatDetectionCustomModulesResponse
{
type PageItem = crate::model::EventThreatDetectionCustomModule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.event_threat_detection_custom_modules
}
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 ListDescendantEventThreatDetectionCustomModulesRequest {
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 ListDescendantEventThreatDetectionCustomModulesRequest {
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 ListDescendantEventThreatDetectionCustomModulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListDescendantEventThreatDetectionCustomModulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDescendantEventThreatDetectionCustomModulesResponse {
pub event_threat_detection_custom_modules:
std::vec::Vec<crate::model::EventThreatDetectionCustomModule>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDescendantEventThreatDetectionCustomModulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_event_threat_detection_custom_modules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EventThreatDetectionCustomModule>,
{
use std::iter::Iterator;
self.event_threat_detection_custom_modules = 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 ListDescendantEventThreatDetectionCustomModulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListDescendantEventThreatDetectionCustomModulesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListDescendantEventThreatDetectionCustomModulesResponse
{
type PageItem = crate::model::EventThreatDetectionCustomModule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.event_threat_detection_custom_modules
}
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 GetEventThreatDetectionCustomModuleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetEventThreatDetectionCustomModuleRequest {
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 GetEventThreatDetectionCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.GetEventThreatDetectionCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateEventThreatDetectionCustomModuleRequest {
pub parent: std::string::String,
pub event_threat_detection_custom_module:
std::option::Option<crate::model::EventThreatDetectionCustomModule>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateEventThreatDetectionCustomModuleRequest {
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_event_threat_detection_custom_module<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EventThreatDetectionCustomModule>,
{
self.event_threat_detection_custom_module = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_event_threat_detection_custom_module<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::EventThreatDetectionCustomModule>,
{
self.event_threat_detection_custom_module = v.map(|x| x.into());
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateEventThreatDetectionCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.CreateEventThreatDetectionCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateEventThreatDetectionCustomModuleRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub event_threat_detection_custom_module:
std::option::Option<crate::model::EventThreatDetectionCustomModule>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateEventThreatDetectionCustomModuleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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
}
pub fn set_event_threat_detection_custom_module<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EventThreatDetectionCustomModule>,
{
self.event_threat_detection_custom_module = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_event_threat_detection_custom_module<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::EventThreatDetectionCustomModule>,
{
self.event_threat_detection_custom_module = v.map(|x| x.into());
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateEventThreatDetectionCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.UpdateEventThreatDetectionCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteEventThreatDetectionCustomModuleRequest {
pub name: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteEventThreatDetectionCustomModuleRequest {
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_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for DeleteEventThreatDetectionCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.DeleteEventThreatDetectionCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ValidateEventThreatDetectionCustomModuleRequest {
pub parent: std::string::String,
pub raw_text: std::string::String,
pub r#type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ValidateEventThreatDetectionCustomModuleRequest {
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_raw_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.raw_text = 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
}
}
impl wkt::message::Message for ValidateEventThreatDetectionCustomModuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ValidateEventThreatDetectionCustomModuleResponse {
pub errors: std::vec::Vec<crate::model::validate_event_threat_detection_custom_module_response::CustomModuleValidationError>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ValidateEventThreatDetectionCustomModuleResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::validate_event_threat_detection_custom_module_response::CustomModuleValidationError>
{
use std::iter::Iterator;
self.errors = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ValidateEventThreatDetectionCustomModuleResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse"
}
}
pub mod validate_event_threat_detection_custom_module_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomModuleValidationError {
pub description: std::string::String,
pub field_path: std::string::String,
pub start: std::option::Option<
crate::model::validate_event_threat_detection_custom_module_response::Position,
>,
pub end: std::option::Option<
crate::model::validate_event_threat_detection_custom_module_response::Position,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomModuleValidationError {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_field_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field_path = v.into();
self
}
pub fn set_start<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::validate_event_threat_detection_custom_module_response::Position,
>,
{
self.start = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::validate_event_threat_detection_custom_module_response::Position,
>,
{
self.start = v.map(|x| x.into());
self
}
pub fn set_end<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::validate_event_threat_detection_custom_module_response::Position,
>,
{
self.end = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::validate_event_threat_detection_custom_module_response::Position,
>,
{
self.end = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CustomModuleValidationError {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse.CustomModuleValidationError"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Position {
pub line_number: i32,
pub column_number: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Position {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_line_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.line_number = v.into();
self
}
pub fn set_column_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.column_number = v.into();
self
}
}
impl wkt::message::Message for Position {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ValidateEventThreatDetectionCustomModuleResponse.Position"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSecurityCenterServiceRequest {
pub name: std::string::String,
pub show_eligible_modules_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSecurityCenterServiceRequest {
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_show_eligible_modules_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_eligible_modules_only = v.into();
self
}
}
impl wkt::message::Message for GetSecurityCenterServiceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.GetSecurityCenterServiceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSecurityCenterServicesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub show_eligible_modules_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSecurityCenterServicesRequest {
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
}
pub fn set_show_eligible_modules_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_eligible_modules_only = v.into();
self
}
}
impl wkt::message::Message for ListSecurityCenterServicesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSecurityCenterServicesResponse {
pub security_center_services: std::vec::Vec<crate::model::SecurityCenterService>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSecurityCenterServicesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_security_center_services<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SecurityCenterService>,
{
use std::iter::Iterator;
self.security_center_services = 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 ListSecurityCenterServicesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListSecurityCenterServicesResponse
{
type PageItem = crate::model::SecurityCenterService;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.security_center_services
}
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 UpdateSecurityCenterServiceRequest {
pub security_center_service: std::option::Option<crate::model::SecurityCenterService>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSecurityCenterServiceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_security_center_service<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecurityCenterService>,
{
self.security_center_service = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_security_center_service<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecurityCenterService>,
{
self.security_center_service = 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
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateSecurityCenterServiceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.securitycentermanagement.v1.UpdateSecurityCenterServiceRequest"
}
}