zio.aws.costoptimizationhub.model.ListRecommendationSummariesResponse.scala Maven / Gradle / Ivy
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 ListRecommendationSummariesResponse(
estimatedTotalDedupedSavings: Optional[Double] = Optional.Absent,
items: Optional[
Iterable[zio.aws.costoptimizationhub.model.RecommendationSummary]
] = Optional.Absent,
groupBy: Optional[String] = Optional.Absent,
currencyCode: Optional[String] = Optional.Absent,
metrics: Optional[zio.aws.costoptimizationhub.model.SummaryMetricsResult] =
Optional.Absent,
nextToken: Optional[String] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.costoptimizationhub.model.ListRecommendationSummariesResponse = {
import ListRecommendationSummariesResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.costoptimizationhub.model.ListRecommendationSummariesResponse
.builder()
.optionallyWith(
estimatedTotalDedupedSavings.map(value => value: java.lang.Double)
)(_.estimatedTotalDedupedSavings)
.optionallyWith(
items.map(value =>
value.map { item =>
item.buildAwsValue()
}.asJavaCollection
)
)(_.items)
.optionallyWith(groupBy.map(value => value: java.lang.String))(_.groupBy)
.optionallyWith(currencyCode.map(value => value: java.lang.String))(
_.currencyCode
)
.optionallyWith(metrics.map(value => value.buildAwsValue()))(_.metrics)
.optionallyWith(nextToken.map(value => value: java.lang.String))(
_.nextToken
)
.build()
}
def asReadOnly
: zio.aws.costoptimizationhub.model.ListRecommendationSummariesResponse.ReadOnly =
zio.aws.costoptimizationhub.model.ListRecommendationSummariesResponse
.wrap(buildAwsValue())
}
object ListRecommendationSummariesResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.costoptimizationhub.model.ListRecommendationSummariesResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.costoptimizationhub.model.ListRecommendationSummariesResponse =
zio.aws.costoptimizationhub.model.ListRecommendationSummariesResponse(
estimatedTotalDedupedSavings.map(value => value),
items.map(value =>
value.map { item =>
item.asEditable
}
),
groupBy.map(value => value),
currencyCode.map(value => value),
metrics.map(value => value.asEditable),
nextToken.map(value => value)
)
def estimatedTotalDedupedSavings: Optional[Double]
def items: Optional[
List[zio.aws.costoptimizationhub.model.RecommendationSummary.ReadOnly]
]
def groupBy: Optional[String]
def currencyCode: Optional[String]
def metrics: Optional[
zio.aws.costoptimizationhub.model.SummaryMetricsResult.ReadOnly
]
def nextToken: Optional[String]
def getEstimatedTotalDedupedSavings: ZIO[Any, AwsError, Double] =
AwsError.unwrapOptionField(
"estimatedTotalDedupedSavings",
estimatedTotalDedupedSavings
)
def getItems: ZIO[Any, AwsError, List[
zio.aws.costoptimizationhub.model.RecommendationSummary.ReadOnly
]] = AwsError.unwrapOptionField("items", items)
def getGroupBy: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("groupBy", groupBy)
def getCurrencyCode: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("currencyCode", currencyCode)
def getMetrics: ZIO[
Any,
AwsError,
zio.aws.costoptimizationhub.model.SummaryMetricsResult.ReadOnly
] = AwsError.unwrapOptionField("metrics", metrics)
def getNextToken: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("nextToken", nextToken)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.costoptimizationhub.model.ListRecommendationSummariesResponse
) extends zio.aws.costoptimizationhub.model.ListRecommendationSummariesResponse.ReadOnly {
override val estimatedTotalDedupedSavings: Optional[Double] =
zio.aws.core.internal
.optionalFromNullable(impl.estimatedTotalDedupedSavings())
.map(value => value: Double)
override val items: Optional[
List[zio.aws.costoptimizationhub.model.RecommendationSummary.ReadOnly]
] = zio.aws.core.internal
.optionalFromNullable(impl.items())
.map(value =>
value.asScala.map { item =>
zio.aws.costoptimizationhub.model.RecommendationSummary.wrap(item)
}.toList
)
override val groupBy: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.groupBy())
.map(value => value: String)
override val currencyCode: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.currencyCode())
.map(value => value: String)
override val metrics: Optional[
zio.aws.costoptimizationhub.model.SummaryMetricsResult.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.metrics())
.map(value =>
zio.aws.costoptimizationhub.model.SummaryMetricsResult.wrap(value)
)
override val nextToken: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.nextToken())
.map(value => value: String)
}
def wrap(
impl: software.amazon.awssdk.services.costoptimizationhub.model.ListRecommendationSummariesResponse
): zio.aws.costoptimizationhub.model.ListRecommendationSummariesResponse.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy