{-# 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.CloudFormation.SetStackPolicy
(
SetStackPolicy (..),
newSetStackPolicy,
setStackPolicy_stackPolicyBody,
setStackPolicy_stackPolicyURL,
setStackPolicy_stackName,
SetStackPolicyResponse (..),
newSetStackPolicyResponse,
)
where
import Amazonka.CloudFormation.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 SetStackPolicy = SetStackPolicy'
{
SetStackPolicy -> Maybe Text
stackPolicyBody :: Prelude.Maybe Prelude.Text,
SetStackPolicy -> Maybe Text
stackPolicyURL :: Prelude.Maybe Prelude.Text,
SetStackPolicy -> Text
stackName :: Prelude.Text
}
deriving (SetStackPolicy -> SetStackPolicy -> Bool
(SetStackPolicy -> SetStackPolicy -> Bool)
-> (SetStackPolicy -> SetStackPolicy -> Bool) -> Eq SetStackPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetStackPolicy -> SetStackPolicy -> Bool
$c/= :: SetStackPolicy -> SetStackPolicy -> Bool
== :: SetStackPolicy -> SetStackPolicy -> Bool
$c== :: SetStackPolicy -> SetStackPolicy -> Bool
Prelude.Eq, ReadPrec [SetStackPolicy]
ReadPrec SetStackPolicy
Int -> ReadS SetStackPolicy
ReadS [SetStackPolicy]
(Int -> ReadS SetStackPolicy)
-> ReadS [SetStackPolicy]
-> ReadPrec SetStackPolicy
-> ReadPrec [SetStackPolicy]
-> Read SetStackPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetStackPolicy]
$creadListPrec :: ReadPrec [SetStackPolicy]
readPrec :: ReadPrec SetStackPolicy
$creadPrec :: ReadPrec SetStackPolicy
readList :: ReadS [SetStackPolicy]
$creadList :: ReadS [SetStackPolicy]
readsPrec :: Int -> ReadS SetStackPolicy
$creadsPrec :: Int -> ReadS SetStackPolicy
Prelude.Read, Int -> SetStackPolicy -> ShowS
[SetStackPolicy] -> ShowS
SetStackPolicy -> String
(Int -> SetStackPolicy -> ShowS)
-> (SetStackPolicy -> String)
-> ([SetStackPolicy] -> ShowS)
-> Show SetStackPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetStackPolicy] -> ShowS
$cshowList :: [SetStackPolicy] -> ShowS
show :: SetStackPolicy -> String
$cshow :: SetStackPolicy -> String
showsPrec :: Int -> SetStackPolicy -> ShowS
$cshowsPrec :: Int -> SetStackPolicy -> ShowS
Prelude.Show, (forall x. SetStackPolicy -> Rep SetStackPolicy x)
-> (forall x. Rep SetStackPolicy x -> SetStackPolicy)
-> Generic SetStackPolicy
forall x. Rep SetStackPolicy x -> SetStackPolicy
forall x. SetStackPolicy -> Rep SetStackPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetStackPolicy x -> SetStackPolicy
$cfrom :: forall x. SetStackPolicy -> Rep SetStackPolicy x
Prelude.Generic)
newSetStackPolicy ::
Prelude.Text ->
SetStackPolicy
newSetStackPolicy :: Text -> SetStackPolicy
newSetStackPolicy Text
pStackName_ =
SetStackPolicy' :: Maybe Text -> Maybe Text -> Text -> SetStackPolicy
SetStackPolicy'
{ $sel:stackPolicyBody:SetStackPolicy' :: Maybe Text
stackPolicyBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stackPolicyURL:SetStackPolicy' :: Maybe Text
stackPolicyURL = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stackName:SetStackPolicy' :: Text
stackName = Text
pStackName_
}
setStackPolicy_stackPolicyBody :: Lens.Lens' SetStackPolicy (Prelude.Maybe Prelude.Text)
setStackPolicy_stackPolicyBody :: (Maybe Text -> f (Maybe Text))
-> SetStackPolicy -> f SetStackPolicy
setStackPolicy_stackPolicyBody = (SetStackPolicy -> Maybe Text)
-> (SetStackPolicy -> Maybe Text -> SetStackPolicy)
-> Lens SetStackPolicy SetStackPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetStackPolicy' {Maybe Text
stackPolicyBody :: Maybe Text
$sel:stackPolicyBody:SetStackPolicy' :: SetStackPolicy -> Maybe Text
stackPolicyBody} -> Maybe Text
stackPolicyBody) (\s :: SetStackPolicy
s@SetStackPolicy' {} Maybe Text
a -> SetStackPolicy
s {$sel:stackPolicyBody:SetStackPolicy' :: Maybe Text
stackPolicyBody = Maybe Text
a} :: SetStackPolicy)
setStackPolicy_stackPolicyURL :: Lens.Lens' SetStackPolicy (Prelude.Maybe Prelude.Text)
setStackPolicy_stackPolicyURL :: (Maybe Text -> f (Maybe Text))
-> SetStackPolicy -> f SetStackPolicy
setStackPolicy_stackPolicyURL = (SetStackPolicy -> Maybe Text)
-> (SetStackPolicy -> Maybe Text -> SetStackPolicy)
-> Lens SetStackPolicy SetStackPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetStackPolicy' {Maybe Text
stackPolicyURL :: Maybe Text
$sel:stackPolicyURL:SetStackPolicy' :: SetStackPolicy -> Maybe Text
stackPolicyURL} -> Maybe Text
stackPolicyURL) (\s :: SetStackPolicy
s@SetStackPolicy' {} Maybe Text
a -> SetStackPolicy
s {$sel:stackPolicyURL:SetStackPolicy' :: Maybe Text
stackPolicyURL = Maybe Text
a} :: SetStackPolicy)
setStackPolicy_stackName :: Lens.Lens' SetStackPolicy Prelude.Text
setStackPolicy_stackName :: (Text -> f Text) -> SetStackPolicy -> f SetStackPolicy
setStackPolicy_stackName = (SetStackPolicy -> Text)
-> (SetStackPolicy -> Text -> SetStackPolicy)
-> Lens SetStackPolicy SetStackPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetStackPolicy' {Text
stackName :: Text
$sel:stackName:SetStackPolicy' :: SetStackPolicy -> Text
stackName} -> Text
stackName) (\s :: SetStackPolicy
s@SetStackPolicy' {} Text
a -> SetStackPolicy
s {$sel:stackName:SetStackPolicy' :: Text
stackName = Text
a} :: SetStackPolicy)
instance Core.AWSRequest SetStackPolicy where
type
AWSResponse SetStackPolicy =
SetStackPolicyResponse
request :: SetStackPolicy -> Request SetStackPolicy
request = Service -> SetStackPolicy -> Request SetStackPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy SetStackPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetStackPolicy)))
response =
AWSResponse SetStackPolicy
-> Logger
-> Service
-> Proxy SetStackPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetStackPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse SetStackPolicy
SetStackPolicyResponse
SetStackPolicyResponse'
instance Prelude.Hashable SetStackPolicy
instance Prelude.NFData SetStackPolicy
instance Core.ToHeaders SetStackPolicy where
toHeaders :: SetStackPolicy -> [Header]
toHeaders = [Header] -> SetStackPolicy -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath SetStackPolicy where
toPath :: SetStackPolicy -> ByteString
toPath = ByteString -> SetStackPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetStackPolicy where
toQuery :: SetStackPolicy -> QueryString
toQuery SetStackPolicy' {Maybe Text
Text
stackName :: Text
stackPolicyURL :: Maybe Text
stackPolicyBody :: Maybe Text
$sel:stackName:SetStackPolicy' :: SetStackPolicy -> Text
$sel:stackPolicyURL:SetStackPolicy' :: SetStackPolicy -> Maybe Text
$sel:stackPolicyBody:SetStackPolicy' :: SetStackPolicy -> 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
"SetStackPolicy" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"StackPolicyBody" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stackPolicyBody,
ByteString
"StackPolicyURL" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stackPolicyURL,
ByteString
"StackName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackName
]
data SetStackPolicyResponse = SetStackPolicyResponse'
{
}
deriving (SetStackPolicyResponse -> SetStackPolicyResponse -> Bool
(SetStackPolicyResponse -> SetStackPolicyResponse -> Bool)
-> (SetStackPolicyResponse -> SetStackPolicyResponse -> Bool)
-> Eq SetStackPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetStackPolicyResponse -> SetStackPolicyResponse -> Bool
$c/= :: SetStackPolicyResponse -> SetStackPolicyResponse -> Bool
== :: SetStackPolicyResponse -> SetStackPolicyResponse -> Bool
$c== :: SetStackPolicyResponse -> SetStackPolicyResponse -> Bool
Prelude.Eq, ReadPrec [SetStackPolicyResponse]
ReadPrec SetStackPolicyResponse
Int -> ReadS SetStackPolicyResponse
ReadS [SetStackPolicyResponse]
(Int -> ReadS SetStackPolicyResponse)
-> ReadS [SetStackPolicyResponse]
-> ReadPrec SetStackPolicyResponse
-> ReadPrec [SetStackPolicyResponse]
-> Read SetStackPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetStackPolicyResponse]
$creadListPrec :: ReadPrec [SetStackPolicyResponse]
readPrec :: ReadPrec SetStackPolicyResponse
$creadPrec :: ReadPrec SetStackPolicyResponse
readList :: ReadS [SetStackPolicyResponse]
$creadList :: ReadS [SetStackPolicyResponse]
readsPrec :: Int -> ReadS SetStackPolicyResponse
$creadsPrec :: Int -> ReadS SetStackPolicyResponse
Prelude.Read, Int -> SetStackPolicyResponse -> ShowS
[SetStackPolicyResponse] -> ShowS
SetStackPolicyResponse -> String
(Int -> SetStackPolicyResponse -> ShowS)
-> (SetStackPolicyResponse -> String)
-> ([SetStackPolicyResponse] -> ShowS)
-> Show SetStackPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetStackPolicyResponse] -> ShowS
$cshowList :: [SetStackPolicyResponse] -> ShowS
show :: SetStackPolicyResponse -> String
$cshow :: SetStackPolicyResponse -> String
showsPrec :: Int -> SetStackPolicyResponse -> ShowS
$cshowsPrec :: Int -> SetStackPolicyResponse -> ShowS
Prelude.Show, (forall x. SetStackPolicyResponse -> Rep SetStackPolicyResponse x)
-> (forall x.
Rep SetStackPolicyResponse x -> SetStackPolicyResponse)
-> Generic SetStackPolicyResponse
forall x. Rep SetStackPolicyResponse x -> SetStackPolicyResponse
forall x. SetStackPolicyResponse -> Rep SetStackPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetStackPolicyResponse x -> SetStackPolicyResponse
$cfrom :: forall x. SetStackPolicyResponse -> Rep SetStackPolicyResponse x
Prelude.Generic)
newSetStackPolicyResponse ::
SetStackPolicyResponse
newSetStackPolicyResponse :: SetStackPolicyResponse
newSetStackPolicyResponse = SetStackPolicyResponse
SetStackPolicyResponse'
instance Prelude.NFData SetStackPolicyResponse