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

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

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

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

final case class ProjectList(
    /** A hash of the page of results.
      */
    etag: Option[String] = None,
    /** Use this token to request the next page of results.
      */
    nextPageToken: Option[String] = None,
    /** Projects to which the user has at least READ access.
      */
    projects: Option[List[ProjectListProject]] = None,
    /** The resource type of the response.
      */
    kind: Option[String] = None,
    /** The total number of projects in the page. A wrapper is used here because the field should still be in the response when the value is 0.
      */
    totalItems: Option[Int] = None,
)
object ProjectList {
  implicit val encoder: Encoder[ProjectList] = Encoder.instance { x =>
    Json.obj(
      "etag" := x.etag,
      "nextPageToken" := x.nextPageToken,
      "projects" := x.projects,
      "kind" := x.kind,
      "totalItems" := x.totalItems,
    )
  }
  implicit val decoder: Decoder[ProjectList] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[String]]("etag")
      v1 <- c.get[Option[String]]("nextPageToken")
      v2 <- c.get[Option[List[ProjectListProject]]]("projects")
      v3 <- c.get[Option[String]]("kind")
      v4 <- c.get[Option[Int]]("totalItems")
    } yield ProjectList(v0, v1, v2, v3, v4)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy