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

scala.googleapis.storage.ObjectAccessControl.scala Maven / Gradle / Ivy

The newest version!
package googleapis.storage

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

final case class ObjectAccessControl(
    /** The ID for the entity, if any.
      */
    entityId: Option[String] = None,
    /** HTTP 1.1 Entity tag for the access-control entry.
      */
    etag: Option[String] = None,
    /** The email address associated with the entity, if any.
      */
    email: Option[String] = None,
    /** The access permission for the entity.
      */
    role: Option[String] = None,
    /** The content generation of the object, if applied to an object.
      */
    generation: Option[Long] = None,
    /** The domain associated with the entity, if any.
      */
    domain: Option[String] = None,
    /** The link to this access-control entry.
      */
    selfLink: Option[String] = None,
    /** The name of the object, if applied to an object.
      */
    `object`: Option[String] = None,
    /** The ID of the access-control entry.
      */
    id: Option[String] = None,
    /** The entity holding the permission, in one of the following forms:
      * - user-userId
      * - user-email
      * - group-groupId
      * - group-email
      * - domain-domain
      * - project-team-projectId
      * - allUsers
      * - allAuthenticatedUsers Examples:
      * - The user [email protected] would be [email protected].
      * - The group [email protected] would be [email protected].
      * - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.
      */
    entity: Option[String] = None,
    /** The name of the bucket.
      */
    bucket: Option[String] = None,
    /** The kind of item this is. For object access control entries, this is always storage#objectAccessControl.
      */
    kind: Option[String] = None,
    /** The project team associated with the entity, if any.
      */
    projectTeam: Option[ObjectAccessControlProjectTeam] = None,
)
object ObjectAccessControl {
  implicit val encoder: Encoder[ObjectAccessControl] = Encoder.instance { x =>
    Json.obj(
      "entityId" := x.entityId,
      "etag" := x.etag,
      "email" := x.email,
      "role" :=
        x.role,
      "generation" := x.generation,
      "domain" := x.domain,
      "selfLink" :=
        x.selfLink,
      "object" := x.`object`,
      "id" := x.id,
      "entity" := x.entity,
      "bucket" := x.bucket,
      "kind" := x.kind,
      "projectTeam" := x.projectTeam,
    )
  }
  implicit val decoder: Decoder[ObjectAccessControl] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[String]]("entityId")
      v1 <- c.get[Option[String]]("etag")
      v2 <- c.get[Option[String]]("email")
      v3 <- c.get[Option[String]]("role")
      v4 <- c.get[Option[Long]]("generation")
      v5 <- c.get[Option[String]]("domain")
      v6 <- c.get[Option[String]]("selfLink")
      v7 <- c.get[Option[String]]("object")
      v8 <- c.get[Option[String]]("id")
      v9 <- c.get[Option[String]]("entity")
      v10 <- c.get[Option[String]]("bucket")
      v11 <- c.get[Option[String]]("kind")
      v12 <- c.get[Option[ObjectAccessControlProjectTeam]]("projectTeam")
    } yield ObjectAccessControl(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12)

  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy