zio.aws.costoptimizationhub.model.GetRecommendationResponse.scala Maven / Gradle / Ivy
package zio.aws.costoptimizationhub.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.costoptimizationhub.model.primitives.{Datetime, Integer}
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import scala.jdk.CollectionConverters.*
final case class GetRecommendationResponse(
recommendationId: Optional[String] = Optional.Absent,
resourceId: Optional[String] = Optional.Absent,
resourceArn: Optional[String] = Optional.Absent,
accountId: Optional[String] = Optional.Absent,
currencyCode: Optional[String] = Optional.Absent,
recommendationLookbackPeriodInDays: Optional[Integer] = Optional.Absent,
costCalculationLookbackPeriodInDays: Optional[Integer] = Optional.Absent,
estimatedSavingsPercentage: Optional[Double] = Optional.Absent,
estimatedSavingsOverCostCalculationLookbackPeriod: Optional[Double] =
Optional.Absent,
currentResourceType: Optional[
zio.aws.costoptimizationhub.model.ResourceType
] = Optional.Absent,
recommendedResourceType: Optional[
zio.aws.costoptimizationhub.model.ResourceType
] = Optional.Absent,
region: Optional[String] = Optional.Absent,
source: Optional[zio.aws.costoptimizationhub.model.Source] =
Optional.Absent,
lastRefreshTimestamp: Optional[Datetime] = Optional.Absent,
estimatedMonthlySavings: Optional[Double] = Optional.Absent,
estimatedMonthlyCost: Optional[Double] = Optional.Absent,
implementationEffort: Optional[
zio.aws.costoptimizationhub.model.ImplementationEffort
] = Optional.Absent,
restartNeeded: Optional[Boolean] = Optional.Absent,
actionType: Optional[zio.aws.costoptimizationhub.model.ActionType] =
Optional.Absent,
rollbackPossible: Optional[Boolean] = Optional.Absent,
currentResourceDetails: Optional[
zio.aws.costoptimizationhub.model.ResourceDetails
] = Optional.Absent,
recommendedResourceDetails: Optional[
zio.aws.costoptimizationhub.model.ResourceDetails
] = Optional.Absent,
tags: Optional[Iterable[zio.aws.costoptimizationhub.model.Tag]] =
Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.costoptimizationhub.model.GetRecommendationResponse = {
import GetRecommendationResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.costoptimizationhub.model.GetRecommendationResponse
.builder()
.optionallyWith(recommendationId.map(value => value: java.lang.String))(
_.recommendationId
)
.optionallyWith(resourceId.map(value => value: java.lang.String))(
_.resourceId
)
.optionallyWith(resourceArn.map(value => value: java.lang.String))(
_.resourceArn
)
.optionallyWith(accountId.map(value => value: java.lang.String))(
_.accountId
)
.optionallyWith(currencyCode.map(value => value: java.lang.String))(
_.currencyCode
)
.optionallyWith(
recommendationLookbackPeriodInDays.map(value =>
value: java.lang.Integer
)
)(_.recommendationLookbackPeriodInDays)
.optionallyWith(
costCalculationLookbackPeriodInDays.map(value =>
value: java.lang.Integer
)
)(_.costCalculationLookbackPeriodInDays)
.optionallyWith(
estimatedSavingsPercentage.map(value => value: java.lang.Double)
)(_.estimatedSavingsPercentage)
.optionallyWith(
estimatedSavingsOverCostCalculationLookbackPeriod.map(value =>
value: java.lang.Double
)
)(_.estimatedSavingsOverCostCalculationLookbackPeriod)
.optionallyWith(currentResourceType.map(value => value.unwrap))(
_.currentResourceType
)
.optionallyWith(recommendedResourceType.map(value => value.unwrap))(
_.recommendedResourceType
)
.optionallyWith(region.map(value => value: java.lang.String))(_.region)
.optionallyWith(source.map(value => value.unwrap))(_.source)
.optionallyWith(
lastRefreshTimestamp.map(value => Datetime.unwrap(value): Instant)
)(_.lastRefreshTimestamp)
.optionallyWith(
estimatedMonthlySavings.map(value => value: java.lang.Double)
)(_.estimatedMonthlySavings)
.optionallyWith(
estimatedMonthlyCost.map(value => value: java.lang.Double)
)(_.estimatedMonthlyCost)
.optionallyWith(implementationEffort.map(value => value.unwrap))(
_.implementationEffort
)
.optionallyWith(restartNeeded.map(value => value: java.lang.Boolean))(
_.restartNeeded
)
.optionallyWith(actionType.map(value => value.unwrap))(_.actionType)
.optionallyWith(rollbackPossible.map(value => value: java.lang.Boolean))(
_.rollbackPossible
)
.optionallyWith(
currentResourceDetails.map(value => value.buildAwsValue())
)(_.currentResourceDetails)
.optionallyWith(
recommendedResourceDetails.map(value => value.buildAwsValue())
)(_.recommendedResourceDetails)
.optionallyWith(
tags.map(value =>
value.map { item =>
item.buildAwsValue()
}.asJavaCollection
)
)(_.tags)
.build()
}
def asReadOnly
: zio.aws.costoptimizationhub.model.GetRecommendationResponse.ReadOnly =
zio.aws.costoptimizationhub.model.GetRecommendationResponse
.wrap(buildAwsValue())
}
object GetRecommendationResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.costoptimizationhub.model.GetRecommendationResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.costoptimizationhub.model.GetRecommendationResponse =
zio.aws.costoptimizationhub.model.GetRecommendationResponse(
recommendationId.map(value => value),
resourceId.map(value => value),
resourceArn.map(value => value),
accountId.map(value => value),
currencyCode.map(value => value),
recommendationLookbackPeriodInDays.map(value => value),
costCalculationLookbackPeriodInDays.map(value => value),
estimatedSavingsPercentage.map(value => value),
estimatedSavingsOverCostCalculationLookbackPeriod.map(value => value),
currentResourceType.map(value => value),
recommendedResourceType.map(value => value),
region.map(value => value),
source.map(value => value),
lastRefreshTimestamp.map(value => value),
estimatedMonthlySavings.map(value => value),
estimatedMonthlyCost.map(value => value),
implementationEffort.map(value => value),
restartNeeded.map(value => value),
actionType.map(value => value),
rollbackPossible.map(value => value),
currentResourceDetails.map(value => value.asEditable),
recommendedResourceDetails.map(value => value.asEditable),
tags.map(value =>
value.map { item =>
item.asEditable
}
)
)
def recommendationId: Optional[String]
def resourceId: Optional[String]
def resourceArn: Optional[String]
def accountId: Optional[String]
def currencyCode: Optional[String]
def recommendationLookbackPeriodInDays: Optional[Integer]
def costCalculationLookbackPeriodInDays: Optional[Integer]
def estimatedSavingsPercentage: Optional[Double]
def estimatedSavingsOverCostCalculationLookbackPeriod: Optional[Double]
def currentResourceType
: Optional[zio.aws.costoptimizationhub.model.ResourceType]
def recommendedResourceType
: Optional[zio.aws.costoptimizationhub.model.ResourceType]
def region: Optional[String]
def source: Optional[zio.aws.costoptimizationhub.model.Source]
def lastRefreshTimestamp: Optional[Datetime]
def estimatedMonthlySavings: Optional[Double]
def estimatedMonthlyCost: Optional[Double]
def implementationEffort
: Optional[zio.aws.costoptimizationhub.model.ImplementationEffort]
def restartNeeded: Optional[Boolean]
def actionType: Optional[zio.aws.costoptimizationhub.model.ActionType]
def rollbackPossible: Optional[Boolean]
def currentResourceDetails
: Optional[zio.aws.costoptimizationhub.model.ResourceDetails.ReadOnly]
def recommendedResourceDetails
: Optional[zio.aws.costoptimizationhub.model.ResourceDetails.ReadOnly]
def tags: Optional[List[zio.aws.costoptimizationhub.model.Tag.ReadOnly]]
def getRecommendationId: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("recommendationId", recommendationId)
def getResourceId: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("resourceId", resourceId)
def getResourceArn: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("resourceArn", resourceArn)
def getAccountId: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("accountId", accountId)
def getCurrencyCode: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("currencyCode", currencyCode)
def getRecommendationLookbackPeriodInDays: ZIO[Any, AwsError, Integer] =
AwsError.unwrapOptionField(
"recommendationLookbackPeriodInDays",
recommendationLookbackPeriodInDays
)
def getCostCalculationLookbackPeriodInDays: ZIO[Any, AwsError, Integer] =
AwsError.unwrapOptionField(
"costCalculationLookbackPeriodInDays",
costCalculationLookbackPeriodInDays
)
def getEstimatedSavingsPercentage: ZIO[Any, AwsError, Double] =
AwsError.unwrapOptionField(
"estimatedSavingsPercentage",
estimatedSavingsPercentage
)
def getEstimatedSavingsOverCostCalculationLookbackPeriod
: ZIO[Any, AwsError, Double] = AwsError.unwrapOptionField(
"estimatedSavingsOverCostCalculationLookbackPeriod",
estimatedSavingsOverCostCalculationLookbackPeriod
)
def getCurrentResourceType
: ZIO[Any, AwsError, zio.aws.costoptimizationhub.model.ResourceType] =
AwsError.unwrapOptionField("currentResourceType", currentResourceType)
def getRecommendedResourceType
: ZIO[Any, AwsError, zio.aws.costoptimizationhub.model.ResourceType] =
AwsError.unwrapOptionField(
"recommendedResourceType",
recommendedResourceType
)
def getRegion: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("region", region)
def getSource
: ZIO[Any, AwsError, zio.aws.costoptimizationhub.model.Source] =
AwsError.unwrapOptionField("source", source)
def getLastRefreshTimestamp: ZIO[Any, AwsError, Datetime] =
AwsError.unwrapOptionField("lastRefreshTimestamp", lastRefreshTimestamp)
def getEstimatedMonthlySavings: ZIO[Any, AwsError, Double] = AwsError
.unwrapOptionField("estimatedMonthlySavings", estimatedMonthlySavings)
def getEstimatedMonthlyCost: ZIO[Any, AwsError, Double] =
AwsError.unwrapOptionField("estimatedMonthlyCost", estimatedMonthlyCost)
def getImplementationEffort: ZIO[
Any,
AwsError,
zio.aws.costoptimizationhub.model.ImplementationEffort
] = AwsError.unwrapOptionField("implementationEffort", implementationEffort)
def getRestartNeeded: ZIO[Any, AwsError, Boolean] =
AwsError.unwrapOptionField("restartNeeded", restartNeeded)
def getActionType
: ZIO[Any, AwsError, zio.aws.costoptimizationhub.model.ActionType] =
AwsError.unwrapOptionField("actionType", actionType)
def getRollbackPossible: ZIO[Any, AwsError, Boolean] =
AwsError.unwrapOptionField("rollbackPossible", rollbackPossible)
def getCurrentResourceDetails: ZIO[
Any,
AwsError,
zio.aws.costoptimizationhub.model.ResourceDetails.ReadOnly
] = AwsError.unwrapOptionField(
"currentResourceDetails",
currentResourceDetails
)
def getRecommendedResourceDetails: ZIO[
Any,
AwsError,
zio.aws.costoptimizationhub.model.ResourceDetails.ReadOnly
] = AwsError.unwrapOptionField(
"recommendedResourceDetails",
recommendedResourceDetails
)
def getTags: ZIO[Any, AwsError, List[
zio.aws.costoptimizationhub.model.Tag.ReadOnly
]] = AwsError.unwrapOptionField("tags", tags)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.costoptimizationhub.model.GetRecommendationResponse
) extends zio.aws.costoptimizationhub.model.GetRecommendationResponse.ReadOnly {
override val recommendationId: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.recommendationId())
.map(value => value: String)
override val resourceId: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.resourceId())
.map(value => value: String)
override val resourceArn: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.resourceArn())
.map(value => value: String)
override val accountId: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.accountId())
.map(value => value: String)
override val currencyCode: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.currencyCode())
.map(value => value: String)
override val recommendationLookbackPeriodInDays: Optional[Integer] =
zio.aws.core.internal
.optionalFromNullable(impl.recommendationLookbackPeriodInDays())
.map(value => value: Integer)
override val costCalculationLookbackPeriodInDays: Optional[Integer] =
zio.aws.core.internal
.optionalFromNullable(impl.costCalculationLookbackPeriodInDays())
.map(value => value: Integer)
override val estimatedSavingsPercentage: Optional[Double] =
zio.aws.core.internal
.optionalFromNullable(impl.estimatedSavingsPercentage())
.map(value => value: Double)
override val estimatedSavingsOverCostCalculationLookbackPeriod
: Optional[Double] = zio.aws.core.internal
.optionalFromNullable(
impl.estimatedSavingsOverCostCalculationLookbackPeriod()
)
.map(value => value: Double)
override val currentResourceType
: Optional[zio.aws.costoptimizationhub.model.ResourceType] =
zio.aws.core.internal
.optionalFromNullable(impl.currentResourceType())
.map(value =>
zio.aws.costoptimizationhub.model.ResourceType.wrap(value)
)
override val recommendedResourceType
: Optional[zio.aws.costoptimizationhub.model.ResourceType] =
zio.aws.core.internal
.optionalFromNullable(impl.recommendedResourceType())
.map(value =>
zio.aws.costoptimizationhub.model.ResourceType.wrap(value)
)
override val region: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.region())
.map(value => value: String)
override val source: Optional[zio.aws.costoptimizationhub.model.Source] =
zio.aws.core.internal
.optionalFromNullable(impl.source())
.map(value => zio.aws.costoptimizationhub.model.Source.wrap(value))
override val lastRefreshTimestamp: Optional[Datetime] =
zio.aws.core.internal
.optionalFromNullable(impl.lastRefreshTimestamp())
.map(value =>
zio.aws.costoptimizationhub.model.primitives.Datetime(value)
)
override val estimatedMonthlySavings: Optional[Double] =
zio.aws.core.internal
.optionalFromNullable(impl.estimatedMonthlySavings())
.map(value => value: Double)
override val estimatedMonthlyCost: Optional[Double] = zio.aws.core.internal
.optionalFromNullable(impl.estimatedMonthlyCost())
.map(value => value: Double)
override val implementationEffort
: Optional[zio.aws.costoptimizationhub.model.ImplementationEffort] =
zio.aws.core.internal
.optionalFromNullable(impl.implementationEffort())
.map(value =>
zio.aws.costoptimizationhub.model.ImplementationEffort.wrap(value)
)
override val restartNeeded: Optional[Boolean] = zio.aws.core.internal
.optionalFromNullable(impl.restartNeeded())
.map(value => value: Boolean)
override val actionType
: Optional[zio.aws.costoptimizationhub.model.ActionType] =
zio.aws.core.internal
.optionalFromNullable(impl.actionType())
.map(value => zio.aws.costoptimizationhub.model.ActionType.wrap(value))
override val rollbackPossible: Optional[Boolean] = zio.aws.core.internal
.optionalFromNullable(impl.rollbackPossible())
.map(value => value: Boolean)
override val currentResourceDetails
: Optional[zio.aws.costoptimizationhub.model.ResourceDetails.ReadOnly] =
zio.aws.core.internal
.optionalFromNullable(impl.currentResourceDetails())
.map(value =>
zio.aws.costoptimizationhub.model.ResourceDetails.wrap(value)
)
override val recommendedResourceDetails
: Optional[zio.aws.costoptimizationhub.model.ResourceDetails.ReadOnly] =
zio.aws.core.internal
.optionalFromNullable(impl.recommendedResourceDetails())
.map(value =>
zio.aws.costoptimizationhub.model.ResourceDetails.wrap(value)
)
override val tags
: Optional[List[zio.aws.costoptimizationhub.model.Tag.ReadOnly]] =
zio.aws.core.internal
.optionalFromNullable(impl.tags())
.map(value =>
value.asScala.map { item =>
zio.aws.costoptimizationhub.model.Tag.wrap(item)
}.toList
)
}
def wrap(
impl: software.amazon.awssdk.services.costoptimizationhub.model.GetRecommendationResponse
): zio.aws.costoptimizationhub.model.GetRecommendationResponse.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy