scala.googleapis.storage.HmacKeyMetadata.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class HmacKeyMetadata(
/** HTTP 1.1 Entity tag for the HMAC key.
*/
etag: Option[String] = None,
/** The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED.
*/
state: Option[String] = None,
/** The ID of the HMAC Key.
*/
accessId: Option[String] = None,
/** The creation time of the HMAC key in RFC 3339 format.
*/
timeCreated: Option[String] = None,
/** Project ID owning the service account to which the key authenticates.
*/
projectId: Option[String] = None,
/** The link to this resource.
*/
selfLink: Option[String] = None,
/** The ID of the HMAC key, including the Project ID and the Access ID.
*/
id: Option[String] = None,
/** The last modification time of the HMAC key metadata in RFC 3339 format.
*/
updated: Option[String] = None,
/** The email address of the key's associated service account.
*/
serviceAccountEmail: Option[String] = None,
/** The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.
*/
kind: Option[String] = None,
)
object HmacKeyMetadata {
implicit val encoder: Encoder[HmacKeyMetadata] = Encoder.instance { x =>
Json.obj(
"etag" := x.etag,
"state" := x.state,
"accessId" := x.accessId,
"timeCreated" := x.timeCreated,
"projectId" := x.projectId,
"selfLink" :=
x.selfLink,
"id" := x.id,
"updated" := x.updated,
"serviceAccountEmail" :=
x.serviceAccountEmail,
"kind" := x.kind,
)
}
implicit val decoder: Decoder[HmacKeyMetadata] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("etag")
v1 <- c.get[Option[String]]("state")
v2 <- c.get[Option[String]]("accessId")
v3 <- c.get[Option[String]]("timeCreated")
v4 <- c.get[Option[String]]("projectId")
v5 <- c.get[Option[String]]("selfLink")
v6 <- c.get[Option[String]]("id")
v7 <- c.get[Option[String]]("updated")
v8 <- c.get[Option[String]]("serviceAccountEmail")
v9 <- c.get[Option[String]]("kind")
} yield HmacKeyMetadata(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9)
}
}