gcloud-sdk 0.30.0

Async Google gRPC/REST APIs and the client implementation hiding complexity of GCP authentication based on Tonic middleware and Reqwest.
Documentation
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
                                      */

use crate::google_rest_apis::bigquery_v2::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Table {
    #[serde(rename = "cloneDefinition", skip_serializing_if = "Option::is_none")]
    pub clone_definition: Option<Box<models::CloneDefinition>>,
    #[serde(rename = "clustering", skip_serializing_if = "Option::is_none")]
    pub clustering: Option<Box<models::Clustering>>,
    /// [Output-only] The time when this table was created, in milliseconds since the epoch.
    #[serde(rename = "creationTime", skip_serializing_if = "Option::is_none")]
    pub creation_time: Option<String>,
    /// [Output-only] The default collation of the table.
    #[serde(rename = "defaultCollation", skip_serializing_if = "Option::is_none")]
    pub default_collation: Option<String>,
    /// [Optional] A user-friendly description of this table.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(
        rename = "encryptionConfiguration",
        skip_serializing_if = "Option::is_none"
    )]
    pub encryption_configuration: Option<Box<models::EncryptionConfiguration>>,
    /// [Output-only] A hash of the table metadata. Used to ensure there were no concurrent modifications to the resource when attempting an update. Not guaranteed to change when the table contents or the fields numRows, numBytes, numLongTermBytes or lastModifiedTime change.
    #[serde(rename = "etag", skip_serializing_if = "Option::is_none")]
    pub etag: Option<String>,
    /// [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed. The defaultTableExpirationMs property of the encapsulating dataset can be used to set a default expirationTime on newly created tables.
    #[serde(rename = "expirationTime", skip_serializing_if = "Option::is_none")]
    pub expiration_time: Option<String>,
    #[serde(
        rename = "externalDataConfiguration",
        skip_serializing_if = "Option::is_none"
    )]
    pub external_data_configuration: Option<Box<models::ExternalDataConfiguration>>,
    /// [Optional] A descriptive name for this table.
    #[serde(rename = "friendlyName", skip_serializing_if = "Option::is_none")]
    pub friendly_name: Option<String>,
    /// [Output-only] An opaque ID uniquely identifying the table.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// [Output-only] The type of the resource.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// The labels associated with this table. You can use these to organize and group your tables. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<std::collections::HashMap<String, String>>,
    /// [Output-only] The time when this table was last modified, in milliseconds since the epoch.
    #[serde(rename = "lastModifiedTime", skip_serializing_if = "Option::is_none")]
    pub last_modified_time: Option<String>,
    /// [Output-only] The geographic location where the table resides. This value is inherited from the dataset.
    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,
    #[serde(rename = "materializedView", skip_serializing_if = "Option::is_none")]
    pub materialized_view: Option<Box<models::MaterializedViewDefinition>>,
    /// [Optional] Max staleness of data that could be returned when table or materialized view is queried (formatted as Google SQL Interval type).
    #[serde(rename = "maxStaleness", skip_serializing_if = "Option::is_none")]
    pub max_staleness: Option<String>,
    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
    pub model: Option<Box<models::ModelDefinition>>,
    /// [Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
    #[serde(rename = "numBytes", skip_serializing_if = "Option::is_none")]
    pub num_bytes: Option<String>,
    /// [Output-only] The number of bytes in the table that are considered \"long-term storage\".
    #[serde(rename = "numLongTermBytes", skip_serializing_if = "Option::is_none")]
    pub num_long_term_bytes: Option<String>,
    /// [Output-only] [TrustedTester] The physical size of this table in bytes, excluding any data in the streaming buffer. This includes compression and storage used for time travel.
    #[serde(rename = "numPhysicalBytes", skip_serializing_if = "Option::is_none")]
    pub num_physical_bytes: Option<String>,
    /// [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
    #[serde(rename = "numRows", skip_serializing_if = "Option::is_none")]
    pub num_rows: Option<String>,
    /// [Output-only] Number of logical bytes that are less than 90 days old.
    #[serde(
        rename = "num_active_logical_bytes",
        skip_serializing_if = "Option::is_none"
    )]
    pub num_active_logical_bytes: Option<String>,
    /// [Output-only] Number of physical bytes less than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
    #[serde(
        rename = "num_active_physical_bytes",
        skip_serializing_if = "Option::is_none"
    )]
    pub num_active_physical_bytes: Option<String>,
    /// [Output-only] Number of logical bytes that are more than 90 days old.
    #[serde(
        rename = "num_long_term_logical_bytes",
        skip_serializing_if = "Option::is_none"
    )]
    pub num_long_term_logical_bytes: Option<String>,
    /// [Output-only] Number of physical bytes more than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
    #[serde(
        rename = "num_long_term_physical_bytes",
        skip_serializing_if = "Option::is_none"
    )]
    pub num_long_term_physical_bytes: Option<String>,
    /// [Output-only] The number of partitions present in the table or materialized view. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
    #[serde(rename = "num_partitions", skip_serializing_if = "Option::is_none")]
    pub num_partitions: Option<String>,
    /// [Output-only] Number of physical bytes used by time travel storage (deleted or changed data). This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
    #[serde(
        rename = "num_time_travel_physical_bytes",
        skip_serializing_if = "Option::is_none"
    )]
    pub num_time_travel_physical_bytes: Option<String>,
    /// [Output-only] Total number of logical bytes in the table or materialized view.
    #[serde(
        rename = "num_total_logical_bytes",
        skip_serializing_if = "Option::is_none"
    )]
    pub num_total_logical_bytes: Option<String>,
    /// [Output-only] The physical size of this table in bytes. This also includes storage used for time travel. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
    #[serde(
        rename = "num_total_physical_bytes",
        skip_serializing_if = "Option::is_none"
    )]
    pub num_total_physical_bytes: Option<String>,
    #[serde(rename = "rangePartitioning", skip_serializing_if = "Option::is_none")]
    pub range_partitioning: Option<Box<models::RangePartitioning>>,
    /// [Optional] If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified.
    #[serde(
        rename = "requirePartitionFilter",
        skip_serializing_if = "Option::is_none"
    )]
    pub require_partition_filter: Option<bool>,
    #[serde(rename = "schema", skip_serializing_if = "Option::is_none")]
    pub schema: Option<Box<models::TableSchema>>,
    /// [Output-only] A URL that can be used to access this resource again.
    #[serde(rename = "selfLink", skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[serde(rename = "snapshotDefinition", skip_serializing_if = "Option::is_none")]
    pub snapshot_definition: Option<Box<models::SnapshotDefinition>>,
    #[serde(rename = "streamingBuffer", skip_serializing_if = "Option::is_none")]
    pub streaming_buffer: Option<Box<models::Streamingbuffer>>,
    #[serde(rename = "tableReference", skip_serializing_if = "Option::is_none")]
    pub table_reference: Option<Box<models::TableReference>>,
    #[serde(rename = "timePartitioning", skip_serializing_if = "Option::is_none")]
    pub time_partitioning: Option<Box<models::TimePartitioning>>,
    /// [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. SNAPSHOT: An immutable, read-only table that is a copy of another table. [TrustedTester] MATERIALIZED_VIEW: SQL query whose result is persisted. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    #[serde(rename = "view", skip_serializing_if = "Option::is_none")]
    pub view: Option<Box<models::ViewDefinition>>,
}

impl Table {
    pub fn new() -> Table {
        Table {
            clone_definition: None,
            clustering: None,
            creation_time: None,
            default_collation: None,
            description: None,
            encryption_configuration: None,
            etag: None,
            expiration_time: None,
            external_data_configuration: None,
            friendly_name: None,
            id: None,
            kind: None,
            labels: None,
            last_modified_time: None,
            location: None,
            materialized_view: None,
            max_staleness: None,
            model: None,
            num_bytes: None,
            num_long_term_bytes: None,
            num_physical_bytes: None,
            num_rows: None,
            num_active_logical_bytes: None,
            num_active_physical_bytes: None,
            num_long_term_logical_bytes: None,
            num_long_term_physical_bytes: None,
            num_partitions: None,
            num_time_travel_physical_bytes: None,
            num_total_logical_bytes: None,
            num_total_physical_bytes: None,
            range_partitioning: None,
            require_partition_filter: None,
            schema: None,
            self_link: None,
            snapshot_definition: None,
            streaming_buffer: None,
            table_reference: None,
            time_partitioning: None,
            r#type: None,
            view: None,
        }
    }
}