{-# 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.DeleteWarmPool
(
DeleteWarmPool (..),
newDeleteWarmPool,
deleteWarmPool_forceDelete,
deleteWarmPool_autoScalingGroupName,
DeleteWarmPoolResponse (..),
newDeleteWarmPoolResponse,
deleteWarmPoolResponse_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 DeleteWarmPool = DeleteWarmPool'
{
DeleteWarmPool -> Maybe Bool
forceDelete :: Prelude.Maybe Prelude.Bool,
DeleteWarmPool -> Text
autoScalingGroupName :: Prelude.Text
}
deriving (DeleteWarmPool -> DeleteWarmPool -> Bool
(DeleteWarmPool -> DeleteWarmPool -> Bool)
-> (DeleteWarmPool -> DeleteWarmPool -> Bool) -> Eq DeleteWarmPool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWarmPool -> DeleteWarmPool -> Bool
$c/= :: DeleteWarmPool -> DeleteWarmPool -> Bool
== :: DeleteWarmPool -> DeleteWarmPool -> Bool
$c== :: DeleteWarmPool -> DeleteWarmPool -> Bool
Prelude.Eq, ReadPrec [DeleteWarmPool]
ReadPrec DeleteWarmPool
Int -> ReadS DeleteWarmPool
ReadS [DeleteWarmPool]
(Int -> ReadS DeleteWarmPool)
-> ReadS [DeleteWarmPool]
-> ReadPrec DeleteWarmPool
-> ReadPrec [DeleteWarmPool]
-> Read DeleteWarmPool
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWarmPool]
$creadListPrec :: ReadPrec [DeleteWarmPool]
readPrec :: ReadPrec DeleteWarmPool
$creadPrec :: ReadPrec DeleteWarmPool
readList :: ReadS [DeleteWarmPool]
$creadList :: ReadS [DeleteWarmPool]
readsPrec :: Int -> ReadS DeleteWarmPool
$creadsPrec :: Int -> ReadS DeleteWarmPool
Prelude.Read, Int -> DeleteWarmPool -> ShowS
[DeleteWarmPool] -> ShowS
DeleteWarmPool -> String
(Int -> DeleteWarmPool -> ShowS)
-> (DeleteWarmPool -> String)
-> ([DeleteWarmPool] -> ShowS)
-> Show DeleteWarmPool
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWarmPool] -> ShowS
$cshowList :: [DeleteWarmPool] -> ShowS
show :: DeleteWarmPool -> String
$cshow :: DeleteWarmPool -> String
showsPrec :: Int -> DeleteWarmPool -> ShowS
$cshowsPrec :: Int -> DeleteWarmPool -> ShowS
Prelude.Show, (forall x. DeleteWarmPool -> Rep DeleteWarmPool x)
-> (forall x. Rep DeleteWarmPool x -> DeleteWarmPool)
-> Generic DeleteWarmPool
forall x. Rep DeleteWarmPool x -> DeleteWarmPool
forall x. DeleteWarmPool -> Rep DeleteWarmPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteWarmPool x -> DeleteWarmPool
$cfrom :: forall x. DeleteWarmPool -> Rep DeleteWarmPool x
Prelude.Generic)
newDeleteWarmPool ::
Prelude.Text ->
DeleteWarmPool
newDeleteWarmPool :: Text -> DeleteWarmPool
newDeleteWarmPool Text
pAutoScalingGroupName_ =
DeleteWarmPool' :: Maybe Bool -> Text -> DeleteWarmPool
DeleteWarmPool'
{ $sel:forceDelete:DeleteWarmPool' :: Maybe Bool
forceDelete = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroupName:DeleteWarmPool' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_
}
deleteWarmPool_forceDelete :: Lens.Lens' DeleteWarmPool (Prelude.Maybe Prelude.Bool)
deleteWarmPool_forceDelete :: (Maybe Bool -> f (Maybe Bool))
-> DeleteWarmPool -> f DeleteWarmPool
deleteWarmPool_forceDelete = (DeleteWarmPool -> Maybe Bool)
-> (DeleteWarmPool -> Maybe Bool -> DeleteWarmPool)
-> Lens DeleteWarmPool DeleteWarmPool (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWarmPool' {Maybe Bool
forceDelete :: Maybe Bool
$sel:forceDelete:DeleteWarmPool' :: DeleteWarmPool -> Maybe Bool
forceDelete} -> Maybe Bool
forceDelete) (\s :: DeleteWarmPool
s@DeleteWarmPool' {} Maybe Bool
a -> DeleteWarmPool
s {$sel:forceDelete:DeleteWarmPool' :: Maybe Bool
forceDelete = Maybe Bool
a} :: DeleteWarmPool)
deleteWarmPool_autoScalingGroupName :: Lens.Lens' DeleteWarmPool Prelude.Text
deleteWarmPool_autoScalingGroupName :: (Text -> f Text) -> DeleteWarmPool -> f DeleteWarmPool
deleteWarmPool_autoScalingGroupName = (DeleteWarmPool -> Text)
-> (DeleteWarmPool -> Text -> DeleteWarmPool)
-> Lens DeleteWarmPool DeleteWarmPool Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWarmPool' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:DeleteWarmPool' :: DeleteWarmPool -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: DeleteWarmPool
s@DeleteWarmPool' {} Text
a -> DeleteWarmPool
s {$sel:autoScalingGroupName:DeleteWarmPool' :: Text
autoScalingGroupName = Text
a} :: DeleteWarmPool)
instance Core.AWSRequest DeleteWarmPool where
type
AWSResponse DeleteWarmPool =
DeleteWarmPoolResponse
request :: DeleteWarmPool -> Request DeleteWarmPool
request = Service -> DeleteWarmPool -> Request DeleteWarmPool
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteWarmPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteWarmPool)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteWarmPool))
-> Logger
-> Service
-> Proxy DeleteWarmPool
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteWarmPool)))
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
"DeleteWarmPoolResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> DeleteWarmPoolResponse
DeleteWarmPoolResponse'
(Int -> DeleteWarmPoolResponse)
-> Either String Int -> Either String DeleteWarmPoolResponse
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 DeleteWarmPool
instance Prelude.NFData DeleteWarmPool
instance Core.ToHeaders DeleteWarmPool where
toHeaders :: DeleteWarmPool -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteWarmPool -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteWarmPool where
toPath :: DeleteWarmPool -> ByteString
toPath = ByteString -> DeleteWarmPool -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteWarmPool where
toQuery :: DeleteWarmPool -> QueryString
toQuery DeleteWarmPool' {Maybe Bool
Text
autoScalingGroupName :: Text
forceDelete :: Maybe Bool
$sel:autoScalingGroupName:DeleteWarmPool' :: DeleteWarmPool -> Text
$sel:forceDelete:DeleteWarmPool' :: DeleteWarmPool -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteWarmPool" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"ForceDelete" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
forceDelete,
ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName
]
data DeleteWarmPoolResponse = DeleteWarmPoolResponse'
{
DeleteWarmPoolResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteWarmPoolResponse -> DeleteWarmPoolResponse -> Bool
(DeleteWarmPoolResponse -> DeleteWarmPoolResponse -> Bool)
-> (DeleteWarmPoolResponse -> DeleteWarmPoolResponse -> Bool)
-> Eq DeleteWarmPoolResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWarmPoolResponse -> DeleteWarmPoolResponse -> Bool
$c/= :: DeleteWarmPoolResponse -> DeleteWarmPoolResponse -> Bool
== :: DeleteWarmPoolResponse -> DeleteWarmPoolResponse -> Bool
$c== :: DeleteWarmPoolResponse -> DeleteWarmPoolResponse -> Bool
Prelude.Eq, ReadPrec [DeleteWarmPoolResponse]
ReadPrec DeleteWarmPoolResponse
Int -> ReadS DeleteWarmPoolResponse
ReadS [DeleteWarmPoolResponse]
(Int -> ReadS DeleteWarmPoolResponse)
-> ReadS [DeleteWarmPoolResponse]
-> ReadPrec DeleteWarmPoolResponse
-> ReadPrec [DeleteWarmPoolResponse]
-> Read DeleteWarmPoolResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWarmPoolResponse]
$creadListPrec :: ReadPrec [DeleteWarmPoolResponse]
readPrec :: ReadPrec DeleteWarmPoolResponse
$creadPrec :: ReadPrec DeleteWarmPoolResponse
readList :: ReadS [DeleteWarmPoolResponse]
$creadList :: ReadS [DeleteWarmPoolResponse]
readsPrec :: Int -> ReadS DeleteWarmPoolResponse
$creadsPrec :: Int -> ReadS DeleteWarmPoolResponse
Prelude.Read, Int -> DeleteWarmPoolResponse -> ShowS
[DeleteWarmPoolResponse] -> ShowS
DeleteWarmPoolResponse -> String
(Int -> DeleteWarmPoolResponse -> ShowS)
-> (DeleteWarmPoolResponse -> String)
-> ([DeleteWarmPoolResponse] -> ShowS)
-> Show DeleteWarmPoolResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWarmPoolResponse] -> ShowS
$cshowList :: [DeleteWarmPoolResponse] -> ShowS
show :: DeleteWarmPoolResponse -> String
$cshow :: DeleteWarmPoolResponse -> String
showsPrec :: Int -> DeleteWarmPoolResponse -> ShowS
$cshowsPrec :: Int -> DeleteWarmPoolResponse -> ShowS
Prelude.Show, (forall x. DeleteWarmPoolResponse -> Rep DeleteWarmPoolResponse x)
-> (forall x.
Rep DeleteWarmPoolResponse x -> DeleteWarmPoolResponse)
-> Generic DeleteWarmPoolResponse
forall x. Rep DeleteWarmPoolResponse x -> DeleteWarmPoolResponse
forall x. DeleteWarmPoolResponse -> Rep DeleteWarmPoolResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteWarmPoolResponse x -> DeleteWarmPoolResponse
$cfrom :: forall x. DeleteWarmPoolResponse -> Rep DeleteWarmPoolResponse x
Prelude.Generic)
newDeleteWarmPoolResponse ::
Prelude.Int ->
DeleteWarmPoolResponse
newDeleteWarmPoolResponse :: Int -> DeleteWarmPoolResponse
newDeleteWarmPoolResponse Int
pHttpStatus_ =
DeleteWarmPoolResponse' :: Int -> DeleteWarmPoolResponse
DeleteWarmPoolResponse' {$sel:httpStatus:DeleteWarmPoolResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteWarmPoolResponse_httpStatus :: Lens.Lens' DeleteWarmPoolResponse Prelude.Int
deleteWarmPoolResponse_httpStatus :: (Int -> f Int)
-> DeleteWarmPoolResponse -> f DeleteWarmPoolResponse
deleteWarmPoolResponse_httpStatus = (DeleteWarmPoolResponse -> Int)
-> (DeleteWarmPoolResponse -> Int -> DeleteWarmPoolResponse)
-> Lens DeleteWarmPoolResponse DeleteWarmPoolResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWarmPoolResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteWarmPoolResponse' :: DeleteWarmPoolResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteWarmPoolResponse
s@DeleteWarmPoolResponse' {} Int
a -> DeleteWarmPoolResponse
s {$sel:httpStatus:DeleteWarmPoolResponse' :: Int
httpStatus = Int
a} :: DeleteWarmPoolResponse)
instance Prelude.NFData DeleteWarmPoolResponse