{-# 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.DescribeStackEvents
(
DescribeStackEvents (..),
newDescribeStackEvents,
describeStackEvents_nextToken,
describeStackEvents_stackName,
DescribeStackEventsResponse (..),
newDescribeStackEventsResponse,
describeStackEventsResponse_nextToken,
describeStackEventsResponse_stackEvents,
describeStackEventsResponse_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 DescribeStackEvents = DescribeStackEvents'
{
DescribeStackEvents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeStackEvents -> Maybe Text
stackName :: Prelude.Maybe Prelude.Text
}
deriving (DescribeStackEvents -> DescribeStackEvents -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStackEvents -> DescribeStackEvents -> Bool
$c/= :: DescribeStackEvents -> DescribeStackEvents -> Bool
== :: DescribeStackEvents -> DescribeStackEvents -> Bool
$c== :: DescribeStackEvents -> DescribeStackEvents -> Bool
Prelude.Eq, ReadPrec [DescribeStackEvents]
ReadPrec DescribeStackEvents
Int -> ReadS DescribeStackEvents
ReadS [DescribeStackEvents]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStackEvents]
$creadListPrec :: ReadPrec [DescribeStackEvents]
readPrec :: ReadPrec DescribeStackEvents
$creadPrec :: ReadPrec DescribeStackEvents
readList :: ReadS [DescribeStackEvents]
$creadList :: ReadS [DescribeStackEvents]
readsPrec :: Int -> ReadS DescribeStackEvents
$creadsPrec :: Int -> ReadS DescribeStackEvents
Prelude.Read, Int -> DescribeStackEvents -> ShowS
[DescribeStackEvents] -> ShowS
DescribeStackEvents -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStackEvents] -> ShowS
$cshowList :: [DescribeStackEvents] -> ShowS
show :: DescribeStackEvents -> String
$cshow :: DescribeStackEvents -> String
showsPrec :: Int -> DescribeStackEvents -> ShowS
$cshowsPrec :: Int -> DescribeStackEvents -> ShowS
Prelude.Show, forall x. Rep DescribeStackEvents x -> DescribeStackEvents
forall x. DescribeStackEvents -> Rep DescribeStackEvents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeStackEvents x -> DescribeStackEvents
$cfrom :: forall x. DescribeStackEvents -> Rep DescribeStackEvents x
Prelude.Generic)
newDescribeStackEvents ::
DescribeStackEvents
newDescribeStackEvents :: DescribeStackEvents
newDescribeStackEvents =
DescribeStackEvents'
{ $sel:nextToken:DescribeStackEvents' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:stackName:DescribeStackEvents' :: Maybe Text
stackName = forall a. Maybe a
Prelude.Nothing
}
describeStackEvents_nextToken :: Lens.Lens' DescribeStackEvents (Prelude.Maybe Prelude.Text)
describeStackEvents_nextToken :: Lens' DescribeStackEvents (Maybe Text)
describeStackEvents_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackEvents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeStackEvents' :: DescribeStackEvents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeStackEvents
s@DescribeStackEvents' {} Maybe Text
a -> DescribeStackEvents
s {$sel:nextToken:DescribeStackEvents' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeStackEvents)
describeStackEvents_stackName :: Lens.Lens' DescribeStackEvents (Prelude.Maybe Prelude.Text)
describeStackEvents_stackName :: Lens' DescribeStackEvents (Maybe Text)
describeStackEvents_stackName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackEvents' {Maybe Text
stackName :: Maybe Text
$sel:stackName:DescribeStackEvents' :: DescribeStackEvents -> Maybe Text
stackName} -> Maybe Text
stackName) (\s :: DescribeStackEvents
s@DescribeStackEvents' {} Maybe Text
a -> DescribeStackEvents
s {$sel:stackName:DescribeStackEvents' :: Maybe Text
stackName = Maybe Text
a} :: DescribeStackEvents)
instance Core.AWSPager DescribeStackEvents where
page :: DescribeStackEvents
-> AWSResponse DescribeStackEvents -> Maybe DescribeStackEvents
page DescribeStackEvents
rq AWSResponse DescribeStackEvents
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeStackEvents
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeStackEventsResponse (Maybe Text)
describeStackEventsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeStackEvents
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeStackEventsResponse (Maybe [StackEvent])
describeStackEventsResponse_stackEvents
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ DescribeStackEvents
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeStackEvents (Maybe Text)
describeStackEvents_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeStackEvents
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeStackEventsResponse (Maybe Text)
describeStackEventsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest DescribeStackEvents where
type
AWSResponse DescribeStackEvents =
DescribeStackEventsResponse
request :: (Service -> Service)
-> DescribeStackEvents -> Request DescribeStackEvents
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 DescribeStackEvents
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeStackEvents)))
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
"DescribeStackEventsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe [StackEvent] -> Int -> DescribeStackEventsResponse
DescribeStackEventsResponse'
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
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"StackEvents"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
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 DescribeStackEvents where
hashWithSalt :: Int -> DescribeStackEvents -> Int
hashWithSalt Int
_salt DescribeStackEvents' {Maybe Text
stackName :: Maybe Text
nextToken :: Maybe Text
$sel:stackName:DescribeStackEvents' :: DescribeStackEvents -> Maybe Text
$sel:nextToken:DescribeStackEvents' :: DescribeStackEvents -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackName
instance Prelude.NFData DescribeStackEvents where
rnf :: DescribeStackEvents -> ()
rnf DescribeStackEvents' {Maybe Text
stackName :: Maybe Text
nextToken :: Maybe Text
$sel:stackName:DescribeStackEvents' :: DescribeStackEvents -> Maybe Text
$sel:nextToken:DescribeStackEvents' :: DescribeStackEvents -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackName
instance Data.ToHeaders DescribeStackEvents where
toHeaders :: DescribeStackEvents -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DescribeStackEvents where
toPath :: DescribeStackEvents -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeStackEvents where
toQuery :: DescribeStackEvents -> QueryString
toQuery DescribeStackEvents' {Maybe Text
stackName :: Maybe Text
nextToken :: Maybe Text
$sel:stackName:DescribeStackEvents' :: DescribeStackEvents -> Maybe Text
$sel:nextToken:DescribeStackEvents' :: DescribeStackEvents -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeStackEvents" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"StackName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
stackName
]
data DescribeStackEventsResponse = DescribeStackEventsResponse'
{
DescribeStackEventsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeStackEventsResponse -> Maybe [StackEvent]
stackEvents :: Prelude.Maybe [StackEvent],
DescribeStackEventsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeStackEventsResponse -> DescribeStackEventsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStackEventsResponse -> DescribeStackEventsResponse -> Bool
$c/= :: DescribeStackEventsResponse -> DescribeStackEventsResponse -> Bool
== :: DescribeStackEventsResponse -> DescribeStackEventsResponse -> Bool
$c== :: DescribeStackEventsResponse -> DescribeStackEventsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeStackEventsResponse]
ReadPrec DescribeStackEventsResponse
Int -> ReadS DescribeStackEventsResponse
ReadS [DescribeStackEventsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStackEventsResponse]
$creadListPrec :: ReadPrec [DescribeStackEventsResponse]
readPrec :: ReadPrec DescribeStackEventsResponse
$creadPrec :: ReadPrec DescribeStackEventsResponse
readList :: ReadS [DescribeStackEventsResponse]
$creadList :: ReadS [DescribeStackEventsResponse]
readsPrec :: Int -> ReadS DescribeStackEventsResponse
$creadsPrec :: Int -> ReadS DescribeStackEventsResponse
Prelude.Read, Int -> DescribeStackEventsResponse -> ShowS
[DescribeStackEventsResponse] -> ShowS
DescribeStackEventsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStackEventsResponse] -> ShowS
$cshowList :: [DescribeStackEventsResponse] -> ShowS
show :: DescribeStackEventsResponse -> String
$cshow :: DescribeStackEventsResponse -> String
showsPrec :: Int -> DescribeStackEventsResponse -> ShowS
$cshowsPrec :: Int -> DescribeStackEventsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeStackEventsResponse x -> DescribeStackEventsResponse
forall x.
DescribeStackEventsResponse -> Rep DescribeStackEventsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStackEventsResponse x -> DescribeStackEventsResponse
$cfrom :: forall x.
DescribeStackEventsResponse -> Rep DescribeStackEventsResponse x
Prelude.Generic)
newDescribeStackEventsResponse ::
Prelude.Int ->
DescribeStackEventsResponse
newDescribeStackEventsResponse :: Int -> DescribeStackEventsResponse
newDescribeStackEventsResponse Int
pHttpStatus_ =
DescribeStackEventsResponse'
{ $sel:nextToken:DescribeStackEventsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:stackEvents:DescribeStackEventsResponse' :: Maybe [StackEvent]
stackEvents = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeStackEventsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeStackEventsResponse_nextToken :: Lens.Lens' DescribeStackEventsResponse (Prelude.Maybe Prelude.Text)
describeStackEventsResponse_nextToken :: Lens' DescribeStackEventsResponse (Maybe Text)
describeStackEventsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackEventsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeStackEventsResponse' :: DescribeStackEventsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeStackEventsResponse
s@DescribeStackEventsResponse' {} Maybe Text
a -> DescribeStackEventsResponse
s {$sel:nextToken:DescribeStackEventsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeStackEventsResponse)
describeStackEventsResponse_stackEvents :: Lens.Lens' DescribeStackEventsResponse (Prelude.Maybe [StackEvent])
describeStackEventsResponse_stackEvents :: Lens' DescribeStackEventsResponse (Maybe [StackEvent])
describeStackEventsResponse_stackEvents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackEventsResponse' {Maybe [StackEvent]
stackEvents :: Maybe [StackEvent]
$sel:stackEvents:DescribeStackEventsResponse' :: DescribeStackEventsResponse -> Maybe [StackEvent]
stackEvents} -> Maybe [StackEvent]
stackEvents) (\s :: DescribeStackEventsResponse
s@DescribeStackEventsResponse' {} Maybe [StackEvent]
a -> DescribeStackEventsResponse
s {$sel:stackEvents:DescribeStackEventsResponse' :: Maybe [StackEvent]
stackEvents = Maybe [StackEvent]
a} :: DescribeStackEventsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeStackEventsResponse_httpStatus :: Lens.Lens' DescribeStackEventsResponse Prelude.Int
describeStackEventsResponse_httpStatus :: Lens' DescribeStackEventsResponse Int
describeStackEventsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackEventsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeStackEventsResponse' :: DescribeStackEventsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeStackEventsResponse
s@DescribeStackEventsResponse' {} Int
a -> DescribeStackEventsResponse
s {$sel:httpStatus:DescribeStackEventsResponse' :: Int
httpStatus = Int
a} :: DescribeStackEventsResponse)
instance Prelude.NFData DescribeStackEventsResponse where
rnf :: DescribeStackEventsResponse -> ()
rnf DescribeStackEventsResponse' {Int
Maybe [StackEvent]
Maybe Text
httpStatus :: Int
stackEvents :: Maybe [StackEvent]
nextToken :: Maybe Text
$sel:httpStatus:DescribeStackEventsResponse' :: DescribeStackEventsResponse -> Int
$sel:stackEvents:DescribeStackEventsResponse' :: DescribeStackEventsResponse -> Maybe [StackEvent]
$sel:nextToken:DescribeStackEventsResponse' :: DescribeStackEventsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [StackEvent]
stackEvents
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus