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