scala.googleapis.storage.HmacKey.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class HmacKey(
/** The kind of item this is. For HMAC keys, this is always storage#hmacKey.
*/
kind: Option[String] = None,
/** Key metadata.
*/
metadata: Option[HmacKeyMetadata] = None,
/** HMAC secret key material.
*/
secret: Option[String] = None,
)
object HmacKey {
implicit val encoder: Encoder[HmacKey] = Encoder.instance { x =>
Json.obj("kind" := x.kind, "metadata" := x.metadata, "secret" := x.secret)
}
implicit val decoder: Decoder[HmacKey] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("kind")
v1 <- c.get[Option[HmacKeyMetadata]]("metadata")
v2 <- c.get[Option[String]]("secret")
} yield HmacKey(v0, v1, v2)
}
}