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

io.github.vigoo.zioaws.elasticbeanstalk.model.Deployment.scala Maven / Gradle / Ivy

package io.github.vigoo.zioaws.elasticbeanstalk.model
import zio.ZIO
import io.github.vigoo.zioaws.elasticbeanstalk.model.primitives.{
  DeploymentTimestamp,
  NullableLong
}
import java.time.Instant
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class Deployment(
    versionLabel: Option[String] = None,
    deploymentId: Option[NullableLong] = None,
    status: Option[String] = None,
    deploymentTime: Option[DeploymentTimestamp] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.elasticbeanstalk.model.Deployment = {
    import Deployment.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.elasticbeanstalk.model.Deployment
      .builder()
      .optionallyWith(versionLabel.map(value => value: java.lang.String))(
        _.versionLabel
      )
      .optionallyWith(deploymentId.map(value => value: java.lang.Long))(
        _.deploymentId
      )
      .optionallyWith(status.map(value => value: java.lang.String))(_.status)
      .optionallyWith(deploymentTime.map(value => value: Instant))(
        _.deploymentTime
      )
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.elasticbeanstalk.model.Deployment.ReadOnly =
    io.github.vigoo.zioaws.elasticbeanstalk.model.Deployment
      .wrap(buildAwsValue())
}
object Deployment {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.elasticbeanstalk.model.Deployment
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable: io.github.vigoo.zioaws.elasticbeanstalk.model.Deployment =
      io.github.vigoo.zioaws.elasticbeanstalk.model.Deployment(
        versionLabelValue.map(value => value),
        deploymentIdValue.map(value => value),
        statusValue.map(value => value),
        deploymentTimeValue.map(value => value)
      )
    def versionLabelValue: Option[String]
    def deploymentIdValue: Option[NullableLong]
    def statusValue: Option[String]
    def deploymentTimeValue: Option[DeploymentTimestamp]
    def versionLabel: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("versionLabel", versionLabelValue)
    def deploymentId: ZIO[Any, AwsError, NullableLong] =
      AwsError.unwrapOptionField("deploymentId", deploymentIdValue)
    def status: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("status", statusValue)
    def deploymentTime: ZIO[Any, AwsError, DeploymentTimestamp] =
      AwsError.unwrapOptionField("deploymentTime", deploymentTimeValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.elasticbeanstalk.model.Deployment
  ) extends io.github.vigoo.zioaws.elasticbeanstalk.model.Deployment.ReadOnly {
    override def versionLabelValue: Option[String] =
      scala.Option(impl.versionLabel()).map(value => value: String)
    override def deploymentIdValue: Option[NullableLong] =
      scala.Option(impl.deploymentId()).map(value => value: NullableLong)
    override def statusValue: Option[String] =
      scala.Option(impl.status()).map(value => value: String)
    override def deploymentTimeValue: Option[DeploymentTimestamp] = scala
      .Option(impl.deploymentTime())
      .map(value => value: DeploymentTimestamp)
  }
  def wrap(
      impl: software.amazon.awssdk.services.elasticbeanstalk.model.Deployment
  ): io.github.vigoo.zioaws.elasticbeanstalk.model.Deployment.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy