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

zio.aws.lightsail.model.CreateInstanceSnapshotResponse.scala Maven / Gradle / Ivy

The newest version!
package zio.aws.lightsail.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters.*
final case class CreateInstanceSnapshotResponse(
    operations: Optional[Iterable[zio.aws.lightsail.model.Operation]] =
      Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.lightsail.model.CreateInstanceSnapshotResponse = {
    import CreateInstanceSnapshotResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.lightsail.model.CreateInstanceSnapshotResponse
      .builder()
      .optionallyWith(
        operations.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.operations)
      .build()
  }
  def asReadOnly
      : zio.aws.lightsail.model.CreateInstanceSnapshotResponse.ReadOnly =
    zio.aws.lightsail.model.CreateInstanceSnapshotResponse.wrap(buildAwsValue())
}
object CreateInstanceSnapshotResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.lightsail.model.CreateInstanceSnapshotResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.lightsail.model.CreateInstanceSnapshotResponse =
      zio.aws.lightsail.model.CreateInstanceSnapshotResponse(
        operations.map(value =>
          value.map { item =>
            item.asEditable
          }
        )
      )
    def operations: Optional[List[zio.aws.lightsail.model.Operation.ReadOnly]]
    def getOperations
        : ZIO[Any, AwsError, List[zio.aws.lightsail.model.Operation.ReadOnly]] =
      AwsError.unwrapOptionField("operations", operations)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.lightsail.model.CreateInstanceSnapshotResponse
  ) extends zio.aws.lightsail.model.CreateInstanceSnapshotResponse.ReadOnly {
    override val operations
        : Optional[List[zio.aws.lightsail.model.Operation.ReadOnly]] =
      zio.aws.core.internal
        .optionalFromNullable(impl.operations())
        .map(value =>
          value.asScala.map { item =>
            zio.aws.lightsail.model.Operation.wrap(item)
          }.toList
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.lightsail.model.CreateInstanceSnapshotResponse
  ): zio.aws.lightsail.model.CreateInstanceSnapshotResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy