{-# 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.DescribeStackInstance
(
DescribeStackInstance (..),
newDescribeStackInstance,
describeStackInstance_callAs,
describeStackInstance_stackSetName,
describeStackInstance_stackInstanceAccount,
describeStackInstance_stackInstanceRegion,
DescribeStackInstanceResponse (..),
newDescribeStackInstanceResponse,
describeStackInstanceResponse_stackInstance,
describeStackInstanceResponse_httpStatus,
)
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 DescribeStackInstance = DescribeStackInstance'
{
DescribeStackInstance -> Maybe CallAs
callAs :: Prelude.Maybe CallAs,
DescribeStackInstance -> Text
stackSetName :: Prelude.Text,
DescribeStackInstance -> Text
stackInstanceAccount :: Prelude.Text,
DescribeStackInstance -> Text
stackInstanceRegion :: Prelude.Text
}
deriving (DescribeStackInstance -> DescribeStackInstance -> Bool
(DescribeStackInstance -> DescribeStackInstance -> Bool)
-> (DescribeStackInstance -> DescribeStackInstance -> Bool)
-> Eq DescribeStackInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStackInstance -> DescribeStackInstance -> Bool
$c/= :: DescribeStackInstance -> DescribeStackInstance -> Bool
== :: DescribeStackInstance -> DescribeStackInstance -> Bool
$c== :: DescribeStackInstance -> DescribeStackInstance -> Bool
Prelude.Eq, ReadPrec [DescribeStackInstance]
ReadPrec DescribeStackInstance
Int -> ReadS DescribeStackInstance
ReadS [DescribeStackInstance]
(Int -> ReadS DescribeStackInstance)
-> ReadS [DescribeStackInstance]
-> ReadPrec DescribeStackInstance
-> ReadPrec [DescribeStackInstance]
-> Read DescribeStackInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStackInstance]
$creadListPrec :: ReadPrec [DescribeStackInstance]
readPrec :: ReadPrec DescribeStackInstance
$creadPrec :: ReadPrec DescribeStackInstance
readList :: ReadS [DescribeStackInstance]
$creadList :: ReadS [DescribeStackInstance]
readsPrec :: Int -> ReadS DescribeStackInstance
$creadsPrec :: Int -> ReadS DescribeStackInstance
Prelude.Read, Int -> DescribeStackInstance -> ShowS
[DescribeStackInstance] -> ShowS
DescribeStackInstance -> String
(Int -> DescribeStackInstance -> ShowS)
-> (DescribeStackInstance -> String)
-> ([DescribeStackInstance] -> ShowS)
-> Show DescribeStackInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStackInstance] -> ShowS
$cshowList :: [DescribeStackInstance] -> ShowS
show :: DescribeStackInstance -> String
$cshow :: DescribeStackInstance -> String
showsPrec :: Int -> DescribeStackInstance -> ShowS
$cshowsPrec :: Int -> DescribeStackInstance -> ShowS
Prelude.Show, (forall x. DescribeStackInstance -> Rep DescribeStackInstance x)
-> (forall x. Rep DescribeStackInstance x -> DescribeStackInstance)
-> Generic DescribeStackInstance
forall x. Rep DescribeStackInstance x -> DescribeStackInstance
forall x. DescribeStackInstance -> Rep DescribeStackInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeStackInstance x -> DescribeStackInstance
$cfrom :: forall x. DescribeStackInstance -> Rep DescribeStackInstance x
Prelude.Generic)
newDescribeStackInstance ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DescribeStackInstance
newDescribeStackInstance :: Text -> Text -> Text -> DescribeStackInstance
newDescribeStackInstance
Text
pStackSetName_
Text
pStackInstanceAccount_
Text
pStackInstanceRegion_ =
DescribeStackInstance' :: Maybe CallAs -> Text -> Text -> Text -> DescribeStackInstance
DescribeStackInstance'
{ $sel:callAs:DescribeStackInstance' :: Maybe CallAs
callAs = Maybe CallAs
forall a. Maybe a
Prelude.Nothing,
$sel:stackSetName:DescribeStackInstance' :: Text
stackSetName = Text
pStackSetName_,
$sel:stackInstanceAccount:DescribeStackInstance' :: Text
stackInstanceAccount = Text
pStackInstanceAccount_,
$sel:stackInstanceRegion:DescribeStackInstance' :: Text
stackInstanceRegion = Text
pStackInstanceRegion_
}
describeStackInstance_callAs :: Lens.Lens' DescribeStackInstance (Prelude.Maybe CallAs)
describeStackInstance_callAs :: (Maybe CallAs -> f (Maybe CallAs))
-> DescribeStackInstance -> f DescribeStackInstance
describeStackInstance_callAs = (DescribeStackInstance -> Maybe CallAs)
-> (DescribeStackInstance -> Maybe CallAs -> DescribeStackInstance)
-> Lens
DescribeStackInstance
DescribeStackInstance
(Maybe CallAs)
(Maybe CallAs)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackInstance' {Maybe CallAs
callAs :: Maybe CallAs
$sel:callAs:DescribeStackInstance' :: DescribeStackInstance -> Maybe CallAs
callAs} -> Maybe CallAs
callAs) (\s :: DescribeStackInstance
s@DescribeStackInstance' {} Maybe CallAs
a -> DescribeStackInstance
s {$sel:callAs:DescribeStackInstance' :: Maybe CallAs
callAs = Maybe CallAs
a} :: DescribeStackInstance)
describeStackInstance_stackSetName :: Lens.Lens' DescribeStackInstance Prelude.Text
describeStackInstance_stackSetName :: (Text -> f Text)
-> DescribeStackInstance -> f DescribeStackInstance
describeStackInstance_stackSetName = (DescribeStackInstance -> Text)
-> (DescribeStackInstance -> Text -> DescribeStackInstance)
-> Lens DescribeStackInstance DescribeStackInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackInstance' {Text
stackSetName :: Text
$sel:stackSetName:DescribeStackInstance' :: DescribeStackInstance -> Text
stackSetName} -> Text
stackSetName) (\s :: DescribeStackInstance
s@DescribeStackInstance' {} Text
a -> DescribeStackInstance
s {$sel:stackSetName:DescribeStackInstance' :: Text
stackSetName = Text
a} :: DescribeStackInstance)
describeStackInstance_stackInstanceAccount :: Lens.Lens' DescribeStackInstance Prelude.Text
describeStackInstance_stackInstanceAccount :: (Text -> f Text)
-> DescribeStackInstance -> f DescribeStackInstance
describeStackInstance_stackInstanceAccount = (DescribeStackInstance -> Text)
-> (DescribeStackInstance -> Text -> DescribeStackInstance)
-> Lens DescribeStackInstance DescribeStackInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackInstance' {Text
stackInstanceAccount :: Text
$sel:stackInstanceAccount:DescribeStackInstance' :: DescribeStackInstance -> Text
stackInstanceAccount} -> Text
stackInstanceAccount) (\s :: DescribeStackInstance
s@DescribeStackInstance' {} Text
a -> DescribeStackInstance
s {$sel:stackInstanceAccount:DescribeStackInstance' :: Text
stackInstanceAccount = Text
a} :: DescribeStackInstance)
describeStackInstance_stackInstanceRegion :: Lens.Lens' DescribeStackInstance Prelude.Text
describeStackInstance_stackInstanceRegion :: (Text -> f Text)
-> DescribeStackInstance -> f DescribeStackInstance
describeStackInstance_stackInstanceRegion = (DescribeStackInstance -> Text)
-> (DescribeStackInstance -> Text -> DescribeStackInstance)
-> Lens DescribeStackInstance DescribeStackInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackInstance' {Text
stackInstanceRegion :: Text
$sel:stackInstanceRegion:DescribeStackInstance' :: DescribeStackInstance -> Text
stackInstanceRegion} -> Text
stackInstanceRegion) (\s :: DescribeStackInstance
s@DescribeStackInstance' {} Text
a -> DescribeStackInstance
s {$sel:stackInstanceRegion:DescribeStackInstance' :: Text
stackInstanceRegion = Text
a} :: DescribeStackInstance)
instance Core.AWSRequest DescribeStackInstance where
type
AWSResponse DescribeStackInstance =
DescribeStackInstanceResponse
request :: DescribeStackInstance -> Request DescribeStackInstance
request = Service -> DescribeStackInstance -> Request DescribeStackInstance
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeStackInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeStackInstance)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeStackInstance))
-> Logger
-> Service
-> Proxy DescribeStackInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeStackInstance)))
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
"DescribeStackInstanceResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe StackInstance -> Int -> DescribeStackInstanceResponse
DescribeStackInstanceResponse'
(Maybe StackInstance -> Int -> DescribeStackInstanceResponse)
-> Either String (Maybe StackInstance)
-> Either String (Int -> DescribeStackInstanceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe StackInstance)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StackInstance")
Either String (Int -> DescribeStackInstanceResponse)
-> Either String Int -> Either String DescribeStackInstanceResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable DescribeStackInstance
instance Prelude.NFData DescribeStackInstance
instance Core.ToHeaders DescribeStackInstance where
toHeaders :: DescribeStackInstance -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeStackInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeStackInstance where
toPath :: DescribeStackInstance -> ByteString
toPath = ByteString -> DescribeStackInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeStackInstance where
toQuery :: DescribeStackInstance -> QueryString
toQuery DescribeStackInstance' {Maybe CallAs
Text
stackInstanceRegion :: Text
stackInstanceAccount :: Text
stackSetName :: Text
callAs :: Maybe CallAs
$sel:stackInstanceRegion:DescribeStackInstance' :: DescribeStackInstance -> Text
$sel:stackInstanceAccount:DescribeStackInstance' :: DescribeStackInstance -> Text
$sel:stackSetName:DescribeStackInstance' :: DescribeStackInstance -> Text
$sel:callAs:DescribeStackInstance' :: DescribeStackInstance -> Maybe CallAs
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeStackInstance" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"CallAs" ByteString -> Maybe CallAs -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe CallAs
callAs,
ByteString
"StackSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackSetName,
ByteString
"StackInstanceAccount" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackInstanceAccount,
ByteString
"StackInstanceRegion" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackInstanceRegion
]
data DescribeStackInstanceResponse = DescribeStackInstanceResponse'
{
DescribeStackInstanceResponse -> Maybe StackInstance
stackInstance :: Prelude.Maybe StackInstance,
DescribeStackInstanceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeStackInstanceResponse
-> DescribeStackInstanceResponse -> Bool
(DescribeStackInstanceResponse
-> DescribeStackInstanceResponse -> Bool)
-> (DescribeStackInstanceResponse
-> DescribeStackInstanceResponse -> Bool)
-> Eq DescribeStackInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStackInstanceResponse
-> DescribeStackInstanceResponse -> Bool
$c/= :: DescribeStackInstanceResponse
-> DescribeStackInstanceResponse -> Bool
== :: DescribeStackInstanceResponse
-> DescribeStackInstanceResponse -> Bool
$c== :: DescribeStackInstanceResponse
-> DescribeStackInstanceResponse -> Bool
Prelude.Eq, ReadPrec [DescribeStackInstanceResponse]
ReadPrec DescribeStackInstanceResponse
Int -> ReadS DescribeStackInstanceResponse
ReadS [DescribeStackInstanceResponse]
(Int -> ReadS DescribeStackInstanceResponse)
-> ReadS [DescribeStackInstanceResponse]
-> ReadPrec DescribeStackInstanceResponse
-> ReadPrec [DescribeStackInstanceResponse]
-> Read DescribeStackInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStackInstanceResponse]
$creadListPrec :: ReadPrec [DescribeStackInstanceResponse]
readPrec :: ReadPrec DescribeStackInstanceResponse
$creadPrec :: ReadPrec DescribeStackInstanceResponse
readList :: ReadS [DescribeStackInstanceResponse]
$creadList :: ReadS [DescribeStackInstanceResponse]
readsPrec :: Int -> ReadS DescribeStackInstanceResponse
$creadsPrec :: Int -> ReadS DescribeStackInstanceResponse
Prelude.Read, Int -> DescribeStackInstanceResponse -> ShowS
[DescribeStackInstanceResponse] -> ShowS
DescribeStackInstanceResponse -> String
(Int -> DescribeStackInstanceResponse -> ShowS)
-> (DescribeStackInstanceResponse -> String)
-> ([DescribeStackInstanceResponse] -> ShowS)
-> Show DescribeStackInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStackInstanceResponse] -> ShowS
$cshowList :: [DescribeStackInstanceResponse] -> ShowS
show :: DescribeStackInstanceResponse -> String
$cshow :: DescribeStackInstanceResponse -> String
showsPrec :: Int -> DescribeStackInstanceResponse -> ShowS
$cshowsPrec :: Int -> DescribeStackInstanceResponse -> ShowS
Prelude.Show, (forall x.
DescribeStackInstanceResponse
-> Rep DescribeStackInstanceResponse x)
-> (forall x.
Rep DescribeStackInstanceResponse x
-> DescribeStackInstanceResponse)
-> Generic DescribeStackInstanceResponse
forall x.
Rep DescribeStackInstanceResponse x
-> DescribeStackInstanceResponse
forall x.
DescribeStackInstanceResponse
-> Rep DescribeStackInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStackInstanceResponse x
-> DescribeStackInstanceResponse
$cfrom :: forall x.
DescribeStackInstanceResponse
-> Rep DescribeStackInstanceResponse x
Prelude.Generic)
newDescribeStackInstanceResponse ::
Prelude.Int ->
DescribeStackInstanceResponse
newDescribeStackInstanceResponse :: Int -> DescribeStackInstanceResponse
newDescribeStackInstanceResponse Int
pHttpStatus_ =
DescribeStackInstanceResponse' :: Maybe StackInstance -> Int -> DescribeStackInstanceResponse
DescribeStackInstanceResponse'
{ $sel:stackInstance:DescribeStackInstanceResponse' :: Maybe StackInstance
stackInstance =
Maybe StackInstance
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeStackInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeStackInstanceResponse_stackInstance :: Lens.Lens' DescribeStackInstanceResponse (Prelude.Maybe StackInstance)
describeStackInstanceResponse_stackInstance :: (Maybe StackInstance -> f (Maybe StackInstance))
-> DescribeStackInstanceResponse -> f DescribeStackInstanceResponse
describeStackInstanceResponse_stackInstance = (DescribeStackInstanceResponse -> Maybe StackInstance)
-> (DescribeStackInstanceResponse
-> Maybe StackInstance -> DescribeStackInstanceResponse)
-> Lens
DescribeStackInstanceResponse
DescribeStackInstanceResponse
(Maybe StackInstance)
(Maybe StackInstance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackInstanceResponse' {Maybe StackInstance
stackInstance :: Maybe StackInstance
$sel:stackInstance:DescribeStackInstanceResponse' :: DescribeStackInstanceResponse -> Maybe StackInstance
stackInstance} -> Maybe StackInstance
stackInstance) (\s :: DescribeStackInstanceResponse
s@DescribeStackInstanceResponse' {} Maybe StackInstance
a -> DescribeStackInstanceResponse
s {$sel:stackInstance:DescribeStackInstanceResponse' :: Maybe StackInstance
stackInstance = Maybe StackInstance
a} :: DescribeStackInstanceResponse)
describeStackInstanceResponse_httpStatus :: Lens.Lens' DescribeStackInstanceResponse Prelude.Int
describeStackInstanceResponse_httpStatus :: (Int -> f Int)
-> DescribeStackInstanceResponse -> f DescribeStackInstanceResponse
describeStackInstanceResponse_httpStatus = (DescribeStackInstanceResponse -> Int)
-> (DescribeStackInstanceResponse
-> Int -> DescribeStackInstanceResponse)
-> Lens
DescribeStackInstanceResponse DescribeStackInstanceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackInstanceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeStackInstanceResponse' :: DescribeStackInstanceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeStackInstanceResponse
s@DescribeStackInstanceResponse' {} Int
a -> DescribeStackInstanceResponse
s {$sel:httpStatus:DescribeStackInstanceResponse' :: Int
httpStatus = Int
a} :: DescribeStackInstanceResponse)
instance Prelude.NFData DescribeStackInstanceResponse