{-# 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.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 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
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]
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
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. 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'
{ $sel:stackPolicyBody:SetStackPolicy' :: Maybe Text
stackPolicyBody = forall a. Maybe a
Prelude.Nothing,
$sel:stackPolicyURL:SetStackPolicy' :: Maybe Text
stackPolicyURL = forall a. Maybe a
Prelude.Nothing,
$sel:stackName:SetStackPolicy' :: Text
stackName = Text
pStackName_
}
setStackPolicy_stackPolicyBody :: Lens.Lens' SetStackPolicy (Prelude.Maybe Prelude.Text)
setStackPolicy_stackPolicyBody :: Lens' SetStackPolicy (Maybe Text)
setStackPolicy_stackPolicyBody = 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 :: Lens' SetStackPolicy (Maybe Text)
setStackPolicy_stackPolicyURL = 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 :: Lens' SetStackPolicy Text
setStackPolicy_stackName = 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 :: (Service -> Service) -> SetStackPolicy -> Request SetStackPolicy
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 SetStackPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetStackPolicy)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull SetStackPolicyResponse
SetStackPolicyResponse'
instance Prelude.Hashable SetStackPolicy where
hashWithSalt :: Int -> SetStackPolicy -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackPolicyBody
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackPolicyURL
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stackName
instance Prelude.NFData SetStackPolicy where
rnf :: SetStackPolicy -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackPolicyBody
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackPolicyURL
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stackName
instance Data.ToHeaders SetStackPolicy where
toHeaders :: SetStackPolicy -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath SetStackPolicy where
toPath :: SetStackPolicy -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"SetStackPolicy" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"StackPolicyBody" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
stackPolicyBody,
ByteString
"StackPolicyURL" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
stackPolicyURL,
ByteString
"StackName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
stackName
]
data SetStackPolicyResponse = SetStackPolicyResponse'
{
}
deriving (SetStackPolicyResponse -> SetStackPolicyResponse -> Bool
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]
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
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. 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 where
rnf :: SetStackPolicyResponse -> ()
rnf SetStackPolicyResponse
_ = ()