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

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

-- |
-- Module      : Amazonka.ApplicationAutoScaling.DescribeScalingPolicies
-- 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)
--
-- Describes the Application Auto Scaling scaling policies for the
-- specified service namespace.
--
-- You can filter the results using @ResourceId@, @ScalableDimension@, and
-- @PolicyNames@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html Target tracking scaling policies>
-- and
-- <https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html Step scaling policies>
-- in the /Application Auto Scaling User Guide/.
--
-- This operation returns paginated results.
module Amazonka.ApplicationAutoScaling.DescribeScalingPolicies
  ( -- * Creating a Request
    DescribeScalingPolicies (..),
    newDescribeScalingPolicies,

    -- * Request Lenses
    describeScalingPolicies_policyNames,
    describeScalingPolicies_scalableDimension,
    describeScalingPolicies_resourceId,
    describeScalingPolicies_nextToken,
    describeScalingPolicies_maxResults,
    describeScalingPolicies_serviceNamespace,

    -- * Destructuring the Response
    DescribeScalingPoliciesResponse (..),
    newDescribeScalingPoliciesResponse,

    -- * Response Lenses
    describeScalingPoliciesResponse_nextToken,
    describeScalingPoliciesResponse_scalingPolicies,
    describeScalingPoliciesResponse_httpStatus,
  )
where

import Amazonka.ApplicationAutoScaling.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeScalingPolicies' smart constructor.
data DescribeScalingPolicies = DescribeScalingPolicies'
  { -- | The names of the scaling policies to describe.
    DescribeScalingPolicies -> Maybe [Text]
policyNames :: Prelude.Maybe [Prelude.Text],
    -- | The scalable dimension. This string consists of the service namespace,
    -- resource type, and scaling property. If you specify a scalable
    -- dimension, you must also specify a resource ID.
    --
    -- -   @ecs:service:DesiredCount@ - The desired task count of an ECS
    --     service.
    --
    -- -   @elasticmapreduce:instancegroup:InstanceCount@ - The instance count
    --     of an EMR Instance Group.
    --
    -- -   @ec2:spot-fleet-request:TargetCapacity@ - The target capacity of a
    --     Spot Fleet.
    --
    -- -   @appstream:fleet:DesiredCapacity@ - The desired capacity of an
    --     AppStream 2.0 fleet.
    --
    -- -   @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.
    --
    -- -   @sagemaker:variant:DesiredInstanceCount@ - The number of EC2
    --     instances for an SageMaker model endpoint variant.
    --
    -- -   @custom-resource:ResourceType:Property@ - The scalable dimension for
    --     a custom resource provided by your own application or service.
    --
    -- -   @comprehend:document-classifier-endpoint:DesiredInferenceUnits@ -
    --     The number of inference units for an Amazon Comprehend document
    --     classification endpoint.
    --
    -- -   @comprehend:entity-recognizer-endpoint:DesiredInferenceUnits@ - The
    --     number of inference units for an Amazon Comprehend entity recognizer
    --     endpoint.
    --
    -- -   @lambda:function:ProvisionedConcurrency@ - The provisioned
    --     concurrency for a Lambda function.
    --
    -- -   @cassandra:table:ReadCapacityUnits@ - The provisioned read capacity
    --     for an Amazon Keyspaces table.
    --
    -- -   @cassandra:table:WriteCapacityUnits@ - The provisioned write
    --     capacity for an Amazon Keyspaces table.
    --
    -- -   @kafka:broker-storage:VolumeSize@ - The provisioned volume size (in
    --     GiB) for brokers in an Amazon MSK cluster.
    --
    -- -   @elasticache:replication-group:NodeGroups@ - The number of node
    --     groups for an Amazon ElastiCache replication group.
    --
    -- -   @elasticache:replication-group:Replicas@ - The number of replicas
    --     per node group for an Amazon ElastiCache replication group.
    --
    -- -   @neptune:cluster:ReadReplicaCount@ - The count of read replicas in
    --     an Amazon Neptune DB cluster.
    DescribeScalingPolicies -> Maybe ScalableDimension
scalableDimension :: Prelude.Maybe ScalableDimension,
    -- | The identifier of the resource associated with the scaling policy. This
    -- string consists of the resource type and unique identifier.
    --
    -- -   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 - 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@.
    --
    -- -   EMR cluster - The resource type is @instancegroup@ and the unique
    --     identifier is the cluster ID and instance group ID. Example:
    --     @instancegroup\/j-2EEZNYKUA1NTV\/ig-1791Y4E1L8YI0@.
    --
    -- -   AppStream 2.0 fleet - The resource type is @fleet@ and the unique
    --     identifier is the fleet name. Example: @fleet\/sample-fleet@.
    --
    -- -   DynamoDB table - The resource type is @table@ and the unique
    --     identifier is the table name. Example: @table\/my-table@.
    --
    -- -   DynamoDB global secondary index - The resource type is @index@ and
    --     the unique identifier is the index name. 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@.
    --
    -- -   SageMaker endpoint variant - The resource type is @variant@ and the
    --     unique identifier is the resource ID. Example:
    --     @endpoint\/my-end-point\/variant\/KMeansClustering@.
    --
    -- -   Custom resources are not supported with a resource type. This
    --     parameter must specify the @OutputValue@ from the CloudFormation
    --     template stack used to access the resources. The unique identifier
    --     is defined by the service provider. More information is available in
    --     our
    --     <https://github.com/aws/aws-auto-scaling-custom-resource GitHub repository>.
    --
    -- -   Amazon Comprehend document classification endpoint - The resource
    --     type and unique identifier are specified using the endpoint ARN.
    --     Example:
    --     @arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint\/EXAMPLE@.
    --
    -- -   Amazon Comprehend entity recognizer endpoint - The resource type and
    --     unique identifier are specified using the endpoint ARN. Example:
    --     @arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint\/EXAMPLE@.
    --
    -- -   Lambda provisioned concurrency - The resource type is @function@ and
    --     the unique identifier is the function name with a function version
    --     or alias name suffix that is not @$LATEST@. Example:
    --     @function:my-function:prod@ or @function:my-function:1@.
    --
    -- -   Amazon Keyspaces table - The resource type is @table@ and the unique
    --     identifier is the table name. Example:
    --     @keyspace\/mykeyspace\/table\/mytable@.
    --
    -- -   Amazon MSK cluster - The resource type and unique identifier are
    --     specified using the cluster ARN. Example:
    --     @arn:aws:kafka:us-east-1:123456789012:cluster\/demo-cluster-1\/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5@.
    --
    -- -   Amazon ElastiCache replication group - The resource type is
    --     @replication-group@ and the unique identifier is the replication
    --     group name. Example: @replication-group\/mycluster@.
    --
    -- -   Neptune cluster - The resource type is @cluster@ and the unique
    --     identifier is the cluster name. Example: @cluster:mycluster@.
    DescribeScalingPolicies -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results.
    DescribeScalingPolicies -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of scalable targets. This value can be between 1 and
    -- 10. The default value is 10.
    --
    -- If this parameter is used, the operation returns up to @MaxResults@
    -- results at a time, along with a @NextToken@ value. To get the next set
    -- of results, include the @NextToken@ value in a subsequent call. If this
    -- parameter is not used, the operation returns up to 10 results and a
    -- @NextToken@ value, if applicable.
    DescribeScalingPolicies -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The namespace of the Amazon Web Services service that provides the
    -- resource. For a resource provided by your own application or service,
    -- use @custom-resource@ instead.
    DescribeScalingPolicies -> ServiceNamespace
serviceNamespace :: ServiceNamespace
  }
  deriving (DescribeScalingPolicies -> DescribeScalingPolicies -> Bool
(DescribeScalingPolicies -> DescribeScalingPolicies -> Bool)
-> (DescribeScalingPolicies -> DescribeScalingPolicies -> Bool)
-> Eq DescribeScalingPolicies
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeScalingPolicies -> DescribeScalingPolicies -> Bool
$c/= :: DescribeScalingPolicies -> DescribeScalingPolicies -> Bool
== :: DescribeScalingPolicies -> DescribeScalingPolicies -> Bool
$c== :: DescribeScalingPolicies -> DescribeScalingPolicies -> Bool
Prelude.Eq, ReadPrec [DescribeScalingPolicies]
ReadPrec DescribeScalingPolicies
Int -> ReadS DescribeScalingPolicies
ReadS [DescribeScalingPolicies]
(Int -> ReadS DescribeScalingPolicies)
-> ReadS [DescribeScalingPolicies]
-> ReadPrec DescribeScalingPolicies
-> ReadPrec [DescribeScalingPolicies]
-> Read DescribeScalingPolicies
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeScalingPolicies]
$creadListPrec :: ReadPrec [DescribeScalingPolicies]
readPrec :: ReadPrec DescribeScalingPolicies
$creadPrec :: ReadPrec DescribeScalingPolicies
readList :: ReadS [DescribeScalingPolicies]
$creadList :: ReadS [DescribeScalingPolicies]
readsPrec :: Int -> ReadS DescribeScalingPolicies
$creadsPrec :: Int -> ReadS DescribeScalingPolicies
Prelude.Read, Int -> DescribeScalingPolicies -> ShowS
[DescribeScalingPolicies] -> ShowS
DescribeScalingPolicies -> String
(Int -> DescribeScalingPolicies -> ShowS)
-> (DescribeScalingPolicies -> String)
-> ([DescribeScalingPolicies] -> ShowS)
-> Show DescribeScalingPolicies
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeScalingPolicies] -> ShowS
$cshowList :: [DescribeScalingPolicies] -> ShowS
show :: DescribeScalingPolicies -> String
$cshow :: DescribeScalingPolicies -> String
showsPrec :: Int -> DescribeScalingPolicies -> ShowS
$cshowsPrec :: Int -> DescribeScalingPolicies -> ShowS
Prelude.Show, (forall x.
 DescribeScalingPolicies -> Rep DescribeScalingPolicies x)
-> (forall x.
    Rep DescribeScalingPolicies x -> DescribeScalingPolicies)
-> Generic DescribeScalingPolicies
forall x. Rep DescribeScalingPolicies x -> DescribeScalingPolicies
forall x. DescribeScalingPolicies -> Rep DescribeScalingPolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeScalingPolicies x -> DescribeScalingPolicies
$cfrom :: forall x. DescribeScalingPolicies -> Rep DescribeScalingPolicies x
Prelude.Generic)

-- |
-- Create a value of 'DescribeScalingPolicies' 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:
--
-- 'policyNames', 'describeScalingPolicies_policyNames' - The names of the scaling policies to describe.
--
-- 'scalableDimension', 'describeScalingPolicies_scalableDimension' - The scalable dimension. This string consists of the service namespace,
-- resource type, and scaling property. If you specify a scalable
-- dimension, you must also specify a resource ID.
--
-- -   @ecs:service:DesiredCount@ - The desired task count of an ECS
--     service.
--
-- -   @elasticmapreduce:instancegroup:InstanceCount@ - The instance count
--     of an EMR Instance Group.
--
-- -   @ec2:spot-fleet-request:TargetCapacity@ - The target capacity of a
--     Spot Fleet.
--
-- -   @appstream:fleet:DesiredCapacity@ - The desired capacity of an
--     AppStream 2.0 fleet.
--
-- -   @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.
--
-- -   @sagemaker:variant:DesiredInstanceCount@ - The number of EC2
--     instances for an SageMaker model endpoint variant.
--
-- -   @custom-resource:ResourceType:Property@ - The scalable dimension for
--     a custom resource provided by your own application or service.
--
-- -   @comprehend:document-classifier-endpoint:DesiredInferenceUnits@ -
--     The number of inference units for an Amazon Comprehend document
--     classification endpoint.
--
-- -   @comprehend:entity-recognizer-endpoint:DesiredInferenceUnits@ - The
--     number of inference units for an Amazon Comprehend entity recognizer
--     endpoint.
--
-- -   @lambda:function:ProvisionedConcurrency@ - The provisioned
--     concurrency for a Lambda function.
--
-- -   @cassandra:table:ReadCapacityUnits@ - The provisioned read capacity
--     for an Amazon Keyspaces table.
--
-- -   @cassandra:table:WriteCapacityUnits@ - The provisioned write
--     capacity for an Amazon Keyspaces table.
--
-- -   @kafka:broker-storage:VolumeSize@ - The provisioned volume size (in
--     GiB) for brokers in an Amazon MSK cluster.
--
-- -   @elasticache:replication-group:NodeGroups@ - The number of node
--     groups for an Amazon ElastiCache replication group.
--
-- -   @elasticache:replication-group:Replicas@ - The number of replicas
--     per node group for an Amazon ElastiCache replication group.
--
-- -   @neptune:cluster:ReadReplicaCount@ - The count of read replicas in
--     an Amazon Neptune DB cluster.
--
-- 'resourceId', 'describeScalingPolicies_resourceId' - The identifier of the resource associated with the scaling policy. This
-- string consists of the resource type and unique identifier.
--
-- -   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 - 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@.
--
-- -   EMR cluster - The resource type is @instancegroup@ and the unique
--     identifier is the cluster ID and instance group ID. Example:
--     @instancegroup\/j-2EEZNYKUA1NTV\/ig-1791Y4E1L8YI0@.
--
-- -   AppStream 2.0 fleet - The resource type is @fleet@ and the unique
--     identifier is the fleet name. Example: @fleet\/sample-fleet@.
--
-- -   DynamoDB table - The resource type is @table@ and the unique
--     identifier is the table name. Example: @table\/my-table@.
--
-- -   DynamoDB global secondary index - The resource type is @index@ and
--     the unique identifier is the index name. 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@.
--
-- -   SageMaker endpoint variant - The resource type is @variant@ and the
--     unique identifier is the resource ID. Example:
--     @endpoint\/my-end-point\/variant\/KMeansClustering@.
--
-- -   Custom resources are not supported with a resource type. This
--     parameter must specify the @OutputValue@ from the CloudFormation
--     template stack used to access the resources. The unique identifier
--     is defined by the service provider. More information is available in
--     our
--     <https://github.com/aws/aws-auto-scaling-custom-resource GitHub repository>.
--
-- -   Amazon Comprehend document classification endpoint - The resource
--     type and unique identifier are specified using the endpoint ARN.
--     Example:
--     @arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint\/EXAMPLE@.
--
-- -   Amazon Comprehend entity recognizer endpoint - The resource type and
--     unique identifier are specified using the endpoint ARN. Example:
--     @arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint\/EXAMPLE@.
--
-- -   Lambda provisioned concurrency - The resource type is @function@ and
--     the unique identifier is the function name with a function version
--     or alias name suffix that is not @$LATEST@. Example:
--     @function:my-function:prod@ or @function:my-function:1@.
--
-- -   Amazon Keyspaces table - The resource type is @table@ and the unique
--     identifier is the table name. Example:
--     @keyspace\/mykeyspace\/table\/mytable@.
--
-- -   Amazon MSK cluster - The resource type and unique identifier are
--     specified using the cluster ARN. Example:
--     @arn:aws:kafka:us-east-1:123456789012:cluster\/demo-cluster-1\/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5@.
--
-- -   Amazon ElastiCache replication group - The resource type is
--     @replication-group@ and the unique identifier is the replication
--     group name. Example: @replication-group\/mycluster@.
--
-- -   Neptune cluster - The resource type is @cluster@ and the unique
--     identifier is the cluster name. Example: @cluster:mycluster@.
--
-- 'nextToken', 'describeScalingPolicies_nextToken' - The token for the next set of results.
--
-- 'maxResults', 'describeScalingPolicies_maxResults' - The maximum number of scalable targets. This value can be between 1 and
-- 10. The default value is 10.
--
-- If this parameter is used, the operation returns up to @MaxResults@
-- results at a time, along with a @NextToken@ value. To get the next set
-- of results, include the @NextToken@ value in a subsequent call. If this
-- parameter is not used, the operation returns up to 10 results and a
-- @NextToken@ value, if applicable.
--
-- 'serviceNamespace', 'describeScalingPolicies_serviceNamespace' - The namespace of the Amazon Web Services service that provides the
-- resource. For a resource provided by your own application or service,
-- use @custom-resource@ instead.
newDescribeScalingPolicies ::
  -- | 'serviceNamespace'
  ServiceNamespace ->
  DescribeScalingPolicies
newDescribeScalingPolicies :: ServiceNamespace -> DescribeScalingPolicies
newDescribeScalingPolicies ServiceNamespace
pServiceNamespace_ =
  DescribeScalingPolicies' :: Maybe [Text]
-> Maybe ScalableDimension
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> ServiceNamespace
-> DescribeScalingPolicies
DescribeScalingPolicies'
    { $sel:policyNames:DescribeScalingPolicies' :: Maybe [Text]
policyNames =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:scalableDimension:DescribeScalingPolicies' :: Maybe ScalableDimension
scalableDimension = Maybe ScalableDimension
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:DescribeScalingPolicies' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeScalingPolicies' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeScalingPolicies' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceNamespace:DescribeScalingPolicies' :: ServiceNamespace
serviceNamespace = ServiceNamespace
pServiceNamespace_
    }

-- | The names of the scaling policies to describe.
describeScalingPolicies_policyNames :: Lens.Lens' DescribeScalingPolicies (Prelude.Maybe [Prelude.Text])
describeScalingPolicies_policyNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeScalingPolicies -> f DescribeScalingPolicies
describeScalingPolicies_policyNames = (DescribeScalingPolicies -> Maybe [Text])
-> (DescribeScalingPolicies
    -> Maybe [Text] -> DescribeScalingPolicies)
-> Lens
     DescribeScalingPolicies
     DescribeScalingPolicies
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPolicies' {Maybe [Text]
policyNames :: Maybe [Text]
$sel:policyNames:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe [Text]
policyNames} -> Maybe [Text]
policyNames) (\s :: DescribeScalingPolicies
s@DescribeScalingPolicies' {} Maybe [Text]
a -> DescribeScalingPolicies
s {$sel:policyNames:DescribeScalingPolicies' :: Maybe [Text]
policyNames = Maybe [Text]
a} :: DescribeScalingPolicies) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeScalingPolicies -> f DescribeScalingPolicies)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeScalingPolicies
-> f DescribeScalingPolicies
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The scalable dimension. This string consists of the service namespace,
-- resource type, and scaling property. If you specify a scalable
-- dimension, you must also specify a resource ID.
--
-- -   @ecs:service:DesiredCount@ - The desired task count of an ECS
--     service.
--
-- -   @elasticmapreduce:instancegroup:InstanceCount@ - The instance count
--     of an EMR Instance Group.
--
-- -   @ec2:spot-fleet-request:TargetCapacity@ - The target capacity of a
--     Spot Fleet.
--
-- -   @appstream:fleet:DesiredCapacity@ - The desired capacity of an
--     AppStream 2.0 fleet.
--
-- -   @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.
--
-- -   @sagemaker:variant:DesiredInstanceCount@ - The number of EC2
--     instances for an SageMaker model endpoint variant.
--
-- -   @custom-resource:ResourceType:Property@ - The scalable dimension for
--     a custom resource provided by your own application or service.
--
-- -   @comprehend:document-classifier-endpoint:DesiredInferenceUnits@ -
--     The number of inference units for an Amazon Comprehend document
--     classification endpoint.
--
-- -   @comprehend:entity-recognizer-endpoint:DesiredInferenceUnits@ - The
--     number of inference units for an Amazon Comprehend entity recognizer
--     endpoint.
--
-- -   @lambda:function:ProvisionedConcurrency@ - The provisioned
--     concurrency for a Lambda function.
--
-- -   @cassandra:table:ReadCapacityUnits@ - The provisioned read capacity
--     for an Amazon Keyspaces table.
--
-- -   @cassandra:table:WriteCapacityUnits@ - The provisioned write
--     capacity for an Amazon Keyspaces table.
--
-- -   @kafka:broker-storage:VolumeSize@ - The provisioned volume size (in
--     GiB) for brokers in an Amazon MSK cluster.
--
-- -   @elasticache:replication-group:NodeGroups@ - The number of node
--     groups for an Amazon ElastiCache replication group.
--
-- -   @elasticache:replication-group:Replicas@ - The number of replicas
--     per node group for an Amazon ElastiCache replication group.
--
-- -   @neptune:cluster:ReadReplicaCount@ - The count of read replicas in
--     an Amazon Neptune DB cluster.
describeScalingPolicies_scalableDimension :: Lens.Lens' DescribeScalingPolicies (Prelude.Maybe ScalableDimension)
describeScalingPolicies_scalableDimension :: (Maybe ScalableDimension -> f (Maybe ScalableDimension))
-> DescribeScalingPolicies -> f DescribeScalingPolicies
describeScalingPolicies_scalableDimension = (DescribeScalingPolicies -> Maybe ScalableDimension)
-> (DescribeScalingPolicies
    -> Maybe ScalableDimension -> DescribeScalingPolicies)
-> Lens
     DescribeScalingPolicies
     DescribeScalingPolicies
     (Maybe ScalableDimension)
     (Maybe ScalableDimension)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPolicies' {Maybe ScalableDimension
scalableDimension :: Maybe ScalableDimension
$sel:scalableDimension:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe ScalableDimension
scalableDimension} -> Maybe ScalableDimension
scalableDimension) (\s :: DescribeScalingPolicies
s@DescribeScalingPolicies' {} Maybe ScalableDimension
a -> DescribeScalingPolicies
s {$sel:scalableDimension:DescribeScalingPolicies' :: Maybe ScalableDimension
scalableDimension = Maybe ScalableDimension
a} :: DescribeScalingPolicies)

-- | The identifier of the resource associated with the scaling policy. This
-- string consists of the resource type and unique identifier.
--
-- -   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 - 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@.
--
-- -   EMR cluster - The resource type is @instancegroup@ and the unique
--     identifier is the cluster ID and instance group ID. Example:
--     @instancegroup\/j-2EEZNYKUA1NTV\/ig-1791Y4E1L8YI0@.
--
-- -   AppStream 2.0 fleet - The resource type is @fleet@ and the unique
--     identifier is the fleet name. Example: @fleet\/sample-fleet@.
--
-- -   DynamoDB table - The resource type is @table@ and the unique
--     identifier is the table name. Example: @table\/my-table@.
--
-- -   DynamoDB global secondary index - The resource type is @index@ and
--     the unique identifier is the index name. 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@.
--
-- -   SageMaker endpoint variant - The resource type is @variant@ and the
--     unique identifier is the resource ID. Example:
--     @endpoint\/my-end-point\/variant\/KMeansClustering@.
--
-- -   Custom resources are not supported with a resource type. This
--     parameter must specify the @OutputValue@ from the CloudFormation
--     template stack used to access the resources. The unique identifier
--     is defined by the service provider. More information is available in
--     our
--     <https://github.com/aws/aws-auto-scaling-custom-resource GitHub repository>.
--
-- -   Amazon Comprehend document classification endpoint - The resource
--     type and unique identifier are specified using the endpoint ARN.
--     Example:
--     @arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint\/EXAMPLE@.
--
-- -   Amazon Comprehend entity recognizer endpoint - The resource type and
--     unique identifier are specified using the endpoint ARN. Example:
--     @arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint\/EXAMPLE@.
--
-- -   Lambda provisioned concurrency - The resource type is @function@ and
--     the unique identifier is the function name with a function version
--     or alias name suffix that is not @$LATEST@. Example:
--     @function:my-function:prod@ or @function:my-function:1@.
--
-- -   Amazon Keyspaces table - The resource type is @table@ and the unique
--     identifier is the table name. Example:
--     @keyspace\/mykeyspace\/table\/mytable@.
--
-- -   Amazon MSK cluster - The resource type and unique identifier are
--     specified using the cluster ARN. Example:
--     @arn:aws:kafka:us-east-1:123456789012:cluster\/demo-cluster-1\/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5@.
--
-- -   Amazon ElastiCache replication group - The resource type is
--     @replication-group@ and the unique identifier is the replication
--     group name. Example: @replication-group\/mycluster@.
--
-- -   Neptune cluster - The resource type is @cluster@ and the unique
--     identifier is the cluster name. Example: @cluster:mycluster@.
describeScalingPolicies_resourceId :: Lens.Lens' DescribeScalingPolicies (Prelude.Maybe Prelude.Text)
describeScalingPolicies_resourceId :: (Maybe Text -> f (Maybe Text))
-> DescribeScalingPolicies -> f DescribeScalingPolicies
describeScalingPolicies_resourceId = (DescribeScalingPolicies -> Maybe Text)
-> (DescribeScalingPolicies
    -> Maybe Text -> DescribeScalingPolicies)
-> Lens
     DescribeScalingPolicies
     DescribeScalingPolicies
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPolicies' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: DescribeScalingPolicies
s@DescribeScalingPolicies' {} Maybe Text
a -> DescribeScalingPolicies
s {$sel:resourceId:DescribeScalingPolicies' :: Maybe Text
resourceId = Maybe Text
a} :: DescribeScalingPolicies)

-- | The token for the next set of results.
describeScalingPolicies_nextToken :: Lens.Lens' DescribeScalingPolicies (Prelude.Maybe Prelude.Text)
describeScalingPolicies_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeScalingPolicies -> f DescribeScalingPolicies
describeScalingPolicies_nextToken = (DescribeScalingPolicies -> Maybe Text)
-> (DescribeScalingPolicies
    -> Maybe Text -> DescribeScalingPolicies)
-> Lens
     DescribeScalingPolicies
     DescribeScalingPolicies
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPolicies' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeScalingPolicies
s@DescribeScalingPolicies' {} Maybe Text
a -> DescribeScalingPolicies
s {$sel:nextToken:DescribeScalingPolicies' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeScalingPolicies)

-- | The maximum number of scalable targets. This value can be between 1 and
-- 10. The default value is 10.
--
-- If this parameter is used, the operation returns up to @MaxResults@
-- results at a time, along with a @NextToken@ value. To get the next set
-- of results, include the @NextToken@ value in a subsequent call. If this
-- parameter is not used, the operation returns up to 10 results and a
-- @NextToken@ value, if applicable.
describeScalingPolicies_maxResults :: Lens.Lens' DescribeScalingPolicies (Prelude.Maybe Prelude.Int)
describeScalingPolicies_maxResults :: (Maybe Int -> f (Maybe Int))
-> DescribeScalingPolicies -> f DescribeScalingPolicies
describeScalingPolicies_maxResults = (DescribeScalingPolicies -> Maybe Int)
-> (DescribeScalingPolicies
    -> Maybe Int -> DescribeScalingPolicies)
-> Lens
     DescribeScalingPolicies
     DescribeScalingPolicies
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPolicies' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeScalingPolicies
s@DescribeScalingPolicies' {} Maybe Int
a -> DescribeScalingPolicies
s {$sel:maxResults:DescribeScalingPolicies' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeScalingPolicies)

-- | The namespace of the Amazon Web Services service that provides the
-- resource. For a resource provided by your own application or service,
-- use @custom-resource@ instead.
describeScalingPolicies_serviceNamespace :: Lens.Lens' DescribeScalingPolicies ServiceNamespace
describeScalingPolicies_serviceNamespace :: (ServiceNamespace -> f ServiceNamespace)
-> DescribeScalingPolicies -> f DescribeScalingPolicies
describeScalingPolicies_serviceNamespace = (DescribeScalingPolicies -> ServiceNamespace)
-> (DescribeScalingPolicies
    -> ServiceNamespace -> DescribeScalingPolicies)
-> Lens
     DescribeScalingPolicies
     DescribeScalingPolicies
     ServiceNamespace
     ServiceNamespace
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPolicies' {ServiceNamespace
serviceNamespace :: ServiceNamespace
$sel:serviceNamespace:DescribeScalingPolicies' :: DescribeScalingPolicies -> ServiceNamespace
serviceNamespace} -> ServiceNamespace
serviceNamespace) (\s :: DescribeScalingPolicies
s@DescribeScalingPolicies' {} ServiceNamespace
a -> DescribeScalingPolicies
s {$sel:serviceNamespace:DescribeScalingPolicies' :: ServiceNamespace
serviceNamespace = ServiceNamespace
a} :: DescribeScalingPolicies)

instance Core.AWSPager DescribeScalingPolicies where
  page :: DescribeScalingPolicies
-> AWSResponse DescribeScalingPolicies
-> Maybe DescribeScalingPolicies
page DescribeScalingPolicies
rq AWSResponse DescribeScalingPolicies
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeScalingPolicies
DescribeScalingPoliciesResponse
rs
            DescribeScalingPoliciesResponse
-> Getting (First Text) DescribeScalingPoliciesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeScalingPoliciesResponse
-> Const (First Text) DescribeScalingPoliciesResponse
Lens' DescribeScalingPoliciesResponse (Maybe Text)
describeScalingPoliciesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeScalingPoliciesResponse
 -> Const (First Text) DescribeScalingPoliciesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeScalingPoliciesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeScalingPolicies
forall a. Maybe a
Prelude.Nothing
    | Maybe [ScalingPolicy] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeScalingPolicies
DescribeScalingPoliciesResponse
rs
            DescribeScalingPoliciesResponse
-> Getting
     (First [ScalingPolicy])
     DescribeScalingPoliciesResponse
     [ScalingPolicy]
-> Maybe [ScalingPolicy]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ScalingPolicy]
 -> Const (First [ScalingPolicy]) (Maybe [ScalingPolicy]))
-> DescribeScalingPoliciesResponse
-> Const (First [ScalingPolicy]) DescribeScalingPoliciesResponse
Lens' DescribeScalingPoliciesResponse (Maybe [ScalingPolicy])
describeScalingPoliciesResponse_scalingPolicies
              ((Maybe [ScalingPolicy]
  -> Const (First [ScalingPolicy]) (Maybe [ScalingPolicy]))
 -> DescribeScalingPoliciesResponse
 -> Const (First [ScalingPolicy]) DescribeScalingPoliciesResponse)
-> (([ScalingPolicy]
     -> Const (First [ScalingPolicy]) [ScalingPolicy])
    -> Maybe [ScalingPolicy]
    -> Const (First [ScalingPolicy]) (Maybe [ScalingPolicy]))
-> Getting
     (First [ScalingPolicy])
     DescribeScalingPoliciesResponse
     [ScalingPolicy]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ScalingPolicy] -> Const (First [ScalingPolicy]) [ScalingPolicy])
-> Maybe [ScalingPolicy]
-> Const (First [ScalingPolicy]) (Maybe [ScalingPolicy])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeScalingPolicies
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeScalingPolicies -> Maybe DescribeScalingPolicies
forall a. a -> Maybe a
Prelude.Just (DescribeScalingPolicies -> Maybe DescribeScalingPolicies)
-> DescribeScalingPolicies -> Maybe DescribeScalingPolicies
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeScalingPolicies
rq
          DescribeScalingPolicies
-> (DescribeScalingPolicies -> DescribeScalingPolicies)
-> DescribeScalingPolicies
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeScalingPolicies -> Identity DescribeScalingPolicies
Lens
  DescribeScalingPolicies
  DescribeScalingPolicies
  (Maybe Text)
  (Maybe Text)
describeScalingPolicies_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeScalingPolicies -> Identity DescribeScalingPolicies)
-> Maybe Text -> DescribeScalingPolicies -> DescribeScalingPolicies
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeScalingPolicies
DescribeScalingPoliciesResponse
rs
          DescribeScalingPoliciesResponse
-> Getting (First Text) DescribeScalingPoliciesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeScalingPoliciesResponse
-> Const (First Text) DescribeScalingPoliciesResponse
Lens' DescribeScalingPoliciesResponse (Maybe Text)
describeScalingPoliciesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeScalingPoliciesResponse
 -> Const (First Text) DescribeScalingPoliciesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeScalingPoliciesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeScalingPolicies where
  type
    AWSResponse DescribeScalingPolicies =
      DescribeScalingPoliciesResponse
  request :: DescribeScalingPolicies -> Request DescribeScalingPolicies
request = Service
-> DescribeScalingPolicies -> Request DescribeScalingPolicies
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeScalingPolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeScalingPolicies)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeScalingPolicies))
-> Logger
-> Service
-> Proxy DescribeScalingPolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeScalingPolicies)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ScalingPolicy] -> Int -> DescribeScalingPoliciesResponse
DescribeScalingPoliciesResponse'
            (Maybe Text
 -> Maybe [ScalingPolicy] -> Int -> DescribeScalingPoliciesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ScalingPolicy] -> Int -> DescribeScalingPoliciesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [ScalingPolicy] -> Int -> DescribeScalingPoliciesResponse)
-> Either String (Maybe [ScalingPolicy])
-> Either String (Int -> DescribeScalingPoliciesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ScalingPolicy]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ScalingPolicies"
                            Either String (Maybe (Maybe [ScalingPolicy]))
-> Maybe [ScalingPolicy] -> Either String (Maybe [ScalingPolicy])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ScalingPolicy]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DescribeScalingPoliciesResponse)
-> Either String Int
-> Either String DescribeScalingPoliciesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeScalingPolicies

instance Prelude.NFData DescribeScalingPolicies

instance Core.ToHeaders DescribeScalingPolicies where
  toHeaders :: DescribeScalingPolicies -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeScalingPolicies -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AnyScaleFrontendService.DescribeScalingPolicies" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DescribeScalingPolicies where
  toJSON :: DescribeScalingPolicies -> Value
toJSON DescribeScalingPolicies' {Maybe Int
Maybe [Text]
Maybe Text
Maybe ScalableDimension
ServiceNamespace
serviceNamespace :: ServiceNamespace
maxResults :: Maybe Int
nextToken :: Maybe Text
resourceId :: Maybe Text
scalableDimension :: Maybe ScalableDimension
policyNames :: Maybe [Text]
$sel:serviceNamespace:DescribeScalingPolicies' :: DescribeScalingPolicies -> ServiceNamespace
$sel:maxResults:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe Int
$sel:nextToken:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe Text
$sel:resourceId:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe Text
$sel:scalableDimension:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe ScalableDimension
$sel:policyNames:DescribeScalingPolicies' :: DescribeScalingPolicies -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PolicyNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
policyNames,
            (Text
"ScalableDimension" Text -> ScalableDimension -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ScalableDimension -> Pair)
-> Maybe ScalableDimension -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScalableDimension
scalableDimension,
            (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceId,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ServiceNamespace" Text -> ServiceNamespace -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ServiceNamespace
serviceNamespace)
          ]
      )

instance Core.ToPath DescribeScalingPolicies where
  toPath :: DescribeScalingPolicies -> ByteString
toPath = ByteString -> DescribeScalingPolicies -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeScalingPolicies where
  toQuery :: DescribeScalingPolicies -> QueryString
toQuery = QueryString -> DescribeScalingPolicies -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeScalingPoliciesResponse' smart constructor.
data DescribeScalingPoliciesResponse = DescribeScalingPoliciesResponse'
  { -- | The token required to get the next set of results. This value is @null@
    -- if there are no more results to return.
    DescribeScalingPoliciesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the scaling policies.
    DescribeScalingPoliciesResponse -> Maybe [ScalingPolicy]
scalingPolicies :: Prelude.Maybe [ScalingPolicy],
    -- | The response's http status code.
    DescribeScalingPoliciesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeScalingPoliciesResponse
-> DescribeScalingPoliciesResponse -> Bool
(DescribeScalingPoliciesResponse
 -> DescribeScalingPoliciesResponse -> Bool)
-> (DescribeScalingPoliciesResponse
    -> DescribeScalingPoliciesResponse -> Bool)
-> Eq DescribeScalingPoliciesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeScalingPoliciesResponse
-> DescribeScalingPoliciesResponse -> Bool
$c/= :: DescribeScalingPoliciesResponse
-> DescribeScalingPoliciesResponse -> Bool
== :: DescribeScalingPoliciesResponse
-> DescribeScalingPoliciesResponse -> Bool
$c== :: DescribeScalingPoliciesResponse
-> DescribeScalingPoliciesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeScalingPoliciesResponse]
ReadPrec DescribeScalingPoliciesResponse
Int -> ReadS DescribeScalingPoliciesResponse
ReadS [DescribeScalingPoliciesResponse]
(Int -> ReadS DescribeScalingPoliciesResponse)
-> ReadS [DescribeScalingPoliciesResponse]
-> ReadPrec DescribeScalingPoliciesResponse
-> ReadPrec [DescribeScalingPoliciesResponse]
-> Read DescribeScalingPoliciesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeScalingPoliciesResponse]
$creadListPrec :: ReadPrec [DescribeScalingPoliciesResponse]
readPrec :: ReadPrec DescribeScalingPoliciesResponse
$creadPrec :: ReadPrec DescribeScalingPoliciesResponse
readList :: ReadS [DescribeScalingPoliciesResponse]
$creadList :: ReadS [DescribeScalingPoliciesResponse]
readsPrec :: Int -> ReadS DescribeScalingPoliciesResponse
$creadsPrec :: Int -> ReadS DescribeScalingPoliciesResponse
Prelude.Read, Int -> DescribeScalingPoliciesResponse -> ShowS
[DescribeScalingPoliciesResponse] -> ShowS
DescribeScalingPoliciesResponse -> String
(Int -> DescribeScalingPoliciesResponse -> ShowS)
-> (DescribeScalingPoliciesResponse -> String)
-> ([DescribeScalingPoliciesResponse] -> ShowS)
-> Show DescribeScalingPoliciesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeScalingPoliciesResponse] -> ShowS
$cshowList :: [DescribeScalingPoliciesResponse] -> ShowS
show :: DescribeScalingPoliciesResponse -> String
$cshow :: DescribeScalingPoliciesResponse -> String
showsPrec :: Int -> DescribeScalingPoliciesResponse -> ShowS
$cshowsPrec :: Int -> DescribeScalingPoliciesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeScalingPoliciesResponse
 -> Rep DescribeScalingPoliciesResponse x)
-> (forall x.
    Rep DescribeScalingPoliciesResponse x
    -> DescribeScalingPoliciesResponse)
-> Generic DescribeScalingPoliciesResponse
forall x.
Rep DescribeScalingPoliciesResponse x
-> DescribeScalingPoliciesResponse
forall x.
DescribeScalingPoliciesResponse
-> Rep DescribeScalingPoliciesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeScalingPoliciesResponse x
-> DescribeScalingPoliciesResponse
$cfrom :: forall x.
DescribeScalingPoliciesResponse
-> Rep DescribeScalingPoliciesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeScalingPoliciesResponse' 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:
--
-- 'nextToken', 'describeScalingPoliciesResponse_nextToken' - The token required to get the next set of results. This value is @null@
-- if there are no more results to return.
--
-- 'scalingPolicies', 'describeScalingPoliciesResponse_scalingPolicies' - Information about the scaling policies.
--
-- 'httpStatus', 'describeScalingPoliciesResponse_httpStatus' - The response's http status code.
newDescribeScalingPoliciesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeScalingPoliciesResponse
newDescribeScalingPoliciesResponse :: Int -> DescribeScalingPoliciesResponse
newDescribeScalingPoliciesResponse Int
pHttpStatus_ =
  DescribeScalingPoliciesResponse' :: Maybe Text
-> Maybe [ScalingPolicy] -> Int -> DescribeScalingPoliciesResponse
DescribeScalingPoliciesResponse'
    { $sel:nextToken:DescribeScalingPoliciesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scalingPolicies:DescribeScalingPoliciesResponse' :: Maybe [ScalingPolicy]
scalingPolicies = Maybe [ScalingPolicy]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeScalingPoliciesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token required to get the next set of results. This value is @null@
-- if there are no more results to return.
describeScalingPoliciesResponse_nextToken :: Lens.Lens' DescribeScalingPoliciesResponse (Prelude.Maybe Prelude.Text)
describeScalingPoliciesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeScalingPoliciesResponse
-> f DescribeScalingPoliciesResponse
describeScalingPoliciesResponse_nextToken = (DescribeScalingPoliciesResponse -> Maybe Text)
-> (DescribeScalingPoliciesResponse
    -> Maybe Text -> DescribeScalingPoliciesResponse)
-> Lens' DescribeScalingPoliciesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPoliciesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeScalingPoliciesResponse' :: DescribeScalingPoliciesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeScalingPoliciesResponse
s@DescribeScalingPoliciesResponse' {} Maybe Text
a -> DescribeScalingPoliciesResponse
s {$sel:nextToken:DescribeScalingPoliciesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeScalingPoliciesResponse)

-- | Information about the scaling policies.
describeScalingPoliciesResponse_scalingPolicies :: Lens.Lens' DescribeScalingPoliciesResponse (Prelude.Maybe [ScalingPolicy])
describeScalingPoliciesResponse_scalingPolicies :: (Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> DescribeScalingPoliciesResponse
-> f DescribeScalingPoliciesResponse
describeScalingPoliciesResponse_scalingPolicies = (DescribeScalingPoliciesResponse -> Maybe [ScalingPolicy])
-> (DescribeScalingPoliciesResponse
    -> Maybe [ScalingPolicy] -> DescribeScalingPoliciesResponse)
-> Lens' DescribeScalingPoliciesResponse (Maybe [ScalingPolicy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPoliciesResponse' {Maybe [ScalingPolicy]
scalingPolicies :: Maybe [ScalingPolicy]
$sel:scalingPolicies:DescribeScalingPoliciesResponse' :: DescribeScalingPoliciesResponse -> Maybe [ScalingPolicy]
scalingPolicies} -> Maybe [ScalingPolicy]
scalingPolicies) (\s :: DescribeScalingPoliciesResponse
s@DescribeScalingPoliciesResponse' {} Maybe [ScalingPolicy]
a -> DescribeScalingPoliciesResponse
s {$sel:scalingPolicies:DescribeScalingPoliciesResponse' :: Maybe [ScalingPolicy]
scalingPolicies = Maybe [ScalingPolicy]
a} :: DescribeScalingPoliciesResponse) ((Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
 -> DescribeScalingPoliciesResponse
 -> f DescribeScalingPoliciesResponse)
-> ((Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
    -> Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> (Maybe [ScalingPolicy] -> f (Maybe [ScalingPolicy]))
-> DescribeScalingPoliciesResponse
-> f DescribeScalingPoliciesResponse
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 response's http status code.
describeScalingPoliciesResponse_httpStatus :: Lens.Lens' DescribeScalingPoliciesResponse Prelude.Int
describeScalingPoliciesResponse_httpStatus :: (Int -> f Int)
-> DescribeScalingPoliciesResponse
-> f DescribeScalingPoliciesResponse
describeScalingPoliciesResponse_httpStatus = (DescribeScalingPoliciesResponse -> Int)
-> (DescribeScalingPoliciesResponse
    -> Int -> DescribeScalingPoliciesResponse)
-> Lens
     DescribeScalingPoliciesResponse
     DescribeScalingPoliciesResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeScalingPoliciesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeScalingPoliciesResponse' :: DescribeScalingPoliciesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeScalingPoliciesResponse
s@DescribeScalingPoliciesResponse' {} Int
a -> DescribeScalingPoliciesResponse
s {$sel:httpStatus:DescribeScalingPoliciesResponse' :: Int
httpStatus = Int
a} :: DescribeScalingPoliciesResponse)

instance
  Prelude.NFData
    DescribeScalingPoliciesResponse