{-# 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.AutoScaling.DescribeWarmPool
(
DescribeWarmPool (..),
newDescribeWarmPool,
describeWarmPool_maxRecords,
describeWarmPool_nextToken,
describeWarmPool_autoScalingGroupName,
DescribeWarmPoolResponse (..),
newDescribeWarmPoolResponse,
describeWarmPoolResponse_instances,
describeWarmPoolResponse_nextToken,
describeWarmPoolResponse_warmPoolConfiguration,
describeWarmPoolResponse_httpStatus,
)
where
import Amazonka.AutoScaling.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeWarmPool = DescribeWarmPool'
{
DescribeWarmPool -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
DescribeWarmPool -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeWarmPool -> Text
autoScalingGroupName :: Prelude.Text
}
deriving (DescribeWarmPool -> DescribeWarmPool -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeWarmPool -> DescribeWarmPool -> Bool
$c/= :: DescribeWarmPool -> DescribeWarmPool -> Bool
== :: DescribeWarmPool -> DescribeWarmPool -> Bool
$c== :: DescribeWarmPool -> DescribeWarmPool -> Bool
Prelude.Eq, ReadPrec [DescribeWarmPool]
ReadPrec DescribeWarmPool
Int -> ReadS DescribeWarmPool
ReadS [DescribeWarmPool]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeWarmPool]
$creadListPrec :: ReadPrec [DescribeWarmPool]
readPrec :: ReadPrec DescribeWarmPool
$creadPrec :: ReadPrec DescribeWarmPool
readList :: ReadS [DescribeWarmPool]
$creadList :: ReadS [DescribeWarmPool]
readsPrec :: Int -> ReadS DescribeWarmPool
$creadsPrec :: Int -> ReadS DescribeWarmPool
Prelude.Read, Int -> DescribeWarmPool -> ShowS
[DescribeWarmPool] -> ShowS
DescribeWarmPool -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeWarmPool] -> ShowS
$cshowList :: [DescribeWarmPool] -> ShowS
show :: DescribeWarmPool -> String
$cshow :: DescribeWarmPool -> String
showsPrec :: Int -> DescribeWarmPool -> ShowS
$cshowsPrec :: Int -> DescribeWarmPool -> ShowS
Prelude.Show, forall x. Rep DescribeWarmPool x -> DescribeWarmPool
forall x. DescribeWarmPool -> Rep DescribeWarmPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeWarmPool x -> DescribeWarmPool
$cfrom :: forall x. DescribeWarmPool -> Rep DescribeWarmPool x
Prelude.Generic)
newDescribeWarmPool ::
Prelude.Text ->
DescribeWarmPool
newDescribeWarmPool :: Text -> DescribeWarmPool
newDescribeWarmPool Text
pAutoScalingGroupName_ =
DescribeWarmPool'
{ $sel:maxRecords:DescribeWarmPool' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:DescribeWarmPool' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroupName:DescribeWarmPool' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_
}
describeWarmPool_maxRecords :: Lens.Lens' DescribeWarmPool (Prelude.Maybe Prelude.Int)
describeWarmPool_maxRecords :: Lens' DescribeWarmPool (Maybe Int)
describeWarmPool_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWarmPool' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeWarmPool' :: DescribeWarmPool -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeWarmPool
s@DescribeWarmPool' {} Maybe Int
a -> DescribeWarmPool
s {$sel:maxRecords:DescribeWarmPool' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeWarmPool)
describeWarmPool_nextToken :: Lens.Lens' DescribeWarmPool (Prelude.Maybe Prelude.Text)
describeWarmPool_nextToken :: Lens' DescribeWarmPool (Maybe Text)
describeWarmPool_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWarmPool' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeWarmPool' :: DescribeWarmPool -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeWarmPool
s@DescribeWarmPool' {} Maybe Text
a -> DescribeWarmPool
s {$sel:nextToken:DescribeWarmPool' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeWarmPool)
describeWarmPool_autoScalingGroupName :: Lens.Lens' DescribeWarmPool Prelude.Text
describeWarmPool_autoScalingGroupName :: Lens' DescribeWarmPool Text
describeWarmPool_autoScalingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWarmPool' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:DescribeWarmPool' :: DescribeWarmPool -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: DescribeWarmPool
s@DescribeWarmPool' {} Text
a -> DescribeWarmPool
s {$sel:autoScalingGroupName:DescribeWarmPool' :: Text
autoScalingGroupName = Text
a} :: DescribeWarmPool)
instance Core.AWSRequest DescribeWarmPool where
type
AWSResponse DescribeWarmPool =
DescribeWarmPoolResponse
request :: (Service -> Service)
-> DescribeWarmPool -> Request DescribeWarmPool
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeWarmPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeWarmPool)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DescribeWarmPoolResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [Instance]
-> Maybe Text
-> Maybe WarmPoolConfiguration
-> Int
-> DescribeWarmPoolResponse
DescribeWarmPoolResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Instances"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"WarmPoolConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeWarmPool where
hashWithSalt :: Int -> DescribeWarmPool -> Int
hashWithSalt Int
_salt DescribeWarmPool' {Maybe Int
Maybe Text
Text
autoScalingGroupName :: Text
nextToken :: Maybe Text
maxRecords :: Maybe Int
$sel:autoScalingGroupName:DescribeWarmPool' :: DescribeWarmPool -> Text
$sel:nextToken:DescribeWarmPool' :: DescribeWarmPool -> Maybe Text
$sel:maxRecords:DescribeWarmPool' :: DescribeWarmPool -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
autoScalingGroupName
instance Prelude.NFData DescribeWarmPool where
rnf :: DescribeWarmPool -> ()
rnf DescribeWarmPool' {Maybe Int
Maybe Text
Text
autoScalingGroupName :: Text
nextToken :: Maybe Text
maxRecords :: Maybe Int
$sel:autoScalingGroupName:DescribeWarmPool' :: DescribeWarmPool -> Text
$sel:nextToken:DescribeWarmPool' :: DescribeWarmPool -> Maybe Text
$sel:maxRecords:DescribeWarmPool' :: DescribeWarmPool -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
autoScalingGroupName
instance Data.ToHeaders DescribeWarmPool where
toHeaders :: DescribeWarmPool -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DescribeWarmPool where
toPath :: DescribeWarmPool -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeWarmPool where
toQuery :: DescribeWarmPool -> QueryString
toQuery DescribeWarmPool' {Maybe Int
Maybe Text
Text
autoScalingGroupName :: Text
nextToken :: Maybe Text
maxRecords :: Maybe Int
$sel:autoScalingGroupName:DescribeWarmPool' :: DescribeWarmPool -> Text
$sel:nextToken:DescribeWarmPool' :: DescribeWarmPool -> Maybe Text
$sel:maxRecords:DescribeWarmPool' :: DescribeWarmPool -> Maybe Int
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeWarmPool" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords,
ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"AutoScalingGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
autoScalingGroupName
]
data DescribeWarmPoolResponse = DescribeWarmPoolResponse'
{
DescribeWarmPoolResponse -> Maybe [Instance]
instances :: Prelude.Maybe [Instance],
DescribeWarmPoolResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeWarmPoolResponse -> Maybe WarmPoolConfiguration
warmPoolConfiguration :: Prelude.Maybe WarmPoolConfiguration,
DescribeWarmPoolResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeWarmPoolResponse -> DescribeWarmPoolResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeWarmPoolResponse -> DescribeWarmPoolResponse -> Bool
$c/= :: DescribeWarmPoolResponse -> DescribeWarmPoolResponse -> Bool
== :: DescribeWarmPoolResponse -> DescribeWarmPoolResponse -> Bool
$c== :: DescribeWarmPoolResponse -> DescribeWarmPoolResponse -> Bool
Prelude.Eq, ReadPrec [DescribeWarmPoolResponse]
ReadPrec DescribeWarmPoolResponse
Int -> ReadS DescribeWarmPoolResponse
ReadS [DescribeWarmPoolResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeWarmPoolResponse]
$creadListPrec :: ReadPrec [DescribeWarmPoolResponse]
readPrec :: ReadPrec DescribeWarmPoolResponse
$creadPrec :: ReadPrec DescribeWarmPoolResponse
readList :: ReadS [DescribeWarmPoolResponse]
$creadList :: ReadS [DescribeWarmPoolResponse]
readsPrec :: Int -> ReadS DescribeWarmPoolResponse
$creadsPrec :: Int -> ReadS DescribeWarmPoolResponse
Prelude.Read, Int -> DescribeWarmPoolResponse -> ShowS
[DescribeWarmPoolResponse] -> ShowS
DescribeWarmPoolResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeWarmPoolResponse] -> ShowS
$cshowList :: [DescribeWarmPoolResponse] -> ShowS
show :: DescribeWarmPoolResponse -> String
$cshow :: DescribeWarmPoolResponse -> String
showsPrec :: Int -> DescribeWarmPoolResponse -> ShowS
$cshowsPrec :: Int -> DescribeWarmPoolResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeWarmPoolResponse x -> DescribeWarmPoolResponse
forall x.
DescribeWarmPoolResponse -> Rep DescribeWarmPoolResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeWarmPoolResponse x -> DescribeWarmPoolResponse
$cfrom :: forall x.
DescribeWarmPoolResponse -> Rep DescribeWarmPoolResponse x
Prelude.Generic)
newDescribeWarmPoolResponse ::
Prelude.Int ->
DescribeWarmPoolResponse
newDescribeWarmPoolResponse :: Int -> DescribeWarmPoolResponse
newDescribeWarmPoolResponse Int
pHttpStatus_ =
DescribeWarmPoolResponse'
{ $sel:instances:DescribeWarmPoolResponse' :: Maybe [Instance]
instances =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:DescribeWarmPoolResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:warmPoolConfiguration:DescribeWarmPoolResponse' :: Maybe WarmPoolConfiguration
warmPoolConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeWarmPoolResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeWarmPoolResponse_instances :: Lens.Lens' DescribeWarmPoolResponse (Prelude.Maybe [Instance])
describeWarmPoolResponse_instances :: Lens' DescribeWarmPoolResponse (Maybe [Instance])
describeWarmPoolResponse_instances = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWarmPoolResponse' {Maybe [Instance]
instances :: Maybe [Instance]
$sel:instances:DescribeWarmPoolResponse' :: DescribeWarmPoolResponse -> Maybe [Instance]
instances} -> Maybe [Instance]
instances) (\s :: DescribeWarmPoolResponse
s@DescribeWarmPoolResponse' {} Maybe [Instance]
a -> DescribeWarmPoolResponse
s {$sel:instances:DescribeWarmPoolResponse' :: Maybe [Instance]
instances = Maybe [Instance]
a} :: DescribeWarmPoolResponse) 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
describeWarmPoolResponse_nextToken :: Lens.Lens' DescribeWarmPoolResponse (Prelude.Maybe Prelude.Text)
describeWarmPoolResponse_nextToken :: Lens' DescribeWarmPoolResponse (Maybe Text)
describeWarmPoolResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWarmPoolResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeWarmPoolResponse' :: DescribeWarmPoolResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeWarmPoolResponse
s@DescribeWarmPoolResponse' {} Maybe Text
a -> DescribeWarmPoolResponse
s {$sel:nextToken:DescribeWarmPoolResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeWarmPoolResponse)
describeWarmPoolResponse_warmPoolConfiguration :: Lens.Lens' DescribeWarmPoolResponse (Prelude.Maybe WarmPoolConfiguration)
describeWarmPoolResponse_warmPoolConfiguration :: Lens' DescribeWarmPoolResponse (Maybe WarmPoolConfiguration)
describeWarmPoolResponse_warmPoolConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWarmPoolResponse' {Maybe WarmPoolConfiguration
warmPoolConfiguration :: Maybe WarmPoolConfiguration
$sel:warmPoolConfiguration:DescribeWarmPoolResponse' :: DescribeWarmPoolResponse -> Maybe WarmPoolConfiguration
warmPoolConfiguration} -> Maybe WarmPoolConfiguration
warmPoolConfiguration) (\s :: DescribeWarmPoolResponse
s@DescribeWarmPoolResponse' {} Maybe WarmPoolConfiguration
a -> DescribeWarmPoolResponse
s {$sel:warmPoolConfiguration:DescribeWarmPoolResponse' :: Maybe WarmPoolConfiguration
warmPoolConfiguration = Maybe WarmPoolConfiguration
a} :: DescribeWarmPoolResponse)
describeWarmPoolResponse_httpStatus :: Lens.Lens' DescribeWarmPoolResponse Prelude.Int
describeWarmPoolResponse_httpStatus :: Lens' DescribeWarmPoolResponse Int
describeWarmPoolResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWarmPoolResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeWarmPoolResponse' :: DescribeWarmPoolResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeWarmPoolResponse
s@DescribeWarmPoolResponse' {} Int
a -> DescribeWarmPoolResponse
s {$sel:httpStatus:DescribeWarmPoolResponse' :: Int
httpStatus = Int
a} :: DescribeWarmPoolResponse)
instance Prelude.NFData DescribeWarmPoolResponse where
rnf :: DescribeWarmPoolResponse -> ()
rnf DescribeWarmPoolResponse' {Int
Maybe [Instance]
Maybe Text
Maybe WarmPoolConfiguration
httpStatus :: Int
warmPoolConfiguration :: Maybe WarmPoolConfiguration
nextToken :: Maybe Text
instances :: Maybe [Instance]
$sel:httpStatus:DescribeWarmPoolResponse' :: DescribeWarmPoolResponse -> Int
$sel:warmPoolConfiguration:DescribeWarmPoolResponse' :: DescribeWarmPoolResponse -> Maybe WarmPoolConfiguration
$sel:nextToken:DescribeWarmPoolResponse' :: DescribeWarmPoolResponse -> Maybe Text
$sel:instances:DescribeWarmPoolResponse' :: DescribeWarmPoolResponse -> Maybe [Instance]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Instance]
instances
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WarmPoolConfiguration
warmPoolConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus