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

io.atlassian.aws.s3.ContentLocation.scala Maven / Gradle / Ivy

There is a newer version: 8.0.3
Show newest version
package io.atlassian.aws
package s3

import argonaut._, Argonaut._

case class ContentLocation(bucket: Bucket, key: S3Key)

object ContentLocation {
  implicit val ContentLocationEncodeJson: EncodeJson[ContentLocation] =
    jencode2L { (c: ContentLocation) => (c.bucket.unwrap, c.key.unwrap) }("bucket", "key")

  implicit val ContentLocationDecodeJson: DecodeJson[ContentLocation] =
    DecodeJson { c =>
      for {
        bucket <- (c --\ "bucket").as[String]
        key <- (c --\ "key").as[String]
      } yield ContentLocation(Bucket(bucket), S3Key(key))
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy