{-# 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.DescribeStackResource
(
DescribeStackResource (..),
newDescribeStackResource,
describeStackResource_stackName,
describeStackResource_logicalResourceId,
DescribeStackResourceResponse (..),
newDescribeStackResourceResponse,
describeStackResourceResponse_stackResourceDetail,
describeStackResourceResponse_httpStatus,
)
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 DescribeStackResource = DescribeStackResource'
{
DescribeStackResource -> Text
stackName :: Prelude.Text,
DescribeStackResource -> Text
logicalResourceId :: Prelude.Text
}
deriving (DescribeStackResource -> DescribeStackResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStackResource -> DescribeStackResource -> Bool
$c/= :: DescribeStackResource -> DescribeStackResource -> Bool
== :: DescribeStackResource -> DescribeStackResource -> Bool
$c== :: DescribeStackResource -> DescribeStackResource -> Bool
Prelude.Eq, ReadPrec [DescribeStackResource]
ReadPrec DescribeStackResource
Int -> ReadS DescribeStackResource
ReadS [DescribeStackResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStackResource]
$creadListPrec :: ReadPrec [DescribeStackResource]
readPrec :: ReadPrec DescribeStackResource
$creadPrec :: ReadPrec DescribeStackResource
readList :: ReadS [DescribeStackResource]
$creadList :: ReadS [DescribeStackResource]
readsPrec :: Int -> ReadS DescribeStackResource
$creadsPrec :: Int -> ReadS DescribeStackResource
Prelude.Read, Int -> DescribeStackResource -> ShowS
[DescribeStackResource] -> ShowS
DescribeStackResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStackResource] -> ShowS
$cshowList :: [DescribeStackResource] -> ShowS
show :: DescribeStackResource -> String
$cshow :: DescribeStackResource -> String
showsPrec :: Int -> DescribeStackResource -> ShowS
$cshowsPrec :: Int -> DescribeStackResource -> ShowS
Prelude.Show, forall x. Rep DescribeStackResource x -> DescribeStackResource
forall x. DescribeStackResource -> Rep DescribeStackResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeStackResource x -> DescribeStackResource
$cfrom :: forall x. DescribeStackResource -> Rep DescribeStackResource x
Prelude.Generic)
newDescribeStackResource ::
Prelude.Text ->
Prelude.Text ->
DescribeStackResource
newDescribeStackResource :: Text -> Text -> DescribeStackResource
newDescribeStackResource
Text
pStackName_
Text
pLogicalResourceId_ =
DescribeStackResource'
{ $sel:stackName:DescribeStackResource' :: Text
stackName = Text
pStackName_,
$sel:logicalResourceId:DescribeStackResource' :: Text
logicalResourceId = Text
pLogicalResourceId_
}
describeStackResource_stackName :: Lens.Lens' DescribeStackResource Prelude.Text
describeStackResource_stackName :: Lens' DescribeStackResource Text
describeStackResource_stackName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResource' {Text
stackName :: Text
$sel:stackName:DescribeStackResource' :: DescribeStackResource -> Text
stackName} -> Text
stackName) (\s :: DescribeStackResource
s@DescribeStackResource' {} Text
a -> DescribeStackResource
s {$sel:stackName:DescribeStackResource' :: Text
stackName = Text
a} :: DescribeStackResource)
describeStackResource_logicalResourceId :: Lens.Lens' DescribeStackResource Prelude.Text
describeStackResource_logicalResourceId :: Lens' DescribeStackResource Text
describeStackResource_logicalResourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResource' {Text
logicalResourceId :: Text
$sel:logicalResourceId:DescribeStackResource' :: DescribeStackResource -> Text
logicalResourceId} -> Text
logicalResourceId) (\s :: DescribeStackResource
s@DescribeStackResource' {} Text
a -> DescribeStackResource
s {$sel:logicalResourceId:DescribeStackResource' :: Text
logicalResourceId = Text
a} :: DescribeStackResource)
instance Core.AWSRequest DescribeStackResource where
type
AWSResponse DescribeStackResource =
DescribeStackResourceResponse
request :: (Service -> Service)
-> DescribeStackResource -> Request DescribeStackResource
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 DescribeStackResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeStackResource)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DescribeStackResourceResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe StackResourceDetail -> Int -> DescribeStackResourceResponse
DescribeStackResourceResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StackResourceDetail")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeStackResource where
hashWithSalt :: Int -> DescribeStackResource -> Int
hashWithSalt Int
_salt DescribeStackResource' {Text
logicalResourceId :: Text
stackName :: Text
$sel:logicalResourceId:DescribeStackResource' :: DescribeStackResource -> Text
$sel:stackName:DescribeStackResource' :: DescribeStackResource -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stackName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
logicalResourceId
instance Prelude.NFData DescribeStackResource where
rnf :: DescribeStackResource -> ()
rnf DescribeStackResource' {Text
logicalResourceId :: Text
stackName :: Text
$sel:logicalResourceId:DescribeStackResource' :: DescribeStackResource -> Text
$sel:stackName:DescribeStackResource' :: DescribeStackResource -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
stackName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
logicalResourceId
instance Data.ToHeaders DescribeStackResource where
toHeaders :: DescribeStackResource -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DescribeStackResource where
toPath :: DescribeStackResource -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeStackResource where
toQuery :: DescribeStackResource -> QueryString
toQuery DescribeStackResource' {Text
logicalResourceId :: Text
stackName :: Text
$sel:logicalResourceId:DescribeStackResource' :: DescribeStackResource -> Text
$sel:stackName:DescribeStackResource' :: DescribeStackResource -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeStackResource" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"StackName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
stackName,
ByteString
"LogicalResourceId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
logicalResourceId
]
data DescribeStackResourceResponse = DescribeStackResourceResponse'
{
DescribeStackResourceResponse -> Maybe StackResourceDetail
stackResourceDetail :: Prelude.Maybe StackResourceDetail,
DescribeStackResourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeStackResourceResponse
-> DescribeStackResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStackResourceResponse
-> DescribeStackResourceResponse -> Bool
$c/= :: DescribeStackResourceResponse
-> DescribeStackResourceResponse -> Bool
== :: DescribeStackResourceResponse
-> DescribeStackResourceResponse -> Bool
$c== :: DescribeStackResourceResponse
-> DescribeStackResourceResponse -> Bool
Prelude.Eq, ReadPrec [DescribeStackResourceResponse]
ReadPrec DescribeStackResourceResponse
Int -> ReadS DescribeStackResourceResponse
ReadS [DescribeStackResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStackResourceResponse]
$creadListPrec :: ReadPrec [DescribeStackResourceResponse]
readPrec :: ReadPrec DescribeStackResourceResponse
$creadPrec :: ReadPrec DescribeStackResourceResponse
readList :: ReadS [DescribeStackResourceResponse]
$creadList :: ReadS [DescribeStackResourceResponse]
readsPrec :: Int -> ReadS DescribeStackResourceResponse
$creadsPrec :: Int -> ReadS DescribeStackResourceResponse
Prelude.Read, Int -> DescribeStackResourceResponse -> ShowS
[DescribeStackResourceResponse] -> ShowS
DescribeStackResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStackResourceResponse] -> ShowS
$cshowList :: [DescribeStackResourceResponse] -> ShowS
show :: DescribeStackResourceResponse -> String
$cshow :: DescribeStackResourceResponse -> String
showsPrec :: Int -> DescribeStackResourceResponse -> ShowS
$cshowsPrec :: Int -> DescribeStackResourceResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeStackResourceResponse x
-> DescribeStackResourceResponse
forall x.
DescribeStackResourceResponse
-> Rep DescribeStackResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStackResourceResponse x
-> DescribeStackResourceResponse
$cfrom :: forall x.
DescribeStackResourceResponse
-> Rep DescribeStackResourceResponse x
Prelude.Generic)
newDescribeStackResourceResponse ::
Prelude.Int ->
DescribeStackResourceResponse
newDescribeStackResourceResponse :: Int -> DescribeStackResourceResponse
newDescribeStackResourceResponse Int
pHttpStatus_ =
DescribeStackResourceResponse'
{ $sel:stackResourceDetail:DescribeStackResourceResponse' :: Maybe StackResourceDetail
stackResourceDetail =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeStackResourceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeStackResourceResponse_stackResourceDetail :: Lens.Lens' DescribeStackResourceResponse (Prelude.Maybe StackResourceDetail)
describeStackResourceResponse_stackResourceDetail :: Lens' DescribeStackResourceResponse (Maybe StackResourceDetail)
describeStackResourceResponse_stackResourceDetail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResourceResponse' {Maybe StackResourceDetail
stackResourceDetail :: Maybe StackResourceDetail
$sel:stackResourceDetail:DescribeStackResourceResponse' :: DescribeStackResourceResponse -> Maybe StackResourceDetail
stackResourceDetail} -> Maybe StackResourceDetail
stackResourceDetail) (\s :: DescribeStackResourceResponse
s@DescribeStackResourceResponse' {} Maybe StackResourceDetail
a -> DescribeStackResourceResponse
s {$sel:stackResourceDetail:DescribeStackResourceResponse' :: Maybe StackResourceDetail
stackResourceDetail = Maybe StackResourceDetail
a} :: DescribeStackResourceResponse)
describeStackResourceResponse_httpStatus :: Lens.Lens' DescribeStackResourceResponse Prelude.Int
describeStackResourceResponse_httpStatus :: Lens' DescribeStackResourceResponse Int
describeStackResourceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeStackResourceResponse' :: DescribeStackResourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeStackResourceResponse
s@DescribeStackResourceResponse' {} Int
a -> DescribeStackResourceResponse
s {$sel:httpStatus:DescribeStackResourceResponse' :: Int
httpStatus = Int
a} :: DescribeStackResourceResponse)
instance Prelude.NFData DescribeStackResourceResponse where
rnf :: DescribeStackResourceResponse -> ()
rnf DescribeStackResourceResponse' {Int
Maybe StackResourceDetail
httpStatus :: Int
stackResourceDetail :: Maybe StackResourceDetail
$sel:httpStatus:DescribeStackResourceResponse' :: DescribeStackResourceResponse -> Int
$sel:stackResourceDetail:DescribeStackResourceResponse' :: DescribeStackResourceResponse -> Maybe StackResourceDetail
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe StackResourceDetail
stackResourceDetail
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus