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

zio.aws.storagegateway.model.DescribeBandwidthRateLimitResponse.scala Maven / Gradle / Ivy

package zio.aws.storagegateway.model
import zio.aws.storagegateway.model.primitives.{
  BandwidthDownloadRateLimit,
  BandwidthUploadRateLimit,
  GatewayARN
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class DescribeBandwidthRateLimitResponse(
    gatewayARN: Optional[GatewayARN] = Optional.Absent,
    averageUploadRateLimitInBitsPerSec: Optional[BandwidthUploadRateLimit] =
      Optional.Absent,
    averageDownloadRateLimitInBitsPerSec: Optional[BandwidthDownloadRateLimit] =
      Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.storagegateway.model.DescribeBandwidthRateLimitResponse = {
    import DescribeBandwidthRateLimitResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.storagegateway.model.DescribeBandwidthRateLimitResponse
      .builder()
      .optionallyWith(
        gatewayARN.map(value => GatewayARN.unwrap(value): java.lang.String)
      )(_.gatewayARN)
      .optionallyWith(
        averageUploadRateLimitInBitsPerSec.map(value =>
          BandwidthUploadRateLimit.unwrap(value): java.lang.Long
        )
      )(_.averageUploadRateLimitInBitsPerSec)
      .optionallyWith(
        averageDownloadRateLimitInBitsPerSec.map(value =>
          BandwidthDownloadRateLimit.unwrap(value): java.lang.Long
        )
      )(_.averageDownloadRateLimitInBitsPerSec)
      .build()
  }
  def asReadOnly
      : zio.aws.storagegateway.model.DescribeBandwidthRateLimitResponse.ReadOnly =
    zio.aws.storagegateway.model.DescribeBandwidthRateLimitResponse
      .wrap(buildAwsValue())
}
object DescribeBandwidthRateLimitResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.storagegateway.model.DescribeBandwidthRateLimitResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable
        : zio.aws.storagegateway.model.DescribeBandwidthRateLimitResponse =
      zio.aws.storagegateway.model.DescribeBandwidthRateLimitResponse(
        gatewayARN.map(value => value),
        averageUploadRateLimitInBitsPerSec.map(value => value),
        averageDownloadRateLimitInBitsPerSec.map(value => value)
      )
    def gatewayARN: Optional[GatewayARN]
    def averageUploadRateLimitInBitsPerSec: Optional[BandwidthUploadRateLimit]
    def averageDownloadRateLimitInBitsPerSec
        : Optional[BandwidthDownloadRateLimit]
    def getGatewayARN: ZIO[Any, AwsError, GatewayARN] =
      AwsError.unwrapOptionField("gatewayARN", gatewayARN)
    def getAverageUploadRateLimitInBitsPerSec
        : ZIO[Any, AwsError, BandwidthUploadRateLimit] =
      AwsError.unwrapOptionField(
        "averageUploadRateLimitInBitsPerSec",
        averageUploadRateLimitInBitsPerSec
      )
    def getAverageDownloadRateLimitInBitsPerSec
        : ZIO[Any, AwsError, BandwidthDownloadRateLimit] =
      AwsError.unwrapOptionField(
        "averageDownloadRateLimitInBitsPerSec",
        averageDownloadRateLimitInBitsPerSec
      )
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.storagegateway.model.DescribeBandwidthRateLimitResponse
  ) extends zio.aws.storagegateway.model.DescribeBandwidthRateLimitResponse.ReadOnly {
    override val gatewayARN: Optional[GatewayARN] = zio.aws.core.internal
      .optionalFromNullable(impl.gatewayARN())
      .map(value => zio.aws.storagegateway.model.primitives.GatewayARN(value))
    override val averageUploadRateLimitInBitsPerSec
        : Optional[BandwidthUploadRateLimit] = zio.aws.core.internal
      .optionalFromNullable(impl.averageUploadRateLimitInBitsPerSec())
      .map(value =>
        zio.aws.storagegateway.model.primitives.BandwidthUploadRateLimit(value)
      )
    override val averageDownloadRateLimitInBitsPerSec
        : Optional[BandwidthDownloadRateLimit] = zio.aws.core.internal
      .optionalFromNullable(impl.averageDownloadRateLimitInBitsPerSec())
      .map(value =>
        zio.aws.storagegateway.model.primitives
          .BandwidthDownloadRateLimit(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.storagegateway.model.DescribeBandwidthRateLimitResponse
  ): zio.aws.storagegateway.model.DescribeBandwidthRateLimitResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy