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

zio.aws.costoptimizationhub.CostOptimizationHubMock.scala Maven / Gradle / Ivy

package zio.aws.costoptimizationhub
import zio.aws.costoptimizationhub.model.UpdatePreferencesResponse.ReadOnly
import zio.mock.{Proxy, Mock}
import zio.aws.costoptimizationhub.model.{
  UpdateEnrollmentStatusRequest,
  GetPreferencesRequest,
  ListRecommendationsRequest,
  ListEnrollmentStatusesRequest,
  GetRecommendationRequest,
  UpdatePreferencesRequest,
  ListRecommendationSummariesRequest
}
import zio.aws.core.AwsError
import zio.aws.core.aspects.AwsCallAspect
import zio.{IO, ZEnvironment, URLayer}
import zio.stream.ZStream
import software.amazon.awssdk.services.costoptimizationhub.CostOptimizationHubAsyncClient
object CostOptimizationHubMock extends Mock[CostOptimizationHub] {
  object ListEnrollmentStatuses
      extends Stream[
        ListEnrollmentStatusesRequest,
        AwsError,
        zio.aws.costoptimizationhub.model.AccountEnrollmentStatus.ReadOnly
      ]
  object ListEnrollmentStatusesPaginated
      extends Effect[
        ListEnrollmentStatusesRequest,
        AwsError,
        zio.aws.costoptimizationhub.model.ListEnrollmentStatusesResponse.ReadOnly
      ]
  object UpdatePreferences
      extends Effect[UpdatePreferencesRequest, AwsError, ReadOnly]
  object GetPreferences
      extends Effect[
        GetPreferencesRequest,
        AwsError,
        zio.aws.costoptimizationhub.model.GetPreferencesResponse.ReadOnly
      ]
  object ListRecommendations
      extends Stream[
        ListRecommendationsRequest,
        AwsError,
        zio.aws.costoptimizationhub.model.Recommendation.ReadOnly
      ]
  object ListRecommendationsPaginated
      extends Effect[
        ListRecommendationsRequest,
        AwsError,
        zio.aws.costoptimizationhub.model.ListRecommendationsResponse.ReadOnly
      ]
  object ListRecommendationSummaries
      extends Stream[
        ListRecommendationSummariesRequest,
        AwsError,
        zio.aws.costoptimizationhub.model.RecommendationSummary.ReadOnly
      ]
  object ListRecommendationSummariesPaginated
      extends Effect[
        ListRecommendationSummariesRequest,
        AwsError,
        zio.aws.costoptimizationhub.model.ListRecommendationSummariesResponse.ReadOnly
      ]
  object UpdateEnrollmentStatus
      extends Effect[
        UpdateEnrollmentStatusRequest,
        AwsError,
        zio.aws.costoptimizationhub.model.UpdateEnrollmentStatusResponse.ReadOnly
      ]
  object GetRecommendation
      extends Effect[
        GetRecommendationRequest,
        AwsError,
        zio.aws.costoptimizationhub.model.GetRecommendationResponse.ReadOnly
      ]
  val compose: URLayer[Proxy, CostOptimizationHub] = zio.ZLayer {
    zio.ZIO.service[Proxy].flatMap { proxy =>
      withRuntime[Proxy, CostOptimizationHub] { rts =>
        zio.ZIO.succeed {
          new CostOptimizationHub {
            val api: CostOptimizationHubAsyncClient = null
            def withAspect[R1](
                newAspect: AwsCallAspect[R1],
                r: ZEnvironment[R1]
            ): CostOptimizationHub = this
            def listEnrollmentStatuses(
                request: ListEnrollmentStatusesRequest
            ): ZStream[
              Any,
              AwsError,
              zio.aws.costoptimizationhub.model.AccountEnrollmentStatus.ReadOnly
            ] = zio.Unsafe.unsafe { implicit u =>
              rts.unsafe
                .run {
                  proxy(ListEnrollmentStatuses, request)
                }
                .getOrThrowFiberFailure()
            }
            def listEnrollmentStatusesPaginated(
                request: ListEnrollmentStatusesRequest
            ): IO[
              AwsError,
              zio.aws.costoptimizationhub.model.ListEnrollmentStatusesResponse.ReadOnly
            ] = proxy(ListEnrollmentStatusesPaginated, request)
            def updatePreferences(
                request: UpdatePreferencesRequest
            ): IO[AwsError, ReadOnly] = proxy(UpdatePreferences, request)
            def getPreferences(request: GetPreferencesRequest): IO[
              AwsError,
              zio.aws.costoptimizationhub.model.GetPreferencesResponse.ReadOnly
            ] = proxy(GetPreferences, request)
            def listRecommendations(
                request: ListRecommendationsRequest
            ): ZStream[
              Any,
              AwsError,
              zio.aws.costoptimizationhub.model.Recommendation.ReadOnly
            ] = zio.Unsafe.unsafe { implicit u =>
              rts.unsafe
                .run {
                  proxy(ListRecommendations, request)
                }
                .getOrThrowFiberFailure()
            }
            def listRecommendationsPaginated(
                request: ListRecommendationsRequest
            ): IO[
              AwsError,
              zio.aws.costoptimizationhub.model.ListRecommendationsResponse.ReadOnly
            ] = proxy(ListRecommendationsPaginated, request)
            def listRecommendationSummaries(
                request: ListRecommendationSummariesRequest
            ): ZStream[
              Any,
              AwsError,
              zio.aws.costoptimizationhub.model.RecommendationSummary.ReadOnly
            ] = zio.Unsafe.unsafe { implicit u =>
              rts.unsafe
                .run {
                  proxy(ListRecommendationSummaries, request)
                }
                .getOrThrowFiberFailure()
            }
            def listRecommendationSummariesPaginated(
                request: ListRecommendationSummariesRequest
            ): IO[
              AwsError,
              zio.aws.costoptimizationhub.model.ListRecommendationSummariesResponse.ReadOnly
            ] = proxy(ListRecommendationSummariesPaginated, request)
            def updateEnrollmentStatus(
                request: UpdateEnrollmentStatusRequest
            ): IO[
              AwsError,
              zio.aws.costoptimizationhub.model.UpdateEnrollmentStatusResponse.ReadOnly
            ] = proxy(UpdateEnrollmentStatus, request)
            def getRecommendation(request: GetRecommendationRequest): IO[
              AwsError,
              zio.aws.costoptimizationhub.model.GetRecommendationResponse.ReadOnly
            ] = proxy(GetRecommendation, request)
          }
        }
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy