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

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

The newest version!
package zio.aws.snowdevicemanagement.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class Command(
    reboot: Optional[zio.aws.snowdevicemanagement.model.Reboot] =
      Optional.Absent,
    unlock: Optional[zio.aws.snowdevicemanagement.model.Unlock] =
      Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.snowdevicemanagement.model.Command = {
    import Command.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.snowdevicemanagement.model.Command
      .builder()
      .optionallyWith(reboot.map(value => value.buildAwsValue()))(_.reboot)
      .optionallyWith(unlock.map(value => value.buildAwsValue()))(_.unlock)
      .build()
  }
  def asReadOnly: zio.aws.snowdevicemanagement.model.Command.ReadOnly =
    zio.aws.snowdevicemanagement.model.Command.wrap(buildAwsValue())
}
object Command {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.snowdevicemanagement.model.Command
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.snowdevicemanagement.model.Command =
      zio.aws.snowdevicemanagement.model.Command(
        reboot.map(value => value.asEditable),
        unlock.map(value => value.asEditable)
      )
    def reboot: Optional[zio.aws.snowdevicemanagement.model.Reboot.ReadOnly]
    def unlock: Optional[zio.aws.snowdevicemanagement.model.Unlock.ReadOnly]
    def getReboot: ZIO[
      Any,
      AwsError,
      zio.aws.snowdevicemanagement.model.Reboot.ReadOnly
    ] = AwsError.unwrapOptionField("reboot", reboot)
    def getUnlock: ZIO[
      Any,
      AwsError,
      zio.aws.snowdevicemanagement.model.Unlock.ReadOnly
    ] = AwsError.unwrapOptionField("unlock", unlock)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.snowdevicemanagement.model.Command
  ) extends zio.aws.snowdevicemanagement.model.Command.ReadOnly {
    override val reboot
        : Optional[zio.aws.snowdevicemanagement.model.Reboot.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.reboot())
        .map(value => zio.aws.snowdevicemanagement.model.Reboot.wrap(value))
    override val unlock
        : Optional[zio.aws.snowdevicemanagement.model.Unlock.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.unlock())
        .map(value => zio.aws.snowdevicemanagement.model.Unlock.wrap(value))
  }
  def wrap(
      impl: software.amazon.awssdk.services.snowdevicemanagement.model.Command
  ): zio.aws.snowdevicemanagement.model.Command.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy