{-# 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.ListStackSets
(
ListStackSets (..),
newListStackSets,
listStackSets_callAs,
listStackSets_maxResults,
listStackSets_nextToken,
listStackSets_status,
ListStackSetsResponse (..),
newListStackSetsResponse,
listStackSetsResponse_nextToken,
listStackSetsResponse_summaries,
listStackSetsResponse_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 ListStackSets = ListStackSets'
{
ListStackSets -> Maybe CallAs
callAs :: Prelude.Maybe CallAs,
ListStackSets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListStackSets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListStackSets -> Maybe StackSetStatus
status :: Prelude.Maybe StackSetStatus
}
deriving (ListStackSets -> ListStackSets -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStackSets -> ListStackSets -> Bool
$c/= :: ListStackSets -> ListStackSets -> Bool
== :: ListStackSets -> ListStackSets -> Bool
$c== :: ListStackSets -> ListStackSets -> Bool
Prelude.Eq, ReadPrec [ListStackSets]
ReadPrec ListStackSets
Int -> ReadS ListStackSets
ReadS [ListStackSets]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStackSets]
$creadListPrec :: ReadPrec [ListStackSets]
readPrec :: ReadPrec ListStackSets
$creadPrec :: ReadPrec ListStackSets
readList :: ReadS [ListStackSets]
$creadList :: ReadS [ListStackSets]
readsPrec :: Int -> ReadS ListStackSets
$creadsPrec :: Int -> ReadS ListStackSets
Prelude.Read, Int -> ListStackSets -> ShowS
[ListStackSets] -> ShowS
ListStackSets -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStackSets] -> ShowS
$cshowList :: [ListStackSets] -> ShowS
show :: ListStackSets -> String
$cshow :: ListStackSets -> String
showsPrec :: Int -> ListStackSets -> ShowS
$cshowsPrec :: Int -> ListStackSets -> ShowS
Prelude.Show, forall x. Rep ListStackSets x -> ListStackSets
forall x. ListStackSets -> Rep ListStackSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListStackSets x -> ListStackSets
$cfrom :: forall x. ListStackSets -> Rep ListStackSets x
Prelude.Generic)
newListStackSets ::
ListStackSets
newListStackSets :: ListStackSets
newListStackSets =
ListStackSets'
{ $sel:callAs:ListStackSets' :: Maybe CallAs
callAs = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListStackSets' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListStackSets' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:status:ListStackSets' :: Maybe StackSetStatus
status = forall a. Maybe a
Prelude.Nothing
}
listStackSets_callAs :: Lens.Lens' ListStackSets (Prelude.Maybe CallAs)
listStackSets_callAs :: Lens' ListStackSets (Maybe CallAs)
listStackSets_callAs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSets' {Maybe CallAs
callAs :: Maybe CallAs
$sel:callAs:ListStackSets' :: ListStackSets -> Maybe CallAs
callAs} -> Maybe CallAs
callAs) (\s :: ListStackSets
s@ListStackSets' {} Maybe CallAs
a -> ListStackSets
s {$sel:callAs:ListStackSets' :: Maybe CallAs
callAs = Maybe CallAs
a} :: ListStackSets)
listStackSets_maxResults :: Lens.Lens' ListStackSets (Prelude.Maybe Prelude.Natural)
listStackSets_maxResults :: Lens' ListStackSets (Maybe Natural)
listStackSets_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSets' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListStackSets' :: ListStackSets -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListStackSets
s@ListStackSets' {} Maybe Natural
a -> ListStackSets
s {$sel:maxResults:ListStackSets' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListStackSets)
listStackSets_nextToken :: Lens.Lens' ListStackSets (Prelude.Maybe Prelude.Text)
listStackSets_nextToken :: Lens' ListStackSets (Maybe Text)
listStackSets_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStackSets' :: ListStackSets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStackSets
s@ListStackSets' {} Maybe Text
a -> ListStackSets
s {$sel:nextToken:ListStackSets' :: Maybe Text
nextToken = Maybe Text
a} :: ListStackSets)
listStackSets_status :: Lens.Lens' ListStackSets (Prelude.Maybe StackSetStatus)
listStackSets_status :: Lens' ListStackSets (Maybe StackSetStatus)
listStackSets_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSets' {Maybe StackSetStatus
status :: Maybe StackSetStatus
$sel:status:ListStackSets' :: ListStackSets -> Maybe StackSetStatus
status} -> Maybe StackSetStatus
status) (\s :: ListStackSets
s@ListStackSets' {} Maybe StackSetStatus
a -> ListStackSets
s {$sel:status:ListStackSets' :: Maybe StackSetStatus
status = Maybe StackSetStatus
a} :: ListStackSets)
instance Core.AWSPager ListStackSets where
page :: ListStackSets -> AWSResponse ListStackSets -> Maybe ListStackSets
page ListStackSets
rq AWSResponse ListStackSets
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListStackSets
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStackSetsResponse (Maybe Text)
listStackSetsResponse_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 ListStackSets
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStackSetsResponse (Maybe [StackSetSummary])
listStackSetsResponse_summaries
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.$ ListStackSets
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListStackSets (Maybe Text)
listStackSets_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListStackSets
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStackSetsResponse (Maybe Text)
listStackSetsResponse_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 ListStackSets where
type
AWSResponse ListStackSets =
ListStackSetsResponse
request :: (Service -> Service) -> ListStackSets -> Request ListStackSets
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 ListStackSets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListStackSets)))
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
"ListStackSetsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe [StackSetSummary] -> Int -> ListStackSetsResponse
ListStackSetsResponse'
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
"Summaries"
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 ListStackSets where
hashWithSalt :: Int -> ListStackSets -> Int
hashWithSalt Int
_salt ListStackSets' {Maybe Natural
Maybe Text
Maybe CallAs
Maybe StackSetStatus
status :: Maybe StackSetStatus
nextToken :: Maybe Text
maxResults :: Maybe Natural
callAs :: Maybe CallAs
$sel:status:ListStackSets' :: ListStackSets -> Maybe StackSetStatus
$sel:nextToken:ListStackSets' :: ListStackSets -> Maybe Text
$sel:maxResults:ListStackSets' :: ListStackSets -> Maybe Natural
$sel:callAs:ListStackSets' :: ListStackSets -> Maybe CallAs
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CallAs
callAs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackSetStatus
status
instance Prelude.NFData ListStackSets where
rnf :: ListStackSets -> ()
rnf ListStackSets' {Maybe Natural
Maybe Text
Maybe CallAs
Maybe StackSetStatus
status :: Maybe StackSetStatus
nextToken :: Maybe Text
maxResults :: Maybe Natural
callAs :: Maybe CallAs
$sel:status:ListStackSets' :: ListStackSets -> Maybe StackSetStatus
$sel:nextToken:ListStackSets' :: ListStackSets -> Maybe Text
$sel:maxResults:ListStackSets' :: ListStackSets -> Maybe Natural
$sel:callAs:ListStackSets' :: ListStackSets -> Maybe CallAs
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CallAs
callAs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 StackSetStatus
status
instance Data.ToHeaders ListStackSets where
toHeaders :: ListStackSets -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListStackSets where
toPath :: ListStackSets -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListStackSets where
toQuery :: ListStackSets -> QueryString
toQuery ListStackSets' {Maybe Natural
Maybe Text
Maybe CallAs
Maybe StackSetStatus
status :: Maybe StackSetStatus
nextToken :: Maybe Text
maxResults :: Maybe Natural
callAs :: Maybe CallAs
$sel:status:ListStackSets' :: ListStackSets -> Maybe StackSetStatus
$sel:nextToken:ListStackSets' :: ListStackSets -> Maybe Text
$sel:maxResults:ListStackSets' :: ListStackSets -> Maybe Natural
$sel:callAs:ListStackSets' :: ListStackSets -> Maybe CallAs
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListStackSets" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"CallAs" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe CallAs
callAs,
ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"Status" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe StackSetStatus
status
]
data ListStackSetsResponse = ListStackSetsResponse'
{
ListStackSetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListStackSetsResponse -> Maybe [StackSetSummary]
summaries :: Prelude.Maybe [StackSetSummary],
ListStackSetsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListStackSetsResponse -> ListStackSetsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStackSetsResponse -> ListStackSetsResponse -> Bool
$c/= :: ListStackSetsResponse -> ListStackSetsResponse -> Bool
== :: ListStackSetsResponse -> ListStackSetsResponse -> Bool
$c== :: ListStackSetsResponse -> ListStackSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListStackSetsResponse]
ReadPrec ListStackSetsResponse
Int -> ReadS ListStackSetsResponse
ReadS [ListStackSetsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStackSetsResponse]
$creadListPrec :: ReadPrec [ListStackSetsResponse]
readPrec :: ReadPrec ListStackSetsResponse
$creadPrec :: ReadPrec ListStackSetsResponse
readList :: ReadS [ListStackSetsResponse]
$creadList :: ReadS [ListStackSetsResponse]
readsPrec :: Int -> ReadS ListStackSetsResponse
$creadsPrec :: Int -> ReadS ListStackSetsResponse
Prelude.Read, Int -> ListStackSetsResponse -> ShowS
[ListStackSetsResponse] -> ShowS
ListStackSetsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStackSetsResponse] -> ShowS
$cshowList :: [ListStackSetsResponse] -> ShowS
show :: ListStackSetsResponse -> String
$cshow :: ListStackSetsResponse -> String
showsPrec :: Int -> ListStackSetsResponse -> ShowS
$cshowsPrec :: Int -> ListStackSetsResponse -> ShowS
Prelude.Show, forall x. Rep ListStackSetsResponse x -> ListStackSetsResponse
forall x. ListStackSetsResponse -> Rep ListStackSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListStackSetsResponse x -> ListStackSetsResponse
$cfrom :: forall x. ListStackSetsResponse -> Rep ListStackSetsResponse x
Prelude.Generic)
newListStackSetsResponse ::
Prelude.Int ->
ListStackSetsResponse
newListStackSetsResponse :: Int -> ListStackSetsResponse
newListStackSetsResponse Int
pHttpStatus_ =
ListStackSetsResponse'
{ $sel:nextToken:ListStackSetsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:summaries:ListStackSetsResponse' :: Maybe [StackSetSummary]
summaries = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListStackSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listStackSetsResponse_nextToken :: Lens.Lens' ListStackSetsResponse (Prelude.Maybe Prelude.Text)
listStackSetsResponse_nextToken :: Lens' ListStackSetsResponse (Maybe Text)
listStackSetsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStackSetsResponse' :: ListStackSetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStackSetsResponse
s@ListStackSetsResponse' {} Maybe Text
a -> ListStackSetsResponse
s {$sel:nextToken:ListStackSetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListStackSetsResponse)
listStackSetsResponse_summaries :: Lens.Lens' ListStackSetsResponse (Prelude.Maybe [StackSetSummary])
listStackSetsResponse_summaries :: Lens' ListStackSetsResponse (Maybe [StackSetSummary])
listStackSetsResponse_summaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetsResponse' {Maybe [StackSetSummary]
summaries :: Maybe [StackSetSummary]
$sel:summaries:ListStackSetsResponse' :: ListStackSetsResponse -> Maybe [StackSetSummary]
summaries} -> Maybe [StackSetSummary]
summaries) (\s :: ListStackSetsResponse
s@ListStackSetsResponse' {} Maybe [StackSetSummary]
a -> ListStackSetsResponse
s {$sel:summaries:ListStackSetsResponse' :: Maybe [StackSetSummary]
summaries = Maybe [StackSetSummary]
a} :: ListStackSetsResponse) 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
listStackSetsResponse_httpStatus :: Lens.Lens' ListStackSetsResponse Prelude.Int
listStackSetsResponse_httpStatus :: Lens' ListStackSetsResponse Int
listStackSetsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListStackSetsResponse' :: ListStackSetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListStackSetsResponse
s@ListStackSetsResponse' {} Int
a -> ListStackSetsResponse
s {$sel:httpStatus:ListStackSetsResponse' :: Int
httpStatus = Int
a} :: ListStackSetsResponse)
instance Prelude.NFData ListStackSetsResponse where
rnf :: ListStackSetsResponse -> ()
rnf ListStackSetsResponse' {Int
Maybe [StackSetSummary]
Maybe Text
httpStatus :: Int
summaries :: Maybe [StackSetSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListStackSetsResponse' :: ListStackSetsResponse -> Int
$sel:summaries:ListStackSetsResponse' :: ListStackSetsResponse -> Maybe [StackSetSummary]
$sel:nextToken:ListStackSetsResponse' :: ListStackSetsResponse -> 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 [StackSetSummary]
summaries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus