zio.aws.costoptimizationhub.model.ListRecommendationSummariesRequest.scala Maven / Gradle / Ivy
The newest version!
package zio.aws.costoptimizationhub.model
import zio.prelude.data.Optional
import zio.aws.costoptimizationhub.model.primitives.ListRecommendationSummariesRequestMaxResultsInteger
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import java.lang.Integer
import scala.jdk.CollectionConverters.*
final case class ListRecommendationSummariesRequest(
filter: Optional[zio.aws.costoptimizationhub.model.Filter] =
Optional.Absent,
groupBy: String,
maxResults: Optional[ListRecommendationSummariesRequestMaxResultsInteger] =
Optional.Absent,
metrics: Optional[
Iterable[zio.aws.costoptimizationhub.model.SummaryMetrics]
] = Optional.Absent,
nextToken: Optional[String] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.costoptimizationhub.model.ListRecommendationSummariesRequest = {
import ListRecommendationSummariesRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.costoptimizationhub.model.ListRecommendationSummariesRequest
.builder()
.optionallyWith(filter.map(value => value.buildAwsValue()))(_.filter)
.groupBy(groupBy: java.lang.String)
.optionallyWith(
maxResults.map(value =>
ListRecommendationSummariesRequestMaxResultsInteger.unwrap(
value
): Integer
)
)(_.maxResults)
.optionallyWith(
metrics.map(value =>
value.map { item =>
item.unwrap.toString
}.asJavaCollection
)
)(_.metricsWithStrings)
.optionallyWith(nextToken.map(value => value: java.lang.String))(
_.nextToken
)
.build()
}
def asReadOnly
: zio.aws.costoptimizationhub.model.ListRecommendationSummariesRequest.ReadOnly =
zio.aws.costoptimizationhub.model.ListRecommendationSummariesRequest
.wrap(buildAwsValue())
}
object ListRecommendationSummariesRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.costoptimizationhub.model.ListRecommendationSummariesRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.costoptimizationhub.model.ListRecommendationSummariesRequest =
zio.aws.costoptimizationhub.model.ListRecommendationSummariesRequest(
filter.map(value => value.asEditable),
groupBy,
maxResults.map(value => value),
metrics.map(value => value),
nextToken.map(value => value)
)
def filter: Optional[zio.aws.costoptimizationhub.model.Filter.ReadOnly]
def groupBy: String
def maxResults
: Optional[ListRecommendationSummariesRequestMaxResultsInteger]
def metrics
: Optional[List[zio.aws.costoptimizationhub.model.SummaryMetrics]]
def nextToken: Optional[String]
def getFilter: ZIO[
Any,
AwsError,
zio.aws.costoptimizationhub.model.Filter.ReadOnly
] = AwsError.unwrapOptionField("filter", filter)
def getGroupBy: ZIO[Any, Nothing, String] = ZIO.succeed(groupBy)
def getMaxResults: ZIO[
Any,
AwsError,
ListRecommendationSummariesRequestMaxResultsInteger
] = AwsError.unwrapOptionField("maxResults", maxResults)
def getMetrics: ZIO[Any, AwsError, List[
zio.aws.costoptimizationhub.model.SummaryMetrics
]] = 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.ListRecommendationSummariesRequest
) extends zio.aws.costoptimizationhub.model.ListRecommendationSummariesRequest.ReadOnly {
override val filter
: Optional[zio.aws.costoptimizationhub.model.Filter.ReadOnly] =
zio.aws.core.internal
.optionalFromNullable(impl.filter())
.map(value => zio.aws.costoptimizationhub.model.Filter.wrap(value))
override val groupBy: String = impl.groupBy(): String
override val maxResults
: Optional[ListRecommendationSummariesRequestMaxResultsInteger] =
zio.aws.core.internal
.optionalFromNullable(impl.maxResults())
.map(value =>
zio.aws.costoptimizationhub.model.primitives
.ListRecommendationSummariesRequestMaxResultsInteger(value)
)
override val metrics
: Optional[List[zio.aws.costoptimizationhub.model.SummaryMetrics]] =
zio.aws.core.internal
.optionalFromNullable(impl.metrics())
.map(value =>
value.asScala.map { item =>
zio.aws.costoptimizationhub.model.SummaryMetrics.wrap(item)
}.toList
)
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.ListRecommendationSummariesRequest
): zio.aws.costoptimizationhub.model.ListRecommendationSummariesRequest.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy