{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Represents a scalable resource.
--
-- /See:/ 'newScalingPlanResource' smart constructor.
data ScalingPlanResource = ScalingPlanResource'
  { -- | The scaling policies.
    ScalingPlanResource -> Maybe [ScalingPolicy]
scalingPolicies :: Prelude.Maybe [ScalingPolicy],
    -- | A simple message about the current scaling status of the resource.
    ScalingPlanResource -> Maybe Text
scalingStatusMessage :: Prelude.Maybe Prelude.Text,
    -- | 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
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]
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
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. 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:
--
-- 'scalingPolicies', 'scalingPlanResource_scalingPolicies' - The scaling policies.
--
-- 'scalingStatusMessage', 'scalingPlanResource_scalingStatusMessage' - A simple message about the current scaling status of the resource.
--
-- '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'
      { $sel:scalingPolicies:ScalingPlanResource' :: Maybe [ScalingPolicy]
scalingPolicies =
          forall a. Maybe a
Prelude.Nothing,
        $sel:scalingStatusMessage:ScalingPlanResource' :: Maybe Text
scalingStatusMessage = 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_
      }

-- | The scaling policies.
scalingPlanResource_scalingPolicies :: Lens.Lens' ScalingPlanResource (Prelude.Maybe [ScalingPolicy])
scalingPlanResource_scalingPolicies :: Lens' ScalingPlanResource (Maybe [ScalingPolicy])
scalingPlanResource_scalingPolicies = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A simple message about the current scaling status of the resource.
scalingPlanResource_scalingStatusMessage :: Lens.Lens' ScalingPlanResource (Prelude.Maybe Prelude.Text)
scalingPlanResource_scalingStatusMessage :: Lens' ScalingPlanResource (Maybe Text)
scalingPlanResource_scalingStatusMessage = 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 name of the scaling plan.
scalingPlanResource_scalingPlanName :: Lens.Lens' ScalingPlanResource Prelude.Text
scalingPlanResource_scalingPlanName :: Lens' ScalingPlanResource Text
scalingPlanResource_scalingPlanName = 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 :: Lens' ScalingPlanResource Integer
scalingPlanResource_scalingPlanVersion = 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 :: Lens' ScalingPlanResource ServiceNamespace
scalingPlanResource_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 :: Lens' ScalingPlanResource Text
scalingPlanResource_resourceId = 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 :: Lens' ScalingPlanResource ScalableDimension
scalingPlanResource_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 :: Lens' ScalingPlanResource ScalingStatusCode
scalingPlanResource_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 Data.FromJSON ScalingPlanResource where
  parseJSON :: Value -> Parser ScalingPlanResource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ScalingPlanResource"
      ( \Object
x ->
          Maybe [ScalingPolicy]
-> Maybe Text
-> Text
-> Integer
-> ServiceNamespace
-> Text
-> ScalableDimension
-> ScalingStatusCode
-> ScalingPlanResource
ScalingPlanResource'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ScalingPolicies"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ScalingStatusMessage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalingPlanName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalingPlanVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ServiceNamespace")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ResourceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalableDimension")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalingStatusCode")
      )

instance Prelude.Hashable ScalingPlanResource where
  hashWithSalt :: Int -> ScalingPlanResource -> Int
hashWithSalt Int
_salt ScalingPlanResource' {Integer
Maybe [ScalingPolicy]
Maybe Text
Text
ScalableDimension
ScalingStatusCode
ServiceNamespace
scalingStatusCode :: ScalingStatusCode
scalableDimension :: ScalableDimension
resourceId :: Text
serviceNamespace :: ServiceNamespace
scalingPlanVersion :: Integer
scalingPlanName :: Text
scalingStatusMessage :: Maybe Text
scalingPolicies :: Maybe [ScalingPolicy]
$sel:scalingStatusCode:ScalingPlanResource' :: ScalingPlanResource -> ScalingStatusCode
$sel:scalableDimension:ScalingPlanResource' :: ScalingPlanResource -> ScalableDimension
$sel:resourceId:ScalingPlanResource' :: ScalingPlanResource -> Text
$sel:serviceNamespace:ScalingPlanResource' :: ScalingPlanResource -> ServiceNamespace
$sel:scalingPlanVersion:ScalingPlanResource' :: ScalingPlanResource -> Integer
$sel:scalingPlanName:ScalingPlanResource' :: ScalingPlanResource -> Text
$sel:scalingStatusMessage:ScalingPlanResource' :: ScalingPlanResource -> Maybe Text
$sel:scalingPolicies:ScalingPlanResource' :: ScalingPlanResource -> Maybe [ScalingPolicy]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ScalingPolicy]
scalingPolicies
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scalingStatusMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
scalingPlanName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
scalingPlanVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ServiceNamespace
serviceNamespace
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScalableDimension
scalableDimension
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScalingStatusCode
scalingStatusCode

instance Prelude.NFData ScalingPlanResource where
  rnf :: ScalingPlanResource -> ()
rnf ScalingPlanResource' {Integer
Maybe [ScalingPolicy]
Maybe Text
Text
ScalableDimension
ScalingStatusCode
ServiceNamespace
scalingStatusCode :: ScalingStatusCode
scalableDimension :: ScalableDimension
resourceId :: Text
serviceNamespace :: ServiceNamespace
scalingPlanVersion :: Integer
scalingPlanName :: Text
scalingStatusMessage :: Maybe Text
scalingPolicies :: Maybe [ScalingPolicy]
$sel:scalingStatusCode:ScalingPlanResource' :: ScalingPlanResource -> ScalingStatusCode
$sel:scalableDimension:ScalingPlanResource' :: ScalingPlanResource -> ScalableDimension
$sel:resourceId:ScalingPlanResource' :: ScalingPlanResource -> Text
$sel:serviceNamespace:ScalingPlanResource' :: ScalingPlanResource -> ServiceNamespace
$sel:scalingPlanVersion:ScalingPlanResource' :: ScalingPlanResource -> Integer
$sel:scalingPlanName:ScalingPlanResource' :: ScalingPlanResource -> Text
$sel:scalingStatusMessage:ScalingPlanResource' :: ScalingPlanResource -> Maybe Text
$sel:scalingPolicies:ScalingPlanResource' :: ScalingPlanResource -> Maybe [ScalingPolicy]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ScalingPolicy]
scalingPolicies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scalingStatusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
scalingPlanName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
scalingPlanVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ServiceNamespace
serviceNamespace
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScalableDimension
scalableDimension
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScalingStatusCode
scalingStatusCode