{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudFormation.ListStackSets
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns summary information about stack sets that are associated with
-- the user.
--
-- -   [Self-managed permissions] If you set the @CallAs@ parameter to
--     @SELF@ while signed in to your Amazon Web Services account,
--     @ListStackSets@ returns all self-managed stack sets in your Amazon
--     Web Services account.
--
-- -   [Service-managed permissions] If you set the @CallAs@ parameter to
--     @SELF@ while signed in to the organization\'s management account,
--     @ListStackSets@ returns all stack sets in the management account.
--
-- -   [Service-managed permissions] If you set the @CallAs@ parameter to
--     @DELEGATED_ADMIN@ while signed in to your member account,
--     @ListStackSets@ returns all stack sets with service-managed
--     permissions in the management account.
--
-- This operation returns paginated results.
module Amazonka.CloudFormation.ListStackSets
  ( -- * Creating a Request
    ListStackSets (..),
    newListStackSets,

    -- * Request Lenses
    listStackSets_status,
    listStackSets_callAs,
    listStackSets_nextToken,
    listStackSets_maxResults,

    -- * Destructuring the Response
    ListStackSetsResponse (..),
    newListStackSetsResponse,

    -- * Response Lenses
    listStackSetsResponse_nextToken,
    listStackSetsResponse_summaries,
    listStackSetsResponse_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

-- | /See:/ 'newListStackSets' smart constructor.
data ListStackSets = ListStackSets'
  { -- | The status of the stack sets that you want to get summary information
    -- about.
    ListStackSets -> Maybe StackSetStatus
status :: Prelude.Maybe StackSetStatus,
    -- | [Service-managed permissions] Specifies whether you are acting as an
    -- account administrator in the management account or as a delegated
    -- administrator in a member account.
    --
    -- By default, @SELF@ is specified. Use @SELF@ for stack sets with
    -- self-managed permissions.
    --
    -- -   If you are signed in to the management account, specify @SELF@.
    --
    -- -   If you are signed in to a delegated administrator account, specify
    --     @DELEGATED_ADMIN@.
    --
    --     Your Amazon Web Services account must be registered as a delegated
    --     administrator in the management account. For more information, see
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
    --     in the /CloudFormation User Guide/.
    ListStackSets -> Maybe CallAs
callAs :: Prelude.Maybe CallAs,
    -- | If the previous paginated request didn\'t return all of the remaining
    -- results, the response object\'s @NextToken@ parameter value is set to a
    -- token. To retrieve the next set of results, call @ListStackSets@ again
    -- and assign that token to the request object\'s @NextToken@ parameter. If
    -- there are no remaining results, the previous response object\'s
    -- @NextToken@ parameter is set to @null@.
    ListStackSets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned with a single call. If the
    -- number of available results exceeds this maximum, the response includes
    -- a @NextToken@ value that you can assign to the @NextToken@ request
    -- parameter to get the next set of results.
    ListStackSets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListStackSets -> ListStackSets -> Bool
(ListStackSets -> ListStackSets -> Bool)
-> (ListStackSets -> ListStackSets -> Bool) -> Eq ListStackSets
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]
(Int -> ReadS ListStackSets)
-> ReadS [ListStackSets]
-> ReadPrec ListStackSets
-> ReadPrec [ListStackSets]
-> Read 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
(Int -> ListStackSets -> ShowS)
-> (ListStackSets -> String)
-> ([ListStackSets] -> ShowS)
-> Show ListStackSets
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. ListStackSets -> Rep ListStackSets x)
-> (forall x. Rep ListStackSets x -> ListStackSets)
-> Generic ListStackSets
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)

-- |
-- Create a value of 'ListStackSets' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'listStackSets_status' - The status of the stack sets that you want to get summary information
-- about.
--
-- 'callAs', 'listStackSets_callAs' - [Service-managed permissions] Specifies whether you are acting as an
-- account administrator in the management account or as a delegated
-- administrator in a member account.
--
-- By default, @SELF@ is specified. Use @SELF@ for stack sets with
-- self-managed permissions.
--
-- -   If you are signed in to the management account, specify @SELF@.
--
-- -   If you are signed in to a delegated administrator account, specify
--     @DELEGATED_ADMIN@.
--
--     Your Amazon Web Services account must be registered as a delegated
--     administrator in the management account. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
--     in the /CloudFormation User Guide/.
--
-- 'nextToken', 'listStackSets_nextToken' - If the previous paginated request didn\'t return all of the remaining
-- results, the response object\'s @NextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListStackSets@ again
-- and assign that token to the request object\'s @NextToken@ parameter. If
-- there are no remaining results, the previous response object\'s
-- @NextToken@ parameter is set to @null@.
--
-- 'maxResults', 'listStackSets_maxResults' - The maximum number of results to be returned with a single call. If the
-- number of available results exceeds this maximum, the response includes
-- a @NextToken@ value that you can assign to the @NextToken@ request
-- parameter to get the next set of results.
newListStackSets ::
  ListStackSets
newListStackSets :: ListStackSets
newListStackSets =
  ListStackSets' :: Maybe StackSetStatus
-> Maybe CallAs -> Maybe Text -> Maybe Natural -> ListStackSets
ListStackSets'
    { $sel:status:ListStackSets' :: Maybe StackSetStatus
status = Maybe StackSetStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:callAs:ListStackSets' :: Maybe CallAs
callAs = Maybe CallAs
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListStackSets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListStackSets' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the stack sets that you want to get summary information
-- about.
listStackSets_status :: Lens.Lens' ListStackSets (Prelude.Maybe StackSetStatus)
listStackSets_status :: (Maybe StackSetStatus -> f (Maybe StackSetStatus))
-> ListStackSets -> f ListStackSets
listStackSets_status = (ListStackSets -> Maybe StackSetStatus)
-> (ListStackSets -> Maybe StackSetStatus -> ListStackSets)
-> Lens
     ListStackSets
     ListStackSets
     (Maybe StackSetStatus)
     (Maybe StackSetStatus)
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)

-- | [Service-managed permissions] Specifies whether you are acting as an
-- account administrator in the management account or as a delegated
-- administrator in a member account.
--
-- By default, @SELF@ is specified. Use @SELF@ for stack sets with
-- self-managed permissions.
--
-- -   If you are signed in to the management account, specify @SELF@.
--
-- -   If you are signed in to a delegated administrator account, specify
--     @DELEGATED_ADMIN@.
--
--     Your Amazon Web Services account must be registered as a delegated
--     administrator in the management account. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
--     in the /CloudFormation User Guide/.
listStackSets_callAs :: Lens.Lens' ListStackSets (Prelude.Maybe CallAs)
listStackSets_callAs :: (Maybe CallAs -> f (Maybe CallAs))
-> ListStackSets -> f ListStackSets
listStackSets_callAs = (ListStackSets -> Maybe CallAs)
-> (ListStackSets -> Maybe CallAs -> ListStackSets)
-> Lens ListStackSets ListStackSets (Maybe CallAs) (Maybe 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)

-- | If the previous paginated request didn\'t return all of the remaining
-- results, the response object\'s @NextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call @ListStackSets@ again
-- and assign that token to the request object\'s @NextToken@ parameter. If
-- there are no remaining results, the previous response object\'s
-- @NextToken@ parameter is set to @null@.
listStackSets_nextToken :: Lens.Lens' ListStackSets (Prelude.Maybe Prelude.Text)
listStackSets_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListStackSets -> f ListStackSets
listStackSets_nextToken = (ListStackSets -> Maybe Text)
-> (ListStackSets -> Maybe Text -> ListStackSets)
-> Lens ListStackSets ListStackSets (Maybe Text) (Maybe Text)
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)

-- | The maximum number of results to be returned with a single call. If the
-- number of available results exceeds this maximum, the response includes
-- a @NextToken@ value that you can assign to the @NextToken@ request
-- parameter to get the next set of results.
listStackSets_maxResults :: Lens.Lens' ListStackSets (Prelude.Maybe Prelude.Natural)
listStackSets_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListStackSets -> f ListStackSets
listStackSets_maxResults = (ListStackSets -> Maybe Natural)
-> (ListStackSets -> Maybe Natural -> ListStackSets)
-> Lens ListStackSets ListStackSets (Maybe Natural) (Maybe Natural)
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)

instance Core.AWSPager ListStackSets where
  page :: ListStackSets -> AWSResponse ListStackSets -> Maybe ListStackSets
page ListStackSets
rq AWSResponse ListStackSets
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStackSets
ListStackSetsResponse
rs
            ListStackSetsResponse
-> Getting (First Text) ListStackSetsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListStackSetsResponse
-> Const (First Text) ListStackSetsResponse
Lens' ListStackSetsResponse (Maybe Text)
listStackSetsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListStackSetsResponse
 -> Const (First Text) ListStackSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListStackSetsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListStackSets
forall a. Maybe a
Prelude.Nothing
    | Maybe [StackSetSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStackSets
ListStackSetsResponse
rs
            ListStackSetsResponse
-> Getting
     (First [StackSetSummary]) ListStackSetsResponse [StackSetSummary]
-> Maybe [StackSetSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [StackSetSummary]
 -> Const (First [StackSetSummary]) (Maybe [StackSetSummary]))
-> ListStackSetsResponse
-> Const (First [StackSetSummary]) ListStackSetsResponse
Lens' ListStackSetsResponse (Maybe [StackSetSummary])
listStackSetsResponse_summaries ((Maybe [StackSetSummary]
  -> Const (First [StackSetSummary]) (Maybe [StackSetSummary]))
 -> ListStackSetsResponse
 -> Const (First [StackSetSummary]) ListStackSetsResponse)
-> (([StackSetSummary]
     -> Const (First [StackSetSummary]) [StackSetSummary])
    -> Maybe [StackSetSummary]
    -> Const (First [StackSetSummary]) (Maybe [StackSetSummary]))
-> Getting
     (First [StackSetSummary]) ListStackSetsResponse [StackSetSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([StackSetSummary]
 -> Const (First [StackSetSummary]) [StackSetSummary])
-> Maybe [StackSetSummary]
-> Const (First [StackSetSummary]) (Maybe [StackSetSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListStackSets
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListStackSets -> Maybe ListStackSets
forall a. a -> Maybe a
Prelude.Just (ListStackSets -> Maybe ListStackSets)
-> ListStackSets -> Maybe ListStackSets
forall a b. (a -> b) -> a -> b
Prelude.$
        ListStackSets
rq
          ListStackSets -> (ListStackSets -> ListStackSets) -> ListStackSets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListStackSets -> Identity ListStackSets
Lens ListStackSets ListStackSets (Maybe Text) (Maybe Text)
listStackSets_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListStackSets -> Identity ListStackSets)
-> Maybe Text -> ListStackSets -> ListStackSets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListStackSets
ListStackSetsResponse
rs
          ListStackSetsResponse
-> Getting (First Text) ListStackSetsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListStackSetsResponse
-> Const (First Text) ListStackSetsResponse
Lens' ListStackSetsResponse (Maybe Text)
listStackSetsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListStackSetsResponse
 -> Const (First Text) ListStackSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListStackSetsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListStackSets where
  type
    AWSResponse ListStackSets =
      ListStackSetsResponse
  request :: ListStackSets -> Request ListStackSets
request = Service -> ListStackSets -> Request ListStackSets
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListStackSets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListStackSets)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListStackSets))
-> Logger
-> Service
-> Proxy ListStackSets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListStackSets)))
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
"ListStackSetsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [StackSetSummary] -> Int -> ListStackSetsResponse
ListStackSetsResponse'
            (Maybe Text
 -> Maybe [StackSetSummary] -> Int -> ListStackSetsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [StackSetSummary] -> Int -> ListStackSetsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
            Either
  String (Maybe [StackSetSummary] -> Int -> ListStackSetsResponse)
-> Either String (Maybe [StackSetSummary])
-> Either String (Int -> ListStackSetsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Summaries" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [StackSetSummary]))
-> Either String (Maybe [StackSetSummary])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [StackSetSummary])
-> [Node] -> Either String (Maybe [StackSetSummary])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [StackSetSummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> ListStackSetsResponse)
-> Either String Int -> Either String ListStackSetsResponse
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 ListStackSets

instance Prelude.NFData ListStackSets

instance Core.ToHeaders ListStackSets where
  toHeaders :: ListStackSets -> ResponseHeaders
toHeaders = ResponseHeaders -> ListStackSets -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ListStackSets where
  toPath :: ListStackSets -> ByteString
toPath = ByteString -> ListStackSets -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListStackSets where
  toQuery :: ListStackSets -> QueryString
toQuery ListStackSets' {Maybe Natural
Maybe Text
Maybe CallAs
Maybe StackSetStatus
maxResults :: Maybe Natural
nextToken :: Maybe Text
callAs :: Maybe CallAs
status :: Maybe StackSetStatus
$sel:maxResults:ListStackSets' :: ListStackSets -> Maybe Natural
$sel:nextToken:ListStackSets' :: ListStackSets -> Maybe Text
$sel:callAs:ListStackSets' :: ListStackSets -> Maybe CallAs
$sel:status:ListStackSets' :: ListStackSets -> Maybe StackSetStatus
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListStackSets" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"Status" ByteString -> Maybe StackSetStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe StackSetStatus
status,
        ByteString
"CallAs" ByteString -> Maybe CallAs -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe CallAs
callAs,
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListStackSetsResponse' smart constructor.
data ListStackSetsResponse = ListStackSetsResponse'
  { -- | If the request doesn\'t return all of the remaining results, @NextToken@
    -- is set to a token. To retrieve the next set of results, call
    -- @ListStackInstances@ again and assign that token to the request
    -- object\'s @NextToken@ parameter. If the request returns all results,
    -- @NextToken@ is set to @null@.
    ListStackSetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of @StackSetSummary@ structures that contain information about
    -- the user\'s stack sets.
    ListStackSetsResponse -> Maybe [StackSetSummary]
summaries :: Prelude.Maybe [StackSetSummary],
    -- | The response's http status code.
    ListStackSetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListStackSetsResponse -> ListStackSetsResponse -> Bool
(ListStackSetsResponse -> ListStackSetsResponse -> Bool)
-> (ListStackSetsResponse -> ListStackSetsResponse -> Bool)
-> Eq ListStackSetsResponse
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]
(Int -> ReadS ListStackSetsResponse)
-> ReadS [ListStackSetsResponse]
-> ReadPrec ListStackSetsResponse
-> ReadPrec [ListStackSetsResponse]
-> Read 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
(Int -> ListStackSetsResponse -> ShowS)
-> (ListStackSetsResponse -> String)
-> ([ListStackSetsResponse] -> ShowS)
-> Show ListStackSetsResponse
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. ListStackSetsResponse -> Rep ListStackSetsResponse x)
-> (forall x. Rep ListStackSetsResponse x -> ListStackSetsResponse)
-> Generic ListStackSetsResponse
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)

-- |
-- Create a value of 'ListStackSetsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listStackSetsResponse_nextToken' - If the request doesn\'t return all of the remaining results, @NextToken@
-- is set to a token. To retrieve the next set of results, call
-- @ListStackInstances@ again and assign that token to the request
-- object\'s @NextToken@ parameter. If the request returns all results,
-- @NextToken@ is set to @null@.
--
-- 'summaries', 'listStackSetsResponse_summaries' - A list of @StackSetSummary@ structures that contain information about
-- the user\'s stack sets.
--
-- 'httpStatus', 'listStackSetsResponse_httpStatus' - The response's http status code.
newListStackSetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListStackSetsResponse
newListStackSetsResponse :: Int -> ListStackSetsResponse
newListStackSetsResponse Int
pHttpStatus_ =
  ListStackSetsResponse' :: Maybe Text
-> Maybe [StackSetSummary] -> Int -> ListStackSetsResponse
ListStackSetsResponse'
    { $sel:nextToken:ListStackSetsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:summaries:ListStackSetsResponse' :: Maybe [StackSetSummary]
summaries = Maybe [StackSetSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListStackSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the request doesn\'t return all of the remaining results, @NextToken@
-- is set to a token. To retrieve the next set of results, call
-- @ListStackInstances@ again and assign that token to the request
-- object\'s @NextToken@ parameter. If the request returns all results,
-- @NextToken@ is set to @null@.
listStackSetsResponse_nextToken :: Lens.Lens' ListStackSetsResponse (Prelude.Maybe Prelude.Text)
listStackSetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListStackSetsResponse -> f ListStackSetsResponse
listStackSetsResponse_nextToken = (ListStackSetsResponse -> Maybe Text)
-> (ListStackSetsResponse -> Maybe Text -> ListStackSetsResponse)
-> Lens' ListStackSetsResponse (Maybe Text)
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)

-- | A list of @StackSetSummary@ structures that contain information about
-- the user\'s stack sets.
listStackSetsResponse_summaries :: Lens.Lens' ListStackSetsResponse (Prelude.Maybe [StackSetSummary])
listStackSetsResponse_summaries :: (Maybe [StackSetSummary] -> f (Maybe [StackSetSummary]))
-> ListStackSetsResponse -> f ListStackSetsResponse
listStackSetsResponse_summaries = (ListStackSetsResponse -> Maybe [StackSetSummary])
-> (ListStackSetsResponse
    -> Maybe [StackSetSummary] -> ListStackSetsResponse)
-> Lens' ListStackSetsResponse (Maybe [StackSetSummary])
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) ((Maybe [StackSetSummary] -> f (Maybe [StackSetSummary]))
 -> ListStackSetsResponse -> f ListStackSetsResponse)
-> ((Maybe [StackSetSummary] -> f (Maybe [StackSetSummary]))
    -> Maybe [StackSetSummary] -> f (Maybe [StackSetSummary]))
-> (Maybe [StackSetSummary] -> f (Maybe [StackSetSummary]))
-> ListStackSetsResponse
-> f ListStackSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [StackSetSummary]
  [StackSetSummary]
  [StackSetSummary]
  [StackSetSummary]
-> Iso
     (Maybe [StackSetSummary])
     (Maybe [StackSetSummary])
     (Maybe [StackSetSummary])
     (Maybe [StackSetSummary])
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
  [StackSetSummary]
  [StackSetSummary]
  [StackSetSummary]
  [StackSetSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listStackSetsResponse_httpStatus :: Lens.Lens' ListStackSetsResponse Prelude.Int
listStackSetsResponse_httpStatus :: (Int -> f Int) -> ListStackSetsResponse -> f ListStackSetsResponse
listStackSetsResponse_httpStatus = (ListStackSetsResponse -> Int)
-> (ListStackSetsResponse -> Int -> ListStackSetsResponse)
-> Lens ListStackSetsResponse ListStackSetsResponse Int Int
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