#![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_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_type;
extern crate lazy_static;
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 GenerateFrameworkAuditScopeReportRequest {
pub scope: std::string::String,
pub report_format: crate::model::generate_framework_audit_scope_report_request::Format,
pub compliance_framework: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateFrameworkAuditScopeReportRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.scope = v.into();
self
}
pub fn set_report_format<
T: std::convert::Into<crate::model::generate_framework_audit_scope_report_request::Format>,
>(
mut self,
v: T,
) -> Self {
self.report_format = v.into();
self
}
pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.compliance_framework = v.into();
self
}
}
impl wkt::message::Message for GenerateFrameworkAuditScopeReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportRequest"
}
}
pub mod generate_framework_audit_scope_report_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Format {
Unspecified,
Odf,
UnknownValue(format::UnknownValue),
}
#[doc(hidden)]
pub mod format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Format {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Odf => 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("FORMAT_UNSPECIFIED"),
Self::Odf => std::option::Option::Some("ODF"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Format {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Format {
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 Format {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Odf,
_ => Self::UnknownValue(format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Format {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FORMAT_UNSPECIFIED" => Self::Unspecified,
"ODF" => Self::Odf,
_ => Self::UnknownValue(format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Format {
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::Odf => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Format {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
".google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportRequest.Format"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GenerateFrameworkAuditScopeReportResponse {
pub name: std::string::String,
pub compliance_framework: std::string::String,
pub audit_report: std::option::Option<
crate::model::generate_framework_audit_scope_report_response::AuditReport,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GenerateFrameworkAuditScopeReportResponse {
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_compliance_framework<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.compliance_framework = v.into();
self
}
pub fn set_audit_report<
T: std::convert::Into<
std::option::Option<
crate::model::generate_framework_audit_scope_report_response::AuditReport,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.audit_report = v.into();
self
}
pub fn scope_report_contents(&self) -> std::option::Option<&::bytes::Bytes> {
#[allow(unreachable_patterns)]
self.audit_report.as_ref().and_then(|v| match v {
crate::model::generate_framework_audit_scope_report_response::AuditReport::ScopeReportContents(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_scope_report_contents<T: std::convert::Into<::bytes::Bytes>>(
mut self,
v: T,
) -> Self {
self.audit_report = std::option::Option::Some(
crate::model::generate_framework_audit_scope_report_response::AuditReport::ScopeReportContents(
v.into()
)
);
self
}
}
impl wkt::message::Message for GenerateFrameworkAuditScopeReportResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportResponse"
}
}
pub mod generate_framework_audit_scope_report_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuditReport {
ScopeReportContents(::bytes::Bytes),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReportSummary {
pub total_count: i32,
pub compliant_count: i32,
pub violation_count: i32,
pub manual_review_needed_count: i32,
pub error_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReportSummary {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_count = v.into();
self
}
pub fn set_compliant_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.compliant_count = v.into();
self
}
pub fn set_violation_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.violation_count = v.into();
self
}
pub fn set_manual_review_needed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.manual_review_needed_count = v.into();
self
}
pub fn set_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.error_count = v.into();
self
}
}
impl wkt::message::Message for ReportSummary {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ReportSummary"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateFrameworkAuditRequest {
pub parent: std::string::String,
pub framework_audit_id: std::string::String,
pub framework_audit: std::option::Option<crate::model::FrameworkAudit>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateFrameworkAuditRequest {
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_framework_audit_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.framework_audit_id = v.into();
self
}
pub fn set_framework_audit<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FrameworkAudit>,
{
self.framework_audit = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_framework_audit<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FrameworkAudit>,
{
self.framework_audit = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateFrameworkAuditRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkAuditRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FrameworkAuditDestination {
pub destination_type:
std::option::Option<crate::model::framework_audit_destination::DestinationType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FrameworkAuditDestination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_destination_type<
T: std::convert::Into<
std::option::Option<crate::model::framework_audit_destination::DestinationType>,
>,
>(
mut self,
v: T,
) -> Self {
self.destination_type = v.into();
self
}
pub fn bucket(&self) -> std::option::Option<&std::boxed::Box<crate::model::BucketDestination>> {
#[allow(unreachable_patterns)]
self.destination_type.as_ref().and_then(|v| match v {
crate::model::framework_audit_destination::DestinationType::Bucket(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_bucket<T: std::convert::Into<std::boxed::Box<crate::model::BucketDestination>>>(
mut self,
v: T,
) -> Self {
self.destination_type = std::option::Option::Some(
crate::model::framework_audit_destination::DestinationType::Bucket(v.into()),
);
self
}
}
impl wkt::message::Message for FrameworkAuditDestination {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkAuditDestination"
}
}
pub mod framework_audit_destination {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DestinationType {
Bucket(std::boxed::Box<crate::model::BucketDestination>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BucketDestination {
pub bucket_uri: std::string::String,
pub framework_audit_format: crate::model::bucket_destination::Format,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BucketDestination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bucket_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket_uri = v.into();
self
}
pub fn set_framework_audit_format<
T: std::convert::Into<crate::model::bucket_destination::Format>,
>(
mut self,
v: T,
) -> Self {
self.framework_audit_format = v.into();
self
}
}
impl wkt::message::Message for BucketDestination {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.BucketDestination"
}
}
pub mod bucket_destination {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Format {
Unspecified,
Odf,
UnknownValue(format::UnknownValue),
}
#[doc(hidden)]
pub mod format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Format {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Odf => 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("FORMAT_UNSPECIFIED"),
Self::Odf => std::option::Option::Some("ODF"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Format {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Format {
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 Format {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Odf,
_ => Self::UnknownValue(format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Format {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FORMAT_UNSPECIFIED" => Self::Unspecified,
"ODF" => Self::Odf,
_ => Self::UnknownValue(format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Format {
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::Odf => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Format {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
".google.cloud.cloudsecuritycompliance.v1.BucketDestination.Format",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FrameworkAudit {
pub name: std::string::String,
pub framework_audit_id: std::string::String,
pub compliance_framework: std::string::String,
pub scope: std::string::String,
pub framework_audit_destination: std::option::Option<crate::model::FrameworkAuditDestination>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub finish_time: std::option::Option<wkt::Timestamp>,
pub compliance_state: crate::model::ComplianceState,
pub report_summary: std::option::Option<crate::model::ReportSummary>,
pub cloud_control_group_audit_details:
std::vec::Vec<crate::model::CloudControlGroupAuditDetails>,
pub cloud_control_audit_details: std::vec::Vec<crate::model::CloudControlAuditDetails>,
pub operation_id: std::string::String,
pub state: crate::model::framework_audit::State,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FrameworkAudit {
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_framework_audit_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.framework_audit_id = v.into();
self
}
pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.compliance_framework = 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_framework_audit_destination<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FrameworkAuditDestination>,
{
self.framework_audit_destination = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_framework_audit_destination<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FrameworkAuditDestination>,
{
self.framework_audit_destination = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_finish_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.finish_time = v.map(|x| x.into());
self
}
pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
mut self,
v: T,
) -> Self {
self.compliance_state = v.into();
self
}
pub fn set_report_summary<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReportSummary>,
{
self.report_summary = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReportSummary>,
{
self.report_summary = v.map(|x| x.into());
self
}
pub fn set_cloud_control_group_audit_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControlGroupAuditDetails>,
{
use std::iter::Iterator;
self.cloud_control_group_audit_details = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cloud_control_audit_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControlAuditDetails>,
{
use std::iter::Iterator;
self.cloud_control_audit_details = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation_id = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::framework_audit::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for FrameworkAudit {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkAudit"
}
}
pub mod framework_audit {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Scheduled,
Running,
Uploading,
Failed,
Succeeded,
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::Scheduled => std::option::Option::Some(1),
Self::Running => std::option::Option::Some(2),
Self::Uploading => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::Succeeded => 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("STATE_UNSPECIFIED"),
Self::Scheduled => std::option::Option::Some("SCHEDULED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Uploading => std::option::Option::Some("UPLOADING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
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::Scheduled,
2 => Self::Running,
3 => Self::Uploading,
4 => Self::Failed,
5 => Self::Succeeded,
_ => 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,
"SCHEDULED" => Self::Scheduled,
"RUNNING" => Self::Running,
"UPLOADING" => Self::Uploading,
"FAILED" => Self::Failed,
"SUCCEEDED" => Self::Succeeded,
_ => 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::Scheduled => serializer.serialize_i32(1),
Self::Running => serializer.serialize_i32(2),
Self::Uploading => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::Succeeded => serializer.serialize_i32(5),
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.cloudsecuritycompliance.v1.FrameworkAudit.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFrameworkAuditsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFrameworkAuditsRequest {
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_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListFrameworkAuditsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkAuditsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFrameworkAuditsResponse {
pub framework_audits: std::vec::Vec<crate::model::FrameworkAudit>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFrameworkAuditsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_framework_audits<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FrameworkAudit>,
{
use std::iter::Iterator;
self.framework_audits = 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 ListFrameworkAuditsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkAuditsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListFrameworkAuditsResponse {
type PageItem = crate::model::FrameworkAudit;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.framework_audits
}
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 GetFrameworkAuditRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetFrameworkAuditRequest {
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 GetFrameworkAuditRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkAuditRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudControlGroupAuditDetails {
pub cloud_control_group_id: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub responsibility_type: std::string::String,
pub google_responsibility_description: std::string::String,
pub google_responsibility_implementation: std::string::String,
pub customer_responsibility_description: std::string::String,
pub customer_responsibility_implementation: std::string::String,
pub compliance_state: crate::model::ComplianceState,
pub control_id: std::string::String,
pub control_family: std::option::Option<crate::model::ControlFamily>,
pub cloud_control_details: std::vec::Vec<crate::model::CloudControlAuditDetails>,
pub report_summary: std::option::Option<crate::model::ReportSummary>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudControlGroupAuditDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_control_group_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cloud_control_group_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
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_responsibility_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.responsibility_type = v.into();
self
}
pub fn set_google_responsibility_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.google_responsibility_description = v.into();
self
}
pub fn set_google_responsibility_implementation<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.google_responsibility_implementation = v.into();
self
}
pub fn set_customer_responsibility_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.customer_responsibility_description = v.into();
self
}
pub fn set_customer_responsibility_implementation<
T: std::convert::Into<std::string::String>,
>(
mut self,
v: T,
) -> Self {
self.customer_responsibility_implementation = v.into();
self
}
pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
mut self,
v: T,
) -> Self {
self.compliance_state = v.into();
self
}
pub fn set_control_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.control_id = v.into();
self
}
pub fn set_control_family<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ControlFamily>,
{
self.control_family = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_control_family<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ControlFamily>,
{
self.control_family = v.map(|x| x.into());
self
}
pub fn set_cloud_control_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControlAuditDetails>,
{
use std::iter::Iterator;
self.cloud_control_details = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_report_summary<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReportSummary>,
{
self.report_summary = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReportSummary>,
{
self.report_summary = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CloudControlGroupAuditDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlGroupAuditDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FindingDetails {
pub name: std::string::String,
pub compliance_state: crate::model::ComplianceState,
pub observation: std::option::Option<crate::model::ObservationDetails>,
pub evidence: std::option::Option<crate::model::EvidenceDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FindingDetails {
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_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
mut self,
v: T,
) -> Self {
self.compliance_state = v.into();
self
}
pub fn set_observation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ObservationDetails>,
{
self.observation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_observation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ObservationDetails>,
{
self.observation = v.map(|x| x.into());
self
}
pub fn set_evidence<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::EvidenceDetails>,
{
self.evidence = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_evidence<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::EvidenceDetails>,
{
self.evidence = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for FindingDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FindingDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ObservationDetails {
pub current_value: std::string::String,
pub expected_value: std::string::String,
pub guidance: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ObservationDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_current_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.current_value = 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_guidance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.guidance = v.into();
self
}
}
impl wkt::message::Message for ObservationDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ObservationDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EvidenceDetails {
pub resource: std::string::String,
pub service: std::string::String,
pub evidence_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EvidenceDetails {
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_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
pub fn set_evidence_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.evidence_path = v.into();
self
}
}
impl wkt::message::Message for EvidenceDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.EvidenceDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudControlAuditDetails {
pub cloud_control: std::string::String,
pub cloud_control_id: std::string::String,
pub cloud_control_description: std::string::String,
pub compliance_state: crate::model::ComplianceState,
pub report_summary: std::option::Option<crate::model::ReportSummary>,
pub findings: std::vec::Vec<crate::model::FindingDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudControlAuditDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cloud_control = v.into();
self
}
pub fn set_cloud_control_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cloud_control_id = v.into();
self
}
pub fn set_cloud_control_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cloud_control_description = v.into();
self
}
pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
mut self,
v: T,
) -> Self {
self.compliance_state = v.into();
self
}
pub fn set_report_summary<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReportSummary>,
{
self.report_summary = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReportSummary>,
{
self.report_summary = v.map(|x| x.into());
self
}
pub fn set_findings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FindingDetails>,
{
use std::iter::Iterator;
self.findings = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CloudControlAuditDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlAuditDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCmEnrollmentRequest {
pub cm_enrollment: std::option::Option<crate::model::CmEnrollment>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCmEnrollmentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CmEnrollment>,
{
self.cm_enrollment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CmEnrollment>,
{
self.cm_enrollment = 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 UpdateCmEnrollmentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateCmEnrollmentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CalculateEffectiveCmEnrollmentRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CalculateEffectiveCmEnrollmentRequest {
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 CalculateEffectiveCmEnrollmentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CalculateEffectiveCmEnrollmentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CmEnrollment {
pub name: std::string::String,
pub enrolled: bool,
pub audit_config: std::option::Option<crate::model::AuditConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CmEnrollment {
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_enrolled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enrolled = v.into();
self
}
pub fn set_audit_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AuditConfig>,
{
self.audit_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AuditConfig>,
{
self.audit_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CmEnrollment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CmEnrollment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CalculateEffectiveCmEnrollmentResponse {
pub cm_enrollment: std::option::Option<crate::model::CmEnrollment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CalculateEffectiveCmEnrollmentResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CmEnrollment>,
{
self.cm_enrollment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CmEnrollment>,
{
self.cm_enrollment = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CalculateEffectiveCmEnrollmentResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CalculateEffectiveCmEnrollmentResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuditConfig {
pub destinations: std::vec::Vec<crate::model::audit_config::CmEligibleDestination>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuditConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::audit_config::CmEligibleDestination>,
{
use std::iter::Iterator;
self.destinations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AuditConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AuditConfig"
}
}
pub mod audit_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CmEligibleDestination {
pub cm_eligible_destinations: std::option::Option<
crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CmEligibleDestination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cm_eligible_destinations<
T: std::convert::Into<
std::option::Option<
crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.cm_eligible_destinations = v.into();
self
}
pub fn gcs_bucket(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.cm_eligible_destinations.as_ref().and_then(|v| match v {
crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations::GcsBucket(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cm_eligible_destinations = std::option::Option::Some(
crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations::GcsBucket(
v.into()
)
);
self
}
}
impl wkt::message::Message for CmEligibleDestination {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AuditConfig.CmEligibleDestination"
}
}
pub mod cm_eligible_destination {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CmEligibleDestinations {
GcsBucket(std::string::String),
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Framework {
pub name: std::string::String,
pub major_revision_id: i64,
pub display_name: std::string::String,
pub description: std::string::String,
pub r#type: crate::model::framework::FrameworkType,
pub cloud_control_details: std::vec::Vec<crate::model::CloudControlDetails>,
pub category: std::vec::Vec<crate::model::FrameworkCategory>,
pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
pub supported_target_resource_types: std::vec::Vec<crate::model::TargetResourceType>,
pub supported_enforcement_modes: std::vec::Vec<crate::model::EnforcementMode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Framework {
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_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_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
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_cloud_control_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControlDetails>,
{
use std::iter::Iterator;
self.cloud_control_details = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_category<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FrameworkCategory>,
{
use std::iter::Iterator;
self.category = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudProvider>,
{
use std::iter::Iterator;
self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_supported_target_resource_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TargetResourceType>,
{
use std::iter::Iterator;
self.supported_target_resource_types = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_supported_enforcement_modes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EnforcementMode>,
{
use std::iter::Iterator;
self.supported_enforcement_modes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Framework {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Framework"
}
}
pub mod framework {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FrameworkType {
Unspecified,
BuiltIn,
Custom,
UnknownValue(framework_type::UnknownValue),
}
#[doc(hidden)]
pub mod framework_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FrameworkType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::BuiltIn => std::option::Option::Some(1),
Self::Custom => 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("FRAMEWORK_TYPE_UNSPECIFIED"),
Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
Self::Custom => std::option::Option::Some("CUSTOM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FrameworkType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FrameworkType {
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 FrameworkType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::BuiltIn,
2 => Self::Custom,
_ => Self::UnknownValue(framework_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FrameworkType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FRAMEWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
"BUILT_IN" => Self::BuiltIn,
"CUSTOM" => Self::Custom,
_ => Self::UnknownValue(framework_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FrameworkType {
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::BuiltIn => serializer.serialize_i32(1),
Self::Custom => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FrameworkType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FrameworkType>::new(
".google.cloud.cloudsecuritycompliance.v1.Framework.FrameworkType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudControlDetails {
pub name: std::string::String,
pub major_revision_id: i64,
pub parameters: std::vec::Vec<crate::model::Parameter>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudControlDetails {
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_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_id = v.into();
self
}
pub fn set_parameters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Parameter>,
{
use std::iter::Iterator;
self.parameters = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CloudControlDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FrameworkReference {
pub framework: std::string::String,
pub major_revision_id: std::option::Option<i64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FrameworkReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.framework = v.into();
self
}
pub fn set_major_revision_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.major_revision_id = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_major_revision_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.major_revision_id = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for FrameworkReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Parameter {
pub name: std::string::String,
pub parameter_value: std::option::Option<std::boxed::Box<crate::model::ParamValue>>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Parameter {
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_parameter_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ParamValue>,
{
self.parameter_value = std::option::Option::Some(std::boxed::Box::new(v.into()));
self
}
pub fn set_or_clear_parameter_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ParamValue>,
{
self.parameter_value = v.map(|x| std::boxed::Box::new(x.into()));
self
}
}
impl wkt::message::Message for Parameter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Parameter"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudControl {
pub name: std::string::String,
pub major_revision_id: i64,
pub description: std::string::String,
pub display_name: std::string::String,
pub supported_enforcement_modes: std::vec::Vec<crate::model::EnforcementMode>,
pub parameter_spec: std::vec::Vec<crate::model::ParameterSpec>,
pub rules: std::vec::Vec<crate::model::Rule>,
pub severity: crate::model::Severity,
pub finding_category: std::string::String,
pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
pub related_frameworks: std::vec::Vec<std::string::String>,
pub remediation_steps: std::string::String,
pub categories: std::vec::Vec<crate::model::CloudControlCategory>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub supported_target_resource_types: std::vec::Vec<crate::model::TargetResourceType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudControl {
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_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_id = 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_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_supported_enforcement_modes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EnforcementMode>,
{
use std::iter::Iterator;
self.supported_enforcement_modes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_parameter_spec<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ParameterSpec>,
{
use std::iter::Iterator;
self.parameter_spec = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Rule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
self.severity = 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_supported_cloud_providers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudProvider>,
{
use std::iter::Iterator;
self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_related_frameworks<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_frameworks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_remediation_steps<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.remediation_steps = v.into();
self
}
pub fn set_categories<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControlCategory>,
{
use std::iter::Iterator;
self.categories = 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
}
pub fn set_supported_target_resource_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TargetResourceType>,
{
use std::iter::Iterator;
self.supported_target_resource_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CloudControl {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControl"
}
}
pub mod cloud_control {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
Custom,
BuiltIn,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Custom => std::option::Option::Some(1),
Self::BuiltIn => 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("TYPE_UNSPECIFIED"),
Self::Custom => std::option::Option::Some("CUSTOM"),
Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
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 Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Custom,
2 => Self::BuiltIn,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"CUSTOM" => Self::Custom,
"BUILT_IN" => Self::BuiltIn,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
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::Custom => serializer.serialize_i32(1),
Self::BuiltIn => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.cloudsecuritycompliance.v1.CloudControl.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ParameterSpec {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub is_required: bool,
pub value_type: crate::model::parameter_spec::ValueType,
pub default_value: std::option::Option<crate::model::ParamValue>,
pub substitution_rules: std::vec::Vec<crate::model::ParameterSubstitutionRule>,
pub sub_parameters: std::vec::Vec<crate::model::ParameterSpec>,
pub validation: std::option::Option<crate::model::Validation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ParameterSpec {
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_is_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.is_required = v.into();
self
}
pub fn set_value_type<T: std::convert::Into<crate::model::parameter_spec::ValueType>>(
mut self,
v: T,
) -> Self {
self.value_type = v.into();
self
}
pub fn set_default_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ParamValue>,
{
self.default_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_default_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ParamValue>,
{
self.default_value = v.map(|x| x.into());
self
}
pub fn set_substitution_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ParameterSubstitutionRule>,
{
use std::iter::Iterator;
self.substitution_rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_sub_parameters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ParameterSpec>,
{
use std::iter::Iterator;
self.sub_parameters = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_validation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Validation>,
{
self.validation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_validation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Validation>,
{
self.validation = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ParameterSpec {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParameterSpec"
}
}
pub mod parameter_spec {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ValueType {
Unspecified,
String,
Boolean,
Stringlist,
Number,
Oneof,
UnknownValue(value_type::UnknownValue),
}
#[doc(hidden)]
pub mod value_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ValueType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::String => std::option::Option::Some(3),
Self::Boolean => std::option::Option::Some(4),
Self::Stringlist => std::option::Option::Some(5),
Self::Number => std::option::Option::Some(6),
Self::Oneof => 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("VALUE_TYPE_UNSPECIFIED"),
Self::String => std::option::Option::Some("STRING"),
Self::Boolean => std::option::Option::Some("BOOLEAN"),
Self::Stringlist => std::option::Option::Some("STRINGLIST"),
Self::Number => std::option::Option::Some("NUMBER"),
Self::Oneof => std::option::Option::Some("ONEOF"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ValueType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ValueType {
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 ValueType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
3 => Self::String,
4 => Self::Boolean,
5 => Self::Stringlist,
6 => Self::Number,
7 => Self::Oneof,
_ => Self::UnknownValue(value_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ValueType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
"STRING" => Self::String,
"BOOLEAN" => Self::Boolean,
"STRINGLIST" => Self::Stringlist,
"NUMBER" => Self::Number,
"ONEOF" => Self::Oneof,
_ => Self::UnknownValue(value_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ValueType {
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::String => serializer.serialize_i32(3),
Self::Boolean => serializer.serialize_i32(4),
Self::Stringlist => serializer.serialize_i32(5),
Self::Number => serializer.serialize_i32(6),
Self::Oneof => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ValueType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
".google.cloud.cloudsecuritycompliance.v1.ParameterSpec.ValueType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Validation {
pub constraint: std::option::Option<crate::model::validation::Constraint>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Validation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_constraint<
T: std::convert::Into<std::option::Option<crate::model::validation::Constraint>>,
>(
mut self,
v: T,
) -> Self {
self.constraint = v.into();
self
}
pub fn allowed_values(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AllowedValues>> {
#[allow(unreachable_patterns)]
self.constraint.as_ref().and_then(|v| match v {
crate::model::validation::Constraint::AllowedValues(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_allowed_values<
T: std::convert::Into<std::boxed::Box<crate::model::AllowedValues>>,
>(
mut self,
v: T,
) -> Self {
self.constraint = std::option::Option::Some(
crate::model::validation::Constraint::AllowedValues(v.into()),
);
self
}
pub fn int_range(&self) -> std::option::Option<&std::boxed::Box<crate::model::IntRange>> {
#[allow(unreachable_patterns)]
self.constraint.as_ref().and_then(|v| match v {
crate::model::validation::Constraint::IntRange(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_int_range<T: std::convert::Into<std::boxed::Box<crate::model::IntRange>>>(
mut self,
v: T,
) -> Self {
self.constraint =
std::option::Option::Some(crate::model::validation::Constraint::IntRange(v.into()));
self
}
pub fn regexp_pattern(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::RegexpPattern>> {
#[allow(unreachable_patterns)]
self.constraint.as_ref().and_then(|v| match v {
crate::model::validation::Constraint::RegexpPattern(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_regexp_pattern<
T: std::convert::Into<std::boxed::Box<crate::model::RegexpPattern>>,
>(
mut self,
v: T,
) -> Self {
self.constraint = std::option::Option::Some(
crate::model::validation::Constraint::RegexpPattern(v.into()),
);
self
}
}
impl wkt::message::Message for Validation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Validation"
}
}
pub mod validation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Constraint {
AllowedValues(std::boxed::Box<crate::model::AllowedValues>),
IntRange(std::boxed::Box<crate::model::IntRange>),
RegexpPattern(std::boxed::Box<crate::model::RegexpPattern>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AllowedValues {
pub values: std::vec::Vec<crate::model::ParamValue>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AllowedValues {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ParamValue>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AllowedValues {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AllowedValues"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RegexpPattern {
pub pattern: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RegexpPattern {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pattern<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pattern = v.into();
self
}
}
impl wkt::message::Message for RegexpPattern {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.RegexpPattern"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IntRange {
pub min: i64,
pub max: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IntRange {
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 IntRange {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.IntRange"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StringList {
pub values: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StringList {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_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.values = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for StringList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.StringList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ParamValue {
pub kind: std::option::Option<crate::model::param_value::Kind>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ParamValue {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::param_value::Kind>>>(
mut self,
v: T,
) -> Self {
self.kind = v.into();
self
}
pub fn string_value(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::param_value::Kind::StringValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind =
std::option::Option::Some(crate::model::param_value::Kind::StringValue(v.into()));
self
}
pub fn bool_value(&self) -> std::option::Option<&bool> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::param_value::Kind::BoolValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.kind = std::option::Option::Some(crate::model::param_value::Kind::BoolValue(v.into()));
self
}
pub fn string_list_value(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::StringList>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::param_value::Kind::StringListValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_string_list_value<
T: std::convert::Into<std::boxed::Box<crate::model::StringList>>,
>(
mut self,
v: T,
) -> Self {
self.kind =
std::option::Option::Some(crate::model::param_value::Kind::StringListValue(v.into()));
self
}
pub fn number_value(&self) -> std::option::Option<&f64> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::param_value::Kind::NumberValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_number_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.kind =
std::option::Option::Some(crate::model::param_value::Kind::NumberValue(v.into()));
self
}
pub fn oneof_value(&self) -> std::option::Option<&std::boxed::Box<crate::model::Parameter>> {
#[allow(unreachable_patterns)]
self.kind.as_ref().and_then(|v| match v {
crate::model::param_value::Kind::OneofValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_oneof_value<T: std::convert::Into<std::boxed::Box<crate::model::Parameter>>>(
mut self,
v: T,
) -> Self {
self.kind =
std::option::Option::Some(crate::model::param_value::Kind::OneofValue(v.into()));
self
}
}
impl wkt::message::Message for ParamValue {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParamValue"
}
}
pub mod param_value {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Kind {
StringValue(std::string::String),
BoolValue(bool),
StringListValue(std::boxed::Box<crate::model::StringList>),
NumberValue(f64),
OneofValue(std::boxed::Box<crate::model::Parameter>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ParameterSubstitutionRule {
pub substitution_type:
std::option::Option<crate::model::parameter_substitution_rule::SubstitutionType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ParameterSubstitutionRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_substitution_type<
T: std::convert::Into<
std::option::Option<crate::model::parameter_substitution_rule::SubstitutionType>,
>,
>(
mut self,
v: T,
) -> Self {
self.substitution_type = v.into();
self
}
pub fn placeholder_substitution_rule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PlaceholderSubstitutionRule>> {
#[allow(unreachable_patterns)]
self.substitution_type.as_ref().and_then(|v| match v {
crate::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_placeholder_substitution_rule<
T: std::convert::Into<std::boxed::Box<crate::model::PlaceholderSubstitutionRule>>,
>(
mut self,
v: T,
) -> Self {
self.substitution_type = std::option::Option::Some(
crate::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(
v.into()
)
);
self
}
pub fn attribute_substitution_rule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AttributeSubstitutionRule>> {
#[allow(unreachable_patterns)]
self.substitution_type.as_ref().and_then(|v| match v {
crate::model::parameter_substitution_rule::SubstitutionType::AttributeSubstitutionRule(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_attribute_substitution_rule<
T: std::convert::Into<std::boxed::Box<crate::model::AttributeSubstitutionRule>>,
>(
mut self,
v: T,
) -> Self {
self.substitution_type = std::option::Option::Some(
crate::model::parameter_substitution_rule::SubstitutionType::AttributeSubstitutionRule(
v.into(),
),
);
self
}
}
impl wkt::message::Message for ParameterSubstitutionRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParameterSubstitutionRule"
}
}
pub mod parameter_substitution_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SubstitutionType {
PlaceholderSubstitutionRule(std::boxed::Box<crate::model::PlaceholderSubstitutionRule>),
AttributeSubstitutionRule(std::boxed::Box<crate::model::AttributeSubstitutionRule>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttributeSubstitutionRule {
pub attribute: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AttributeSubstitutionRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.attribute = v.into();
self
}
}
impl wkt::message::Message for AttributeSubstitutionRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AttributeSubstitutionRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PlaceholderSubstitutionRule {
pub attribute: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PlaceholderSubstitutionRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.attribute = v.into();
self
}
}
impl wkt::message::Message for PlaceholderSubstitutionRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.PlaceholderSubstitutionRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Rule {
pub description: std::string::String,
pub rule_action_types: std::vec::Vec<crate::model::RuleActionType>,
pub implementation: std::option::Option<crate::model::rule::Implementation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Rule {
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_rule_action_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RuleActionType>,
{
use std::iter::Iterator;
self.rule_action_types = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_implementation<
T: std::convert::Into<std::option::Option<crate::model::rule::Implementation>>,
>(
mut self,
v: T,
) -> Self {
self.implementation = v.into();
self
}
pub fn cel_expression(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CELExpression>> {
#[allow(unreachable_patterns)]
self.implementation.as_ref().and_then(|v| match v {
crate::model::rule::Implementation::CelExpression(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_cel_expression<
T: std::convert::Into<std::boxed::Box<crate::model::CELExpression>>,
>(
mut self,
v: T,
) -> Self {
self.implementation =
std::option::Option::Some(crate::model::rule::Implementation::CelExpression(v.into()));
self
}
}
impl wkt::message::Message for Rule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Rule"
}
}
pub mod rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Implementation {
CelExpression(std::boxed::Box<crate::model::CELExpression>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CELExpression {
pub expression: std::string::String,
pub criteria: std::option::Option<crate::model::cel_expression::Criteria>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CELExpression {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_expression<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.expression = v.into();
self
}
pub fn set_criteria<
T: std::convert::Into<std::option::Option<crate::model::cel_expression::Criteria>>,
>(
mut self,
v: T,
) -> Self {
self.criteria = v.into();
self
}
pub fn resource_types_values(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::StringList>> {
#[allow(unreachable_patterns)]
self.criteria.as_ref().and_then(|v| match v {
crate::model::cel_expression::Criteria::ResourceTypesValues(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_resource_types_values<
T: std::convert::Into<std::boxed::Box<crate::model::StringList>>,
>(
mut self,
v: T,
) -> Self {
self.criteria = std::option::Option::Some(
crate::model::cel_expression::Criteria::ResourceTypesValues(v.into()),
);
self
}
}
impl wkt::message::Message for CELExpression {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CELExpression"
}
}
pub mod cel_expression {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Criteria {
ResourceTypesValues(std::boxed::Box<crate::model::StringList>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub target: std::string::String,
pub verb: std::string::String,
pub status_message: std::string::String,
pub requested_cancellation: bool,
pub api_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
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_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = 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_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status_message = v.into();
self
}
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_version = v.into();
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ControlFamily {
pub family_id: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ControlFamily {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_family_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.family_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 ControlFamily {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlFamily"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFrameworksRequest {
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 ListFrameworksRequest {
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 ListFrameworksRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworksRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFrameworksResponse {
pub frameworks: std::vec::Vec<crate::model::Framework>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFrameworksResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_frameworks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Framework>,
{
use std::iter::Iterator;
self.frameworks = 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 ListFrameworksResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworksResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListFrameworksResponse {
type PageItem = crate::model::Framework;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.frameworks
}
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 GetFrameworkRequest {
pub name: std::string::String,
pub major_revision_id: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetFrameworkRequest {
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_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_id = v.into();
self
}
}
impl wkt::message::Message for GetFrameworkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateFrameworkRequest {
pub parent: std::string::String,
pub framework_id: std::string::String,
pub framework: std::option::Option<crate::model::Framework>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateFrameworkRequest {
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_framework_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.framework_id = v.into();
self
}
pub fn set_framework<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Framework>,
{
self.framework = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Framework>,
{
self.framework = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateFrameworkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateFrameworkRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub framework: std::option::Option<crate::model::Framework>,
pub major_revision_id: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateFrameworkRequest {
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_framework<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Framework>,
{
self.framework = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Framework>,
{
self.framework = v.map(|x| x.into());
self
}
pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_id = v.into();
self
}
}
impl wkt::message::Message for UpdateFrameworkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateFrameworkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteFrameworkRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteFrameworkRequest {
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 DeleteFrameworkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteFrameworkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCloudControlsRequest {
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 ListCloudControlsRequest {
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 ListCloudControlsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCloudControlsResponse {
pub cloud_controls: std::vec::Vec<crate::model::CloudControl>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCloudControlsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_controls<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControl>,
{
use std::iter::Iterator;
self.cloud_controls = 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 ListCloudControlsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCloudControlsResponse {
type PageItem = crate::model::CloudControl;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.cloud_controls
}
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 GetCloudControlRequest {
pub name: std::string::String,
pub major_revision_id: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCloudControlRequest {
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_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_id = v.into();
self
}
}
impl wkt::message::Message for GetCloudControlRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetCloudControlRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCloudControlRequest {
pub parent: std::string::String,
pub cloud_control_id: std::string::String,
pub cloud_control: std::option::Option<crate::model::CloudControl>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCloudControlRequest {
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_cloud_control_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cloud_control_id = v.into();
self
}
pub fn set_cloud_control<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudControl>,
{
self.cloud_control = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudControl>,
{
self.cloud_control = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateCloudControlRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateCloudControlRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCloudControlRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub cloud_control: std::option::Option<crate::model::CloudControl>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCloudControlRequest {
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_cloud_control<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudControl>,
{
self.cloud_control = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudControl>,
{
self.cloud_control = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateCloudControlRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateCloudControlRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCloudControlRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCloudControlRequest {
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 DeleteCloudControlRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteCloudControlRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FrameworkDeployment {
pub name: std::string::String,
pub target_resource_config: std::option::Option<crate::model::TargetResourceConfig>,
pub computed_target_resource: std::string::String,
pub framework: std::option::Option<crate::model::FrameworkReference>,
pub description: std::string::String,
pub cloud_control_metadata: std::vec::Vec<crate::model::CloudControlMetadata>,
pub deployment_state: crate::model::DeploymentState,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub target_resource_display_name: std::string::String,
pub cloud_control_deployment_references:
std::vec::Vec<crate::model::CloudControlDeploymentReference>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FrameworkDeployment {
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_target_resource_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TargetResourceConfig>,
{
self.target_resource_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TargetResourceConfig>,
{
self.target_resource_config = v.map(|x| x.into());
self
}
pub fn set_computed_target_resource<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.computed_target_resource = v.into();
self
}
pub fn set_framework<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FrameworkReference>,
{
self.framework = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FrameworkReference>,
{
self.framework = v.map(|x| x.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_cloud_control_metadata<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControlMetadata>,
{
use std::iter::Iterator;
self.cloud_control_metadata = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_deployment_state<T: std::convert::Into<crate::model::DeploymentState>>(
mut self,
v: T,
) -> Self {
self.deployment_state = 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_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.target_resource_display_name = v.into();
self
}
pub fn set_cloud_control_deployment_references<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControlDeploymentReference>,
{
use std::iter::Iterator;
self.cloud_control_deployment_references = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FrameworkDeployment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkDeployment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudControlDeployment {
pub name: std::string::String,
pub target_resource_config: std::option::Option<crate::model::TargetResourceConfig>,
pub target_resource: std::string::String,
pub cloud_control_metadata: std::option::Option<crate::model::CloudControlMetadata>,
pub description: std::string::String,
pub deployment_state: crate::model::DeploymentState,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub parameter_substituted_cloud_control: std::option::Option<crate::model::CloudControl>,
pub framework_deployment_references: std::vec::Vec<crate::model::FrameworkDeploymentReference>,
pub target_resource_display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudControlDeployment {
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_target_resource_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TargetResourceConfig>,
{
self.target_resource_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TargetResourceConfig>,
{
self.target_resource_config = v.map(|x| x.into());
self
}
pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_resource = v.into();
self
}
pub fn set_cloud_control_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudControlMetadata>,
{
self.cloud_control_metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_control_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudControlMetadata>,
{
self.cloud_control_metadata = v.map(|x| x.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_deployment_state<T: std::convert::Into<crate::model::DeploymentState>>(
mut self,
v: T,
) -> Self {
self.deployment_state = 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_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_parameter_substituted_cloud_control<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudControl>,
{
self.parameter_substituted_cloud_control = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_parameter_substituted_cloud_control<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::CloudControl>,
{
self.parameter_substituted_cloud_control = v.map(|x| x.into());
self
}
pub fn set_framework_deployment_references<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FrameworkDeploymentReference>,
{
use std::iter::Iterator;
self.framework_deployment_references = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.target_resource_display_name = v.into();
self
}
}
impl wkt::message::Message for CloudControlDeployment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDeployment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetResourceConfig {
pub resource_config: std::option::Option<crate::model::target_resource_config::ResourceConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetResourceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_config<
T: std::convert::Into<
std::option::Option<crate::model::target_resource_config::ResourceConfig>,
>,
>(
mut self,
v: T,
) -> Self {
self.resource_config = v.into();
self
}
pub fn existing_target_resource(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.resource_config.as_ref().and_then(|v| match v {
crate::model::target_resource_config::ResourceConfig::ExistingTargetResource(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_existing_target_resource<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_config = std::option::Option::Some(
crate::model::target_resource_config::ResourceConfig::ExistingTargetResource(v.into()),
);
self
}
pub fn target_resource_creation_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TargetResourceCreationConfig>> {
#[allow(unreachable_patterns)]
self.resource_config.as_ref().and_then(|v| match v {
crate::model::target_resource_config::ResourceConfig::TargetResourceCreationConfig(
v,
) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_target_resource_creation_config<
T: std::convert::Into<std::boxed::Box<crate::model::TargetResourceCreationConfig>>,
>(
mut self,
v: T,
) -> Self {
self.resource_config = std::option::Option::Some(
crate::model::target_resource_config::ResourceConfig::TargetResourceCreationConfig(
v.into(),
),
);
self
}
}
impl wkt::message::Message for TargetResourceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceConfig"
}
}
pub mod target_resource_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResourceConfig {
ExistingTargetResource(std::string::String),
TargetResourceCreationConfig(std::boxed::Box<crate::model::TargetResourceCreationConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetResourceCreationConfig {
pub resource_creation_config:
std::option::Option<crate::model::target_resource_creation_config::ResourceCreationConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetResourceCreationConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_creation_config<
T: std::convert::Into<
std::option::Option<
crate::model::target_resource_creation_config::ResourceCreationConfig,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.resource_creation_config = v.into();
self
}
pub fn folder_creation_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::FolderCreationConfig>> {
#[allow(unreachable_patterns)]
self.resource_creation_config.as_ref().and_then(|v| match v {
crate::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_folder_creation_config<
T: std::convert::Into<std::boxed::Box<crate::model::FolderCreationConfig>>,
>(
mut self,
v: T,
) -> Self {
self.resource_creation_config = std::option::Option::Some(
crate::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(
v.into()
)
);
self
}
pub fn project_creation_config(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ProjectCreationConfig>> {
#[allow(unreachable_patterns)]
self.resource_creation_config.as_ref().and_then(|v| match v {
crate::model::target_resource_creation_config::ResourceCreationConfig::ProjectCreationConfig(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_project_creation_config<
T: std::convert::Into<std::boxed::Box<crate::model::ProjectCreationConfig>>,
>(
mut self,
v: T,
) -> Self {
self.resource_creation_config = std::option::Option::Some(
crate::model::target_resource_creation_config::ResourceCreationConfig::ProjectCreationConfig(
v.into()
)
);
self
}
}
impl wkt::message::Message for TargetResourceCreationConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceCreationConfig"
}
}
pub mod target_resource_creation_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResourceCreationConfig {
FolderCreationConfig(std::boxed::Box<crate::model::FolderCreationConfig>),
ProjectCreationConfig(std::boxed::Box<crate::model::ProjectCreationConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FolderCreationConfig {
pub parent: std::string::String,
pub folder_display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FolderCreationConfig {
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_folder_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.folder_display_name = v.into();
self
}
}
impl wkt::message::Message for FolderCreationConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FolderCreationConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProjectCreationConfig {
pub parent: std::string::String,
pub project_display_name: std::string::String,
pub billing_account_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ProjectCreationConfig {
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_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_billing_account_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.billing_account_id = v.into();
self
}
}
impl wkt::message::Message for ProjectCreationConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ProjectCreationConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudControlMetadata {
pub cloud_control_details: std::option::Option<crate::model::CloudControlDetails>,
pub enforcement_mode: crate::model::EnforcementMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudControlMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_control_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudControlDetails>,
{
self.cloud_control_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_control_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudControlDetails>,
{
self.cloud_control_details = v.map(|x| x.into());
self
}
pub fn set_enforcement_mode<T: std::convert::Into<crate::model::EnforcementMode>>(
mut self,
v: T,
) -> Self {
self.enforcement_mode = v.into();
self
}
}
impl wkt::message::Message for CloudControlMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateFrameworkDeploymentRequest {
pub parent: std::string::String,
pub framework_deployment_id: std::string::String,
pub framework_deployment: std::option::Option<crate::model::FrameworkDeployment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateFrameworkDeploymentRequest {
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_framework_deployment_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.framework_deployment_id = v.into();
self
}
pub fn set_framework_deployment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FrameworkDeployment>,
{
self.framework_deployment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_framework_deployment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FrameworkDeployment>,
{
self.framework_deployment = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateFrameworkDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteFrameworkDeploymentRequest {
pub name: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteFrameworkDeploymentRequest {
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_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteFrameworkDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteFrameworkDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetFrameworkDeploymentRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetFrameworkDeploymentRequest {
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 GetFrameworkDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFrameworkDeploymentsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFrameworkDeploymentsRequest {
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_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
}
}
impl wkt::message::Message for ListFrameworkDeploymentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkDeploymentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFrameworkDeploymentsResponse {
pub framework_deployments: std::vec::Vec<crate::model::FrameworkDeployment>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFrameworkDeploymentsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_framework_deployments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FrameworkDeployment>,
{
use std::iter::Iterator;
self.framework_deployments = 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 ListFrameworkDeploymentsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkDeploymentsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListFrameworkDeploymentsResponse {
type PageItem = crate::model::FrameworkDeployment;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.framework_deployments
}
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 GetCloudControlDeploymentRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCloudControlDeploymentRequest {
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 GetCloudControlDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetCloudControlDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCloudControlDeploymentsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCloudControlDeploymentsRequest {
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_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
}
}
impl wkt::message::Message for ListCloudControlDeploymentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlDeploymentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCloudControlDeploymentsResponse {
pub cloud_control_deployments: std::vec::Vec<crate::model::CloudControlDeployment>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCloudControlDeploymentsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_control_deployments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControlDeployment>,
{
use std::iter::Iterator;
self.cloud_control_deployments = 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 ListCloudControlDeploymentsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlDeploymentsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListCloudControlDeploymentsResponse
{
type PageItem = crate::model::CloudControlDeployment;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.cloud_control_deployments
}
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 CloudControlDeploymentReference {
pub cloud_control_deployment: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudControlDeploymentReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_control_deployment<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cloud_control_deployment = v.into();
self
}
}
impl wkt::message::Message for CloudControlDeploymentReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDeploymentReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FrameworkDeploymentReference {
pub framework_deployment: std::string::String,
pub framework_reference: std::option::Option<crate::model::FrameworkReference>,
pub framework_display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FrameworkDeploymentReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_framework_deployment<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.framework_deployment = v.into();
self
}
pub fn set_framework_reference<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FrameworkReference>,
{
self.framework_reference = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_framework_reference<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FrameworkReference>,
{
self.framework_reference = v.map(|x| x.into());
self
}
pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.framework_display_name = v.into();
self
}
}
impl wkt::message::Message for FrameworkDeploymentReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkDeploymentReference"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFrameworkComplianceSummariesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFrameworkComplianceSummariesRequest {
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_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListFrameworkComplianceSummariesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFrameworkComplianceSummariesResponse {
pub framework_compliance_summaries: std::vec::Vec<crate::model::FrameworkComplianceSummary>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFrameworkComplianceSummariesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_framework_compliance_summaries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FrameworkComplianceSummary>,
{
use std::iter::Iterator;
self.framework_compliance_summaries = 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 ListFrameworkComplianceSummariesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListFrameworkComplianceSummariesResponse
{
type PageItem = crate::model::FrameworkComplianceSummary;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.framework_compliance_summaries
}
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 FrameworkComplianceReport {
pub framework: std::string::String,
pub framework_description: std::string::String,
pub update_time: std::option::Option<wkt::Timestamp>,
pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
pub framework_type: crate::model::framework::FrameworkType,
pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
pub framework_categories: std::vec::Vec<crate::model::FrameworkCategory>,
pub framework_display_name: std::string::String,
pub name: std::string::String,
pub major_revision_id: i64,
pub minor_revision_id: i64,
pub target_resource_details: std::vec::Vec<crate::model::TargetResourceDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FrameworkComplianceReport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.framework = v.into();
self
}
pub fn set_framework_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.framework_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_control_assessment_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ControlAssessmentDetails>,
{
self.control_assessment_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ControlAssessmentDetails>,
{
self.control_assessment_details = v.map(|x| x.into());
self
}
pub fn set_framework_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
mut self,
v: T,
) -> Self {
self.framework_type = v.into();
self
}
pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudProvider>,
{
use std::iter::Iterator;
self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_framework_categories<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FrameworkCategory>,
{
use std::iter::Iterator;
self.framework_categories = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.framework_display_name = 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_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_id = v.into();
self
}
pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.minor_revision_id = v.into();
self
}
pub fn set_target_resource_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TargetResourceDetails>,
{
use std::iter::Iterator;
self.target_resource_details = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FrameworkComplianceReport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkComplianceReport"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FetchFrameworkComplianceReportRequest {
pub name: std::string::String,
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FetchFrameworkComplianceReportRequest {
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_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for FetchFrameworkComplianceReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FetchFrameworkComplianceReportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFindingSummariesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
#[deprecated]
pub end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFindingSummariesRequest {
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_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
#[deprecated]
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ListFindingSummariesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFindingSummariesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFindingSummariesResponse {
pub finding_summaries: std::vec::Vec<crate::model::FindingSummary>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFindingSummariesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_finding_summaries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FindingSummary>,
{
use std::iter::Iterator;
self.finding_summaries = 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 ListFindingSummariesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFindingSummariesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListFindingSummariesResponse {
type PageItem = crate::model::FindingSummary;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.finding_summaries
}
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 ListControlComplianceSummariesRequest {
pub parent: std::string::String,
#[deprecated]
pub end_time: std::option::Option<wkt::Timestamp>,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListControlComplianceSummariesRequest {
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
}
#[deprecated]
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.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_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListControlComplianceSummariesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListControlComplianceSummariesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListControlComplianceSummariesResponse {
pub control_compliance_summaries: std::vec::Vec<crate::model::ControlComplianceSummary>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListControlComplianceSummariesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_control_compliance_summaries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ControlComplianceSummary>,
{
use std::iter::Iterator;
self.control_compliance_summaries = 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 ListControlComplianceSummariesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListControlComplianceSummariesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListControlComplianceSummariesResponse
{
type PageItem = crate::model::ControlComplianceSummary;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.control_compliance_summaries
}
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 AggregateFrameworkComplianceReportRequest {
pub name: std::string::String,
pub interval: std::option::Option<google_cloud_type::model::Interval>,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AggregateFrameworkComplianceReportRequest {
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_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.interval = v.map(|x| x.into());
self
}
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 AggregateFrameworkComplianceReportRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregateFrameworkComplianceReportRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AggregateFrameworkComplianceReportResponse {
pub aggregated_compliance_reports: std::vec::Vec<crate::model::AggregatedComplianceReport>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AggregateFrameworkComplianceReportResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_aggregated_compliance_reports<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AggregatedComplianceReport>,
{
use std::iter::Iterator;
self.aggregated_compliance_reports = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AggregateFrameworkComplianceReportResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregateFrameworkComplianceReportResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ControlAssessmentDetails {
pub passing_controls: i32,
pub failing_controls: i32,
pub assessed_passing_controls: i32,
pub not_assessed_controls: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ControlAssessmentDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_passing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.passing_controls = v.into();
self
}
pub fn set_failing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.failing_controls = v.into();
self
}
pub fn set_assessed_passing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.assessed_passing_controls = v.into();
self
}
pub fn set_not_assessed_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.not_assessed_controls = v.into();
self
}
}
impl wkt::message::Message for ControlAssessmentDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlAssessmentDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FrameworkComplianceSummary {
pub framework: std::string::String,
pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
pub framework_type: crate::model::framework::FrameworkType,
pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
pub framework_categories: std::vec::Vec<crate::model::FrameworkCategory>,
pub framework_display_name: std::string::String,
pub name: std::string::String,
pub major_revision_id: i64,
pub minor_revision_id: i64,
pub target_resource_details: std::vec::Vec<crate::model::TargetResourceDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FrameworkComplianceSummary {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.framework = v.into();
self
}
pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ControlAssessmentDetails>,
{
self.control_assessment_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ControlAssessmentDetails>,
{
self.control_assessment_details = v.map(|x| x.into());
self
}
pub fn set_framework_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
mut self,
v: T,
) -> Self {
self.framework_type = v.into();
self
}
pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudProvider>,
{
use std::iter::Iterator;
self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_framework_categories<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FrameworkCategory>,
{
use std::iter::Iterator;
self.framework_categories = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.framework_display_name = 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_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_id = v.into();
self
}
pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.minor_revision_id = v.into();
self
}
pub fn set_target_resource_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TargetResourceDetails>,
{
use std::iter::Iterator;
self.target_resource_details = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FrameworkComplianceSummary {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkComplianceSummary"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FindingSummary {
pub finding_category: std::string::String,
pub finding_class: crate::model::FindingClass,
pub severity: crate::model::Severity,
pub finding_count: i64,
pub update_time: std::option::Option<wkt::Timestamp>,
pub related_frameworks: std::vec::Vec<std::string::String>,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FindingSummary {
pub fn new() -> Self {
std::default::Default::default()
}
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_finding_class<T: std::convert::Into<crate::model::FindingClass>>(
mut self,
v: T,
) -> Self {
self.finding_class = v.into();
self
}
pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
self.severity = v.into();
self
}
pub fn set_finding_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.finding_count = 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_related_frameworks<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_frameworks = v.into_iter().map(|i| i.into()).collect();
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 FindingSummary {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FindingSummary"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ControlComplianceSummary {
pub control: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub overall_evaluation_state: crate::model::EvaluationState,
pub total_findings_count: i32,
pub compliance_frameworks: std::vec::Vec<std::string::String>,
pub similar_controls: std::vec::Vec<crate::model::SimilarControls>,
pub cloud_control_reports: std::vec::Vec<crate::model::CloudControlReport>,
pub control_responsibility_type: crate::model::RegulatoryControlResponsibilityType,
pub is_fake_control: bool,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ControlComplianceSummary {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.control = 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_overall_evaluation_state<T: std::convert::Into<crate::model::EvaluationState>>(
mut self,
v: T,
) -> Self {
self.overall_evaluation_state = v.into();
self
}
pub fn set_total_findings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_findings_count = v.into();
self
}
pub fn set_compliance_frameworks<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.compliance_frameworks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_similar_controls<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SimilarControls>,
{
use std::iter::Iterator;
self.similar_controls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cloud_control_reports<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CloudControlReport>,
{
use std::iter::Iterator;
self.cloud_control_reports = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_control_responsibility_type<
T: std::convert::Into<crate::model::RegulatoryControlResponsibilityType>,
>(
mut self,
v: T,
) -> Self {
self.control_responsibility_type = v.into();
self
}
pub fn set_is_fake_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.is_fake_control = 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 ControlComplianceSummary {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlComplianceSummary"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudControlReport {
pub cloud_control: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub categories: std::vec::Vec<std::string::String>,
pub similar_controls: std::vec::Vec<crate::model::SimilarControls>,
pub cloud_control_type: crate::model::cloud_control::Type,
pub finding_category: std::string::String,
pub rules: std::vec::Vec<crate::model::Rule>,
pub finding_severity: crate::model::Severity,
pub enforcement_mode: crate::model::EnforcementMode,
pub cloud_control_deployment: std::string::String,
pub major_revision_id: i64,
pub minor_revision_id: i64,
pub framework_major_revision_ids: std::vec::Vec<i64>,
pub assessment_details:
std::option::Option<crate::model::cloud_control_report::AssessmentDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudControlReport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cloud_control = 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_categories<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.categories = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_similar_controls<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SimilarControls>,
{
use std::iter::Iterator;
self.similar_controls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cloud_control_type<T: std::convert::Into<crate::model::cloud_control::Type>>(
mut self,
v: T,
) -> Self {
self.cloud_control_type = 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_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Rule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_finding_severity<T: std::convert::Into<crate::model::Severity>>(
mut self,
v: T,
) -> Self {
self.finding_severity = v.into();
self
}
pub fn set_enforcement_mode<T: std::convert::Into<crate::model::EnforcementMode>>(
mut self,
v: T,
) -> Self {
self.enforcement_mode = v.into();
self
}
pub fn set_cloud_control_deployment<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cloud_control_deployment = v.into();
self
}
pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_id = v.into();
self
}
pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.minor_revision_id = v.into();
self
}
pub fn set_framework_major_revision_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<i64>,
{
use std::iter::Iterator;
self.framework_major_revision_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_assessment_details<
T: std::convert::Into<
std::option::Option<crate::model::cloud_control_report::AssessmentDetails>,
>,
>(
mut self,
v: T,
) -> Self {
self.assessment_details = v.into();
self
}
pub fn manual_cloud_control_assessment_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>>
{
#[allow(unreachable_patterns)]
self.assessment_details.as_ref().and_then(|v| match v {
crate::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_manual_cloud_control_assessment_details<
T: std::convert::Into<std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>>,
>(
mut self,
v: T,
) -> Self {
self.assessment_details = std::option::Option::Some(
crate::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(
v.into()
)
);
self
}
pub fn cloud_control_assessment_details(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CloudControlAssessmentDetails>> {
#[allow(unreachable_patterns)]
self.assessment_details.as_ref().and_then(|v| match v {
crate::model::cloud_control_report::AssessmentDetails::CloudControlAssessmentDetails(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_cloud_control_assessment_details<
T: std::convert::Into<std::boxed::Box<crate::model::CloudControlAssessmentDetails>>,
>(
mut self,
v: T,
) -> Self {
self.assessment_details = std::option::Option::Some(
crate::model::cloud_control_report::AssessmentDetails::CloudControlAssessmentDetails(
v.into(),
),
);
self
}
}
impl wkt::message::Message for CloudControlReport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlReport"
}
}
pub mod cloud_control_report {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AssessmentDetails {
ManualCloudControlAssessmentDetails(
std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>,
),
CloudControlAssessmentDetails(std::boxed::Box<crate::model::CloudControlAssessmentDetails>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManualCloudControlAssessmentDetails {
pub manual_cloud_control_guide: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManualCloudControlAssessmentDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_manual_cloud_control_guide<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.manual_cloud_control_guide = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ManualCloudControlAssessmentDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ManualCloudControlAssessmentDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudControlAssessmentDetails {
pub findings_count: i32,
pub evaluation_state: crate::model::EvaluationState,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudControlAssessmentDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_findings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.findings_count = v.into();
self
}
pub fn set_evaluation_state<T: std::convert::Into<crate::model::EvaluationState>>(
mut self,
v: T,
) -> Self {
self.evaluation_state = v.into();
self
}
}
impl wkt::message::Message for CloudControlAssessmentDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlAssessmentDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SimilarControls {
pub framework: std::string::String,
pub control_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SimilarControls {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.framework = v.into();
self
}
pub fn set_control_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.control_id = v.into();
self
}
}
impl wkt::message::Message for SimilarControls {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.SimilarControls"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AggregatedComplianceReport {
pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
pub report_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AggregatedComplianceReport {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ControlAssessmentDetails>,
{
self.control_assessment_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ControlAssessmentDetails>,
{
self.control_assessment_details = v.map(|x| x.into());
self
}
pub fn set_report_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.report_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_report_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.report_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AggregatedComplianceReport {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregatedComplianceReport"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetResourceDetails {
pub framework_deployment: std::string::String,
pub target_resource_display_name: std::string::String,
pub target_resource: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub major_revision_id: i64,
pub minor_revision_id: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetResourceDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_framework_deployment<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.framework_deployment = v.into();
self
}
pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.target_resource_display_name = v.into();
self
}
pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_resource = 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_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.major_revision_id = v.into();
self
}
pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.minor_revision_id = v.into();
self
}
}
impl wkt::message::Message for TargetResourceDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceDetails"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ComplianceState {
Unspecified,
Compliant,
Violation,
ManualReviewNeeded,
Error,
AuditNotSupported,
UnknownValue(compliance_state::UnknownValue),
}
#[doc(hidden)]
pub mod compliance_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ComplianceState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Compliant => std::option::Option::Some(1),
Self::Violation => std::option::Option::Some(2),
Self::ManualReviewNeeded => std::option::Option::Some(3),
Self::Error => std::option::Option::Some(4),
Self::AuditNotSupported => 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("COMPLIANCE_STATE_UNSPECIFIED"),
Self::Compliant => std::option::Option::Some("COMPLIANT"),
Self::Violation => std::option::Option::Some("VIOLATION"),
Self::ManualReviewNeeded => std::option::Option::Some("MANUAL_REVIEW_NEEDED"),
Self::Error => std::option::Option::Some("ERROR"),
Self::AuditNotSupported => std::option::Option::Some("AUDIT_NOT_SUPPORTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ComplianceState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ComplianceState {
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 ComplianceState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Compliant,
2 => Self::Violation,
3 => Self::ManualReviewNeeded,
4 => Self::Error,
5 => Self::AuditNotSupported,
_ => Self::UnknownValue(compliance_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ComplianceState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPLIANCE_STATE_UNSPECIFIED" => Self::Unspecified,
"COMPLIANT" => Self::Compliant,
"VIOLATION" => Self::Violation,
"MANUAL_REVIEW_NEEDED" => Self::ManualReviewNeeded,
"ERROR" => Self::Error,
"AUDIT_NOT_SUPPORTED" => Self::AuditNotSupported,
_ => Self::UnknownValue(compliance_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ComplianceState {
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::Compliant => serializer.serialize_i32(1),
Self::Violation => serializer.serialize_i32(2),
Self::ManualReviewNeeded => serializer.serialize_i32(3),
Self::Error => serializer.serialize_i32(4),
Self::AuditNotSupported => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ComplianceState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComplianceState>::new(
".google.cloud.cloudsecuritycompliance.v1.ComplianceState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RegulatoryControlResponsibilityType {
Unspecified,
Google,
Customer,
Shared,
UnknownValue(regulatory_control_responsibility_type::UnknownValue),
}
#[doc(hidden)]
pub mod regulatory_control_responsibility_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RegulatoryControlResponsibilityType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Google => std::option::Option::Some(1),
Self::Customer => std::option::Option::Some(2),
Self::Shared => 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("REGULATORY_CONTROL_RESPONSIBILITY_TYPE_UNSPECIFIED")
}
Self::Google => std::option::Option::Some("GOOGLE"),
Self::Customer => std::option::Option::Some("CUSTOMER"),
Self::Shared => std::option::Option::Some("SHARED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RegulatoryControlResponsibilityType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RegulatoryControlResponsibilityType {
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 RegulatoryControlResponsibilityType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Google,
2 => Self::Customer,
3 => Self::Shared,
_ => Self::UnknownValue(regulatory_control_responsibility_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RegulatoryControlResponsibilityType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REGULATORY_CONTROL_RESPONSIBILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
"GOOGLE" => Self::Google,
"CUSTOMER" => Self::Customer,
"SHARED" => Self::Shared,
_ => Self::UnknownValue(regulatory_control_responsibility_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RegulatoryControlResponsibilityType {
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::Google => serializer.serialize_i32(1),
Self::Customer => serializer.serialize_i32(2),
Self::Shared => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RegulatoryControlResponsibilityType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<
RegulatoryControlResponsibilityType,
>::new(
".google.cloud.cloudsecuritycompliance.v1.RegulatoryControlResponsibilityType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EnforcementMode {
Unspecified,
Preventive,
Detective,
Audit,
UnknownValue(enforcement_mode::UnknownValue),
}
#[doc(hidden)]
pub mod enforcement_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EnforcementMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Preventive => std::option::Option::Some(1),
Self::Detective => std::option::Option::Some(2),
Self::Audit => 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("ENFORCEMENT_MODE_UNSPECIFIED"),
Self::Preventive => std::option::Option::Some("PREVENTIVE"),
Self::Detective => std::option::Option::Some("DETECTIVE"),
Self::Audit => std::option::Option::Some("AUDIT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EnforcementMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EnforcementMode {
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 EnforcementMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Preventive,
2 => Self::Detective,
3 => Self::Audit,
_ => Self::UnknownValue(enforcement_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EnforcementMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENFORCEMENT_MODE_UNSPECIFIED" => Self::Unspecified,
"PREVENTIVE" => Self::Preventive,
"DETECTIVE" => Self::Detective,
"AUDIT" => Self::Audit,
_ => Self::UnknownValue(enforcement_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EnforcementMode {
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::Preventive => serializer.serialize_i32(1),
Self::Detective => serializer.serialize_i32(2),
Self::Audit => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EnforcementMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnforcementMode>::new(
".google.cloud.cloudsecuritycompliance.v1.EnforcementMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FrameworkCategory {
Unspecified,
IndustryDefinedStandard,
AssuredWorkloads,
DataSecurity,
GoogleBestPractices,
CustomFramework,
UnknownValue(framework_category::UnknownValue),
}
#[doc(hidden)]
pub mod framework_category {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FrameworkCategory {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::IndustryDefinedStandard => std::option::Option::Some(1),
Self::AssuredWorkloads => std::option::Option::Some(2),
Self::DataSecurity => std::option::Option::Some(3),
Self::GoogleBestPractices => std::option::Option::Some(4),
Self::CustomFramework => 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("FRAMEWORK_CATEGORY_UNSPECIFIED"),
Self::IndustryDefinedStandard => std::option::Option::Some("INDUSTRY_DEFINED_STANDARD"),
Self::AssuredWorkloads => std::option::Option::Some("ASSURED_WORKLOADS"),
Self::DataSecurity => std::option::Option::Some("DATA_SECURITY"),
Self::GoogleBestPractices => std::option::Option::Some("GOOGLE_BEST_PRACTICES"),
Self::CustomFramework => std::option::Option::Some("CUSTOM_FRAMEWORK"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FrameworkCategory {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FrameworkCategory {
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 FrameworkCategory {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::IndustryDefinedStandard,
2 => Self::AssuredWorkloads,
3 => Self::DataSecurity,
4 => Self::GoogleBestPractices,
5 => Self::CustomFramework,
_ => Self::UnknownValue(framework_category::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FrameworkCategory {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FRAMEWORK_CATEGORY_UNSPECIFIED" => Self::Unspecified,
"INDUSTRY_DEFINED_STANDARD" => Self::IndustryDefinedStandard,
"ASSURED_WORKLOADS" => Self::AssuredWorkloads,
"DATA_SECURITY" => Self::DataSecurity,
"GOOGLE_BEST_PRACTICES" => Self::GoogleBestPractices,
"CUSTOM_FRAMEWORK" => Self::CustomFramework,
_ => Self::UnknownValue(framework_category::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FrameworkCategory {
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::IndustryDefinedStandard => serializer.serialize_i32(1),
Self::AssuredWorkloads => serializer.serialize_i32(2),
Self::DataSecurity => serializer.serialize_i32(3),
Self::GoogleBestPractices => serializer.serialize_i32(4),
Self::CustomFramework => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FrameworkCategory {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FrameworkCategory>::new(
".google.cloud.cloudsecuritycompliance.v1.FrameworkCategory",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CloudControlCategory {
Unspecified,
CcCategoryInfrastructure,
CcCategoryArtificialIntelligence,
CcCategoryPhysicalSecurity,
CcCategoryDataSecurity,
CcCategoryNetworkSecurity,
CcCategoryIncidentManagement,
CcCategoryIdentityAndAccessManagement,
CcCategoryEncryption,
CcCategoryLogsManagementAndInfrastructure,
CcCategoryHrAdminAndProcesses,
CcCategoryThirdPartyAndSubProcessorManagement,
CcCategoryLegalAndDisclosures,
CcCategoryVulnerabilityManagement,
CcCategoryPrivacy,
CcCategoryBcdr,
UnknownValue(cloud_control_category::UnknownValue),
}
#[doc(hidden)]
pub mod cloud_control_category {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CloudControlCategory {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CcCategoryInfrastructure => std::option::Option::Some(1),
Self::CcCategoryArtificialIntelligence => std::option::Option::Some(2),
Self::CcCategoryPhysicalSecurity => std::option::Option::Some(3),
Self::CcCategoryDataSecurity => std::option::Option::Some(4),
Self::CcCategoryNetworkSecurity => std::option::Option::Some(5),
Self::CcCategoryIncidentManagement => std::option::Option::Some(6),
Self::CcCategoryIdentityAndAccessManagement => std::option::Option::Some(7),
Self::CcCategoryEncryption => std::option::Option::Some(8),
Self::CcCategoryLogsManagementAndInfrastructure => std::option::Option::Some(9),
Self::CcCategoryHrAdminAndProcesses => std::option::Option::Some(10),
Self::CcCategoryThirdPartyAndSubProcessorManagement => std::option::Option::Some(11),
Self::CcCategoryLegalAndDisclosures => std::option::Option::Some(12),
Self::CcCategoryVulnerabilityManagement => std::option::Option::Some(13),
Self::CcCategoryPrivacy => std::option::Option::Some(14),
Self::CcCategoryBcdr => std::option::Option::Some(15),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CLOUD_CONTROL_CATEGORY_UNSPECIFIED"),
Self::CcCategoryInfrastructure => {
std::option::Option::Some("CC_CATEGORY_INFRASTRUCTURE")
}
Self::CcCategoryArtificialIntelligence => {
std::option::Option::Some("CC_CATEGORY_ARTIFICIAL_INTELLIGENCE")
}
Self::CcCategoryPhysicalSecurity => {
std::option::Option::Some("CC_CATEGORY_PHYSICAL_SECURITY")
}
Self::CcCategoryDataSecurity => std::option::Option::Some("CC_CATEGORY_DATA_SECURITY"),
Self::CcCategoryNetworkSecurity => {
std::option::Option::Some("CC_CATEGORY_NETWORK_SECURITY")
}
Self::CcCategoryIncidentManagement => {
std::option::Option::Some("CC_CATEGORY_INCIDENT_MANAGEMENT")
}
Self::CcCategoryIdentityAndAccessManagement => {
std::option::Option::Some("CC_CATEGORY_IDENTITY_AND_ACCESS_MANAGEMENT")
}
Self::CcCategoryEncryption => std::option::Option::Some("CC_CATEGORY_ENCRYPTION"),
Self::CcCategoryLogsManagementAndInfrastructure => {
std::option::Option::Some("CC_CATEGORY_LOGS_MANAGEMENT_AND_INFRASTRUCTURE")
}
Self::CcCategoryHrAdminAndProcesses => {
std::option::Option::Some("CC_CATEGORY_HR_ADMIN_AND_PROCESSES")
}
Self::CcCategoryThirdPartyAndSubProcessorManagement => {
std::option::Option::Some("CC_CATEGORY_THIRD_PARTY_AND_SUB_PROCESSOR_MANAGEMENT")
}
Self::CcCategoryLegalAndDisclosures => {
std::option::Option::Some("CC_CATEGORY_LEGAL_AND_DISCLOSURES")
}
Self::CcCategoryVulnerabilityManagement => {
std::option::Option::Some("CC_CATEGORY_VULNERABILITY_MANAGEMENT")
}
Self::CcCategoryPrivacy => std::option::Option::Some("CC_CATEGORY_PRIVACY"),
Self::CcCategoryBcdr => std::option::Option::Some("CC_CATEGORY_BCDR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CloudControlCategory {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CloudControlCategory {
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 CloudControlCategory {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CcCategoryInfrastructure,
2 => Self::CcCategoryArtificialIntelligence,
3 => Self::CcCategoryPhysicalSecurity,
4 => Self::CcCategoryDataSecurity,
5 => Self::CcCategoryNetworkSecurity,
6 => Self::CcCategoryIncidentManagement,
7 => Self::CcCategoryIdentityAndAccessManagement,
8 => Self::CcCategoryEncryption,
9 => Self::CcCategoryLogsManagementAndInfrastructure,
10 => Self::CcCategoryHrAdminAndProcesses,
11 => Self::CcCategoryThirdPartyAndSubProcessorManagement,
12 => Self::CcCategoryLegalAndDisclosures,
13 => Self::CcCategoryVulnerabilityManagement,
14 => Self::CcCategoryPrivacy,
15 => Self::CcCategoryBcdr,
_ => Self::UnknownValue(cloud_control_category::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CloudControlCategory {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CLOUD_CONTROL_CATEGORY_UNSPECIFIED" => Self::Unspecified,
"CC_CATEGORY_INFRASTRUCTURE" => Self::CcCategoryInfrastructure,
"CC_CATEGORY_ARTIFICIAL_INTELLIGENCE" => Self::CcCategoryArtificialIntelligence,
"CC_CATEGORY_PHYSICAL_SECURITY" => Self::CcCategoryPhysicalSecurity,
"CC_CATEGORY_DATA_SECURITY" => Self::CcCategoryDataSecurity,
"CC_CATEGORY_NETWORK_SECURITY" => Self::CcCategoryNetworkSecurity,
"CC_CATEGORY_INCIDENT_MANAGEMENT" => Self::CcCategoryIncidentManagement,
"CC_CATEGORY_IDENTITY_AND_ACCESS_MANAGEMENT" => {
Self::CcCategoryIdentityAndAccessManagement
}
"CC_CATEGORY_ENCRYPTION" => Self::CcCategoryEncryption,
"CC_CATEGORY_LOGS_MANAGEMENT_AND_INFRASTRUCTURE" => {
Self::CcCategoryLogsManagementAndInfrastructure
}
"CC_CATEGORY_HR_ADMIN_AND_PROCESSES" => Self::CcCategoryHrAdminAndProcesses,
"CC_CATEGORY_THIRD_PARTY_AND_SUB_PROCESSOR_MANAGEMENT" => {
Self::CcCategoryThirdPartyAndSubProcessorManagement
}
"CC_CATEGORY_LEGAL_AND_DISCLOSURES" => Self::CcCategoryLegalAndDisclosures,
"CC_CATEGORY_VULNERABILITY_MANAGEMENT" => Self::CcCategoryVulnerabilityManagement,
"CC_CATEGORY_PRIVACY" => Self::CcCategoryPrivacy,
"CC_CATEGORY_BCDR" => Self::CcCategoryBcdr,
_ => Self::UnknownValue(cloud_control_category::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CloudControlCategory {
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::CcCategoryInfrastructure => serializer.serialize_i32(1),
Self::CcCategoryArtificialIntelligence => serializer.serialize_i32(2),
Self::CcCategoryPhysicalSecurity => serializer.serialize_i32(3),
Self::CcCategoryDataSecurity => serializer.serialize_i32(4),
Self::CcCategoryNetworkSecurity => serializer.serialize_i32(5),
Self::CcCategoryIncidentManagement => serializer.serialize_i32(6),
Self::CcCategoryIdentityAndAccessManagement => serializer.serialize_i32(7),
Self::CcCategoryEncryption => serializer.serialize_i32(8),
Self::CcCategoryLogsManagementAndInfrastructure => serializer.serialize_i32(9),
Self::CcCategoryHrAdminAndProcesses => serializer.serialize_i32(10),
Self::CcCategoryThirdPartyAndSubProcessorManagement => serializer.serialize_i32(11),
Self::CcCategoryLegalAndDisclosures => serializer.serialize_i32(12),
Self::CcCategoryVulnerabilityManagement => serializer.serialize_i32(13),
Self::CcCategoryPrivacy => serializer.serialize_i32(14),
Self::CcCategoryBcdr => serializer.serialize_i32(15),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CloudControlCategory {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudControlCategory>::new(
".google.cloud.cloudsecuritycompliance.v1.CloudControlCategory",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CloudProvider {
Unspecified,
Aws,
Azure,
Gcp,
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::Aws => std::option::Option::Some(1),
Self::Azure => std::option::Option::Some(2),
Self::Gcp => 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::Aws => std::option::Option::Some("AWS"),
Self::Azure => std::option::Option::Some("AZURE"),
Self::Gcp => std::option::Option::Some("GCP"),
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::Aws,
2 => Self::Azure,
3 => Self::Gcp,
_ => 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,
"AWS" => Self::Aws,
"AZURE" => Self::Azure,
"GCP" => Self::Gcp,
_ => 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::Aws => serializer.serialize_i32(1),
Self::Azure => serializer.serialize_i32(2),
Self::Gcp => 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.cloudsecuritycompliance.v1.CloudProvider",
))
}
}
#[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.cloudsecuritycompliance.v1.Severity",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RuleActionType {
Unspecified,
Preventive,
Detective,
Audit,
UnknownValue(rule_action_type::UnknownValue),
}
#[doc(hidden)]
pub mod rule_action_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RuleActionType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Preventive => std::option::Option::Some(1),
Self::Detective => std::option::Option::Some(2),
Self::Audit => 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("RULE_ACTION_TYPE_UNSPECIFIED"),
Self::Preventive => std::option::Option::Some("RULE_ACTION_TYPE_PREVENTIVE"),
Self::Detective => std::option::Option::Some("RULE_ACTION_TYPE_DETECTIVE"),
Self::Audit => std::option::Option::Some("RULE_ACTION_TYPE_AUDIT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RuleActionType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RuleActionType {
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 RuleActionType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Preventive,
2 => Self::Detective,
3 => Self::Audit,
_ => Self::UnknownValue(rule_action_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RuleActionType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RULE_ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
"RULE_ACTION_TYPE_PREVENTIVE" => Self::Preventive,
"RULE_ACTION_TYPE_DETECTIVE" => Self::Detective,
"RULE_ACTION_TYPE_AUDIT" => Self::Audit,
_ => Self::UnknownValue(rule_action_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RuleActionType {
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::Preventive => serializer.serialize_i32(1),
Self::Detective => serializer.serialize_i32(2),
Self::Audit => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RuleActionType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleActionType>::new(
".google.cloud.cloudsecuritycompliance.v1.RuleActionType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TargetResourceType {
Unspecified,
TargetResourceCrmTypeOrg,
TargetResourceCrmTypeFolder,
TargetResourceCrmTypeProject,
Application,
UnknownValue(target_resource_type::UnknownValue),
}
#[doc(hidden)]
pub mod target_resource_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TargetResourceType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::TargetResourceCrmTypeOrg => std::option::Option::Some(1),
Self::TargetResourceCrmTypeFolder => std::option::Option::Some(2),
Self::TargetResourceCrmTypeProject => std::option::Option::Some(3),
Self::Application => 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("TARGET_RESOURCE_TYPE_UNSPECIFIED"),
Self::TargetResourceCrmTypeOrg => {
std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_ORG")
}
Self::TargetResourceCrmTypeFolder => {
std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_FOLDER")
}
Self::TargetResourceCrmTypeProject => {
std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_PROJECT")
}
Self::Application => std::option::Option::Some("TARGET_RESOURCE_TYPE_APPLICATION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TargetResourceType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TargetResourceType {
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 TargetResourceType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::TargetResourceCrmTypeOrg,
2 => Self::TargetResourceCrmTypeFolder,
3 => Self::TargetResourceCrmTypeProject,
4 => Self::Application,
_ => Self::UnknownValue(target_resource_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TargetResourceType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TARGET_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
"TARGET_RESOURCE_CRM_TYPE_ORG" => Self::TargetResourceCrmTypeOrg,
"TARGET_RESOURCE_CRM_TYPE_FOLDER" => Self::TargetResourceCrmTypeFolder,
"TARGET_RESOURCE_CRM_TYPE_PROJECT" => Self::TargetResourceCrmTypeProject,
"TARGET_RESOURCE_TYPE_APPLICATION" => Self::Application,
_ => Self::UnknownValue(target_resource_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TargetResourceType {
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::TargetResourceCrmTypeOrg => serializer.serialize_i32(1),
Self::TargetResourceCrmTypeFolder => serializer.serialize_i32(2),
Self::TargetResourceCrmTypeProject => serializer.serialize_i32(3),
Self::Application => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TargetResourceType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceType>::new(
".google.cloud.cloudsecuritycompliance.v1.TargetResourceType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DeploymentState {
Unspecified,
Validating,
Creating,
Deleting,
Failed,
Ready,
PartiallyDeployed,
PartiallyDeleted,
UnknownValue(deployment_state::UnknownValue),
}
#[doc(hidden)]
pub mod deployment_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DeploymentState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Validating => std::option::Option::Some(1),
Self::Creating => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::Ready => std::option::Option::Some(5),
Self::PartiallyDeployed => std::option::Option::Some(6),
Self::PartiallyDeleted => 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("DEPLOYMENT_STATE_UNSPECIFIED"),
Self::Validating => std::option::Option::Some("DEPLOYMENT_STATE_VALIDATING"),
Self::Creating => std::option::Option::Some("DEPLOYMENT_STATE_CREATING"),
Self::Deleting => std::option::Option::Some("DEPLOYMENT_STATE_DELETING"),
Self::Failed => std::option::Option::Some("DEPLOYMENT_STATE_FAILED"),
Self::Ready => std::option::Option::Some("DEPLOYMENT_STATE_READY"),
Self::PartiallyDeployed => {
std::option::Option::Some("DEPLOYMENT_STATE_PARTIALLY_DEPLOYED")
}
Self::PartiallyDeleted => {
std::option::Option::Some("DEPLOYMENT_STATE_PARTIALLY_DELETED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DeploymentState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DeploymentState {
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 DeploymentState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Validating,
2 => Self::Creating,
3 => Self::Deleting,
4 => Self::Failed,
5 => Self::Ready,
6 => Self::PartiallyDeployed,
7 => Self::PartiallyDeleted,
_ => Self::UnknownValue(deployment_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DeploymentState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DEPLOYMENT_STATE_UNSPECIFIED" => Self::Unspecified,
"DEPLOYMENT_STATE_VALIDATING" => Self::Validating,
"DEPLOYMENT_STATE_CREATING" => Self::Creating,
"DEPLOYMENT_STATE_DELETING" => Self::Deleting,
"DEPLOYMENT_STATE_FAILED" => Self::Failed,
"DEPLOYMENT_STATE_READY" => Self::Ready,
"DEPLOYMENT_STATE_PARTIALLY_DEPLOYED" => Self::PartiallyDeployed,
"DEPLOYMENT_STATE_PARTIALLY_DELETED" => Self::PartiallyDeleted,
_ => Self::UnknownValue(deployment_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DeploymentState {
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::Validating => serializer.serialize_i32(1),
Self::Creating => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::Ready => serializer.serialize_i32(5),
Self::PartiallyDeployed => serializer.serialize_i32(6),
Self::PartiallyDeleted => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DeploymentState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentState>::new(
".google.cloud.cloudsecuritycompliance.v1.DeploymentState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EvaluationState {
Unspecified,
Passed,
Failed,
NotAssessed,
UnknownValue(evaluation_state::UnknownValue),
}
#[doc(hidden)]
pub mod evaluation_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EvaluationState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Passed => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::NotAssessed => 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("EVALUATION_STATE_UNSPECIFIED"),
Self::Passed => std::option::Option::Some("EVALUATION_STATE_PASSED"),
Self::Failed => std::option::Option::Some("EVALUATION_STATE_FAILED"),
Self::NotAssessed => std::option::Option::Some("EVALUATION_STATE_NOT_ASSESSED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EvaluationState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EvaluationState {
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 EvaluationState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Passed,
2 => Self::Failed,
3 => Self::NotAssessed,
_ => Self::UnknownValue(evaluation_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EvaluationState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EVALUATION_STATE_UNSPECIFIED" => Self::Unspecified,
"EVALUATION_STATE_PASSED" => Self::Passed,
"EVALUATION_STATE_FAILED" => Self::Failed,
"EVALUATION_STATE_NOT_ASSESSED" => Self::NotAssessed,
_ => Self::UnknownValue(evaluation_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EvaluationState {
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::Passed => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::NotAssessed => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EvaluationState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EvaluationState>::new(
".google.cloud.cloudsecuritycompliance.v1.EvaluationState",
))
}
}
#[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.cloudsecuritycompliance.v1.FindingClass",
))
}
}