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

zio.aws.tnb.model.ValidateSolFunctionPackageContentRequest.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.10
Show newest version
package zio.aws.tnb.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import zio.aws.tnb.model.primitives.{VnfPkgId, Blob}
import scala.jdk.CollectionConverters.*
final case class ValidateSolFunctionPackageContentRequest(
    contentType: Optional[zio.aws.tnb.model.PackageContentType] =
      Optional.Absent,
    file: Blob,
    vnfPkgId: VnfPkgId
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.tnb.model.ValidateSolFunctionPackageContentRequest = {
    import ValidateSolFunctionPackageContentRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.tnb.model.ValidateSolFunctionPackageContentRequest
      .builder()
      .optionallyWith(contentType.map(value => value.unwrap))(_.contentType)
      .file(
        software.amazon.awssdk.core.SdkBytes
          .fromByteArrayUnsafe(file.toArray[Byte])
      )
      .vnfPkgId(VnfPkgId.unwrap(vnfPkgId): java.lang.String)
      .build()
  }
  def asReadOnly
      : zio.aws.tnb.model.ValidateSolFunctionPackageContentRequest.ReadOnly =
    zio.aws.tnb.model.ValidateSolFunctionPackageContentRequest
      .wrap(buildAwsValue())
}
object ValidateSolFunctionPackageContentRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.tnb.model.ValidateSolFunctionPackageContentRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.tnb.model.ValidateSolFunctionPackageContentRequest =
      zio.aws.tnb.model.ValidateSolFunctionPackageContentRequest(
        contentType.map(value => value),
        file,
        vnfPkgId
      )
    def contentType: Optional[zio.aws.tnb.model.PackageContentType]
    def file: Blob
    def vnfPkgId: VnfPkgId
    def getContentType
        : ZIO[Any, AwsError, zio.aws.tnb.model.PackageContentType] =
      AwsError.unwrapOptionField("contentType", contentType)
    def getFile: ZIO[Any, Nothing, Blob] = ZIO.succeed(file)
    def getVnfPkgId: ZIO[Any, Nothing, VnfPkgId] = ZIO.succeed(vnfPkgId)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.tnb.model.ValidateSolFunctionPackageContentRequest
  ) extends zio.aws.tnb.model.ValidateSolFunctionPackageContentRequest.ReadOnly {
    override val contentType: Optional[zio.aws.tnb.model.PackageContentType] =
      zio.aws.core.internal
        .optionalFromNullable(impl.contentType())
        .map(value => zio.aws.tnb.model.PackageContentType.wrap(value))
    override val file: Blob = zio.aws.tnb.model.primitives
      .Blob(zio.Chunk.fromArray(impl.file().asByteArrayUnsafe()))
    override val vnfPkgId: VnfPkgId =
      zio.aws.tnb.model.primitives.VnfPkgId(impl.vnfPkgId())
  }
  def wrap(
      impl: software.amazon.awssdk.services.tnb.model.ValidateSolFunctionPackageContentRequest
  ): zio.aws.tnb.model.ValidateSolFunctionPackageContentRequest.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy