{-# 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 #-}
module Amazonka.ApplicationAutoScaling.DescribeScalingPolicies
(
DescribeScalingPolicies (..),
newDescribeScalingPolicies,
describeScalingPolicies_policyNames,
describeScalingPolicies_scalableDimension,
describeScalingPolicies_resourceId,
describeScalingPolicies_nextToken,
describeScalingPolicies_maxResults,
describeScalingPolicies_serviceNamespace,
DescribeScalingPoliciesResponse (..),
newDescribeScalingPoliciesResponse,
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
data DescribeScalingPolicies = DescribeScalingPolicies'
{
DescribeScalingPolicies -> Maybe [Text]
policyNames :: Prelude.Maybe [Prelude.Text],
DescribeScalingPolicies -> Maybe ScalableDimension
scalableDimension :: Prelude.Maybe ScalableDimension,
DescribeScalingPolicies -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
DescribeScalingPolicies -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeScalingPolicies -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
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)
newDescribeScalingPolicies ::
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_
}
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
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)
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)
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)
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)
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
data DescribeScalingPoliciesResponse = DescribeScalingPoliciesResponse'
{
DescribeScalingPoliciesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeScalingPoliciesResponse -> Maybe [ScalingPolicy]
scalingPolicies :: Prelude.Maybe [ScalingPolicy],
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)
newDescribeScalingPoliciesResponse ::
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_
}
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)
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
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