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

zio.aws.costoptimizationhub.model.ResourceDetails.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 ResourceDetails(
    lambdaFunction: Optional[zio.aws.costoptimizationhub.model.LambdaFunction] =
      Optional.Absent,
    ecsService: Optional[zio.aws.costoptimizationhub.model.EcsService] =
      Optional.Absent,
    ec2Instance: Optional[zio.aws.costoptimizationhub.model.Ec2Instance] =
      Optional.Absent,
    ebsVolume: Optional[zio.aws.costoptimizationhub.model.EbsVolume] =
      Optional.Absent,
    ec2AutoScalingGroup: Optional[
      zio.aws.costoptimizationhub.model.Ec2AutoScalingGroup
    ] = Optional.Absent,
    ec2ReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.Ec2ReservedInstances
    ] = Optional.Absent,
    rdsReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.RdsReservedInstances
    ] = Optional.Absent,
    elastiCacheReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances
    ] = Optional.Absent,
    openSearchReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.OpenSearchReservedInstances
    ] = Optional.Absent,
    redshiftReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.RedshiftReservedInstances
    ] = Optional.Absent,
    ec2InstanceSavingsPlans: Optional[
      zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlans
    ] = Optional.Absent,
    computeSavingsPlans: Optional[
      zio.aws.costoptimizationhub.model.ComputeSavingsPlans
    ] = Optional.Absent,
    sageMakerSavingsPlans: Optional[
      zio.aws.costoptimizationhub.model.SageMakerSavingsPlans
    ] = Optional.Absent,
    rdsDbInstance: Optional[zio.aws.costoptimizationhub.model.RdsDbInstance] =
      Optional.Absent,
    rdsDbInstanceStorage: Optional[
      zio.aws.costoptimizationhub.model.RdsDbInstanceStorage
    ] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.costoptimizationhub.model.ResourceDetails = {
    import ResourceDetails.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.costoptimizationhub.model.ResourceDetails
      .builder()
      .optionallyWith(lambdaFunction.map(value => value.buildAwsValue()))(
        _.lambdaFunction
      )
      .optionallyWith(ecsService.map(value => value.buildAwsValue()))(
        _.ecsService
      )
      .optionallyWith(ec2Instance.map(value => value.buildAwsValue()))(
        _.ec2Instance
      )
      .optionallyWith(ebsVolume.map(value => value.buildAwsValue()))(
        _.ebsVolume
      )
      .optionallyWith(ec2AutoScalingGroup.map(value => value.buildAwsValue()))(
        _.ec2AutoScalingGroup
      )
      .optionallyWith(ec2ReservedInstances.map(value => value.buildAwsValue()))(
        _.ec2ReservedInstances
      )
      .optionallyWith(rdsReservedInstances.map(value => value.buildAwsValue()))(
        _.rdsReservedInstances
      )
      .optionallyWith(
        elastiCacheReservedInstances.map(value => value.buildAwsValue())
      )(_.elastiCacheReservedInstances)
      .optionallyWith(
        openSearchReservedInstances.map(value => value.buildAwsValue())
      )(_.openSearchReservedInstances)
      .optionallyWith(
        redshiftReservedInstances.map(value => value.buildAwsValue())
      )(_.redshiftReservedInstances)
      .optionallyWith(
        ec2InstanceSavingsPlans.map(value => value.buildAwsValue())
      )(_.ec2InstanceSavingsPlans)
      .optionallyWith(computeSavingsPlans.map(value => value.buildAwsValue()))(
        _.computeSavingsPlans
      )
      .optionallyWith(
        sageMakerSavingsPlans.map(value => value.buildAwsValue())
      )(_.sageMakerSavingsPlans)
      .optionallyWith(rdsDbInstance.map(value => value.buildAwsValue()))(
        _.rdsDbInstance
      )
      .optionallyWith(rdsDbInstanceStorage.map(value => value.buildAwsValue()))(
        _.rdsDbInstanceStorage
      )
      .build()
  }
  def asReadOnly: zio.aws.costoptimizationhub.model.ResourceDetails.ReadOnly =
    zio.aws.costoptimizationhub.model.ResourceDetails.wrap(buildAwsValue())
}
object ResourceDetails {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.costoptimizationhub.model.ResourceDetails
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.costoptimizationhub.model.ResourceDetails =
      zio.aws.costoptimizationhub.model.ResourceDetails(
        lambdaFunction.map(value => value.asEditable),
        ecsService.map(value => value.asEditable),
        ec2Instance.map(value => value.asEditable),
        ebsVolume.map(value => value.asEditable),
        ec2AutoScalingGroup.map(value => value.asEditable),
        ec2ReservedInstances.map(value => value.asEditable),
        rdsReservedInstances.map(value => value.asEditable),
        elastiCacheReservedInstances.map(value => value.asEditable),
        openSearchReservedInstances.map(value => value.asEditable),
        redshiftReservedInstances.map(value => value.asEditable),
        ec2InstanceSavingsPlans.map(value => value.asEditable),
        computeSavingsPlans.map(value => value.asEditable),
        sageMakerSavingsPlans.map(value => value.asEditable),
        rdsDbInstance.map(value => value.asEditable),
        rdsDbInstanceStorage.map(value => value.asEditable)
      )
    def lambdaFunction
        : Optional[zio.aws.costoptimizationhub.model.LambdaFunction.ReadOnly]
    def ecsService
        : Optional[zio.aws.costoptimizationhub.model.EcsService.ReadOnly]
    def ec2Instance
        : Optional[zio.aws.costoptimizationhub.model.Ec2Instance.ReadOnly]
    def ebsVolume
        : Optional[zio.aws.costoptimizationhub.model.EbsVolume.ReadOnly]
    def ec2AutoScalingGroup: Optional[
      zio.aws.costoptimizationhub.model.Ec2AutoScalingGroup.ReadOnly
    ]
    def ec2ReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.Ec2ReservedInstances.ReadOnly
    ]
    def rdsReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.RdsReservedInstances.ReadOnly
    ]
    def elastiCacheReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances.ReadOnly
    ]
    def openSearchReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.OpenSearchReservedInstances.ReadOnly
    ]
    def redshiftReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.RedshiftReservedInstances.ReadOnly
    ]
    def ec2InstanceSavingsPlans: Optional[
      zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlans.ReadOnly
    ]
    def computeSavingsPlans: Optional[
      zio.aws.costoptimizationhub.model.ComputeSavingsPlans.ReadOnly
    ]
    def sageMakerSavingsPlans: Optional[
      zio.aws.costoptimizationhub.model.SageMakerSavingsPlans.ReadOnly
    ]
    def rdsDbInstance
        : Optional[zio.aws.costoptimizationhub.model.RdsDbInstance.ReadOnly]
    def rdsDbInstanceStorage: Optional[
      zio.aws.costoptimizationhub.model.RdsDbInstanceStorage.ReadOnly
    ]
    def getLambdaFunction: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.LambdaFunction.ReadOnly
    ] = AwsError.unwrapOptionField("lambdaFunction", lambdaFunction)
    def getEcsService: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.EcsService.ReadOnly
    ] = AwsError.unwrapOptionField("ecsService", ecsService)
    def getEc2Instance: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.Ec2Instance.ReadOnly
    ] = AwsError.unwrapOptionField("ec2Instance", ec2Instance)
    def getEbsVolume: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.EbsVolume.ReadOnly
    ] = AwsError.unwrapOptionField("ebsVolume", ebsVolume)
    def getEc2AutoScalingGroup: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.Ec2AutoScalingGroup.ReadOnly
    ] = AwsError.unwrapOptionField("ec2AutoScalingGroup", ec2AutoScalingGroup)
    def getEc2ReservedInstances: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.Ec2ReservedInstances.ReadOnly
    ] = AwsError.unwrapOptionField("ec2ReservedInstances", ec2ReservedInstances)
    def getRdsReservedInstances: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.RdsReservedInstances.ReadOnly
    ] = AwsError.unwrapOptionField("rdsReservedInstances", rdsReservedInstances)
    def getElastiCacheReservedInstances: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances.ReadOnly
    ] = AwsError.unwrapOptionField(
      "elastiCacheReservedInstances",
      elastiCacheReservedInstances
    )
    def getOpenSearchReservedInstances: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.OpenSearchReservedInstances.ReadOnly
    ] = AwsError.unwrapOptionField(
      "openSearchReservedInstances",
      openSearchReservedInstances
    )
    def getRedshiftReservedInstances: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.RedshiftReservedInstances.ReadOnly
    ] = AwsError.unwrapOptionField(
      "redshiftReservedInstances",
      redshiftReservedInstances
    )
    def getEc2InstanceSavingsPlans: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlans.ReadOnly
    ] = AwsError.unwrapOptionField(
      "ec2InstanceSavingsPlans",
      ec2InstanceSavingsPlans
    )
    def getComputeSavingsPlans: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.ComputeSavingsPlans.ReadOnly
    ] = AwsError.unwrapOptionField("computeSavingsPlans", computeSavingsPlans)
    def getSageMakerSavingsPlans: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.SageMakerSavingsPlans.ReadOnly
    ] =
      AwsError.unwrapOptionField("sageMakerSavingsPlans", sageMakerSavingsPlans)
    def getRdsDbInstance: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.RdsDbInstance.ReadOnly
    ] = AwsError.unwrapOptionField("rdsDbInstance", rdsDbInstance)
    def getRdsDbInstanceStorage: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.RdsDbInstanceStorage.ReadOnly
    ] = AwsError.unwrapOptionField("rdsDbInstanceStorage", rdsDbInstanceStorage)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.ResourceDetails
  ) extends zio.aws.costoptimizationhub.model.ResourceDetails.ReadOnly {
    override val lambdaFunction
        : Optional[zio.aws.costoptimizationhub.model.LambdaFunction.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.lambdaFunction())
        .map(value =>
          zio.aws.costoptimizationhub.model.LambdaFunction.wrap(value)
        )
    override val ecsService
        : Optional[zio.aws.costoptimizationhub.model.EcsService.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.ecsService())
        .map(value => zio.aws.costoptimizationhub.model.EcsService.wrap(value))
    override val ec2Instance
        : Optional[zio.aws.costoptimizationhub.model.Ec2Instance.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.ec2Instance())
        .map(value => zio.aws.costoptimizationhub.model.Ec2Instance.wrap(value))
    override val ebsVolume
        : Optional[zio.aws.costoptimizationhub.model.EbsVolume.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.ebsVolume())
        .map(value => zio.aws.costoptimizationhub.model.EbsVolume.wrap(value))
    override val ec2AutoScalingGroup: Optional[
      zio.aws.costoptimizationhub.model.Ec2AutoScalingGroup.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.ec2AutoScalingGroup())
      .map(value =>
        zio.aws.costoptimizationhub.model.Ec2AutoScalingGroup.wrap(value)
      )
    override val ec2ReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.Ec2ReservedInstances.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.ec2ReservedInstances())
      .map(value =>
        zio.aws.costoptimizationhub.model.Ec2ReservedInstances.wrap(value)
      )
    override val rdsReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.RdsReservedInstances.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.rdsReservedInstances())
      .map(value =>
        zio.aws.costoptimizationhub.model.RdsReservedInstances.wrap(value)
      )
    override val elastiCacheReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.elastiCacheReservedInstances())
      .map(value =>
        zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances
          .wrap(value)
      )
    override val openSearchReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.OpenSearchReservedInstances.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.openSearchReservedInstances())
      .map(value =>
        zio.aws.costoptimizationhub.model.OpenSearchReservedInstances
          .wrap(value)
      )
    override val redshiftReservedInstances: Optional[
      zio.aws.costoptimizationhub.model.RedshiftReservedInstances.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.redshiftReservedInstances())
      .map(value =>
        zio.aws.costoptimizationhub.model.RedshiftReservedInstances.wrap(value)
      )
    override val ec2InstanceSavingsPlans: Optional[
      zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlans.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.ec2InstanceSavingsPlans())
      .map(value =>
        zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlans.wrap(value)
      )
    override val computeSavingsPlans: Optional[
      zio.aws.costoptimizationhub.model.ComputeSavingsPlans.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.computeSavingsPlans())
      .map(value =>
        zio.aws.costoptimizationhub.model.ComputeSavingsPlans.wrap(value)
      )
    override val sageMakerSavingsPlans: Optional[
      zio.aws.costoptimizationhub.model.SageMakerSavingsPlans.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.sageMakerSavingsPlans())
      .map(value =>
        zio.aws.costoptimizationhub.model.SageMakerSavingsPlans.wrap(value)
      )
    override val rdsDbInstance
        : Optional[zio.aws.costoptimizationhub.model.RdsDbInstance.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.rdsDbInstance())
        .map(value =>
          zio.aws.costoptimizationhub.model.RdsDbInstance.wrap(value)
        )
    override val rdsDbInstanceStorage: Optional[
      zio.aws.costoptimizationhub.model.RdsDbInstanceStorage.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.rdsDbInstanceStorage())
      .map(value =>
        zio.aws.costoptimizationhub.model.RdsDbInstanceStorage.wrap(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.ResourceDetails
  ): zio.aws.costoptimizationhub.model.ResourceDetails.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy