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

zio.aws.tnb.model.ValidateSolNetworkPackageContentRequest.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.{NsdInfoId, SensitiveBlob}
import scala.jdk.CollectionConverters.*
final case class ValidateSolNetworkPackageContentRequest(
    contentType: Optional[zio.aws.tnb.model.PackageContentType] =
      Optional.Absent,
    file: SensitiveBlob,
    nsdInfoId: NsdInfoId
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.tnb.model.ValidateSolNetworkPackageContentRequest = {
    import ValidateSolNetworkPackageContentRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.tnb.model.ValidateSolNetworkPackageContentRequest
      .builder()
      .optionallyWith(contentType.map(value => value.unwrap))(_.contentType)
      .file(
        software.amazon.awssdk.core.SdkBytes
          .fromByteArrayUnsafe(file.toArray[Byte])
      )
      .nsdInfoId(NsdInfoId.unwrap(nsdInfoId): java.lang.String)
      .build()
  }
  def asReadOnly
      : zio.aws.tnb.model.ValidateSolNetworkPackageContentRequest.ReadOnly =
    zio.aws.tnb.model.ValidateSolNetworkPackageContentRequest
      .wrap(buildAwsValue())
}
object ValidateSolNetworkPackageContentRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.tnb.model.ValidateSolNetworkPackageContentRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.tnb.model.ValidateSolNetworkPackageContentRequest =
      zio.aws.tnb.model.ValidateSolNetworkPackageContentRequest(
        contentType.map(value => value),
        file,
        nsdInfoId
      )
    def contentType: Optional[zio.aws.tnb.model.PackageContentType]
    def file: SensitiveBlob
    def nsdInfoId: NsdInfoId
    def getContentType
        : ZIO[Any, AwsError, zio.aws.tnb.model.PackageContentType] =
      AwsError.unwrapOptionField("contentType", contentType)
    def getFile: ZIO[Any, Nothing, SensitiveBlob] = ZIO.succeed(file)
    def getNsdInfoId: ZIO[Any, Nothing, NsdInfoId] = ZIO.succeed(nsdInfoId)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.tnb.model.ValidateSolNetworkPackageContentRequest
  ) extends zio.aws.tnb.model.ValidateSolNetworkPackageContentRequest.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: SensitiveBlob = zio.aws.tnb.model.primitives
      .SensitiveBlob(zio.Chunk.fromArray(impl.file().asByteArrayUnsafe()))
    override val nsdInfoId: NsdInfoId =
      zio.aws.tnb.model.primitives.NsdInfoId(impl.nsdInfoId())
  }
  def wrap(
      impl: software.amazon.awssdk.services.tnb.model.ValidateSolNetworkPackageContentRequest
  ): zio.aws.tnb.model.ValidateSolNetworkPackageContentRequest.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy