{-# 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.DetectStackResourceDrift
(
DetectStackResourceDrift (..),
newDetectStackResourceDrift,
detectStackResourceDrift_stackName,
detectStackResourceDrift_logicalResourceId,
DetectStackResourceDriftResponse (..),
newDetectStackResourceDriftResponse,
detectStackResourceDriftResponse_httpStatus,
detectStackResourceDriftResponse_stackResourceDrift,
)
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 DetectStackResourceDrift = DetectStackResourceDrift'
{
DetectStackResourceDrift -> Text
stackName :: Prelude.Text,
DetectStackResourceDrift -> Text
logicalResourceId :: Prelude.Text
}
deriving (DetectStackResourceDrift -> DetectStackResourceDrift -> Bool
(DetectStackResourceDrift -> DetectStackResourceDrift -> Bool)
-> (DetectStackResourceDrift -> DetectStackResourceDrift -> Bool)
-> Eq DetectStackResourceDrift
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectStackResourceDrift -> DetectStackResourceDrift -> Bool
$c/= :: DetectStackResourceDrift -> DetectStackResourceDrift -> Bool
== :: DetectStackResourceDrift -> DetectStackResourceDrift -> Bool
$c== :: DetectStackResourceDrift -> DetectStackResourceDrift -> Bool
Prelude.Eq, ReadPrec [DetectStackResourceDrift]
ReadPrec DetectStackResourceDrift
Int -> ReadS DetectStackResourceDrift
ReadS [DetectStackResourceDrift]
(Int -> ReadS DetectStackResourceDrift)
-> ReadS [DetectStackResourceDrift]
-> ReadPrec DetectStackResourceDrift
-> ReadPrec [DetectStackResourceDrift]
-> Read DetectStackResourceDrift
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectStackResourceDrift]
$creadListPrec :: ReadPrec [DetectStackResourceDrift]
readPrec :: ReadPrec DetectStackResourceDrift
$creadPrec :: ReadPrec DetectStackResourceDrift
readList :: ReadS [DetectStackResourceDrift]
$creadList :: ReadS [DetectStackResourceDrift]
readsPrec :: Int -> ReadS DetectStackResourceDrift
$creadsPrec :: Int -> ReadS DetectStackResourceDrift
Prelude.Read, Int -> DetectStackResourceDrift -> ShowS
[DetectStackResourceDrift] -> ShowS
DetectStackResourceDrift -> String
(Int -> DetectStackResourceDrift -> ShowS)
-> (DetectStackResourceDrift -> String)
-> ([DetectStackResourceDrift] -> ShowS)
-> Show DetectStackResourceDrift
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectStackResourceDrift] -> ShowS
$cshowList :: [DetectStackResourceDrift] -> ShowS
show :: DetectStackResourceDrift -> String
$cshow :: DetectStackResourceDrift -> String
showsPrec :: Int -> DetectStackResourceDrift -> ShowS
$cshowsPrec :: Int -> DetectStackResourceDrift -> ShowS
Prelude.Show, (forall x.
DetectStackResourceDrift -> Rep DetectStackResourceDrift x)
-> (forall x.
Rep DetectStackResourceDrift x -> DetectStackResourceDrift)
-> Generic DetectStackResourceDrift
forall x.
Rep DetectStackResourceDrift x -> DetectStackResourceDrift
forall x.
DetectStackResourceDrift -> Rep DetectStackResourceDrift x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectStackResourceDrift x -> DetectStackResourceDrift
$cfrom :: forall x.
DetectStackResourceDrift -> Rep DetectStackResourceDrift x
Prelude.Generic)
newDetectStackResourceDrift ::
Prelude.Text ->
Prelude.Text ->
DetectStackResourceDrift
newDetectStackResourceDrift :: Text -> Text -> DetectStackResourceDrift
newDetectStackResourceDrift
Text
pStackName_
Text
pLogicalResourceId_ =
DetectStackResourceDrift' :: Text -> Text -> DetectStackResourceDrift
DetectStackResourceDrift'
{ $sel:stackName:DetectStackResourceDrift' :: Text
stackName = Text
pStackName_,
$sel:logicalResourceId:DetectStackResourceDrift' :: Text
logicalResourceId = Text
pLogicalResourceId_
}
detectStackResourceDrift_stackName :: Lens.Lens' DetectStackResourceDrift Prelude.Text
detectStackResourceDrift_stackName :: (Text -> f Text)
-> DetectStackResourceDrift -> f DetectStackResourceDrift
detectStackResourceDrift_stackName = (DetectStackResourceDrift -> Text)
-> (DetectStackResourceDrift -> Text -> DetectStackResourceDrift)
-> Lens DetectStackResourceDrift DetectStackResourceDrift Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectStackResourceDrift' {Text
stackName :: Text
$sel:stackName:DetectStackResourceDrift' :: DetectStackResourceDrift -> Text
stackName} -> Text
stackName) (\s :: DetectStackResourceDrift
s@DetectStackResourceDrift' {} Text
a -> DetectStackResourceDrift
s {$sel:stackName:DetectStackResourceDrift' :: Text
stackName = Text
a} :: DetectStackResourceDrift)
detectStackResourceDrift_logicalResourceId :: Lens.Lens' DetectStackResourceDrift Prelude.Text
detectStackResourceDrift_logicalResourceId :: (Text -> f Text)
-> DetectStackResourceDrift -> f DetectStackResourceDrift
detectStackResourceDrift_logicalResourceId = (DetectStackResourceDrift -> Text)
-> (DetectStackResourceDrift -> Text -> DetectStackResourceDrift)
-> Lens DetectStackResourceDrift DetectStackResourceDrift Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectStackResourceDrift' {Text
logicalResourceId :: Text
$sel:logicalResourceId:DetectStackResourceDrift' :: DetectStackResourceDrift -> Text
logicalResourceId} -> Text
logicalResourceId) (\s :: DetectStackResourceDrift
s@DetectStackResourceDrift' {} Text
a -> DetectStackResourceDrift
s {$sel:logicalResourceId:DetectStackResourceDrift' :: Text
logicalResourceId = Text
a} :: DetectStackResourceDrift)
instance Core.AWSRequest DetectStackResourceDrift where
type
AWSResponse DetectStackResourceDrift =
DetectStackResourceDriftResponse
request :: DetectStackResourceDrift -> Request DetectStackResourceDrift
request = Service
-> DetectStackResourceDrift -> Request DetectStackResourceDrift
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DetectStackResourceDrift
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DetectStackResourceDrift)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DetectStackResourceDrift))
-> Logger
-> Service
-> Proxy DetectStackResourceDrift
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DetectStackResourceDrift)))
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
"DetectStackResourceDriftResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> StackResourceDrift -> DetectStackResourceDriftResponse
DetectStackResourceDriftResponse'
(Int -> StackResourceDrift -> DetectStackResourceDriftResponse)
-> Either String Int
-> Either
String (StackResourceDrift -> DetectStackResourceDriftResponse)
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))
Either
String (StackResourceDrift -> DetectStackResourceDriftResponse)
-> Either String StackResourceDrift
-> Either String DetectStackResourceDriftResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String StackResourceDrift
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"StackResourceDrift")
)
instance Prelude.Hashable DetectStackResourceDrift
instance Prelude.NFData DetectStackResourceDrift
instance Core.ToHeaders DetectStackResourceDrift where
toHeaders :: DetectStackResourceDrift -> ResponseHeaders
toHeaders = ResponseHeaders -> DetectStackResourceDrift -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DetectStackResourceDrift where
toPath :: DetectStackResourceDrift -> ByteString
toPath = ByteString -> DetectStackResourceDrift -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DetectStackResourceDrift where
toQuery :: DetectStackResourceDrift -> QueryString
toQuery DetectStackResourceDrift' {Text
logicalResourceId :: Text
stackName :: Text
$sel:logicalResourceId:DetectStackResourceDrift' :: DetectStackResourceDrift -> Text
$sel:stackName:DetectStackResourceDrift' :: DetectStackResourceDrift -> 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
"DetectStackResourceDrift" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"StackName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackName,
ByteString
"LogicalResourceId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
logicalResourceId
]
data DetectStackResourceDriftResponse = DetectStackResourceDriftResponse'
{
DetectStackResourceDriftResponse -> Int
httpStatus :: Prelude.Int,
DetectStackResourceDriftResponse -> StackResourceDrift
stackResourceDrift :: StackResourceDrift
}
deriving (DetectStackResourceDriftResponse
-> DetectStackResourceDriftResponse -> Bool
(DetectStackResourceDriftResponse
-> DetectStackResourceDriftResponse -> Bool)
-> (DetectStackResourceDriftResponse
-> DetectStackResourceDriftResponse -> Bool)
-> Eq DetectStackResourceDriftResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectStackResourceDriftResponse
-> DetectStackResourceDriftResponse -> Bool
$c/= :: DetectStackResourceDriftResponse
-> DetectStackResourceDriftResponse -> Bool
== :: DetectStackResourceDriftResponse
-> DetectStackResourceDriftResponse -> Bool
$c== :: DetectStackResourceDriftResponse
-> DetectStackResourceDriftResponse -> Bool
Prelude.Eq, ReadPrec [DetectStackResourceDriftResponse]
ReadPrec DetectStackResourceDriftResponse
Int -> ReadS DetectStackResourceDriftResponse
ReadS [DetectStackResourceDriftResponse]
(Int -> ReadS DetectStackResourceDriftResponse)
-> ReadS [DetectStackResourceDriftResponse]
-> ReadPrec DetectStackResourceDriftResponse
-> ReadPrec [DetectStackResourceDriftResponse]
-> Read DetectStackResourceDriftResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectStackResourceDriftResponse]
$creadListPrec :: ReadPrec [DetectStackResourceDriftResponse]
readPrec :: ReadPrec DetectStackResourceDriftResponse
$creadPrec :: ReadPrec DetectStackResourceDriftResponse
readList :: ReadS [DetectStackResourceDriftResponse]
$creadList :: ReadS [DetectStackResourceDriftResponse]
readsPrec :: Int -> ReadS DetectStackResourceDriftResponse
$creadsPrec :: Int -> ReadS DetectStackResourceDriftResponse
Prelude.Read, Int -> DetectStackResourceDriftResponse -> ShowS
[DetectStackResourceDriftResponse] -> ShowS
DetectStackResourceDriftResponse -> String
(Int -> DetectStackResourceDriftResponse -> ShowS)
-> (DetectStackResourceDriftResponse -> String)
-> ([DetectStackResourceDriftResponse] -> ShowS)
-> Show DetectStackResourceDriftResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectStackResourceDriftResponse] -> ShowS
$cshowList :: [DetectStackResourceDriftResponse] -> ShowS
show :: DetectStackResourceDriftResponse -> String
$cshow :: DetectStackResourceDriftResponse -> String
showsPrec :: Int -> DetectStackResourceDriftResponse -> ShowS
$cshowsPrec :: Int -> DetectStackResourceDriftResponse -> ShowS
Prelude.Show, (forall x.
DetectStackResourceDriftResponse
-> Rep DetectStackResourceDriftResponse x)
-> (forall x.
Rep DetectStackResourceDriftResponse x
-> DetectStackResourceDriftResponse)
-> Generic DetectStackResourceDriftResponse
forall x.
Rep DetectStackResourceDriftResponse x
-> DetectStackResourceDriftResponse
forall x.
DetectStackResourceDriftResponse
-> Rep DetectStackResourceDriftResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectStackResourceDriftResponse x
-> DetectStackResourceDriftResponse
$cfrom :: forall x.
DetectStackResourceDriftResponse
-> Rep DetectStackResourceDriftResponse x
Prelude.Generic)
newDetectStackResourceDriftResponse ::
Prelude.Int ->
StackResourceDrift ->
DetectStackResourceDriftResponse
newDetectStackResourceDriftResponse :: Int -> StackResourceDrift -> DetectStackResourceDriftResponse
newDetectStackResourceDriftResponse
Int
pHttpStatus_
StackResourceDrift
pStackResourceDrift_ =
DetectStackResourceDriftResponse' :: Int -> StackResourceDrift -> DetectStackResourceDriftResponse
DetectStackResourceDriftResponse'
{ $sel:httpStatus:DetectStackResourceDriftResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:stackResourceDrift:DetectStackResourceDriftResponse' :: StackResourceDrift
stackResourceDrift = StackResourceDrift
pStackResourceDrift_
}
detectStackResourceDriftResponse_httpStatus :: Lens.Lens' DetectStackResourceDriftResponse Prelude.Int
detectStackResourceDriftResponse_httpStatus :: (Int -> f Int)
-> DetectStackResourceDriftResponse
-> f DetectStackResourceDriftResponse
detectStackResourceDriftResponse_httpStatus = (DetectStackResourceDriftResponse -> Int)
-> (DetectStackResourceDriftResponse
-> Int -> DetectStackResourceDriftResponse)
-> Lens
DetectStackResourceDriftResponse
DetectStackResourceDriftResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectStackResourceDriftResponse' {Int
httpStatus :: Int
$sel:httpStatus:DetectStackResourceDriftResponse' :: DetectStackResourceDriftResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DetectStackResourceDriftResponse
s@DetectStackResourceDriftResponse' {} Int
a -> DetectStackResourceDriftResponse
s {$sel:httpStatus:DetectStackResourceDriftResponse' :: Int
httpStatus = Int
a} :: DetectStackResourceDriftResponse)
detectStackResourceDriftResponse_stackResourceDrift :: Lens.Lens' DetectStackResourceDriftResponse StackResourceDrift
detectStackResourceDriftResponse_stackResourceDrift :: (StackResourceDrift -> f StackResourceDrift)
-> DetectStackResourceDriftResponse
-> f DetectStackResourceDriftResponse
detectStackResourceDriftResponse_stackResourceDrift = (DetectStackResourceDriftResponse -> StackResourceDrift)
-> (DetectStackResourceDriftResponse
-> StackResourceDrift -> DetectStackResourceDriftResponse)
-> Lens
DetectStackResourceDriftResponse
DetectStackResourceDriftResponse
StackResourceDrift
StackResourceDrift
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectStackResourceDriftResponse' {StackResourceDrift
stackResourceDrift :: StackResourceDrift
$sel:stackResourceDrift:DetectStackResourceDriftResponse' :: DetectStackResourceDriftResponse -> StackResourceDrift
stackResourceDrift} -> StackResourceDrift
stackResourceDrift) (\s :: DetectStackResourceDriftResponse
s@DetectStackResourceDriftResponse' {} StackResourceDrift
a -> DetectStackResourceDriftResponse
s {$sel:stackResourceDrift:DetectStackResourceDriftResponse' :: StackResourceDrift
stackResourceDrift = StackResourceDrift
a} :: DetectStackResourceDriftResponse)
instance
Prelude.NFData
DetectStackResourceDriftResponse