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

zio.aws.costoptimizationhub.model.AccountEnrollmentStatus.scala Maven / Gradle / Ivy

package zio.aws.costoptimizationhub.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.costoptimizationhub.model.primitives.{Timestamp, AccountId}
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import scala.jdk.CollectionConverters.*
final case class AccountEnrollmentStatus(
    accountId: Optional[AccountId] = Optional.Absent,
    status: Optional[zio.aws.costoptimizationhub.model.EnrollmentStatus] =
      Optional.Absent,
    lastUpdatedTimestamp: Optional[Timestamp] = Optional.Absent,
    createdTimestamp: Optional[Timestamp] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.costoptimizationhub.model.AccountEnrollmentStatus = {
    import AccountEnrollmentStatus.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.costoptimizationhub.model.AccountEnrollmentStatus
      .builder()
      .optionallyWith(
        accountId.map(value => AccountId.unwrap(value): java.lang.String)
      )(_.accountId)
      .optionallyWith(status.map(value => value.unwrap))(_.status)
      .optionallyWith(
        lastUpdatedTimestamp.map(value => Timestamp.unwrap(value): Instant)
      )(_.lastUpdatedTimestamp)
      .optionallyWith(
        createdTimestamp.map(value => Timestamp.unwrap(value): Instant)
      )(_.createdTimestamp)
      .build()
  }
  def asReadOnly
      : zio.aws.costoptimizationhub.model.AccountEnrollmentStatus.ReadOnly =
    zio.aws.costoptimizationhub.model.AccountEnrollmentStatus
      .wrap(buildAwsValue())
}
object AccountEnrollmentStatus {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.costoptimizationhub.model.AccountEnrollmentStatus
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.costoptimizationhub.model.AccountEnrollmentStatus =
      zio.aws.costoptimizationhub.model.AccountEnrollmentStatus(
        accountId.map(value => value),
        status.map(value => value),
        lastUpdatedTimestamp.map(value => value),
        createdTimestamp.map(value => value)
      )
    def accountId: Optional[AccountId]
    def status: Optional[zio.aws.costoptimizationhub.model.EnrollmentStatus]
    def lastUpdatedTimestamp: Optional[Timestamp]
    def createdTimestamp: Optional[Timestamp]
    def getAccountId: ZIO[Any, AwsError, AccountId] =
      AwsError.unwrapOptionField("accountId", accountId)
    def getStatus: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.EnrollmentStatus
    ] = AwsError.unwrapOptionField("status", status)
    def getLastUpdatedTimestamp: ZIO[Any, AwsError, Timestamp] =
      AwsError.unwrapOptionField("lastUpdatedTimestamp", lastUpdatedTimestamp)
    def getCreatedTimestamp: ZIO[Any, AwsError, Timestamp] =
      AwsError.unwrapOptionField("createdTimestamp", createdTimestamp)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.AccountEnrollmentStatus
  ) extends zio.aws.costoptimizationhub.model.AccountEnrollmentStatus.ReadOnly {
    override val accountId: Optional[AccountId] = zio.aws.core.internal
      .optionalFromNullable(impl.accountId())
      .map(value =>
        zio.aws.costoptimizationhub.model.primitives.AccountId(value)
      )
    override val status
        : Optional[zio.aws.costoptimizationhub.model.EnrollmentStatus] =
      zio.aws.core.internal
        .optionalFromNullable(impl.status())
        .map(value =>
          zio.aws.costoptimizationhub.model.EnrollmentStatus.wrap(value)
        )
    override val lastUpdatedTimestamp: Optional[Timestamp] =
      zio.aws.core.internal
        .optionalFromNullable(impl.lastUpdatedTimestamp())
        .map(value =>
          zio.aws.costoptimizationhub.model.primitives.Timestamp(value)
        )
    override val createdTimestamp: Optional[Timestamp] = zio.aws.core.internal
      .optionalFromNullable(impl.createdTimestamp())
      .map(value =>
        zio.aws.costoptimizationhub.model.primitives.Timestamp(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.AccountEnrollmentStatus
  ): zio.aws.costoptimizationhub.model.AccountEnrollmentStatus.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy