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

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

There is a newer version: 0.4.5-v2-20240905
Show newest version
package googleapis.bigquery

import io.circe._
import io.circe.syntax._

final case class JobConfigurationExtract(
    /** [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
      */
    destinationUris: Option[List[String]] = None,
    /** Whether to use logical types when extracting to AVRO format. Not applicable when extracting models.
      */
    useAvroLogicalTypes: Option[Boolean] = None,
    /** A reference to the model being exported.
      */
    sourceModel: Option[ModelReference] = None,
    /** Optional. Whether to print out a header row in the results. Default is true. Not applicable when extracting models.
      */
    printHeader: Option[Boolean] = None,
    /** Optional. The compression type to use for exported files. Possible values include DEFLATE, GZIP, NONE, SNAPPY, and ZSTD. The default value is NONE. Not all compression formats are support for all file formats. DEFLATE is only supported for Avro. ZSTD is only supported for Parquet. Not applicable when extracting models.
      */
    compression: Option[String] = None,
    /** Optional. When extracting data in CSV format, this defines the delimiter to use between fields in the exported data. Default is ','. Not applicable when extracting models.
      */
    fieldDelimiter: Option[String] = None,
    /** [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted table should be written.
      */
    destinationUri: Option[String] = None,
    /** Optional. The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON, PARQUET, or AVRO for tables and ML_TF_SAVED_MODEL or ML_XGBOOST_BOOSTER for models. The default value for tables is CSV. Tables with nested or repeated fields cannot be exported as CSV. The default value for models is ML_TF_SAVED_MODEL.
      */
    destinationFormat: Option[String] = None,
    /** Optional. Model extract options only applicable when extracting models.
      */
    modelExtractOptions: Option[ModelExtractOptions] = None,
    /** A reference to the table being exported.
      */
    sourceTable: Option[TableReference] = None,
)
object JobConfigurationExtract {
  implicit val encoder: Encoder[
    JobConfigurationExtract
  ] = Encoder.instance { x =>
    Json.obj(
      "destinationUris" := x.destinationUris,
      "useAvroLogicalTypes" := x.useAvroLogicalTypes,
      "sourceModel" := x.sourceModel,
      "printHeader" := x.printHeader,
      "compression" := x.compression,
      "fieldDelimiter" := x.fieldDelimiter,
      "destinationUri" := x.destinationUri,
      "destinationFormat"
        := x.destinationFormat,
      "modelExtractOptions" := x.modelExtractOptions,
      "sourceTable" := x.sourceTable,
    )
  }
  implicit val decoder: Decoder[
    JobConfigurationExtract
  ] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[List[String]]]("destinationUris")
      v1 <- c.get[Option[Boolean]]("useAvroLogicalTypes")
      v2 <- c.get[Option[ModelReference]]("sourceModel")
      v3 <- c.get[Option[Boolean]]("printHeader")
      v4 <- c.get[Option[String]]("compression")
      v5 <- c.get[Option[String]]("fieldDelimiter")
      v6 <- c.get[Option[String]]("destinationUri")
      v7 <- c.get[Option[String]]("destinationFormat")
      v8 <- c.get[Option[ModelExtractOptions]]("modelExtractOptions")
      v9 <- c.get[Option[TableReference]]("sourceTable")
    } yield JobConfigurationExtract(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy