zio.aws.codepipeline.model.S3Location.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-codepipeline_2.12 Show documentation
Show all versions of zio-aws-codepipeline_2.12 Show documentation
Low-level AWS wrapper for ZIO
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)
}