google-api-proto 1.710.0

This library generated from googleapis/googleapis using tonic-build.
// This file is @generated by prost-build.
/// Logged event discussing an abuse finding on the monitored resource.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AbuseEvent {
    /// REQUIRED Correlates to the abuse finding causing the notification.
    #[prost(enumeration = "abuse_event::DetectionType", tag = "1")]
    pub detection_type: i32,
    /// REQUIRED Explains the meaning of the detection_type.
    #[prost(string, tag = "2")]
    pub reason: ::prost::alloc::string::String,
    /// REQUIRED Correlates to the action taken on the monitored resource.
    #[prost(enumeration = "abuse_event::ActionType", tag = "3")]
    pub action: i32,
    /// Contains the umbrella link for remediation after an abuse notification.
    #[prost(string, tag = "7")]
    pub remediation_link: ::prost::alloc::string::String,
    /// REQUIRED Contains addiional metadata about the detected abuse event.
    #[prost(oneof = "abuse_event::EventType", tags = "4, 5, 6, 8, 9")]
    pub event_type: ::core::option::Option<abuse_event::EventType>,
}
/// Nested message and enum types in `AbuseEvent`.
pub mod abuse_event {
    /// Indicates the type of abuse detected on the monitored resource.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum DetectionType {
        /// Default/unspecified abuse detection type.
        Unspecified = 0,
        /// The monitored resource is used to mine cryptocurrencies.
        CryptoMining = 1,
        /// The monitored resource's credentials have accidentally been leaked on the
        /// internet.
        LeakedCredentials = 2,
        /// The monitored resource is used for phishing attacks.
        Phishing = 3,
        /// The monitored resource is associated with content that is infected or
        /// infects users with malicious software.
        Malware = 4,
        /// No abuse is detected on the monitored resource, but its abuse state may
        /// have been updated.
        NoAbuse = 5,
    }
    impl DetectionType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                DetectionType::Unspecified => "DETECTION_TYPE_UNSPECIFIED",
                DetectionType::CryptoMining => "CRYPTO_MINING",
                DetectionType::LeakedCredentials => "LEAKED_CREDENTIALS",
                DetectionType::Phishing => "PHISHING",
                DetectionType::Malware => "MALWARE",
                DetectionType::NoAbuse => "NO_ABUSE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "DETECTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "CRYPTO_MINING" => Some(Self::CryptoMining),
                "LEAKED_CREDENTIALS" => Some(Self::LeakedCredentials),
                "PHISHING" => Some(Self::Phishing),
                "MALWARE" => Some(Self::Malware),
                "NO_ABUSE" => Some(Self::NoAbuse),
                _ => None,
            }
        }
    }
    /// Indicates any action taken on the monitored resource due to abuse
    /// detection.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum ActionType {
        /// The monitored resource state is unspecified.
        Unspecified = 0,
        /// The owner of the monitored resource needs to be notified about a finding.
        Notify = 1,
        /// The associated cloud project has been suspended.
        ProjectSuspension = 2,
        /// The monitored resource has been reinstated.
        Reinstate = 3,
        /// The owner of the monitored resource needs to be warned about abusive
        /// behavior. This notification could lead to future enforcements if remedial
        /// actions are not taken. This action should not be confused with NOTIFY.
        Warn = 4,
        /// The resource (eg: VM) has been suspended.
        ResourceSuspension = 5,
    }
    impl ActionType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                ActionType::Unspecified => "ACTION_TYPE_UNSPECIFIED",
                ActionType::Notify => "NOTIFY",
                ActionType::ProjectSuspension => "PROJECT_SUSPENSION",
                ActionType::Reinstate => "REINSTATE",
                ActionType::Warn => "WARN",
                ActionType::ResourceSuspension => "RESOURCE_SUSPENSION",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "ACTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "NOTIFY" => Some(Self::Notify),
                "PROJECT_SUSPENSION" => Some(Self::ProjectSuspension),
                "REINSTATE" => Some(Self::Reinstate),
                "WARN" => Some(Self::Warn),
                "RESOURCE_SUSPENSION" => Some(Self::ResourceSuspension),
                _ => None,
            }
        }
    }
    /// REQUIRED Contains addiional metadata about the detected abuse event.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum EventType {
        /// Information about a cryptocurrency mining event observed on the monitored
        /// resource.
        #[prost(message, tag = "4")]
        CryptoMiningEvent(super::CryptoMiningEvent),
        /// Information about the leaked client credentials observed on the monitored
        /// resource.
        #[prost(message, tag = "5")]
        LeakedCredentialEvent(super::LeakedCredentialEvent),
        /// Information about the phishing/malware URI(s) associated with the
        /// monitored resource.
        #[prost(message, tag = "6")]
        HarmfulContentEvent(super::HarmfulContentEvent),
        /// Information about the reinstatement issued on the monitored resource.
        #[prost(message, tag = "8")]
        ReinstatementEvent(super::ReinstatementEvent),
        /// Information about the escalation of enforcement action on the monitored
        /// resource.
        #[prost(message, tag = "9")]
        DecisionEscalationEvent(super::DecisionEscalationEvent),
    }
}
/// Information about a cryptocurrency mining event observed on the monitored
/// resource.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CryptoMiningEvent {
    /// VM and zone in which cryptocurrency mining occurred.
    /// Format: projects/{project}/zones/{zone}/instances/{instance}
    #[prost(string, repeated, tag = "1")]
    pub vm_resource: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Detected start time of the cryptocurrency mining.
    #[prost(message, optional, tag = "2")]
    pub detected_mining_start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Detected end time of the cryptocurrency mining.
    #[prost(message, optional, tag = "3")]
    pub detected_mining_end_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Information about the leaked client credentials observed on the monitored
/// resource.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeakedCredentialEvent {
    /// URI where the client credentials were found.
    #[prost(string, tag = "3")]
    pub detected_uri: ::prost::alloc::string::String,
    /// Indicates the type of credential leaked.
    #[prost(oneof = "leaked_credential_event::CredentialType", tags = "1, 2")]
    pub credential_type: ::core::option::Option<leaked_credential_event::CredentialType>,
}
/// Nested message and enum types in `LeakedCredentialEvent`.
pub mod leaked_credential_event {
    /// Indicates the type of credential leaked.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum CredentialType {
        /// Information about leaked service accounts.
        #[prost(message, tag = "1")]
        ServiceAccountCredential(super::ServiceAccountCredential),
        /// Information about leaked API keys.
        #[prost(message, tag = "2")]
        ApiKeyCredential(super::ApiKeyCredential),
    }
}
/// Information about leaked service accounts.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceAccountCredential {
    /// Service account whose credentials were leaked.
    #[prost(string, tag = "1")]
    pub service_account: ::prost::alloc::string::String,
    /// Private Key ID for any leaked keys.
    #[prost(string, tag = "2")]
    pub key_id: ::prost::alloc::string::String,
}
/// Information about leaked API keys.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApiKeyCredential {
    /// API key that was leaked.
    #[prost(string, tag = "1")]
    pub api_key: ::prost::alloc::string::String,
}
/// Information about the phishing/malware URIs associated with the monitored
/// resource.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HarmfulContentEvent {
    /// URIs associated with the phishing/malware finding.
    #[prost(string, repeated, tag = "1")]
    pub uri: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Information about the reinstatement issued on the monitored resource.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ReinstatementEvent {}
/// Information about the escalation of enforcement action on the monitored
/// resource. Eg: Used for repeat offenders.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DecisionEscalationEvent {}