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

scala.googleapis.bigquery.TableDataInsertAllRequest.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 TableDataInsertAllRequest(
    /** Optional. Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values as errors.
      */
    ignoreUnknownValues: Option[Boolean] = None,
    /** Optional. Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any invalid rows exist.
      */
    skipInvalidRows: Option[Boolean] = None,
    /** Optional. If specified, treats the destination table as a base template, and inserts the rows into an instance table named "{destination}{templateSuffix}". BigQuery will manage creation of the instance table, using the schema of the base template table. See https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates tables.
      */
    templateSuffix: Option[String] = None,
    /** Optional. The resource type of the response. The value is not checked at the backend. Historically, it has been set to "bigquery#tableDataInsertAllRequest" but you are not required to set it.
      */
    kind: Option[String] = None,
    /** Optional. Unique request trace id. Used for debugging purposes only. It is case-sensitive, limited to up to 36 ASCII characters. A UUID is recommended.
      */
    traceId: Option[String] = None,
    rows: Option[List[TableDataInsertAllRequestRow]] = None,
)
object TableDataInsertAllRequest {
  implicit val encoder: Encoder[
    TableDataInsertAllRequest
  ] = Encoder.instance { x =>
    Json.obj(
      "ignoreUnknownValues" := x.ignoreUnknownValues,
      "skipInvalidRows" := x.skipInvalidRows,
      "templateSuffix" := x.templateSuffix,
      "kind" := x.kind,
      "traceId" := x.traceId,
      "rows" := x.rows,
    )
  }
  implicit val decoder: Decoder[
    TableDataInsertAllRequest
  ] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[Boolean]]("ignoreUnknownValues")
      v1 <- c.get[Option[Boolean]]("skipInvalidRows")
      v2 <- c.get[Option[String]]("templateSuffix")
      v3 <- c.get[Option[String]]("kind")
      v4 <- c.get[Option[String]]("traceId")
      v5 <- c.get[Option[List[TableDataInsertAllRequestRow]]]("rows")
    } yield TableDataInsertAllRequest(v0, v1, v2, v3, v4, v5)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy