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

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

package io.github.vigoo.zioaws.elasticbeanstalk.model
import zio.ZIO
import io.github.vigoo.zioaws.elasticbeanstalk.model.primitives.{
  ConfigurationTemplateName,
  DNSCname,
  ApplicationName,
  EnvironmentArn,
  OperationsRole,
  EnvironmentName,
  AbortableOperationInProgress,
  SolutionStackName,
  VersionLabel,
  PlatformArn,
  UpdateDate,
  EnvironmentId,
  Description,
  EndpointURL,
  CreationDate
}
import java.time.Instant
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class UpdateEnvironmentResponse(
    environmentName: Option[EnvironmentName] = None,
    environmentId: Option[EnvironmentId] = None,
    applicationName: Option[ApplicationName] = None,
    versionLabel: Option[VersionLabel] = None,
    solutionStackName: Option[SolutionStackName] = None,
    platformArn: Option[PlatformArn] = None,
    templateName: Option[ConfigurationTemplateName] = None,
    description: Option[Description] = None,
    endpointURL: Option[EndpointURL] = None,
    cname: Option[DNSCname] = None,
    dateCreated: Option[CreationDate] = None,
    dateUpdated: Option[UpdateDate] = None,
    status: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentStatus
    ] = None,
    abortableOperationInProgress: Option[AbortableOperationInProgress] = None,
    health: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealth
    ] = None,
    healthStatus: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealthStatus
    ] = None,
    resources: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentResourcesDescription
    ] = None,
    tier: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentTier
    ] = None,
    environmentLinks: Option[
      Iterable[io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentLink]
    ] = None,
    environmentArn: Option[EnvironmentArn] = None,
    operationsRole: Option[OperationsRole] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.elasticbeanstalk.model.UpdateEnvironmentResponse = {
    import UpdateEnvironmentResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.elasticbeanstalk.model.UpdateEnvironmentResponse
      .builder()
      .optionallyWith(environmentName.map(value => value: java.lang.String))(
        _.environmentName
      )
      .optionallyWith(environmentId.map(value => value: java.lang.String))(
        _.environmentId
      )
      .optionallyWith(applicationName.map(value => value: java.lang.String))(
        _.applicationName
      )
      .optionallyWith(versionLabel.map(value => value: java.lang.String))(
        _.versionLabel
      )
      .optionallyWith(solutionStackName.map(value => value: java.lang.String))(
        _.solutionStackName
      )
      .optionallyWith(platformArn.map(value => value: java.lang.String))(
        _.platformArn
      )
      .optionallyWith(templateName.map(value => value: java.lang.String))(
        _.templateName
      )
      .optionallyWith(description.map(value => value: java.lang.String))(
        _.description
      )
      .optionallyWith(endpointURL.map(value => value: java.lang.String))(
        _.endpointURL
      )
      .optionallyWith(cname.map(value => value: java.lang.String))(_.cname)
      .optionallyWith(dateCreated.map(value => value: Instant))(_.dateCreated)
      .optionallyWith(dateUpdated.map(value => value: Instant))(_.dateUpdated)
      .optionallyWith(status.map(value => value.unwrap))(_.status)
      .optionallyWith(
        abortableOperationInProgress.map(value => value: java.lang.Boolean)
      )(_.abortableOperationInProgress)
      .optionallyWith(health.map(value => value.unwrap))(_.health)
      .optionallyWith(healthStatus.map(value => value.unwrap))(_.healthStatus)
      .optionallyWith(resources.map(value => value.buildAwsValue()))(
        _.resources
      )
      .optionallyWith(tier.map(value => value.buildAwsValue()))(_.tier)
      .optionallyWith(
        environmentLinks.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.environmentLinks)
      .optionallyWith(environmentArn.map(value => value: java.lang.String))(
        _.environmentArn
      )
      .optionallyWith(operationsRole.map(value => value: java.lang.String))(
        _.operationsRole
      )
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.elasticbeanstalk.model.UpdateEnvironmentResponse.ReadOnly =
    io.github.vigoo.zioaws.elasticbeanstalk.model.UpdateEnvironmentResponse
      .wrap(buildAwsValue())
}
object UpdateEnvironmentResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.elasticbeanstalk.model.UpdateEnvironmentResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable
        : io.github.vigoo.zioaws.elasticbeanstalk.model.UpdateEnvironmentResponse =
      io.github.vigoo.zioaws.elasticbeanstalk.model.UpdateEnvironmentResponse(
        environmentNameValue.map(value => value),
        environmentIdValue.map(value => value),
        applicationNameValue.map(value => value),
        versionLabelValue.map(value => value),
        solutionStackNameValue.map(value => value),
        platformArnValue.map(value => value),
        templateNameValue.map(value => value),
        descriptionValue.map(value => value),
        endpointURLValue.map(value => value),
        cnameValue.map(value => value),
        dateCreatedValue.map(value => value),
        dateUpdatedValue.map(value => value),
        statusValue.map(value => value),
        abortableOperationInProgressValue.map(value => value),
        healthValue.map(value => value),
        healthStatusValue.map(value => value),
        resourcesValue.map(value => value.editable),
        tierValue.map(value => value.editable),
        environmentLinksValue.map(value =>
          value.map { item =>
            item.editable
          }
        ),
        environmentArnValue.map(value => value),
        operationsRoleValue.map(value => value)
      )
    def environmentNameValue: Option[EnvironmentName]
    def environmentIdValue: Option[EnvironmentId]
    def applicationNameValue: Option[ApplicationName]
    def versionLabelValue: Option[VersionLabel]
    def solutionStackNameValue: Option[SolutionStackName]
    def platformArnValue: Option[PlatformArn]
    def templateNameValue: Option[ConfigurationTemplateName]
    def descriptionValue: Option[Description]
    def endpointURLValue: Option[EndpointURL]
    def cnameValue: Option[DNSCname]
    def dateCreatedValue: Option[CreationDate]
    def dateUpdatedValue: Option[UpdateDate]
    def statusValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentStatus
    ]
    def abortableOperationInProgressValue: Option[AbortableOperationInProgress]
    def healthValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealth
    ]
    def healthStatusValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealthStatus
    ]
    def resourcesValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentResourcesDescription.ReadOnly
    ]
    def tierValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentTier.ReadOnly
    ]
    def environmentLinksValue: Option[List[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentLink.ReadOnly
    ]]
    def environmentArnValue: Option[EnvironmentArn]
    def operationsRoleValue: Option[OperationsRole]
    def environmentName: ZIO[Any, AwsError, EnvironmentName] =
      AwsError.unwrapOptionField("environmentName", environmentNameValue)
    def environmentId: ZIO[Any, AwsError, EnvironmentId] =
      AwsError.unwrapOptionField("environmentId", environmentIdValue)
    def applicationName: ZIO[Any, AwsError, ApplicationName] =
      AwsError.unwrapOptionField("applicationName", applicationNameValue)
    def versionLabel: ZIO[Any, AwsError, VersionLabel] =
      AwsError.unwrapOptionField("versionLabel", versionLabelValue)
    def solutionStackName: ZIO[Any, AwsError, SolutionStackName] =
      AwsError.unwrapOptionField("solutionStackName", solutionStackNameValue)
    def platformArn: ZIO[Any, AwsError, PlatformArn] =
      AwsError.unwrapOptionField("platformArn", platformArnValue)
    def templateName: ZIO[Any, AwsError, ConfigurationTemplateName] =
      AwsError.unwrapOptionField("templateName", templateNameValue)
    def description: ZIO[Any, AwsError, Description] =
      AwsError.unwrapOptionField("description", descriptionValue)
    def endpointURL: ZIO[Any, AwsError, EndpointURL] =
      AwsError.unwrapOptionField("endpointURL", endpointURLValue)
    def cname: ZIO[Any, AwsError, DNSCname] =
      AwsError.unwrapOptionField("cname", cnameValue)
    def dateCreated: ZIO[Any, AwsError, CreationDate] =
      AwsError.unwrapOptionField("dateCreated", dateCreatedValue)
    def dateUpdated: ZIO[Any, AwsError, UpdateDate] =
      AwsError.unwrapOptionField("dateUpdated", dateUpdatedValue)
    def status: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentStatus
    ] = AwsError.unwrapOptionField("status", statusValue)
    def abortableOperationInProgress
        : ZIO[Any, AwsError, AbortableOperationInProgress] =
      AwsError.unwrapOptionField(
        "abortableOperationInProgress",
        abortableOperationInProgressValue
      )
    def health: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealth
    ] = AwsError.unwrapOptionField("health", healthValue)
    def healthStatus: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealthStatus
    ] = AwsError.unwrapOptionField("healthStatus", healthStatusValue)
    def resources: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentResourcesDescription.ReadOnly
    ] = AwsError.unwrapOptionField("resources", resourcesValue)
    def tier: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentTier.ReadOnly
    ] = AwsError.unwrapOptionField("tier", tierValue)
    def environmentLinks: ZIO[Any, AwsError, List[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentLink.ReadOnly
    ]] = AwsError.unwrapOptionField("environmentLinks", environmentLinksValue)
    def environmentArn: ZIO[Any, AwsError, EnvironmentArn] =
      AwsError.unwrapOptionField("environmentArn", environmentArnValue)
    def operationsRole: ZIO[Any, AwsError, OperationsRole] =
      AwsError.unwrapOptionField("operationsRole", operationsRoleValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.elasticbeanstalk.model.UpdateEnvironmentResponse
  ) extends io.github.vigoo.zioaws.elasticbeanstalk.model.UpdateEnvironmentResponse.ReadOnly {
    override def environmentNameValue: Option[EnvironmentName] =
      scala.Option(impl.environmentName()).map(value => value: EnvironmentName)
    override def environmentIdValue: Option[EnvironmentId] =
      scala.Option(impl.environmentId()).map(value => value: EnvironmentId)
    override def applicationNameValue: Option[ApplicationName] =
      scala.Option(impl.applicationName()).map(value => value: ApplicationName)
    override def versionLabelValue: Option[VersionLabel] =
      scala.Option(impl.versionLabel()).map(value => value: VersionLabel)
    override def solutionStackNameValue: Option[SolutionStackName] = scala
      .Option(impl.solutionStackName())
      .map(value => value: SolutionStackName)
    override def platformArnValue: Option[PlatformArn] =
      scala.Option(impl.platformArn()).map(value => value: PlatformArn)
    override def templateNameValue: Option[ConfigurationTemplateName] = scala
      .Option(impl.templateName())
      .map(value => value: ConfigurationTemplateName)
    override def descriptionValue: Option[Description] =
      scala.Option(impl.description()).map(value => value: Description)
    override def endpointURLValue: Option[EndpointURL] =
      scala.Option(impl.endpointURL()).map(value => value: EndpointURL)
    override def cnameValue: Option[DNSCname] =
      scala.Option(impl.cname()).map(value => value: DNSCname)
    override def dateCreatedValue: Option[CreationDate] =
      scala.Option(impl.dateCreated()).map(value => value: CreationDate)
    override def dateUpdatedValue: Option[UpdateDate] =
      scala.Option(impl.dateUpdated()).map(value => value: UpdateDate)
    override def statusValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentStatus
    ] = scala
      .Option(impl.status())
      .map(value =>
        io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentStatus
          .wrap(value)
      )
    override def abortableOperationInProgressValue
        : Option[AbortableOperationInProgress] = scala
      .Option(impl.abortableOperationInProgress())
      .map(value => value: AbortableOperationInProgress)
    override def healthValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealth
    ] = scala
      .Option(impl.health())
      .map(value =>
        io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealth
          .wrap(value)
      )
    override def healthStatusValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealthStatus
    ] = scala
      .Option(impl.healthStatus())
      .map(value =>
        io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentHealthStatus
          .wrap(value)
      )
    override def resourcesValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentResourcesDescription.ReadOnly
    ] = scala
      .Option(impl.resources())
      .map(value =>
        io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentResourcesDescription
          .wrap(value)
      )
    override def tierValue: Option[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentTier.ReadOnly
    ] = scala
      .Option(impl.tier())
      .map(value =>
        io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentTier
          .wrap(value)
      )
    override def environmentLinksValue: Option[List[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentLink.ReadOnly
    ]] = scala
      .Option(impl.environmentLinks())
      .map(value =>
        value.asScala.map { item =>
          io.github.vigoo.zioaws.elasticbeanstalk.model.EnvironmentLink
            .wrap(item)
        }.toList
      )
    override def environmentArnValue: Option[EnvironmentArn] =
      scala.Option(impl.environmentArn()).map(value => value: EnvironmentArn)
    override def operationsRoleValue: Option[OperationsRole] =
      scala.Option(impl.operationsRole()).map(value => value: OperationsRole)
  }
  def wrap(
      impl: software.amazon.awssdk.services.elasticbeanstalk.model.UpdateEnvironmentResponse
  ): io.github.vigoo.zioaws.elasticbeanstalk.model.UpdateEnvironmentResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy