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

zio.aws.nimble.model.CreateStreamingImageRequest.scala Maven / Gradle / Ivy

The newest version!
package zio.aws.nimble.model
import zio.aws.nimble.model.primitives.{
  StreamingImageName,
  EC2ImageId,
  StreamingImageDescription,
  ClientToken
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters.*
final case class CreateStreamingImageRequest(
    clientToken: Optional[ClientToken] = Optional.Absent,
    description: Optional[StreamingImageDescription] = Optional.Absent,
    ec2ImageId: EC2ImageId,
    name: StreamingImageName,
    studioId: String,
    tags: Optional[Map[String, String]] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.nimble.model.CreateStreamingImageRequest = {
    import CreateStreamingImageRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.nimble.model.CreateStreamingImageRequest
      .builder()
      .optionallyWith(
        clientToken.map(value => ClientToken.unwrap(value): java.lang.String)
      )(_.clientToken)
      .optionallyWith(
        description.map(value =>
          StreamingImageDescription.unwrap(value): java.lang.String
        )
      )(_.description)
      .ec2ImageId(EC2ImageId.unwrap(ec2ImageId): java.lang.String)
      .name(StreamingImageName.unwrap(name): java.lang.String)
      .studioId(studioId: java.lang.String)
      .optionallyWith(
        tags.map(value =>
          value
            .map({ case (key, value) =>
              (key: java.lang.String) -> (value: java.lang.String)
            })
            .asJava
        )
      )(_.tags)
      .build()
  }
  def asReadOnly: zio.aws.nimble.model.CreateStreamingImageRequest.ReadOnly =
    zio.aws.nimble.model.CreateStreamingImageRequest.wrap(buildAwsValue())
}
object CreateStreamingImageRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.nimble.model.CreateStreamingImageRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.nimble.model.CreateStreamingImageRequest =
      zio.aws.nimble.model.CreateStreamingImageRequest(
        clientToken.map(value => value),
        description.map(value => value),
        ec2ImageId,
        name,
        studioId,
        tags.map(value => value)
      )
    def clientToken: Optional[ClientToken]
    def description: Optional[StreamingImageDescription]
    def ec2ImageId: EC2ImageId
    def name: StreamingImageName
    def studioId: String
    def tags: Optional[Map[String, String]]
    def getClientToken: ZIO[Any, AwsError, ClientToken] =
      AwsError.unwrapOptionField("clientToken", clientToken)
    def getDescription: ZIO[Any, AwsError, StreamingImageDescription] =
      AwsError.unwrapOptionField("description", description)
    def getEc2ImageId: ZIO[Any, Nothing, EC2ImageId] = ZIO.succeed(ec2ImageId)
    def getName: ZIO[Any, Nothing, StreamingImageName] = ZIO.succeed(name)
    def getStudioId: ZIO[Any, Nothing, String] = ZIO.succeed(studioId)
    def getTags: ZIO[Any, AwsError, Map[String, String]] =
      AwsError.unwrapOptionField("tags", tags)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.nimble.model.CreateStreamingImageRequest
  ) extends zio.aws.nimble.model.CreateStreamingImageRequest.ReadOnly {
    override val clientToken: Optional[ClientToken] = zio.aws.core.internal
      .optionalFromNullable(impl.clientToken())
      .map(value => zio.aws.nimble.model.primitives.ClientToken(value))
    override val description: Optional[StreamingImageDescription] =
      zio.aws.core.internal
        .optionalFromNullable(impl.description())
        .map(value =>
          zio.aws.nimble.model.primitives.StreamingImageDescription(value)
        )
    override val ec2ImageId: EC2ImageId =
      zio.aws.nimble.model.primitives.EC2ImageId(impl.ec2ImageId())
    override val name: StreamingImageName =
      zio.aws.nimble.model.primitives.StreamingImageName(impl.name())
    override val studioId: String = impl.studioId(): String
    override val tags: Optional[Map[String, String]] = zio.aws.core.internal
      .optionalFromNullable(impl.tags())
      .map(value =>
        value.asScala
          .map({ case (key, value) =>
            (key: String) -> (value: String)
          })
          .toMap
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.nimble.model.CreateStreamingImageRequest
  ): zio.aws.nimble.model.CreateStreamingImageRequest.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy