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

zio.aws.snowdevicemanagement.model.InstanceSummary.scala Maven / Gradle / Ivy

The newest version!
package zio.aws.snowdevicemanagement.model
import zio.aws.snowdevicemanagement.model.primitives.Timestamp
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import scala.jdk.CollectionConverters._
final case class InstanceSummary(
    instance: Optional[zio.aws.snowdevicemanagement.model.Instance] =
      Optional.Absent,
    lastUpdatedAt: Optional[Timestamp] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.snowdevicemanagement.model.InstanceSummary = {
    import InstanceSummary.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.snowdevicemanagement.model.InstanceSummary
      .builder()
      .optionallyWith(instance.map(value => value.buildAwsValue()))(_.instance)
      .optionallyWith(
        lastUpdatedAt.map(value => Timestamp.unwrap(value): Instant)
      )(_.lastUpdatedAt)
      .build()
  }
  def asReadOnly: zio.aws.snowdevicemanagement.model.InstanceSummary.ReadOnly =
    zio.aws.snowdevicemanagement.model.InstanceSummary.wrap(buildAwsValue())
}
object InstanceSummary {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.snowdevicemanagement.model.InstanceSummary
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.snowdevicemanagement.model.InstanceSummary =
      zio.aws.snowdevicemanagement.model.InstanceSummary(
        instance.map(value => value.asEditable),
        lastUpdatedAt.map(value => value)
      )
    def instance: Optional[zio.aws.snowdevicemanagement.model.Instance.ReadOnly]
    def lastUpdatedAt: Optional[Timestamp]
    def getInstance: ZIO[
      Any,
      AwsError,
      zio.aws.snowdevicemanagement.model.Instance.ReadOnly
    ] = AwsError.unwrapOptionField("instance", instance)
    def getLastUpdatedAt: ZIO[Any, AwsError, Timestamp] =
      AwsError.unwrapOptionField("lastUpdatedAt", lastUpdatedAt)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.snowdevicemanagement.model.InstanceSummary
  ) extends zio.aws.snowdevicemanagement.model.InstanceSummary.ReadOnly {
    override val instance
        : Optional[zio.aws.snowdevicemanagement.model.Instance.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.instance())
        .map(value => zio.aws.snowdevicemanagement.model.Instance.wrap(value))
    override val lastUpdatedAt: Optional[Timestamp] = zio.aws.core.internal
      .optionalFromNullable(impl.lastUpdatedAt())
      .map(value =>
        zio.aws.snowdevicemanagement.model.primitives.Timestamp(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.snowdevicemanagement.model.InstanceSummary
  ): zio.aws.snowdevicemanagement.model.InstanceSummary.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy