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

zio.aws.costoptimizationhub.model.OrderBy.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.14
Show newest version
package zio.aws.costoptimizationhub.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class OrderBy(
    dimension: Optional[String] = Optional.Absent,
    order: Optional[zio.aws.costoptimizationhub.model.Order] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.costoptimizationhub.model.OrderBy = {
    import OrderBy.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.costoptimizationhub.model.OrderBy
      .builder()
      .optionallyWith(dimension.map(value => value: java.lang.String))(
        _.dimension
      )
      .optionallyWith(order.map(value => value.unwrap))(_.order)
      .build()
  }
  def asReadOnly: zio.aws.costoptimizationhub.model.OrderBy.ReadOnly =
    zio.aws.costoptimizationhub.model.OrderBy.wrap(buildAwsValue())
}
object OrderBy {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.costoptimizationhub.model.OrderBy
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.costoptimizationhub.model.OrderBy =
      zio.aws.costoptimizationhub.model
        .OrderBy(dimension.map(value => value), order.map(value => value))
    def dimension: Optional[String]
    def order: Optional[zio.aws.costoptimizationhub.model.Order]
    def getDimension: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("dimension", dimension)
    def getOrder: ZIO[Any, AwsError, zio.aws.costoptimizationhub.model.Order] =
      AwsError.unwrapOptionField("order", order)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.OrderBy
  ) extends zio.aws.costoptimizationhub.model.OrderBy.ReadOnly {
    override val dimension: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.dimension())
      .map(value => value: String)
    override val order: Optional[zio.aws.costoptimizationhub.model.Order] =
      zio.aws.core.internal
        .optionalFromNullable(impl.order())
        .map(value => zio.aws.costoptimizationhub.model.Order.wrap(value))
  }
  def wrap(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.OrderBy
  ): zio.aws.costoptimizationhub.model.OrderBy.ReadOnly = new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy