{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_callAs,
    listStackSets_maxResults,
    listStackSets_nextToken,
    listStackSets_status,

    -- * 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.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

-- | /See:/ 'newListStackSets' smart constructor.
data ListStackSets = 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 -> Maybe CallAs
callAs :: Prelude.Maybe CallAs,
    -- | 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,
    -- | If the previous paginated request didn\'t return all 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 status of the stack sets that you want to get summary information
    -- about.
    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)

-- |
-- 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:
--
-- '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/.
--
-- '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.
--
-- 'nextToken', 'listStackSets_nextToken' - If the previous paginated request didn\'t return all 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@.
--
-- 'status', 'listStackSets_status' - The status of the stack sets that you want to get summary information
-- about.
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
    }

-- | [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 :: 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)

-- | 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 :: 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)

-- | If the previous paginated request didn\'t return all 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 :: 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)

-- | The status of the stack sets that you want to get summary information
-- about.
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
      ]

-- | /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
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)

-- |
-- 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'
    { $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_
    }

-- | 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 :: 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)

-- | A list of @StackSetSummary@ structures that contain information about
-- the user\'s stack sets.
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

-- | The response's http status code.
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