google-cloudevents 0.2.0

Prost/Serde structs for Google CloudEvent types with axum integration
Documentation
// This file is @generated by prost-build.
/// The data within all Firebase test matrix events.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TestMatrixEventData {
    /// Time the test matrix was created.
    #[prost(message, optional, tag = "1")]
    pub create_time: ::core::option::Option<::pbjson_types::Timestamp>,
    /// State of the test matrix.
    #[prost(enumeration = "TestState", tag = "2")]
    pub state: i32,
    /// Code that describes why the test matrix is considered invalid. Only set for
    /// matrices in the INVALID state.
    #[prost(string, tag = "3")]
    pub invalid_matrix_details: ::prost::alloc::string::String,
    /// Outcome summary of the test matrix.
    #[prost(enumeration = "OutcomeSummary", tag = "4")]
    pub outcome_summary: i32,
    /// Locations where test results are stored.
    #[prost(message, optional, tag = "5")]
    pub result_storage: ::core::option::Option<ResultStorage>,
    /// Information provided by the client that created the test matrix.
    #[prost(message, optional, tag = "6")]
    pub client_info: ::core::option::Option<ClientInfo>,
    /// ID of the test matrix this event belongs to.
    #[prost(string, tag = "7")]
    pub test_matrix_id: ::prost::alloc::string::String,
}
/// Information about the client which invoked the test.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientInfo {
    /// Client name, such as "gcloud".
    #[prost(string, tag = "1")]
    pub client: ::prost::alloc::string::String,
    /// Map of detailed information about the client.
    #[prost(map = "string, string", tag = "2")]
    pub details: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// Locations where test results are stored.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResultStorage {
    /// Tool Results history resource containing test results. Format is
    /// `projects/{project_id}/histories/{history_id}`.
    /// See <https://firebase.google.com/docs/test-lab/reference/toolresults/rest>
    /// for more information.
    #[prost(string, tag = "1")]
    pub tool_results_history: ::prost::alloc::string::String,
    /// Tool Results execution resource containing test results. Format is
    /// `projects/{project_id}/histories/{history_id}/executions/{execution_id}`.
    /// Optional, can be omitted in erroneous test states.
    /// See <https://firebase.google.com/docs/test-lab/reference/toolresults/rest>
    /// for more information.
    #[prost(string, tag = "2")]
    pub tool_results_execution: ::prost::alloc::string::String,
    /// URI to the test results in the Firebase Web Console.
    #[prost(string, tag = "3")]
    pub results_uri: ::prost::alloc::string::String,
    /// Location in Google Cloud Storage where test results are written to.
    /// In the form "gs://bucket/path/to/somewhere".
    #[prost(string, tag = "4")]
    pub gcs_path: ::prost::alloc::string::String,
}
/// Possible test states for a test matrix.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TestState {
    /// The default value. This value is used if the state is omitted.
    Unspecified = 0,
    /// The test matrix is being validated.
    Validating = 1,
    /// The test matrix is waiting for resources to become available.
    Pending = 2,
    /// The test matrix has completed normally.
    Finished = 3,
    /// The test matrix has completed because of an infrastructure failure.
    Error = 4,
    /// The test matrix was not run because the provided inputs are not valid.
    Invalid = 5,
}
impl TestState {
    /// 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 {
            Self::Unspecified => "TEST_STATE_UNSPECIFIED",
            Self::Validating => "VALIDATING",
            Self::Pending => "PENDING",
            Self::Finished => "FINISHED",
            Self::Error => "ERROR",
            Self::Invalid => "INVALID",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TEST_STATE_UNSPECIFIED" => Some(Self::Unspecified),
            "VALIDATING" => Some(Self::Validating),
            "PENDING" => Some(Self::Pending),
            "FINISHED" => Some(Self::Finished),
            "ERROR" => Some(Self::Error),
            "INVALID" => Some(Self::Invalid),
            _ => None,
        }
    }
}
/// Outcome summary for a finished test matrix.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OutcomeSummary {
    /// The default value. This value is used if the state is omitted.
    Unspecified = 0,
    /// The test matrix run was successful, for instance:
    /// - All test cases passed.
    /// - No crash of the application under test was detected.
    Success = 1,
    /// A run failed, for instance:
    /// - One or more test case failed.
    /// - A test timed out.
    /// - The application under test crashed.
    Failure = 2,
    /// Something unexpected happened. The test run should still be considered
    /// unsuccessful but this is likely a transient problem and re-running the
    /// test might be successful.
    Inconclusive = 3,
    /// All tests were skipped.
    Skipped = 4,
}
impl OutcomeSummary {
    /// 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 {
            Self::Unspecified => "OUTCOME_SUMMARY_UNSPECIFIED",
            Self::Success => "SUCCESS",
            Self::Failure => "FAILURE",
            Self::Inconclusive => "INCONCLUSIVE",
            Self::Skipped => "SKIPPED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "OUTCOME_SUMMARY_UNSPECIFIED" => Some(Self::Unspecified),
            "SUCCESS" => Some(Self::Success),
            "FAILURE" => Some(Self::Failure),
            "INCONCLUSIVE" => Some(Self::Inconclusive),
            "SKIPPED" => Some(Self::Skipped),
            _ => None,
        }
    }
}
/// The CloudEvent raised when a TestMatrix is completed
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TestMatrixCompletedEvent {
    /// The data associated with the event.
    #[prost(message, optional, tag = "1")]
    pub data: ::core::option::Option<TestMatrixEventData>,
}