use serde::{Deserialize, Serialize}; /*
                                      * BigQuery API
                                      *
                                      * A data platform for customers to create, manage, share and query data.
                                      *
                                      * The version of the OpenAPI document: v2
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct JobStatistics {
    /// [TrustedTester] [Output-only] Job progress (0.0 -> 1.0) for LOAD and EXTRACT jobs.
    #[serde(rename = "completionRatio", skip_serializing_if = "Option::is_none")]
    pub completion_ratio: Option<f64>,
    #[serde(rename = "copy", skip_serializing_if = "Option::is_none")]
    pub copy: Option<Box<crate::google_rest_apis::bigquery_v2::models::JobStatistics5>>,
    /// [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
    #[serde(rename = "creationTime", skip_serializing_if = "Option::is_none")]
    pub creation_time: Option<String>,
    #[serde(
        rename = "dataMaskingStatistics",
        skip_serializing_if = "Option::is_none"
    )]
    pub data_masking_statistics:
        Option<Box<crate::google_rest_apis::bigquery_v2::models::DataMaskingStatistics>>,
    /// [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state.
    #[serde(rename = "endTime", skip_serializing_if = "Option::is_none")]
    pub end_time: Option<String>,
    #[serde(rename = "extract", skip_serializing_if = "Option::is_none")]
    pub extract: Option<Box<crate::google_rest_apis::bigquery_v2::models::JobStatistics4>>,
    #[serde(rename = "load", skip_serializing_if = "Option::is_none")]
    pub load: Option<Box<crate::google_rest_apis::bigquery_v2::models::JobStatistics3>>,
    /// [Output-only] Number of child jobs executed.
    #[serde(rename = "numChildJobs", skip_serializing_if = "Option::is_none")]
    pub num_child_jobs: Option<String>,
    /// [Output-only] If this is a child job, the id of the parent.
    #[serde(rename = "parentJobId", skip_serializing_if = "Option::is_none")]
    pub parent_job_id: Option<String>,
    #[serde(rename = "query", skip_serializing_if = "Option::is_none")]
    pub query: Option<Box<crate::google_rest_apis::bigquery_v2::models::JobStatistics2>>,
    /// [Output-only] Quotas which delayed this job's start time.
    #[serde(rename = "quotaDeferments", skip_serializing_if = "Option::is_none")]
    pub quota_deferments: Option<Vec<String>>,
    /// [Output-only] Job resource usage breakdown by reservation.
    #[serde(rename = "reservationUsage", skip_serializing_if = "Option::is_none")]
    pub reservation_usage: Option<
        Vec<crate::google_rest_apis::bigquery_v2::models::JobStatisticsReservationUsageInner>,
    >,
    /// [Output-only] Name of the primary reservation assigned to this job. Note that this could be different than reservations reported in the reservation usage field if parent reservations were used to execute this job.
    #[serde(rename = "reservation_id", skip_serializing_if = "Option::is_none")]
    pub reservation_id: Option<String>,
    #[serde(
        rename = "rowLevelSecurityStatistics",
        skip_serializing_if = "Option::is_none"
    )]
    pub row_level_security_statistics:
        Option<Box<crate::google_rest_apis::bigquery_v2::models::RowLevelSecurityStatistics>>,
    #[serde(rename = "scriptStatistics", skip_serializing_if = "Option::is_none")]
    pub script_statistics:
        Option<Box<crate::google_rest_apis::bigquery_v2::models::ScriptStatistics>>,
    #[serde(rename = "sessionInfo", skip_serializing_if = "Option::is_none")]
    pub session_info: Option<Box<crate::google_rest_apis::bigquery_v2::models::SessionInfo>>,
    /// [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE.
    #[serde(rename = "startTime", skip_serializing_if = "Option::is_none")]
    pub start_time: Option<String>,
    /// [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
    #[serde(
        rename = "totalBytesProcessed",
        skip_serializing_if = "Option::is_none"
    )]
    pub total_bytes_processed: Option<String>,
    /// [Output-only] Slot-milliseconds for the job.
    #[serde(rename = "totalSlotMs", skip_serializing_if = "Option::is_none")]
    pub total_slot_ms: Option<String>,
    #[serde(rename = "transactionInfo", skip_serializing_if = "Option::is_none")]
    pub transaction_info:
        Option<Box<crate::google_rest_apis::bigquery_v2::models::TransactionInfo>>,
}

impl JobStatistics {
    pub fn new() -> JobStatistics {
        JobStatistics {
            completion_ratio: None,
            copy: None,
            creation_time: None,
            data_masking_statistics: None,
            end_time: None,
            extract: None,
            load: None,
            num_child_jobs: None,
            parent_job_id: None,
            query: None,
            quota_deferments: None,
            reservation_usage: None,
            reservation_id: None,
            row_level_security_statistics: None,
            script_statistics: None,
            session_info: None,
            start_time: None,
            total_bytes_processed: None,
            total_slot_ms: None,
            transaction_info: None,
        }
    }
}
