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 QueryResponse {
    /// Whether the query result was fetched from the query cache.
    #[serde(rename = "cacheHit", skip_serializing_if = "Option::is_none")]
    pub cache_hit: Option<bool>,
    #[serde(rename = "dmlStats", skip_serializing_if = "Option::is_none")]
    pub dml_stats: Option<Box<crate::google_rest_apis::bigquery_v2::models::DmlStatistics>>,
    /// [Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful.
    #[serde(rename = "errors", skip_serializing_if = "Option::is_none")]
    pub errors: Option<Vec<crate::google_rest_apis::bigquery_v2::models::ErrorProto>>,
    /// Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
    #[serde(rename = "jobComplete", skip_serializing_if = "Option::is_none")]
    pub job_complete: Option<bool>,
    #[serde(rename = "jobReference", skip_serializing_if = "Option::is_none")]
    pub job_reference: Option<Box<crate::google_rest_apis::bigquery_v2::models::JobReference>>,
    /// The resource type.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
    #[serde(rename = "numDmlAffectedRows", skip_serializing_if = "Option::is_none")]
    pub num_dml_affected_rows: Option<String>,
    /// A token used for paging results.
    #[serde(rename = "pageToken", skip_serializing_if = "Option::is_none")]
    pub page_token: Option<String>,
    /// An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above.
    #[serde(rename = "rows", skip_serializing_if = "Option::is_none")]
    pub rows: Option<Vec<crate::google_rest_apis::bigquery_v2::models::TableRow>>,
    #[serde(rename = "schema", skip_serializing_if = "Option::is_none")]
    pub schema: Option<Box<crate::google_rest_apis::bigquery_v2::models::TableSchema>>,
    #[serde(rename = "sessionInfo", skip_serializing_if = "Option::is_none")]
    pub session_info: Option<Box<crate::google_rest_apis::bigquery_v2::models::SessionInfo>>,
    /// The total number of bytes processed for this query. If this query was a dry run, this is the number of bytes that would be processed if the query were run.
    #[serde(
        rename = "totalBytesProcessed",
        skip_serializing_if = "Option::is_none"
    )]
    pub total_bytes_processed: Option<String>,
    /// The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results.
    #[serde(rename = "totalRows", skip_serializing_if = "Option::is_none")]
    pub total_rows: Option<String>,
}

impl QueryResponse {
    pub fn new() -> QueryResponse {
        QueryResponse {
            cache_hit: None,
            dml_stats: None,
            errors: None,
            job_complete: None,
            job_reference: None,
            kind: None,
            num_dml_affected_rows: None,
            page_token: None,
            rows: None,
            schema: None,
            session_info: None,
            total_bytes_processed: None,
            total_rows: None,
        }
    }
}
