{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AutoScalingPlans.Types.ScalingPlanResource
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AutoScalingPlans.Types.ScalingPlanResource where

import Amazonka.AutoScalingPlans.Types.ScalableDimension
import Amazonka.AutoScalingPlans.Types.ScalingPolicy
import Amazonka.AutoScalingPlans.Types.ScalingStatusCode
import Amazonka.AutoScalingPlans.Types.ServiceNamespace
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents a scalable resource.
--
-- /See:/ 'newScalingPlanResource' smart constructor.
data ScalingPlanResource = ScalingPlanResource'
  { -- | A simple message about the current scaling status of the resource.
    ScalingPlanResource -> Maybe Text
scalingStatusMessage :: Prelude.Maybe Prelude.Text,
    -- | The scaling policies.
    ScalingPlanResource -> Maybe [ScalingPolicy]
scalingPolicies :: Prelude.Maybe [ScalingPolicy],
    -- | The name of the scaling plan.
    ScalingPlanResource -> Text
scalingPlanName :: Prelude.Text,
    -- | The version number of the scaling plan.
    ScalingPlanResource -> Integer
scalingPlanVersion :: Prelude.Integer,
    -- | The namespace of the AWS service.
    ScalingPlanResource -> ServiceNamespace
serviceNamespace :: ServiceNamespace,
    -- | The ID of the resource. This string consists of the resource type and
    -- unique identifier.
    --
    -- -   Auto Scaling group - The resource type is @autoScalingGroup@ and the
    --     unique identifier is the name of the Auto Scaling group. Example:
    --     @autoScalingGroup\/my-asg@.
    --
    -- -   ECS service - The resource type is @service@ and the unique
    --     identifier is the cluster name and service name. Example:
    --     @service\/default\/sample-webapp@.
    --
    -- -   Spot Fleet request - The resource type is @spot-fleet-request@ and
    --     the unique identifier is the Spot Fleet request ID. Example:
    --     @spot-fleet-request\/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE@.
    --
    -- -   DynamoDB table - The resource type is @table@ and the unique
    --     identifier is the resource ID. Example: @table\/my-table@.
    --
    -- -   DynamoDB global secondary index - The resource type is @index@ and
    --     the unique identifier is the resource ID. Example:
    --     @table\/my-table\/index\/my-table-index@.
    --
    -- -   Aurora DB cluster - The resource type is @cluster@ and the unique
    --     identifier is the cluster name. Example: @cluster:my-db-cluster@.
    ScalingPlanResource -> Text
resourceId :: Prelude.Text,
    -- | The scalable dimension for the resource.
    --
    -- -   @autoscaling:autoScalingGroup:DesiredCapacity@ - The desired
    --     capacity of an Auto Scaling group.
    --
    -- -   @ecs:service:DesiredCount@ - The desired task count of an ECS
    --     service.
    --
    -- -   @ec2:spot-fleet-request:TargetCapacity@ - The target capacity of a
    --     Spot Fleet request.
    --
    -- -   @dynamodb:table:ReadCapacityUnits@ - The provisioned read capacity
    --     for a DynamoDB table.
    --
    -- -   @dynamodb:table:WriteCapacityUnits@ - The provisioned write capacity
    --     for a DynamoDB table.
    --
    -- -   @dynamodb:index:ReadCapacityUnits@ - The provisioned read capacity
    --     for a DynamoDB global secondary index.
    --
    -- -   @dynamodb:index:WriteCapacityUnits@ - The provisioned write capacity
    --     for a DynamoDB global secondary index.
    --
    -- -   @rds:cluster:ReadReplicaCount@ - The count of Aurora Replicas in an
    --     Aurora DB cluster. Available for Aurora MySQL-compatible edition and
    --     Aurora PostgreSQL-compatible edition.
    ScalingPlanResource -> ScalableDimension
scalableDimension :: ScalableDimension,
    -- | The scaling status of the resource.
    --
    -- -   @Active@ - The scaling configuration is active.
    --
    -- -   @Inactive@ - The scaling configuration is not active because the
    --     scaling plan is being created or the scaling configuration could not
    --     be applied. Check the status message for more information.
    --
    -- -   @PartiallyActive@ - The scaling configuration is partially active
    --     because the scaling plan is being created or deleted or the scaling
    --     configuration could not be fully applied. Check the status message
    --     for more information.
    ScalingPlanResource -> ScalingStatusCode
scalingStatusCode :: ScalingStatusCode
  }
  deriving (ScalingPlanResource -> ScalingPlanResource -> Bool
(ScalingPlanResource -> ScalingPlanResource -> Bool)
-> (ScalingPlanResource -> ScalingPlanResource -> Bool)
-> Eq ScalingPlanResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScalingPlanResource -> ScalingPlanResource -> Bool
$c/= :: ScalingPlanResource -> ScalingPlanResource -> Bool
== :: ScalingPlanResource -> ScalingPlanResource -> Bool
$c== :: ScalingPlanResource -> ScalingPlanResource -> Bool
Prelude.Eq, ReadPrec [ScalingPlanResource]
ReadPrec ScalingPlanResource
Int -> ReadS ScalingPlanResource
ReadS [ScalingPlanResource]
(Int -> ReadS ScalingPlanResource)
-> ReadS [ScalingPlanResource]
-> ReadPrec ScalingPlanResource
-> ReadPrec [ScalingPlanResource]
-> Read ScalingPlanResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScalingPlanResource]
$creadListPrec :: ReadPrec [ScalingPlanResource]
readPrec :: ReadPrec ScalingPlanResource
$creadPrec :: ReadPrec ScalingPlanResource
readList :: ReadS [ScalingPlanResource]
$creadList :: ReadS [ScalingPlanResource]
readsPrec :: Int -> ReadS ScalingPlanResource
$creadsPrec :: Int -> ReadS ScalingPlanResource
Prelude.Read, Int -> ScalingPlanResource -> ShowS
[ScalingPlanResource] -> ShowS
ScalingPlanResource -> String
(Int -> ScalingPlanResource -> ShowS)
-> (ScalingPlanResource -> String)
-> ([ScalingPlanResource] -> ShowS)
-> Show ScalingPlanResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScalingPlanResource] -> ShowS
$cshowList :: [ScalingPlanResource] -> ShowS
show :: ScalingPlanResource -> String
$cshow :: ScalingPlanResource -> String
showsPrec :: Int -> ScalingPlanResource -> ShowS
$cshowsPrec :: Int -> ScalingPlanResource -> ShowS
Prelude.Show, (forall x. ScalingPlanResource -> Rep ScalingPlanResource x)
-> (forall x. Rep ScalingPlanResource x -> ScalingPlanResource)
-> Generic ScalingPlanResource
forall x. Rep ScalingPlanResource x -> ScalingPlanResource
forall x. ScalingPlanResource -> Rep ScalingPlanResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScalingPlanResource x -> ScalingPlanResource
$cfrom :: forall x. ScalingPlanResource -> Rep ScalingPlanResource x
Prelude.Generic)

-- |
-- Create a value of 'ScalingPlanResource' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'scalingStatusMessage', 'scalingPlanResource_scalingStatusMessage' - A simple message about the current scaling status of the resource.
--
-- 'scalingPolicies', 'scalingPlanResource_scalingPolicies' - The scaling policies.
--
-- 'scalingPlanName', 'scalingPlanResource_scalingPlanName' - The name of the scaling plan.
--
-- 'scalingPlanVersion', 'scalingPlanResource_scalingPlanVersion' - The version number of the scaling plan.
--
-- 'serviceNamespace', 'scalingPlanResource_serviceNamespace' - The namespace of the AWS service.
--
-- 'resourceId', 'scalingPlanResource_resourceId' - The ID of the resource. This string consists of the resource type and
-- unique identifier.
--
-- -   Auto Scaling group - The resource type is @autoScalingGroup@ and the
--     unique identifier is the name of the Auto Scaling group. Example:
--     @autoScalingGroup\/my-asg@.
--
-- -   ECS service - The resource type is @service@ and the unique
--     identifier is the cluster name and service name. Example:
--     @service\/default\/sample-webapp@.
--
-- -   Spot Fleet request - The resource type is @spot-fleet-request@ and
--     the unique identifier is the Spot Fleet request ID. Example:
--     @spot-fleet-request\/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE@.
--
-- -   DynamoDB table - The resource type is @table@ and the unique
--     identifier is the resource ID. Example: @table\/my-table@.
--
-- -   DynamoDB global secondary index - The resource type is @index@ and
--     the unique identifier is the resource ID. Example:
--     @table\/my-table\/index\/my-table-index@.
--
-- -   Aurora DB cluster - The resource type is @cluster@ and the unique
--     identifier is the cluster name. Example: @cluster:my-db-cluster@.
--
-- 'scalableDimension', 'scalingPlanResource_scalableDimension' - The scalable dimension for the resource.
--
-- -   @autoscaling:autoScalingGroup:DesiredCapacity@ - The desired
--     capacity of an Auto Scaling group.
--
-- -   @ecs:service:DesiredCount@ - The desired task count of an ECS
--     service.
--
-- -   @ec2:spot-fleet-request:TargetCapacity@ - The target capacity of a
--     Spot Fleet request.
--
-- -   @dynamodb:table:ReadCapacityUnits@ - The provisioned read capacity
--     for a DynamoDB table.
--
-- -   @dynamodb:table:WriteCapacityUnits@ - The provisioned write capacity
--     for a DynamoDB table.
--
-- -   @dynamodb:index:ReadCapacityUnits@ - The provisioned read capacity
--     for a DynamoDB global secondary index.
--
-- -   @dynamodb:index:WriteCapacityUnits@ - The provisioned write capacity
--     for a DynamoDB global secondary index.
--
-- -   @rds:cluster:ReadReplicaCount@ - The count of Aurora Replicas in an
--     Aurora DB cluster. Available for Aurora MySQL-compatible edition and
--     Aurora PostgreSQL-compatible edition.
--
-- 'scalingStatusCode', 'scalingPlanResource_scalingStatusCode' - The scaling status of the resource.
--
-- -   @Active@ - The scaling configuration is active.
--
-- -   @Inactive@ - The scaling configuration is not active because the
--     scaling plan is being created or the scaling configuration could not
--     be applied. Check the status message for more information.
--
-- -   @PartiallyActive@ - The scaling configuration is partially active
--     because the scaling plan is being created or deleted or the scaling
--     configuration could not be fully applied. Check the status message
--     for more information.
newScalingPlanResource ::
  -- | 'scalingPlanName'
  Prelude.Text ->
  -- | 'scalingPlanVersion'
  Prelude.Integer ->
  -- | 'serviceNamespace'
  ServiceNamespace ->
  -- | 'resourceId'
  Prelude.Text ->
  -- | 'scalableDimension'
  ScalableDimension ->
  -- | 'scalingStatusCode'
  ScalingStatusCode ->
  ScalingPlanResource
newScalingPlanResource :: Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource
newScalingPlanResource
  Text
pScalingPlanName_
  Integer
pScalingPlanVersion_
  ServiceNamespace
pServiceNamespace_
  Text
pResourceId_
  ScalableDimension
pScalableDimension_
  ScalingStatusCode
pScalingStatusCode_ =
    ScalingPlanResource' :: Maybe Text
-> Maybe [ScalingPolicy]
-> Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource
ScalingPlanResource'
      { $sel:scalingStatusMessage:ScalingPlanResource' :: Maybe Text
scalingStatusMessage =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:scalingPolicies:ScalingPlanResource' :: Maybe [ScalingPolicy]
scalingPolicies = Maybe [ScalingPolicy]
forall a. Maybe a
Prelude.Nothing,
        $sel:scalingPlanName:ScalingPlanResource' :: Text
scalingPlanName = Text
pScalingPlanName_,
        $sel:scalingPlanVersion:ScalingPlanResource' :: Integer
scalingPlanVersion = Integer
pScalingPlanVersion_,
        $sel:serviceNamespace:ScalingPlanResource' :: ServiceNamespace
serviceNamespace = ServiceNamespace
pServiceNamespace_,
        $sel:resourceId:ScalingPlanResource' :: Text
resourceId = Text
pResourceId_,
        $sel:scalableDimension:ScalingPlanResource' :: ScalableDimension
scalableDimension = ScalableDimension
pScalableDimension_,
        $sel:scalingStatusCode:ScalingPlanResource' :: ScalingStatusCode
scalingStatusCode = ScalingStatusCode
pScalingStatusCode_
      }

-- | A simple message about the current scaling status of the resource.
scalingPlanResource_scalingStatusMessage :: Lens.Lens' ScalingPlanResource (Prelude.Maybe Prelude.Text)
scalingPlanResource_scalingStatusMessage :: (Maybe Text -> f (Maybe Text))
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingStatusMessage = (ScalingPlanResource -> Maybe Text)
-> (ScalingPlanResource -> Maybe Text -> ScalingPlanResource)
-> Lens
     ScalingPlanResource ScalingPlanResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Maybe Text
scalingStatusMessage :: Maybe Text
$sel:scalingStatusMessage:ScalingPlanResource' :: ScalingPlanResource -> Maybe Text
scalingStatusMessage} -> Maybe Text
scalingStatusMessage) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Maybe Text
a -> ScalingPlanResource
s {$sel:scalingStatusMessage:ScalingPlanResource' :: Maybe Text
scalingStatusMessage = Maybe Text
a} :: ScalingPlanResource)

-- | The scaling policies.
scalingPlanResource_scalingPolicies :: Lens.Lens' ScalingPlanResource (Prelude.Maybe [ScalingPolicy])
scalingPlanResource_scalingPolicies :: (Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingPolicies = (ScalingPlanResource -> Maybe [ScalingPolicy])
-> (ScalingPlanResource
    -> Maybe [ScalingPolicy] -> ScalingPlanResource)
-> Lens
     ScalingPlanResource
     ScalingPlanResource
     (Maybe [ScalingPolicy])
     (Maybe [ScalingPolicy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Maybe [ScalingPolicy]
scalingPolicies :: Maybe [ScalingPolicy]
$sel:scalingPolicies:ScalingPlanResource' :: ScalingPlanResource -> Maybe [ScalingPolicy]
scalingPolicies} -> Maybe [ScalingPolicy]
scalingPolicies) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Maybe [ScalingPolicy]
a -> ScalingPlanResource
s {$sel:scalingPolicies:ScalingPlanResource' :: Maybe [ScalingPolicy]
scalingPolicies = Maybe [ScalingPolicy]
a} :: ScalingPlanResource) ((Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
 -> ScalingPlanResource -> f ScalingPlanResource)
-> ((Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
    -> Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> (Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> ScalingPlanResource
-> f ScalingPlanResource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ScalingPolicy] [ScalingPolicy] [ScalingPolicy] [ScalingPolicy]
-> Iso
     (Maybe [ScalingPolicy])
     (Maybe [ScalingPolicy])
     (Maybe [ScalingPolicy])
     (Maybe [ScalingPolicy])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ScalingPolicy] [ScalingPolicy] [ScalingPolicy] [ScalingPolicy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the scaling plan.
scalingPlanResource_scalingPlanName :: Lens.Lens' ScalingPlanResource Prelude.Text
scalingPlanResource_scalingPlanName :: (Text -> f Text) -> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingPlanName = (ScalingPlanResource -> Text)
-> (ScalingPlanResource -> Text -> ScalingPlanResource)
-> Lens ScalingPlanResource ScalingPlanResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Text
scalingPlanName :: Text
$sel:scalingPlanName:ScalingPlanResource' :: ScalingPlanResource -> Text
scalingPlanName} -> Text
scalingPlanName) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Text
a -> ScalingPlanResource
s {$sel:scalingPlanName:ScalingPlanResource' :: Text
scalingPlanName = Text
a} :: ScalingPlanResource)

-- | The version number of the scaling plan.
scalingPlanResource_scalingPlanVersion :: Lens.Lens' ScalingPlanResource Prelude.Integer
scalingPlanResource_scalingPlanVersion :: (Integer -> f Integer)
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingPlanVersion = (ScalingPlanResource -> Integer)
-> (ScalingPlanResource -> Integer -> ScalingPlanResource)
-> Lens ScalingPlanResource ScalingPlanResource Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Integer
scalingPlanVersion :: Integer
$sel:scalingPlanVersion:ScalingPlanResource' :: ScalingPlanResource -> Integer
scalingPlanVersion} -> Integer
scalingPlanVersion) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Integer
a -> ScalingPlanResource
s {$sel:scalingPlanVersion:ScalingPlanResource' :: Integer
scalingPlanVersion = Integer
a} :: ScalingPlanResource)

-- | The namespace of the AWS service.
scalingPlanResource_serviceNamespace :: Lens.Lens' ScalingPlanResource ServiceNamespace
scalingPlanResource_serviceNamespace :: (ServiceNamespace -> f ServiceNamespace)
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_serviceNamespace = (ScalingPlanResource -> ServiceNamespace)
-> (ScalingPlanResource -> ServiceNamespace -> ScalingPlanResource)
-> Lens
     ScalingPlanResource
     ScalingPlanResource
     ServiceNamespace
     ServiceNamespace
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {ServiceNamespace
serviceNamespace :: ServiceNamespace
$sel:serviceNamespace:ScalingPlanResource' :: ScalingPlanResource -> ServiceNamespace
serviceNamespace} -> ServiceNamespace
serviceNamespace) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} ServiceNamespace
a -> ScalingPlanResource
s {$sel:serviceNamespace:ScalingPlanResource' :: ServiceNamespace
serviceNamespace = ServiceNamespace
a} :: ScalingPlanResource)

-- | The ID of the resource. This string consists of the resource type and
-- unique identifier.
--
-- -   Auto Scaling group - The resource type is @autoScalingGroup@ and the
--     unique identifier is the name of the Auto Scaling group. Example:
--     @autoScalingGroup\/my-asg@.
--
-- -   ECS service - The resource type is @service@ and the unique
--     identifier is the cluster name and service name. Example:
--     @service\/default\/sample-webapp@.
--
-- -   Spot Fleet request - The resource type is @spot-fleet-request@ and
--     the unique identifier is the Spot Fleet request ID. Example:
--     @spot-fleet-request\/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE@.
--
-- -   DynamoDB table - The resource type is @table@ and the unique
--     identifier is the resource ID. Example: @table\/my-table@.
--
-- -   DynamoDB global secondary index - The resource type is @index@ and
--     the unique identifier is the resource ID. Example:
--     @table\/my-table\/index\/my-table-index@.
--
-- -   Aurora DB cluster - The resource type is @cluster@ and the unique
--     identifier is the cluster name. Example: @cluster:my-db-cluster@.
scalingPlanResource_resourceId :: Lens.Lens' ScalingPlanResource Prelude.Text
scalingPlanResource_resourceId :: (Text -> f Text) -> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_resourceId = (ScalingPlanResource -> Text)
-> (ScalingPlanResource -> Text -> ScalingPlanResource)
-> Lens ScalingPlanResource ScalingPlanResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {Text
resourceId :: Text
$sel:resourceId:ScalingPlanResource' :: ScalingPlanResource -> Text
resourceId} -> Text
resourceId) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} Text
a -> ScalingPlanResource
s {$sel:resourceId:ScalingPlanResource' :: Text
resourceId = Text
a} :: ScalingPlanResource)

-- | The scalable dimension for the resource.
--
-- -   @autoscaling:autoScalingGroup:DesiredCapacity@ - The desired
--     capacity of an Auto Scaling group.
--
-- -   @ecs:service:DesiredCount@ - The desired task count of an ECS
--     service.
--
-- -   @ec2:spot-fleet-request:TargetCapacity@ - The target capacity of a
--     Spot Fleet request.
--
-- -   @dynamodb:table:ReadCapacityUnits@ - The provisioned read capacity
--     for a DynamoDB table.
--
-- -   @dynamodb:table:WriteCapacityUnits@ - The provisioned write capacity
--     for a DynamoDB table.
--
-- -   @dynamodb:index:ReadCapacityUnits@ - The provisioned read capacity
--     for a DynamoDB global secondary index.
--
-- -   @dynamodb:index:WriteCapacityUnits@ - The provisioned write capacity
--     for a DynamoDB global secondary index.
--
-- -   @rds:cluster:ReadReplicaCount@ - The count of Aurora Replicas in an
--     Aurora DB cluster. Available for Aurora MySQL-compatible edition and
--     Aurora PostgreSQL-compatible edition.
scalingPlanResource_scalableDimension :: Lens.Lens' ScalingPlanResource ScalableDimension
scalingPlanResource_scalableDimension :: (ScalableDimension -> f ScalableDimension)
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalableDimension = (ScalingPlanResource -> ScalableDimension)
-> (ScalingPlanResource
    -> ScalableDimension -> ScalingPlanResource)
-> Lens
     ScalingPlanResource
     ScalingPlanResource
     ScalableDimension
     ScalableDimension
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {ScalableDimension
scalableDimension :: ScalableDimension
$sel:scalableDimension:ScalingPlanResource' :: ScalingPlanResource -> ScalableDimension
scalableDimension} -> ScalableDimension
scalableDimension) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} ScalableDimension
a -> ScalingPlanResource
s {$sel:scalableDimension:ScalingPlanResource' :: ScalableDimension
scalableDimension = ScalableDimension
a} :: ScalingPlanResource)

-- | The scaling status of the resource.
--
-- -   @Active@ - The scaling configuration is active.
--
-- -   @Inactive@ - The scaling configuration is not active because the
--     scaling plan is being created or the scaling configuration could not
--     be applied. Check the status message for more information.
--
-- -   @PartiallyActive@ - The scaling configuration is partially active
--     because the scaling plan is being created or deleted or the scaling
--     configuration could not be fully applied. Check the status message
--     for more information.
scalingPlanResource_scalingStatusCode :: Lens.Lens' ScalingPlanResource ScalingStatusCode
scalingPlanResource_scalingStatusCode :: (ScalingStatusCode -> f ScalingStatusCode)
-> ScalingPlanResource -> f ScalingPlanResource
scalingPlanResource_scalingStatusCode = (ScalingPlanResource -> ScalingStatusCode)
-> (ScalingPlanResource
    -> ScalingStatusCode -> ScalingPlanResource)
-> Lens
     ScalingPlanResource
     ScalingPlanResource
     ScalingStatusCode
     ScalingStatusCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingPlanResource' {ScalingStatusCode
scalingStatusCode :: ScalingStatusCode
$sel:scalingStatusCode:ScalingPlanResource' :: ScalingPlanResource -> ScalingStatusCode
scalingStatusCode} -> ScalingStatusCode
scalingStatusCode) (\s :: ScalingPlanResource
s@ScalingPlanResource' {} ScalingStatusCode
a -> ScalingPlanResource
s {$sel:scalingStatusCode:ScalingPlanResource' :: ScalingStatusCode
scalingStatusCode = ScalingStatusCode
a} :: ScalingPlanResource)

instance Core.FromJSON ScalingPlanResource where
  parseJSON :: Value -> Parser ScalingPlanResource
parseJSON =
    String
-> (Object -> Parser ScalingPlanResource)
-> Value
-> Parser ScalingPlanResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ScalingPlanResource"
      ( \Object
x ->
          Maybe Text
-> Maybe [ScalingPolicy]
-> Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource
ScalingPlanResource'
            (Maybe Text
 -> Maybe [ScalingPolicy]
 -> Text
 -> Integer
 -> ServiceNamespace
 -> Text
 -> ScalableDimension
 -> ScalingStatusCode
 -> ScalingPlanResource)
-> Parser (Maybe Text)
-> Parser
     (Maybe [ScalingPolicy]
      -> Text
      -> Integer
      -> ServiceNamespace
      -> Text
      -> ScalableDimension
      -> ScalingStatusCode
      -> ScalingPlanResource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ScalingStatusMessage")
            Parser
  (Maybe [ScalingPolicy]
   -> Text
   -> Integer
   -> ServiceNamespace
   -> Text
   -> ScalableDimension
   -> ScalingStatusCode
   -> ScalingPlanResource)
-> Parser (Maybe [ScalingPolicy])
-> Parser
     (Text
      -> Integer
      -> ServiceNamespace
      -> Text
      -> ScalableDimension
      -> ScalingStatusCode
      -> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ScalingPolicy]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ScalingPolicies"
                            Parser (Maybe (Maybe [ScalingPolicy]))
-> Maybe [ScalingPolicy] -> Parser (Maybe [ScalingPolicy])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ScalingPolicy]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Text
   -> Integer
   -> ServiceNamespace
   -> Text
   -> ScalableDimension
   -> ScalingStatusCode
   -> ScalingPlanResource)
-> Parser Text
-> Parser
     (Integer
      -> ServiceNamespace
      -> Text
      -> ScalableDimension
      -> ScalingStatusCode
      -> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ScalingPlanName")
            Parser
  (Integer
   -> ServiceNamespace
   -> Text
   -> ScalableDimension
   -> ScalingStatusCode
   -> ScalingPlanResource)
-> Parser Integer
-> Parser
     (ServiceNamespace
      -> Text
      -> ScalableDimension
      -> ScalingStatusCode
      -> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ScalingPlanVersion")
            Parser
  (ServiceNamespace
   -> Text
   -> ScalableDimension
   -> ScalingStatusCode
   -> ScalingPlanResource)
-> Parser ServiceNamespace
-> Parser
     (Text
      -> ScalableDimension -> ScalingStatusCode -> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ServiceNamespace
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ServiceNamespace")
            Parser
  (Text
   -> ScalableDimension -> ScalingStatusCode -> ScalingPlanResource)
-> Parser Text
-> Parser
     (ScalableDimension -> ScalingStatusCode -> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ResourceId")
            Parser
  (ScalableDimension -> ScalingStatusCode -> ScalingPlanResource)
-> Parser ScalableDimension
-> Parser (ScalingStatusCode -> ScalingPlanResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ScalableDimension
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ScalableDimension")
            Parser (ScalingStatusCode -> ScalingPlanResource)
-> Parser ScalingStatusCode -> Parser ScalingPlanResource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ScalingStatusCode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ScalingStatusCode")
      )

instance Prelude.Hashable ScalingPlanResource

instance Prelude.NFData ScalingPlanResource