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

io.github.vigoo.zioaws.datasync.model.QopConfiguration.scala Maven / Gradle / Ivy

package io.github.vigoo.zioaws.datasync.model
import zio.ZIO
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class QopConfiguration(
    rpcProtection: Option[
      io.github.vigoo.zioaws.datasync.model.HdfsRpcProtection
    ] = None,
    dataTransferProtection: Option[
      io.github.vigoo.zioaws.datasync.model.HdfsDataTransferProtection
    ] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.datasync.model.QopConfiguration = {
    import QopConfiguration.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.datasync.model.QopConfiguration
      .builder()
      .optionallyWith(rpcProtection.map(value => value.unwrap))(_.rpcProtection)
      .optionallyWith(dataTransferProtection.map(value => value.unwrap))(
        _.dataTransferProtection
      )
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.datasync.model.QopConfiguration.ReadOnly =
    io.github.vigoo.zioaws.datasync.model.QopConfiguration.wrap(buildAwsValue())
}
object QopConfiguration {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.datasync.model.QopConfiguration
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable: io.github.vigoo.zioaws.datasync.model.QopConfiguration =
      io.github.vigoo.zioaws.datasync.model.QopConfiguration(
        rpcProtectionValue.map(value => value),
        dataTransferProtectionValue.map(value => value)
      )
    def rpcProtectionValue
        : Option[io.github.vigoo.zioaws.datasync.model.HdfsRpcProtection]
    def dataTransferProtectionValue: Option[
      io.github.vigoo.zioaws.datasync.model.HdfsDataTransferProtection
    ]
    def rpcProtection: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.datasync.model.HdfsRpcProtection
    ] = AwsError.unwrapOptionField("rpcProtection", rpcProtectionValue)
    def dataTransferProtection: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.datasync.model.HdfsDataTransferProtection
    ] = AwsError.unwrapOptionField(
      "dataTransferProtection",
      dataTransferProtectionValue
    )
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.datasync.model.QopConfiguration
  ) extends io.github.vigoo.zioaws.datasync.model.QopConfiguration.ReadOnly {
    override def rpcProtectionValue
        : Option[io.github.vigoo.zioaws.datasync.model.HdfsRpcProtection] =
      scala
        .Option(impl.rpcProtection())
        .map(value =>
          io.github.vigoo.zioaws.datasync.model.HdfsRpcProtection.wrap(value)
        )
    override def dataTransferProtectionValue: Option[
      io.github.vigoo.zioaws.datasync.model.HdfsDataTransferProtection
    ] = scala
      .Option(impl.dataTransferProtection())
      .map(value =>
        io.github.vigoo.zioaws.datasync.model.HdfsDataTransferProtection
          .wrap(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.datasync.model.QopConfiguration
  ): io.github.vigoo.zioaws.datasync.model.QopConfiguration.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy