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

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

The newest version!
package googleapis.storage

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

final case class BucketAccessControl(
    /** 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 domain associated with the entity, if any.
      */
    domain: Option[String] = None,
    /** The link to this access-control entry.
      */
    selfLink: 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 bucket access control entries, this is always storage#bucketAccessControl.
      */
    kind: Option[String] = None,
    /** The project team associated with the entity, if any.
      */
    projectTeam: Option[BucketAccessControlProjectTeam] = None,
)
object BucketAccessControl {
  implicit val encoder: Encoder[BucketAccessControl] = Encoder.instance { x =>
    Json.obj(
      "entityId" := x.entityId,
      "etag" := x.etag,
      "email" := x.email,
      "role" :=
        x.role,
      "domain" := x.domain,
      "selfLink" := x.selfLink,
      "id" := x.id,
      "entity" := x.entity,
      "bucket" := x.bucket,
      "kind" := x.kind,
      "projectTeam" := x.projectTeam,
    )
  }
  implicit val decoder: Decoder[BucketAccessControl] = 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[String]]("domain")
      v5 <- c.get[Option[String]]("selfLink")
      v6 <- c.get[Option[String]]("id")
      v7 <- c.get[Option[String]]("entity")
      v8 <- c.get[Option[String]]("bucket")
      v9 <- c.get[Option[String]]("kind")
      v10 <- c.get[Option[BucketAccessControlProjectTeam]]("projectTeam")
    } yield BucketAccessControl(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10)

  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy