{-# 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.PutWarmPool
(
PutWarmPool (..),
newPutWarmPool,
putWarmPool_minSize,
putWarmPool_maxGroupPreparedCapacity,
putWarmPool_poolState,
putWarmPool_autoScalingGroupName,
PutWarmPoolResponse (..),
newPutWarmPoolResponse,
putWarmPoolResponse_httpStatus,
)
where
import Amazonka.AutoScaling.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 PutWarmPool = PutWarmPool'
{
PutWarmPool -> Maybe Natural
minSize :: Prelude.Maybe Prelude.Natural,
PutWarmPool -> Maybe Int
maxGroupPreparedCapacity :: Prelude.Maybe Prelude.Int,
PutWarmPool -> Maybe WarmPoolState
poolState :: Prelude.Maybe WarmPoolState,
PutWarmPool -> Text
autoScalingGroupName :: Prelude.Text
}
deriving (PutWarmPool -> PutWarmPool -> Bool
(PutWarmPool -> PutWarmPool -> Bool)
-> (PutWarmPool -> PutWarmPool -> Bool) -> Eq PutWarmPool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutWarmPool -> PutWarmPool -> Bool
$c/= :: PutWarmPool -> PutWarmPool -> Bool
== :: PutWarmPool -> PutWarmPool -> Bool
$c== :: PutWarmPool -> PutWarmPool -> Bool
Prelude.Eq, ReadPrec [PutWarmPool]
ReadPrec PutWarmPool
Int -> ReadS PutWarmPool
ReadS [PutWarmPool]
(Int -> ReadS PutWarmPool)
-> ReadS [PutWarmPool]
-> ReadPrec PutWarmPool
-> ReadPrec [PutWarmPool]
-> Read PutWarmPool
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutWarmPool]
$creadListPrec :: ReadPrec [PutWarmPool]
readPrec :: ReadPrec PutWarmPool
$creadPrec :: ReadPrec PutWarmPool
readList :: ReadS [PutWarmPool]
$creadList :: ReadS [PutWarmPool]
readsPrec :: Int -> ReadS PutWarmPool
$creadsPrec :: Int -> ReadS PutWarmPool
Prelude.Read, Int -> PutWarmPool -> ShowS
[PutWarmPool] -> ShowS
PutWarmPool -> String
(Int -> PutWarmPool -> ShowS)
-> (PutWarmPool -> String)
-> ([PutWarmPool] -> ShowS)
-> Show PutWarmPool
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutWarmPool] -> ShowS
$cshowList :: [PutWarmPool] -> ShowS
show :: PutWarmPool -> String
$cshow :: PutWarmPool -> String
showsPrec :: Int -> PutWarmPool -> ShowS
$cshowsPrec :: Int -> PutWarmPool -> ShowS
Prelude.Show, (forall x. PutWarmPool -> Rep PutWarmPool x)
-> (forall x. Rep PutWarmPool x -> PutWarmPool)
-> Generic PutWarmPool
forall x. Rep PutWarmPool x -> PutWarmPool
forall x. PutWarmPool -> Rep PutWarmPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutWarmPool x -> PutWarmPool
$cfrom :: forall x. PutWarmPool -> Rep PutWarmPool x
Prelude.Generic)
newPutWarmPool ::
Prelude.Text ->
PutWarmPool
newPutWarmPool :: Text -> PutWarmPool
newPutWarmPool Text
pAutoScalingGroupName_ =
PutWarmPool' :: Maybe Natural
-> Maybe Int -> Maybe WarmPoolState -> Text -> PutWarmPool
PutWarmPool'
{ $sel:minSize:PutWarmPool' :: Maybe Natural
minSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maxGroupPreparedCapacity:PutWarmPool' :: Maybe Int
maxGroupPreparedCapacity = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:poolState:PutWarmPool' :: Maybe WarmPoolState
poolState = Maybe WarmPoolState
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroupName:PutWarmPool' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_
}
putWarmPool_minSize :: Lens.Lens' PutWarmPool (Prelude.Maybe Prelude.Natural)
putWarmPool_minSize :: (Maybe Natural -> f (Maybe Natural))
-> PutWarmPool -> f PutWarmPool
putWarmPool_minSize = (PutWarmPool -> Maybe Natural)
-> (PutWarmPool -> Maybe Natural -> PutWarmPool)
-> Lens PutWarmPool PutWarmPool (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutWarmPool' {Maybe Natural
minSize :: Maybe Natural
$sel:minSize:PutWarmPool' :: PutWarmPool -> Maybe Natural
minSize} -> Maybe Natural
minSize) (\s :: PutWarmPool
s@PutWarmPool' {} Maybe Natural
a -> PutWarmPool
s {$sel:minSize:PutWarmPool' :: Maybe Natural
minSize = Maybe Natural
a} :: PutWarmPool)
putWarmPool_maxGroupPreparedCapacity :: Lens.Lens' PutWarmPool (Prelude.Maybe Prelude.Int)
putWarmPool_maxGroupPreparedCapacity :: (Maybe Int -> f (Maybe Int)) -> PutWarmPool -> f PutWarmPool
putWarmPool_maxGroupPreparedCapacity = (PutWarmPool -> Maybe Int)
-> (PutWarmPool -> Maybe Int -> PutWarmPool)
-> Lens PutWarmPool PutWarmPool (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutWarmPool' {Maybe Int
maxGroupPreparedCapacity :: Maybe Int
$sel:maxGroupPreparedCapacity:PutWarmPool' :: PutWarmPool -> Maybe Int
maxGroupPreparedCapacity} -> Maybe Int
maxGroupPreparedCapacity) (\s :: PutWarmPool
s@PutWarmPool' {} Maybe Int
a -> PutWarmPool
s {$sel:maxGroupPreparedCapacity:PutWarmPool' :: Maybe Int
maxGroupPreparedCapacity = Maybe Int
a} :: PutWarmPool)
putWarmPool_poolState :: Lens.Lens' PutWarmPool (Prelude.Maybe WarmPoolState)
putWarmPool_poolState :: (Maybe WarmPoolState -> f (Maybe WarmPoolState))
-> PutWarmPool -> f PutWarmPool
putWarmPool_poolState = (PutWarmPool -> Maybe WarmPoolState)
-> (PutWarmPool -> Maybe WarmPoolState -> PutWarmPool)
-> Lens
PutWarmPool PutWarmPool (Maybe WarmPoolState) (Maybe WarmPoolState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutWarmPool' {Maybe WarmPoolState
poolState :: Maybe WarmPoolState
$sel:poolState:PutWarmPool' :: PutWarmPool -> Maybe WarmPoolState
poolState} -> Maybe WarmPoolState
poolState) (\s :: PutWarmPool
s@PutWarmPool' {} Maybe WarmPoolState
a -> PutWarmPool
s {$sel:poolState:PutWarmPool' :: Maybe WarmPoolState
poolState = Maybe WarmPoolState
a} :: PutWarmPool)
putWarmPool_autoScalingGroupName :: Lens.Lens' PutWarmPool Prelude.Text
putWarmPool_autoScalingGroupName :: (Text -> f Text) -> PutWarmPool -> f PutWarmPool
putWarmPool_autoScalingGroupName = (PutWarmPool -> Text)
-> (PutWarmPool -> Text -> PutWarmPool)
-> Lens PutWarmPool PutWarmPool Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutWarmPool' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:PutWarmPool' :: PutWarmPool -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: PutWarmPool
s@PutWarmPool' {} Text
a -> PutWarmPool
s {$sel:autoScalingGroupName:PutWarmPool' :: Text
autoScalingGroupName = Text
a} :: PutWarmPool)
instance Core.AWSRequest PutWarmPool where
type AWSResponse PutWarmPool = PutWarmPoolResponse
request :: PutWarmPool -> Request PutWarmPool
request = Service -> PutWarmPool -> Request PutWarmPool
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy PutWarmPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutWarmPool)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse PutWarmPool))
-> Logger
-> Service
-> Proxy PutWarmPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutWarmPool)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"PutWarmPoolResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> PutWarmPoolResponse
PutWarmPoolResponse'
(Int -> PutWarmPoolResponse)
-> Either String Int -> Either String PutWarmPoolResponse
forall (f :: * -> *) a b. Functor 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 PutWarmPool
instance Prelude.NFData PutWarmPool
instance Core.ToHeaders PutWarmPool where
toHeaders :: PutWarmPool -> ResponseHeaders
toHeaders = ResponseHeaders -> PutWarmPool -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath PutWarmPool where
toPath :: PutWarmPool -> ByteString
toPath = ByteString -> PutWarmPool -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutWarmPool where
toQuery :: PutWarmPool -> QueryString
toQuery PutWarmPool' {Maybe Int
Maybe Natural
Maybe WarmPoolState
Text
autoScalingGroupName :: Text
poolState :: Maybe WarmPoolState
maxGroupPreparedCapacity :: Maybe Int
minSize :: Maybe Natural
$sel:autoScalingGroupName:PutWarmPool' :: PutWarmPool -> Text
$sel:poolState:PutWarmPool' :: PutWarmPool -> Maybe WarmPoolState
$sel:maxGroupPreparedCapacity:PutWarmPool' :: PutWarmPool -> Maybe Int
$sel:minSize:PutWarmPool' :: PutWarmPool -> Maybe Natural
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"PutWarmPool" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"MinSize" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
minSize,
ByteString
"MaxGroupPreparedCapacity"
ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxGroupPreparedCapacity,
ByteString
"PoolState" ByteString -> Maybe WarmPoolState -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe WarmPoolState
poolState,
ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName
]
data PutWarmPoolResponse = PutWarmPoolResponse'
{
PutWarmPoolResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutWarmPoolResponse -> PutWarmPoolResponse -> Bool
(PutWarmPoolResponse -> PutWarmPoolResponse -> Bool)
-> (PutWarmPoolResponse -> PutWarmPoolResponse -> Bool)
-> Eq PutWarmPoolResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutWarmPoolResponse -> PutWarmPoolResponse -> Bool
$c/= :: PutWarmPoolResponse -> PutWarmPoolResponse -> Bool
== :: PutWarmPoolResponse -> PutWarmPoolResponse -> Bool
$c== :: PutWarmPoolResponse -> PutWarmPoolResponse -> Bool
Prelude.Eq, ReadPrec [PutWarmPoolResponse]
ReadPrec PutWarmPoolResponse
Int -> ReadS PutWarmPoolResponse
ReadS [PutWarmPoolResponse]
(Int -> ReadS PutWarmPoolResponse)
-> ReadS [PutWarmPoolResponse]
-> ReadPrec PutWarmPoolResponse
-> ReadPrec [PutWarmPoolResponse]
-> Read PutWarmPoolResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutWarmPoolResponse]
$creadListPrec :: ReadPrec [PutWarmPoolResponse]
readPrec :: ReadPrec PutWarmPoolResponse
$creadPrec :: ReadPrec PutWarmPoolResponse
readList :: ReadS [PutWarmPoolResponse]
$creadList :: ReadS [PutWarmPoolResponse]
readsPrec :: Int -> ReadS PutWarmPoolResponse
$creadsPrec :: Int -> ReadS PutWarmPoolResponse
Prelude.Read, Int -> PutWarmPoolResponse -> ShowS
[PutWarmPoolResponse] -> ShowS
PutWarmPoolResponse -> String
(Int -> PutWarmPoolResponse -> ShowS)
-> (PutWarmPoolResponse -> String)
-> ([PutWarmPoolResponse] -> ShowS)
-> Show PutWarmPoolResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutWarmPoolResponse] -> ShowS
$cshowList :: [PutWarmPoolResponse] -> ShowS
show :: PutWarmPoolResponse -> String
$cshow :: PutWarmPoolResponse -> String
showsPrec :: Int -> PutWarmPoolResponse -> ShowS
$cshowsPrec :: Int -> PutWarmPoolResponse -> ShowS
Prelude.Show, (forall x. PutWarmPoolResponse -> Rep PutWarmPoolResponse x)
-> (forall x. Rep PutWarmPoolResponse x -> PutWarmPoolResponse)
-> Generic PutWarmPoolResponse
forall x. Rep PutWarmPoolResponse x -> PutWarmPoolResponse
forall x. PutWarmPoolResponse -> Rep PutWarmPoolResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutWarmPoolResponse x -> PutWarmPoolResponse
$cfrom :: forall x. PutWarmPoolResponse -> Rep PutWarmPoolResponse x
Prelude.Generic)
newPutWarmPoolResponse ::
Prelude.Int ->
PutWarmPoolResponse
newPutWarmPoolResponse :: Int -> PutWarmPoolResponse
newPutWarmPoolResponse Int
pHttpStatus_ =
PutWarmPoolResponse' :: Int -> PutWarmPoolResponse
PutWarmPoolResponse' {$sel:httpStatus:PutWarmPoolResponse' :: Int
httpStatus = Int
pHttpStatus_}
putWarmPoolResponse_httpStatus :: Lens.Lens' PutWarmPoolResponse Prelude.Int
putWarmPoolResponse_httpStatus :: (Int -> f Int) -> PutWarmPoolResponse -> f PutWarmPoolResponse
putWarmPoolResponse_httpStatus = (PutWarmPoolResponse -> Int)
-> (PutWarmPoolResponse -> Int -> PutWarmPoolResponse)
-> Lens PutWarmPoolResponse PutWarmPoolResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutWarmPoolResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutWarmPoolResponse' :: PutWarmPoolResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutWarmPoolResponse
s@PutWarmPoolResponse' {} Int
a -> PutWarmPoolResponse
s {$sel:httpStatus:PutWarmPoolResponse' :: Int
httpStatus = Int
a} :: PutWarmPoolResponse)
instance Prelude.NFData PutWarmPoolResponse