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

zio.aws.codepipeline.model.S3Location.scala Maven / Gradle / Ivy

The newest version!
package zio.aws.codepipeline.model
import zio.aws.codepipeline.model.primitives.{S3Key, S3Bucket}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class S3Location(
    bucket: Optional[S3Bucket] = Optional.Absent,
    key: Optional[S3Key] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.codepipeline.model.S3Location = {
    import S3Location.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.codepipeline.model.S3Location
      .builder()
      .optionallyWith(
        bucket.map(value => S3Bucket.unwrap(value): java.lang.String)
      )(_.bucket)
      .optionallyWith(key.map(value => S3Key.unwrap(value): java.lang.String))(
        _.key
      )
      .build()
  }
  def asReadOnly: zio.aws.codepipeline.model.S3Location.ReadOnly =
    zio.aws.codepipeline.model.S3Location.wrap(buildAwsValue())
}
object S3Location {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.codepipeline.model.S3Location
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.codepipeline.model.S3Location =
      zio.aws.codepipeline.model
        .S3Location(bucket.map(value => value), key.map(value => value))
    def bucket: Optional[S3Bucket]
    def key: Optional[S3Key]
    def getBucket: ZIO[Any, AwsError, S3Bucket] =
      AwsError.unwrapOptionField("bucket", bucket)
    def getKey: ZIO[Any, AwsError, S3Key] =
      AwsError.unwrapOptionField("key", key)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.codepipeline.model.S3Location
  ) extends zio.aws.codepipeline.model.S3Location.ReadOnly {
    override val bucket: Optional[S3Bucket] = zio.aws.core.internal
      .optionalFromNullable(impl.bucket())
      .map(value => zio.aws.codepipeline.model.primitives.S3Bucket(value))
    override val key: Optional[S3Key] = zio.aws.core.internal
      .optionalFromNullable(impl.key())
      .map(value => zio.aws.codepipeline.model.primitives.S3Key(value))
  }
  def wrap(
      impl: software.amazon.awssdk.services.codepipeline.model.S3Location
  ): zio.aws.codepipeline.model.S3Location.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy