All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.googleapis.bigquery.Table.scala Maven / Gradle / Ivy

There is a newer version: 0.6.1-v2-20241111
Show newest version
package googleapis.bigquery

import JsonInstances._
import io.circe._
import io.circe.syntax._
import scala.concurrent.duration.FiniteDuration

final case class Table(
    /** Custom encryption configuration (e.g., Cloud KMS keys).
      */
    encryptionConfiguration: Option[EncryptionConfiguration] = None,
    /** Optional. Table replication info for table created `AS REPLICA` DDL like: `CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv`
      */
    tableReplicationInfo: Option[TableReplicationInfo] = None,
    /** Optional. Options defining open source compatible table.
      */
    externalCatalogTableOptions: Option[ExternalCatalogTableOptions] = None,
    /** Output only. A hash of this resource.
      */
    etag: Option[String] = None,
    /** Output only. The time when this table was last modified, in milliseconds since the epoch.
      */
    lastModifiedTime: Option[BigInt] = None,
    /** Required. Reference describing the ID of this table.
      */
    tableReference: Option[TableReference] = None,
    /** Output only. The physical size of this table in bytes. This includes storage used for time travel.
      */
    numPhysicalBytes: Option[Long] = None,
    /** Output only. The materialized view status.
      */
    materializedViewStatus: Option[MaterializedViewStatus] = None,
    /** 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.
      */
    expirationTime: Option[FiniteDuration] = None,
    /** Output only. The geographic location where the table resides. This value is inherited from the dataset.
      */
    location: Option[String] = None,
    /** Optional. Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
      */
    externalDataConfiguration: Option[ExternalDataConfiguration] = None,
    /** Deprecated.
      */
    model: Option[ModelDefinition] = None,
    /** Optional. A user-friendly description of this table.
      */
    description: Option[String] = None,
    /** Optional. Output only. Table references of all replicas currently active on the table.
      */
    replicas: Option[List[TableReference]] = None,
    /** Optional. Tables Primary Key and Foreign Key information
      */
    tableConstraints: Option[TableConstraints] = None,
    /** 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.
      */
    numTimeTravelPhysicalBytes: Option[Long] = None,
    /** Optional. If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified.
      */
    requirePartitionFilter: Option[Boolean] = None,
    /** Optional. A descriptive name for this table.
      */
    friendlyName: Option[String] = None,
    /** Optional. Output only. Restriction config for table. If set, restrict certain accesses on the table based on the config. See [Data egress](https://cloud.google.com/bigquery/docs/analytics-hub-introduction#data_egress) for more details.
      */
    restrictions: Option[RestrictionConfig] = None,
    /** Output only. A URL that can be used to access this resource again.
      */
    selfLink: Option[String] = None,
    /** [Optional] The tags associated with this table. Tag keys are globally unique. See additional information on [tags](https://cloud.google.com/iam/docs/tags-access-control#definitions). An object containing a list of "key": value pairs. The key is the namespaced friendly name of the tag key, e.g. "12345/environment" where 12345 is parent id. The value is the friendly short name of the tag value, e.g. "production".
      */
    resourceTags: Option[Map[String, String]] = None,
    /** Output only. Number of logical bytes that are more than 90 days old.
      */
    numLongTermLogicalBytes: Option[Long] = None,
    /** Output only. Number of logical bytes that are less than 90 days old.
      */
    numActiveLogicalBytes: Option[Long] = None,
    /** Output only. Number of physical bytes used by current live data storage. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
      */
    numCurrentPhysicalBytes: Option[Long] = None,
    /** 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.
      */
    numActivePhysicalBytes: Option[Long] = None,
    /** Output only. An opaque ID uniquely identifying the table.
      */
    id: Option[String] = None,
    /** Output only. Total number of logical bytes in the table or materialized view.
      */
    numTotalLogicalBytes: Option[Long] = None,
    /** Optional. Describes the schema of this table.
      */
    schema: Option[TableSchema] = None,
    /** If specified, configures time-based partitioning for this table.
      */
    timePartitioning: Option[TimePartitioning] = None,
    /** 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.
      */
    labels: Option[Map[String, String]] = None,
    /** 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.
      */
    numLongTermPhysicalBytes: Option[Long] = None,
    /** Optional. Defines the default rounding mode specification of new decimal fields (NUMERIC OR BIGNUMERIC) in the table. During table creation or update, if a decimal field is added to this table without an explicit rounding mode specified, then the field inherits the table default rounding mode. Changing this field doesn't affect existing fields.
      */
    defaultRoundingMode: Option[TableDefaultRoundingMode] = None,
    /** Output only. The number of logical bytes in the table that are considered "long-term storage".
      */
    numLongTermBytes: Option[Long] = None,
    /** Output only. Contains information about the snapshot. This value is set via snapshot creation.
      */
    snapshotDefinition: Option[SnapshotDefinition] = None,
    /** 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.
      */
    numTotalPhysicalBytes: Option[Long] = None,
    /** Optional. Defines the default collation specification of new STRING fields in the table. During table creation or update, if a STRING field is added to this table without explicit collation specified, then the table inherits the table default collation. A change to this field affects only fields added afterwards, and does not alter the existing fields. The following values are supported:
      * 'und:ci': undetermined locale, case insensitive.
      * '': empty string. Default to case-sensitive behavior.
      */
    defaultCollation: Option[String] = None,
    /** The type of resource ID.
      */
    kind: Option[String] = None,
    /** Optional. The maximum staleness of data that could be returned when the table (or stale MV) is queried. Staleness encoded as a string encoding of sql IntervalValue type.
      */
    maxStaleness: Option[String] = None,
    /** 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.
      * `EXTERNAL`: A table that references data stored in an external storage system, such as Google Cloud Storage.
      * `MATERIALIZED_VIEW`: A precomputed view defined by a SQL query.
      * `SNAPSHOT`: An immutable BigQuery table that preserves the contents of a base table at a particular time. See additional information on [table snapshots](https://cloud.google.com/bigquery/docs/table-snapshots-intro). The default value is `TABLE`.
      */
    `type`: Option[String] = None,
    /** Output only. Contains information about the clone. This value is set via the clone operation.
      */
    cloneDefinition: Option[CloneDefinition] = None,
    /** Output only. The size of this table in logical bytes, excluding any data in the streaming buffer.
      */
    numBytes: Option[Long] = None,
    /** Optional. The partition information for all table formats, including managed partitioned tables, hive partitioned tables, iceberg partitioned, and metastore partitioned tables. This field is only populated for metastore partitioned tables. For other table formats, this is an output only field.
      */
    partitionDefinition: Option[PartitioningDefinition] = None,
    /** Optional. Specifies the configuration of a BigLake managed table.
      */
    biglakeConfiguration: Option[BigLakeConfiguration] = None,
    /** Output only. Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
      */
    streamingBuffer: Option[Streamingbuffer] = None,
    /** 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.
      */
    numPartitions: Option[Long] = None,
    /** Output only. The number of rows of data in this table, excluding any data in the streaming buffer.
      */
    numRows: Option[BigInt] = None,
    /** Optional. The materialized view definition.
      */
    materializedView: Option[MaterializedViewDefinition] = None,
    /** If specified, configures range partitioning for this table.
      */
    rangePartitioning: Option[RangePartitioning] = None,
    /** Output only. The time when this table was created, in milliseconds since the epoch.
      */
    creationTime: Option[FiniteDuration] = None,
    /** Optional. The view definition.
      */
    view: Option[ViewDefinition] = None,
    /** Clustering specification for the table. Must be specified with time-based partitioning, data in the table will be first partitioned and subsequently clustered.
      */
    clustering: Option[Clustering] = None,
)
object Table {
  implicit val encoder: Encoder[Table] = Encoder.instance { x =>
    Json.obj(
      "encryptionConfiguration" := x.encryptionConfiguration,
      "tableReplicationInfo" := x.tableReplicationInfo,
      "externalCatalogTableOptions" := x.externalCatalogTableOptions,
      "etag" :=
        x.etag,
      "lastModifiedTime" := x.lastModifiedTime,
      "tableReference" := x.tableReference,
      "numPhysicalBytes" := x.numPhysicalBytes,
      "materializedViewStatus" := x.materializedViewStatus,
      "expirationTime" :=
        x.expirationTime,
      "location" := x.location,
      "externalDataConfiguration" :=
        x.externalDataConfiguration,
      "model" := x.model,
      "description" := x.description,
      "replicas" := x.replicas,
      "tableConstraints" := x.tableConstraints,
      "numTimeTravelPhysicalBytes" := x.numTimeTravelPhysicalBytes,
      "requirePartitionFilter" := x.requirePartitionFilter,
      "friendlyName" := x.friendlyName,
      "restrictions"
        := x.restrictions,
      "selfLink" := x.selfLink,
      "resourceTags" := x.resourceTags,
      "numLongTermLogicalBytes" := x.numLongTermLogicalBytes,
      "numActiveLogicalBytes" := x.numActiveLogicalBytes,
      "numCurrentPhysicalBytes" := x.numCurrentPhysicalBytes,
      "numActivePhysicalBytes" := x.numActivePhysicalBytes,
      "id" := x.id,
      "numTotalLogicalBytes" := x.numTotalLogicalBytes,
      "schema" := x.schema,
      "timePartitioning" := x.timePartitioning,
      "labels" := x.labels,
      "numLongTermPhysicalBytes" := x.numLongTermPhysicalBytes,
      "defaultRoundingMode" := x.defaultRoundingMode,
      "numLongTermBytes" := x.numLongTermBytes,
      "snapshotDefinition" := x.snapshotDefinition,
      "numTotalPhysicalBytes" := x.numTotalPhysicalBytes,
      "defaultCollation" :=
        x.defaultCollation,
      "kind" := x.kind,
      "maxStaleness" := x.maxStaleness,
      "type" := x.`type`,
      "cloneDefinition" := x.cloneDefinition,
      "numBytes" :=
        x.numBytes,
      "partitionDefinition" := x.partitionDefinition,
      "biglakeConfiguration" := x.biglakeConfiguration,
      "streamingBuffer" := x.streamingBuffer,
      "numPartitions" := x.numPartitions,
      "numRows" := x.numRows,
      "materializedView" := x.materializedView,
      "rangePartitioning" :=
        x.rangePartitioning,
      "creationTime" := x.creationTime,
      "view" := x.view,
      "clustering" := x.clustering,
    )
  }
  implicit val decoder: Decoder[Table] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[EncryptionConfiguration]]("encryptionConfiguration")
      v1 <- c.get[Option[TableReplicationInfo]]("tableReplicationInfo")
      v2 <- c.get[Option[ExternalCatalogTableOptions]]("externalCatalogTableOptions")
      v3 <- c.get[Option[String]]("etag")
      v4 <- c.get[Option[BigInt]]("lastModifiedTime")
      v5 <- c.get[Option[TableReference]]("tableReference")
      v6 <- c.get[Option[Long]]("numPhysicalBytes")
      v7 <- c.get[Option[MaterializedViewStatus]]("materializedViewStatus")
      v8 <- c.get[Option[FiniteDuration]]("expirationTime")
      v9 <- c.get[Option[String]]("location")
      v10 <- c.get[Option[ExternalDataConfiguration]]("externalDataConfiguration")
      v11 <- c.get[Option[ModelDefinition]]("model")
      v12 <- c.get[Option[String]]("description")
      v13 <- c.get[Option[List[TableReference]]]("replicas")
      v14 <- c.get[Option[TableConstraints]]("tableConstraints")
      v15 <- c.get[Option[Long]]("numTimeTravelPhysicalBytes")
      v16 <- c.get[Option[Boolean]]("requirePartitionFilter")
      v17 <- c.get[Option[String]]("friendlyName")
      v18 <- c.get[Option[RestrictionConfig]]("restrictions")
      v19 <- c.get[Option[String]]("selfLink")
      v20 <- c.get[Option[Map[String, String]]]("resourceTags")
      v21 <- c.get[Option[Long]]("numLongTermLogicalBytes")
      v22 <- c.get[Option[Long]]("numActiveLogicalBytes")
      v23 <- c.get[Option[Long]]("numCurrentPhysicalBytes")
      v24 <- c.get[Option[Long]]("numActivePhysicalBytes")
      v25 <- c.get[Option[String]]("id")
      v26 <- c.get[Option[Long]]("numTotalLogicalBytes")
      v27 <- c.get[Option[TableSchema]]("schema")
      v28 <- c.get[Option[TimePartitioning]]("timePartitioning")
      v29 <- c.get[Option[Map[String, String]]]("labels")
      v30 <- c.get[Option[Long]]("numLongTermPhysicalBytes")
      v31 <- c.get[Option[TableDefaultRoundingMode]]("defaultRoundingMode")
      v32 <- c.get[Option[Long]]("numLongTermBytes")
      v33 <- c.get[Option[SnapshotDefinition]]("snapshotDefinition")
      v34 <- c.get[Option[Long]]("numTotalPhysicalBytes")
      v35 <- c.get[Option[String]]("defaultCollation")
      v36 <- c.get[Option[String]]("kind")
      v37 <- c.get[Option[String]]("maxStaleness")
      v38 <- c.get[Option[String]]("type")
      v39 <- c.get[Option[CloneDefinition]]("cloneDefinition")
      v40 <- c.get[Option[Long]]("numBytes")
      v41 <- c.get[Option[PartitioningDefinition]]("partitionDefinition")
      v42 <- c.get[Option[BigLakeConfiguration]]("biglakeConfiguration")
      v43 <- c.get[Option[Streamingbuffer]]("streamingBuffer")
      v44 <- c.get[Option[Long]]("numPartitions")
      v45 <- c.get[Option[BigInt]]("numRows")
      v46 <- c.get[Option[MaterializedViewDefinition]]("materializedView")
      v47 <- c.get[Option[RangePartitioning]]("rangePartitioning")
      v48 <- c.get[Option[FiniteDuration]]("creationTime")
      v49 <- c.get[Option[ViewDefinition]]("view")
      v50 <- c.get[Option[Clustering]]("clustering")
    } yield Table(
      v0,
      v1,
      v2,
      v3,
      v4,
      v5,
      v6,
      v7,
      v8,
      v9,
      v10,
      v11,
      v12,
      v13,
      v14,
      v15,
      v16,
      v17,
      v18,
      v19,
      v20,
      v21,
      v22,
      v23,
      v24,
      v25,
      v26,
      v27,
      v28,
      v29,
      v30,
      v31,
      v32,
      v33,
      v34,
      v35,
      v36,
      v37,
      v38,
      v39,
      v40,
      v41,
      v42,
      v43,
      v44,
      v45,
      v46,
      v47,
      v48,
      v49,
      v50,
    )
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy