{-# 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.DeletePolicy
(
DeletePolicy (..),
newDeletePolicy,
deletePolicy_autoScalingGroupName,
deletePolicy_policyName,
DeletePolicyResponse (..),
newDeletePolicyResponse,
)
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 DeletePolicy = DeletePolicy'
{
DeletePolicy -> Maybe Text
autoScalingGroupName :: Prelude.Maybe Prelude.Text,
DeletePolicy -> Text
policyName :: Prelude.Text
}
deriving (DeletePolicy -> DeletePolicy -> Bool
(DeletePolicy -> DeletePolicy -> Bool)
-> (DeletePolicy -> DeletePolicy -> Bool) -> Eq DeletePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePolicy -> DeletePolicy -> Bool
$c/= :: DeletePolicy -> DeletePolicy -> Bool
== :: DeletePolicy -> DeletePolicy -> Bool
$c== :: DeletePolicy -> DeletePolicy -> Bool
Prelude.Eq, ReadPrec [DeletePolicy]
ReadPrec DeletePolicy
Int -> ReadS DeletePolicy
ReadS [DeletePolicy]
(Int -> ReadS DeletePolicy)
-> ReadS [DeletePolicy]
-> ReadPrec DeletePolicy
-> ReadPrec [DeletePolicy]
-> Read DeletePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePolicy]
$creadListPrec :: ReadPrec [DeletePolicy]
readPrec :: ReadPrec DeletePolicy
$creadPrec :: ReadPrec DeletePolicy
readList :: ReadS [DeletePolicy]
$creadList :: ReadS [DeletePolicy]
readsPrec :: Int -> ReadS DeletePolicy
$creadsPrec :: Int -> ReadS DeletePolicy
Prelude.Read, Int -> DeletePolicy -> ShowS
[DeletePolicy] -> ShowS
DeletePolicy -> String
(Int -> DeletePolicy -> ShowS)
-> (DeletePolicy -> String)
-> ([DeletePolicy] -> ShowS)
-> Show DeletePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePolicy] -> ShowS
$cshowList :: [DeletePolicy] -> ShowS
show :: DeletePolicy -> String
$cshow :: DeletePolicy -> String
showsPrec :: Int -> DeletePolicy -> ShowS
$cshowsPrec :: Int -> DeletePolicy -> ShowS
Prelude.Show, (forall x. DeletePolicy -> Rep DeletePolicy x)
-> (forall x. Rep DeletePolicy x -> DeletePolicy)
-> Generic DeletePolicy
forall x. Rep DeletePolicy x -> DeletePolicy
forall x. DeletePolicy -> Rep DeletePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePolicy x -> DeletePolicy
$cfrom :: forall x. DeletePolicy -> Rep DeletePolicy x
Prelude.Generic)
newDeletePolicy ::
Prelude.Text ->
DeletePolicy
newDeletePolicy :: Text -> DeletePolicy
newDeletePolicy Text
pPolicyName_ =
DeletePolicy' :: Maybe Text -> Text -> DeletePolicy
DeletePolicy'
{ $sel:autoScalingGroupName:DeletePolicy' :: Maybe Text
autoScalingGroupName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:policyName:DeletePolicy' :: Text
policyName = Text
pPolicyName_
}
deletePolicy_autoScalingGroupName :: Lens.Lens' DeletePolicy (Prelude.Maybe Prelude.Text)
deletePolicy_autoScalingGroupName :: (Maybe Text -> f (Maybe Text)) -> DeletePolicy -> f DeletePolicy
deletePolicy_autoScalingGroupName = (DeletePolicy -> Maybe Text)
-> (DeletePolicy -> Maybe Text -> DeletePolicy)
-> Lens DeletePolicy DeletePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePolicy' {Maybe Text
autoScalingGroupName :: Maybe Text
$sel:autoScalingGroupName:DeletePolicy' :: DeletePolicy -> Maybe Text
autoScalingGroupName} -> Maybe Text
autoScalingGroupName) (\s :: DeletePolicy
s@DeletePolicy' {} Maybe Text
a -> DeletePolicy
s {$sel:autoScalingGroupName:DeletePolicy' :: Maybe Text
autoScalingGroupName = Maybe Text
a} :: DeletePolicy)
deletePolicy_policyName :: Lens.Lens' DeletePolicy Prelude.Text
deletePolicy_policyName :: (Text -> f Text) -> DeletePolicy -> f DeletePolicy
deletePolicy_policyName = (DeletePolicy -> Text)
-> (DeletePolicy -> Text -> DeletePolicy)
-> Lens DeletePolicy DeletePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePolicy' {Text
policyName :: Text
$sel:policyName:DeletePolicy' :: DeletePolicy -> Text
policyName} -> Text
policyName) (\s :: DeletePolicy
s@DeletePolicy' {} Text
a -> DeletePolicy
s {$sel:policyName:DeletePolicy' :: Text
policyName = Text
a} :: DeletePolicy)
instance Core.AWSRequest DeletePolicy where
type AWSResponse DeletePolicy = DeletePolicyResponse
request :: DeletePolicy -> Request DeletePolicy
request = Service -> DeletePolicy -> Request DeletePolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeletePolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeletePolicy)))
response = AWSResponse DeletePolicy
-> Logger
-> Service
-> Proxy DeletePolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeletePolicy)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeletePolicy
DeletePolicyResponse
DeletePolicyResponse'
instance Prelude.Hashable DeletePolicy
instance Prelude.NFData DeletePolicy
instance Core.ToHeaders DeletePolicy where
toHeaders :: DeletePolicy -> [Header]
toHeaders = [Header] -> DeletePolicy -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeletePolicy where
toPath :: DeletePolicy -> ByteString
toPath = ByteString -> DeletePolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeletePolicy where
toQuery :: DeletePolicy -> QueryString
toQuery DeletePolicy' {Maybe Text
Text
policyName :: Text
autoScalingGroupName :: Maybe Text
$sel:policyName:DeletePolicy' :: DeletePolicy -> Text
$sel:autoScalingGroupName:DeletePolicy' :: DeletePolicy -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeletePolicy" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"AutoScalingGroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
autoScalingGroupName,
ByteString
"PolicyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyName
]
data DeletePolicyResponse = DeletePolicyResponse'
{
}
deriving (DeletePolicyResponse -> DeletePolicyResponse -> Bool
(DeletePolicyResponse -> DeletePolicyResponse -> Bool)
-> (DeletePolicyResponse -> DeletePolicyResponse -> Bool)
-> Eq DeletePolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePolicyResponse -> DeletePolicyResponse -> Bool
$c/= :: DeletePolicyResponse -> DeletePolicyResponse -> Bool
== :: DeletePolicyResponse -> DeletePolicyResponse -> Bool
$c== :: DeletePolicyResponse -> DeletePolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeletePolicyResponse]
ReadPrec DeletePolicyResponse
Int -> ReadS DeletePolicyResponse
ReadS [DeletePolicyResponse]
(Int -> ReadS DeletePolicyResponse)
-> ReadS [DeletePolicyResponse]
-> ReadPrec DeletePolicyResponse
-> ReadPrec [DeletePolicyResponse]
-> Read DeletePolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePolicyResponse]
$creadListPrec :: ReadPrec [DeletePolicyResponse]
readPrec :: ReadPrec DeletePolicyResponse
$creadPrec :: ReadPrec DeletePolicyResponse
readList :: ReadS [DeletePolicyResponse]
$creadList :: ReadS [DeletePolicyResponse]
readsPrec :: Int -> ReadS DeletePolicyResponse
$creadsPrec :: Int -> ReadS DeletePolicyResponse
Prelude.Read, Int -> DeletePolicyResponse -> ShowS
[DeletePolicyResponse] -> ShowS
DeletePolicyResponse -> String
(Int -> DeletePolicyResponse -> ShowS)
-> (DeletePolicyResponse -> String)
-> ([DeletePolicyResponse] -> ShowS)
-> Show DeletePolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePolicyResponse] -> ShowS
$cshowList :: [DeletePolicyResponse] -> ShowS
show :: DeletePolicyResponse -> String
$cshow :: DeletePolicyResponse -> String
showsPrec :: Int -> DeletePolicyResponse -> ShowS
$cshowsPrec :: Int -> DeletePolicyResponse -> ShowS
Prelude.Show, (forall x. DeletePolicyResponse -> Rep DeletePolicyResponse x)
-> (forall x. Rep DeletePolicyResponse x -> DeletePolicyResponse)
-> Generic DeletePolicyResponse
forall x. Rep DeletePolicyResponse x -> DeletePolicyResponse
forall x. DeletePolicyResponse -> Rep DeletePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePolicyResponse x -> DeletePolicyResponse
$cfrom :: forall x. DeletePolicyResponse -> Rep DeletePolicyResponse x
Prelude.Generic)
newDeletePolicyResponse ::
DeletePolicyResponse
newDeletePolicyResponse :: DeletePolicyResponse
newDeletePolicyResponse = DeletePolicyResponse
DeletePolicyResponse'
instance Prelude.NFData DeletePolicyResponse