{-# 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.DetectStackDrift
(
DetectStackDrift (..),
newDetectStackDrift,
detectStackDrift_logicalResourceIds,
detectStackDrift_stackName,
DetectStackDriftResponse (..),
newDetectStackDriftResponse,
detectStackDriftResponse_httpStatus,
detectStackDriftResponse_stackDriftDetectionId,
)
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 DetectStackDrift = DetectStackDrift'
{
DetectStackDrift -> Maybe (NonEmpty Text)
logicalResourceIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
DetectStackDrift -> Text
stackName :: Prelude.Text
}
deriving (DetectStackDrift -> DetectStackDrift -> Bool
(DetectStackDrift -> DetectStackDrift -> Bool)
-> (DetectStackDrift -> DetectStackDrift -> Bool)
-> Eq DetectStackDrift
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectStackDrift -> DetectStackDrift -> Bool
$c/= :: DetectStackDrift -> DetectStackDrift -> Bool
== :: DetectStackDrift -> DetectStackDrift -> Bool
$c== :: DetectStackDrift -> DetectStackDrift -> Bool
Prelude.Eq, ReadPrec [DetectStackDrift]
ReadPrec DetectStackDrift
Int -> ReadS DetectStackDrift
ReadS [DetectStackDrift]
(Int -> ReadS DetectStackDrift)
-> ReadS [DetectStackDrift]
-> ReadPrec DetectStackDrift
-> ReadPrec [DetectStackDrift]
-> Read DetectStackDrift
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectStackDrift]
$creadListPrec :: ReadPrec [DetectStackDrift]
readPrec :: ReadPrec DetectStackDrift
$creadPrec :: ReadPrec DetectStackDrift
readList :: ReadS [DetectStackDrift]
$creadList :: ReadS [DetectStackDrift]
readsPrec :: Int -> ReadS DetectStackDrift
$creadsPrec :: Int -> ReadS DetectStackDrift
Prelude.Read, Int -> DetectStackDrift -> ShowS
[DetectStackDrift] -> ShowS
DetectStackDrift -> String
(Int -> DetectStackDrift -> ShowS)
-> (DetectStackDrift -> String)
-> ([DetectStackDrift] -> ShowS)
-> Show DetectStackDrift
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectStackDrift] -> ShowS
$cshowList :: [DetectStackDrift] -> ShowS
show :: DetectStackDrift -> String
$cshow :: DetectStackDrift -> String
showsPrec :: Int -> DetectStackDrift -> ShowS
$cshowsPrec :: Int -> DetectStackDrift -> ShowS
Prelude.Show, (forall x. DetectStackDrift -> Rep DetectStackDrift x)
-> (forall x. Rep DetectStackDrift x -> DetectStackDrift)
-> Generic DetectStackDrift
forall x. Rep DetectStackDrift x -> DetectStackDrift
forall x. DetectStackDrift -> Rep DetectStackDrift x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetectStackDrift x -> DetectStackDrift
$cfrom :: forall x. DetectStackDrift -> Rep DetectStackDrift x
Prelude.Generic)
newDetectStackDrift ::
Prelude.Text ->
DetectStackDrift
newDetectStackDrift :: Text -> DetectStackDrift
newDetectStackDrift Text
pStackName_ =
DetectStackDrift' :: Maybe (NonEmpty Text) -> Text -> DetectStackDrift
DetectStackDrift'
{ $sel:logicalResourceIds:DetectStackDrift' :: Maybe (NonEmpty Text)
logicalResourceIds =
Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:stackName:DetectStackDrift' :: Text
stackName = Text
pStackName_
}
detectStackDrift_logicalResourceIds :: Lens.Lens' DetectStackDrift (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
detectStackDrift_logicalResourceIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DetectStackDrift -> f DetectStackDrift
detectStackDrift_logicalResourceIds = (DetectStackDrift -> Maybe (NonEmpty Text))
-> (DetectStackDrift -> Maybe (NonEmpty Text) -> DetectStackDrift)
-> Lens
DetectStackDrift
DetectStackDrift
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectStackDrift' {Maybe (NonEmpty Text)
logicalResourceIds :: Maybe (NonEmpty Text)
$sel:logicalResourceIds:DetectStackDrift' :: DetectStackDrift -> Maybe (NonEmpty Text)
logicalResourceIds} -> Maybe (NonEmpty Text)
logicalResourceIds) (\s :: DetectStackDrift
s@DetectStackDrift' {} Maybe (NonEmpty Text)
a -> DetectStackDrift
s {$sel:logicalResourceIds:DetectStackDrift' :: Maybe (NonEmpty Text)
logicalResourceIds = Maybe (NonEmpty Text)
a} :: DetectStackDrift) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DetectStackDrift -> f DetectStackDrift)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DetectStackDrift
-> f DetectStackDrift
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
detectStackDrift_stackName :: Lens.Lens' DetectStackDrift Prelude.Text
detectStackDrift_stackName :: (Text -> f Text) -> DetectStackDrift -> f DetectStackDrift
detectStackDrift_stackName = (DetectStackDrift -> Text)
-> (DetectStackDrift -> Text -> DetectStackDrift)
-> Lens DetectStackDrift DetectStackDrift Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectStackDrift' {Text
stackName :: Text
$sel:stackName:DetectStackDrift' :: DetectStackDrift -> Text
stackName} -> Text
stackName) (\s :: DetectStackDrift
s@DetectStackDrift' {} Text
a -> DetectStackDrift
s {$sel:stackName:DetectStackDrift' :: Text
stackName = Text
a} :: DetectStackDrift)
instance Core.AWSRequest DetectStackDrift where
type
AWSResponse DetectStackDrift =
DetectStackDriftResponse
request :: DetectStackDrift -> Request DetectStackDrift
request = Service -> DetectStackDrift -> Request DetectStackDrift
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DetectStackDrift
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DetectStackDrift)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DetectStackDrift))
-> Logger
-> Service
-> Proxy DetectStackDrift
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DetectStackDrift)))
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
"DetectStackDriftResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> Text -> DetectStackDriftResponse
DetectStackDriftResponse'
(Int -> Text -> DetectStackDriftResponse)
-> Either String Int
-> Either String (Text -> DetectStackDriftResponse)
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 (Text -> DetectStackDriftResponse)
-> Either String Text -> Either String DetectStackDriftResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"StackDriftDetectionId")
)
instance Prelude.Hashable DetectStackDrift
instance Prelude.NFData DetectStackDrift
instance Core.ToHeaders DetectStackDrift where
toHeaders :: DetectStackDrift -> ResponseHeaders
toHeaders = ResponseHeaders -> DetectStackDrift -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DetectStackDrift where
toPath :: DetectStackDrift -> ByteString
toPath = ByteString -> DetectStackDrift -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DetectStackDrift where
toQuery :: DetectStackDrift -> QueryString
toQuery DetectStackDrift' {Maybe (NonEmpty Text)
Text
stackName :: Text
logicalResourceIds :: Maybe (NonEmpty Text)
$sel:stackName:DetectStackDrift' :: DetectStackDrift -> Text
$sel:logicalResourceIds:DetectStackDrift' :: DetectStackDrift -> Maybe (NonEmpty 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
"DetectStackDrift" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"LogicalResourceIds"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> NonEmpty Text -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
(NonEmpty Text -> QueryString)
-> Maybe (NonEmpty Text) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
logicalResourceIds
),
ByteString
"StackName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackName
]
data DetectStackDriftResponse = DetectStackDriftResponse'
{
DetectStackDriftResponse -> Int
httpStatus :: Prelude.Int,
DetectStackDriftResponse -> Text
stackDriftDetectionId :: Prelude.Text
}
deriving (DetectStackDriftResponse -> DetectStackDriftResponse -> Bool
(DetectStackDriftResponse -> DetectStackDriftResponse -> Bool)
-> (DetectStackDriftResponse -> DetectStackDriftResponse -> Bool)
-> Eq DetectStackDriftResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectStackDriftResponse -> DetectStackDriftResponse -> Bool
$c/= :: DetectStackDriftResponse -> DetectStackDriftResponse -> Bool
== :: DetectStackDriftResponse -> DetectStackDriftResponse -> Bool
$c== :: DetectStackDriftResponse -> DetectStackDriftResponse -> Bool
Prelude.Eq, ReadPrec [DetectStackDriftResponse]
ReadPrec DetectStackDriftResponse
Int -> ReadS DetectStackDriftResponse
ReadS [DetectStackDriftResponse]
(Int -> ReadS DetectStackDriftResponse)
-> ReadS [DetectStackDriftResponse]
-> ReadPrec DetectStackDriftResponse
-> ReadPrec [DetectStackDriftResponse]
-> Read DetectStackDriftResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectStackDriftResponse]
$creadListPrec :: ReadPrec [DetectStackDriftResponse]
readPrec :: ReadPrec DetectStackDriftResponse
$creadPrec :: ReadPrec DetectStackDriftResponse
readList :: ReadS [DetectStackDriftResponse]
$creadList :: ReadS [DetectStackDriftResponse]
readsPrec :: Int -> ReadS DetectStackDriftResponse
$creadsPrec :: Int -> ReadS DetectStackDriftResponse
Prelude.Read, Int -> DetectStackDriftResponse -> ShowS
[DetectStackDriftResponse] -> ShowS
DetectStackDriftResponse -> String
(Int -> DetectStackDriftResponse -> ShowS)
-> (DetectStackDriftResponse -> String)
-> ([DetectStackDriftResponse] -> ShowS)
-> Show DetectStackDriftResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectStackDriftResponse] -> ShowS
$cshowList :: [DetectStackDriftResponse] -> ShowS
show :: DetectStackDriftResponse -> String
$cshow :: DetectStackDriftResponse -> String
showsPrec :: Int -> DetectStackDriftResponse -> ShowS
$cshowsPrec :: Int -> DetectStackDriftResponse -> ShowS
Prelude.Show, (forall x.
DetectStackDriftResponse -> Rep DetectStackDriftResponse x)
-> (forall x.
Rep DetectStackDriftResponse x -> DetectStackDriftResponse)
-> Generic DetectStackDriftResponse
forall x.
Rep DetectStackDriftResponse x -> DetectStackDriftResponse
forall x.
DetectStackDriftResponse -> Rep DetectStackDriftResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectStackDriftResponse x -> DetectStackDriftResponse
$cfrom :: forall x.
DetectStackDriftResponse -> Rep DetectStackDriftResponse x
Prelude.Generic)
newDetectStackDriftResponse ::
Prelude.Int ->
Prelude.Text ->
DetectStackDriftResponse
newDetectStackDriftResponse :: Int -> Text -> DetectStackDriftResponse
newDetectStackDriftResponse
Int
pHttpStatus_
Text
pStackDriftDetectionId_ =
DetectStackDriftResponse' :: Int -> Text -> DetectStackDriftResponse
DetectStackDriftResponse'
{ $sel:httpStatus:DetectStackDriftResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:stackDriftDetectionId:DetectStackDriftResponse' :: Text
stackDriftDetectionId = Text
pStackDriftDetectionId_
}
detectStackDriftResponse_httpStatus :: Lens.Lens' DetectStackDriftResponse Prelude.Int
detectStackDriftResponse_httpStatus :: (Int -> f Int)
-> DetectStackDriftResponse -> f DetectStackDriftResponse
detectStackDriftResponse_httpStatus = (DetectStackDriftResponse -> Int)
-> (DetectStackDriftResponse -> Int -> DetectStackDriftResponse)
-> Lens DetectStackDriftResponse DetectStackDriftResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectStackDriftResponse' {Int
httpStatus :: Int
$sel:httpStatus:DetectStackDriftResponse' :: DetectStackDriftResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DetectStackDriftResponse
s@DetectStackDriftResponse' {} Int
a -> DetectStackDriftResponse
s {$sel:httpStatus:DetectStackDriftResponse' :: Int
httpStatus = Int
a} :: DetectStackDriftResponse)
detectStackDriftResponse_stackDriftDetectionId :: Lens.Lens' DetectStackDriftResponse Prelude.Text
detectStackDriftResponse_stackDriftDetectionId :: (Text -> f Text)
-> DetectStackDriftResponse -> f DetectStackDriftResponse
detectStackDriftResponse_stackDriftDetectionId = (DetectStackDriftResponse -> Text)
-> (DetectStackDriftResponse -> Text -> DetectStackDriftResponse)
-> Lens DetectStackDriftResponse DetectStackDriftResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectStackDriftResponse' {Text
stackDriftDetectionId :: Text
$sel:stackDriftDetectionId:DetectStackDriftResponse' :: DetectStackDriftResponse -> Text
stackDriftDetectionId} -> Text
stackDriftDetectionId) (\s :: DetectStackDriftResponse
s@DetectStackDriftResponse' {} Text
a -> DetectStackDriftResponse
s {$sel:stackDriftDetectionId:DetectStackDriftResponse' :: Text
stackDriftDetectionId = Text
a} :: DetectStackDriftResponse)
instance Prelude.NFData DetectStackDriftResponse