{-# 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.ListStacks
-- 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 the summary information for stacks whose status matches the
-- specified StackStatusFilter. Summary information for stacks that have
-- been deleted is kept for 90 days after the stack is deleted. If no
-- StackStatusFilter is specified, summary information for all stacks is
-- returned (including existing stacks and stacks that have been deleted).
--
-- This operation returns paginated results.
module Amazonka.CloudFormation.ListStacks
  ( -- * Creating a Request
    ListStacks (..),
    newListStacks,

    -- * Request Lenses
    listStacks_nextToken,
    listStacks_stackStatusFilter,

    -- * Destructuring the Response
    ListStacksResponse (..),
    newListStacksResponse,

    -- * Response Lenses
    listStacksResponse_nextToken,
    listStacksResponse_stackSummaries,
    listStacksResponse_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

-- | The input for ListStacks action.
--
-- /See:/ 'newListStacks' smart constructor.
data ListStacks = ListStacks'
  { -- | A string that identifies the next page of stacks that you want to
    -- retrieve.
    ListStacks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Stack status to use as a filter. Specify one or more stack status codes
    -- to list only stacks with the specified status codes. For a complete list
    -- of stack status codes, see the @StackStatus@ parameter of the Stack data
    -- type.
    ListStacks -> Maybe [StackStatus]
stackStatusFilter :: Prelude.Maybe [StackStatus]
  }
  deriving (ListStacks -> ListStacks -> Bool
(ListStacks -> ListStacks -> Bool)
-> (ListStacks -> ListStacks -> Bool) -> Eq ListStacks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStacks -> ListStacks -> Bool
$c/= :: ListStacks -> ListStacks -> Bool
== :: ListStacks -> ListStacks -> Bool
$c== :: ListStacks -> ListStacks -> Bool
Prelude.Eq, ReadPrec [ListStacks]
ReadPrec ListStacks
Int -> ReadS ListStacks
ReadS [ListStacks]
(Int -> ReadS ListStacks)
-> ReadS [ListStacks]
-> ReadPrec ListStacks
-> ReadPrec [ListStacks]
-> Read ListStacks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStacks]
$creadListPrec :: ReadPrec [ListStacks]
readPrec :: ReadPrec ListStacks
$creadPrec :: ReadPrec ListStacks
readList :: ReadS [ListStacks]
$creadList :: ReadS [ListStacks]
readsPrec :: Int -> ReadS ListStacks
$creadsPrec :: Int -> ReadS ListStacks
Prelude.Read, Int -> ListStacks -> ShowS
[ListStacks] -> ShowS
ListStacks -> String
(Int -> ListStacks -> ShowS)
-> (ListStacks -> String)
-> ([ListStacks] -> ShowS)
-> Show ListStacks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStacks] -> ShowS
$cshowList :: [ListStacks] -> ShowS
show :: ListStacks -> String
$cshow :: ListStacks -> String
showsPrec :: Int -> ListStacks -> ShowS
$cshowsPrec :: Int -> ListStacks -> ShowS
Prelude.Show, (forall x. ListStacks -> Rep ListStacks x)
-> (forall x. Rep ListStacks x -> ListStacks) -> Generic ListStacks
forall x. Rep ListStacks x -> ListStacks
forall x. ListStacks -> Rep ListStacks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListStacks x -> ListStacks
$cfrom :: forall x. ListStacks -> Rep ListStacks x
Prelude.Generic)

-- |
-- Create a value of 'ListStacks' 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', 'listStacks_nextToken' - A string that identifies the next page of stacks that you want to
-- retrieve.
--
-- 'stackStatusFilter', 'listStacks_stackStatusFilter' - Stack status to use as a filter. Specify one or more stack status codes
-- to list only stacks with the specified status codes. For a complete list
-- of stack status codes, see the @StackStatus@ parameter of the Stack data
-- type.
newListStacks ::
  ListStacks
newListStacks :: ListStacks
newListStacks =
  ListStacks' :: Maybe Text -> Maybe [StackStatus] -> ListStacks
ListStacks'
    { $sel:nextToken:ListStacks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackStatusFilter:ListStacks' :: Maybe [StackStatus]
stackStatusFilter = Maybe [StackStatus]
forall a. Maybe a
Prelude.Nothing
    }

-- | A string that identifies the next page of stacks that you want to
-- retrieve.
listStacks_nextToken :: Lens.Lens' ListStacks (Prelude.Maybe Prelude.Text)
listStacks_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListStacks -> f ListStacks
listStacks_nextToken = (ListStacks -> Maybe Text)
-> (ListStacks -> Maybe Text -> ListStacks)
-> Lens ListStacks ListStacks (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStacks' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStacks' :: ListStacks -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStacks
s@ListStacks' {} Maybe Text
a -> ListStacks
s {$sel:nextToken:ListStacks' :: Maybe Text
nextToken = Maybe Text
a} :: ListStacks)

-- | Stack status to use as a filter. Specify one or more stack status codes
-- to list only stacks with the specified status codes. For a complete list
-- of stack status codes, see the @StackStatus@ parameter of the Stack data
-- type.
listStacks_stackStatusFilter :: Lens.Lens' ListStacks (Prelude.Maybe [StackStatus])
listStacks_stackStatusFilter :: (Maybe [StackStatus] -> f (Maybe [StackStatus]))
-> ListStacks -> f ListStacks
listStacks_stackStatusFilter = (ListStacks -> Maybe [StackStatus])
-> (ListStacks -> Maybe [StackStatus] -> ListStacks)
-> Lens
     ListStacks ListStacks (Maybe [StackStatus]) (Maybe [StackStatus])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStacks' {Maybe [StackStatus]
stackStatusFilter :: Maybe [StackStatus]
$sel:stackStatusFilter:ListStacks' :: ListStacks -> Maybe [StackStatus]
stackStatusFilter} -> Maybe [StackStatus]
stackStatusFilter) (\s :: ListStacks
s@ListStacks' {} Maybe [StackStatus]
a -> ListStacks
s {$sel:stackStatusFilter:ListStacks' :: Maybe [StackStatus]
stackStatusFilter = Maybe [StackStatus]
a} :: ListStacks) ((Maybe [StackStatus] -> f (Maybe [StackStatus]))
 -> ListStacks -> f ListStacks)
-> ((Maybe [StackStatus] -> f (Maybe [StackStatus]))
    -> Maybe [StackStatus] -> f (Maybe [StackStatus]))
-> (Maybe [StackStatus] -> f (Maybe [StackStatus]))
-> ListStacks
-> f ListStacks
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [StackStatus] [StackStatus] [StackStatus] [StackStatus]
-> Iso
     (Maybe [StackStatus])
     (Maybe [StackStatus])
     (Maybe [StackStatus])
     (Maybe [StackStatus])
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 [StackStatus] [StackStatus] [StackStatus] [StackStatus]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager ListStacks where
  page :: ListStacks -> AWSResponse ListStacks -> Maybe ListStacks
page ListStacks
rq AWSResponse ListStacks
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStacks
ListStacksResponse
rs
            ListStacksResponse
-> Getting (First Text) ListStacksResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListStacksResponse -> Const (First Text) ListStacksResponse
Lens' ListStacksResponse (Maybe Text)
listStacksResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListStacksResponse -> Const (First Text) ListStacksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListStacksResponse 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 ListStacks
forall a. Maybe a
Prelude.Nothing
    | Maybe [StackSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStacks
ListStacksResponse
rs
            ListStacksResponse
-> Getting (First [StackSummary]) ListStacksResponse [StackSummary]
-> Maybe [StackSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [StackSummary]
 -> Const (First [StackSummary]) (Maybe [StackSummary]))
-> ListStacksResponse
-> Const (First [StackSummary]) ListStacksResponse
Lens' ListStacksResponse (Maybe [StackSummary])
listStacksResponse_stackSummaries
              ((Maybe [StackSummary]
  -> Const (First [StackSummary]) (Maybe [StackSummary]))
 -> ListStacksResponse
 -> Const (First [StackSummary]) ListStacksResponse)
-> (([StackSummary] -> Const (First [StackSummary]) [StackSummary])
    -> Maybe [StackSummary]
    -> Const (First [StackSummary]) (Maybe [StackSummary]))
-> Getting (First [StackSummary]) ListStacksResponse [StackSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([StackSummary] -> Const (First [StackSummary]) [StackSummary])
-> Maybe [StackSummary]
-> Const (First [StackSummary]) (Maybe [StackSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListStacks
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListStacks -> Maybe ListStacks
forall a. a -> Maybe a
Prelude.Just (ListStacks -> Maybe ListStacks) -> ListStacks -> Maybe ListStacks
forall a b. (a -> b) -> a -> b
Prelude.$
        ListStacks
rq
          ListStacks -> (ListStacks -> ListStacks) -> ListStacks
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListStacks -> Identity ListStacks
Lens ListStacks ListStacks (Maybe Text) (Maybe Text)
listStacks_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListStacks -> Identity ListStacks)
-> Maybe Text -> ListStacks -> ListStacks
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListStacks
ListStacksResponse
rs
          ListStacksResponse
-> Getting (First Text) ListStacksResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListStacksResponse -> Const (First Text) ListStacksResponse
Lens' ListStacksResponse (Maybe Text)
listStacksResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListStacksResponse -> Const (First Text) ListStacksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListStacksResponse 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 ListStacks where
  type AWSResponse ListStacks = ListStacksResponse
  request :: ListStacks -> Request ListStacks
request = Service -> ListStacks -> Request ListStacks
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListStacks
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListStacks)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListStacks))
-> Logger
-> Service
-> Proxy ListStacks
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListStacks)))
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
"ListStacksResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Maybe [StackSummary] -> Int -> ListStacksResponse
ListStacksResponse'
            (Maybe Text -> Maybe [StackSummary] -> Int -> ListStacksResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [StackSummary] -> Int -> ListStacksResponse)
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 [StackSummary] -> Int -> ListStacksResponse)
-> Either String (Maybe [StackSummary])
-> Either String (Int -> ListStacksResponse)
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
"StackSummaries" 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 [StackSummary]))
-> Either String (Maybe [StackSummary])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [StackSummary])
-> [Node] -> Either String (Maybe [StackSummary])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [StackSummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> ListStacksResponse)
-> Either String Int -> Either String ListStacksResponse
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 ListStacks

instance Prelude.NFData ListStacks

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

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

instance Core.ToQuery ListStacks where
  toQuery :: ListStacks -> QueryString
toQuery ListStacks' {Maybe [StackStatus]
Maybe Text
stackStatusFilter :: Maybe [StackStatus]
nextToken :: Maybe Text
$sel:stackStatusFilter:ListStacks' :: ListStacks -> Maybe [StackStatus]
$sel:nextToken:ListStacks' :: ListStacks -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListStacks" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"StackStatusFilter"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [StackStatus] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([StackStatus] -> QueryString)
-> Maybe [StackStatus] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [StackStatus]
stackStatusFilter
            )
      ]

-- | The output for ListStacks action.
--
-- /See:/ 'newListStacksResponse' smart constructor.
data ListStacksResponse = ListStacksResponse'
  { -- | If the output exceeds 1 MB in size, a string that identifies the next
    -- page of stacks. If no additional page exists, this value is null.
    ListStacksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of @StackSummary@ structures containing information about the
    -- specified stacks.
    ListStacksResponse -> Maybe [StackSummary]
stackSummaries :: Prelude.Maybe [StackSummary],
    -- | The response's http status code.
    ListStacksResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListStacksResponse -> ListStacksResponse -> Bool
(ListStacksResponse -> ListStacksResponse -> Bool)
-> (ListStacksResponse -> ListStacksResponse -> Bool)
-> Eq ListStacksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStacksResponse -> ListStacksResponse -> Bool
$c/= :: ListStacksResponse -> ListStacksResponse -> Bool
== :: ListStacksResponse -> ListStacksResponse -> Bool
$c== :: ListStacksResponse -> ListStacksResponse -> Bool
Prelude.Eq, ReadPrec [ListStacksResponse]
ReadPrec ListStacksResponse
Int -> ReadS ListStacksResponse
ReadS [ListStacksResponse]
(Int -> ReadS ListStacksResponse)
-> ReadS [ListStacksResponse]
-> ReadPrec ListStacksResponse
-> ReadPrec [ListStacksResponse]
-> Read ListStacksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStacksResponse]
$creadListPrec :: ReadPrec [ListStacksResponse]
readPrec :: ReadPrec ListStacksResponse
$creadPrec :: ReadPrec ListStacksResponse
readList :: ReadS [ListStacksResponse]
$creadList :: ReadS [ListStacksResponse]
readsPrec :: Int -> ReadS ListStacksResponse
$creadsPrec :: Int -> ReadS ListStacksResponse
Prelude.Read, Int -> ListStacksResponse -> ShowS
[ListStacksResponse] -> ShowS
ListStacksResponse -> String
(Int -> ListStacksResponse -> ShowS)
-> (ListStacksResponse -> String)
-> ([ListStacksResponse] -> ShowS)
-> Show ListStacksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStacksResponse] -> ShowS
$cshowList :: [ListStacksResponse] -> ShowS
show :: ListStacksResponse -> String
$cshow :: ListStacksResponse -> String
showsPrec :: Int -> ListStacksResponse -> ShowS
$cshowsPrec :: Int -> ListStacksResponse -> ShowS
Prelude.Show, (forall x. ListStacksResponse -> Rep ListStacksResponse x)
-> (forall x. Rep ListStacksResponse x -> ListStacksResponse)
-> Generic ListStacksResponse
forall x. Rep ListStacksResponse x -> ListStacksResponse
forall x. ListStacksResponse -> Rep ListStacksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListStacksResponse x -> ListStacksResponse
$cfrom :: forall x. ListStacksResponse -> Rep ListStacksResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListStacksResponse' 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', 'listStacksResponse_nextToken' - If the output exceeds 1 MB in size, a string that identifies the next
-- page of stacks. If no additional page exists, this value is null.
--
-- 'stackSummaries', 'listStacksResponse_stackSummaries' - A list of @StackSummary@ structures containing information about the
-- specified stacks.
--
-- 'httpStatus', 'listStacksResponse_httpStatus' - The response's http status code.
newListStacksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListStacksResponse
newListStacksResponse :: Int -> ListStacksResponse
newListStacksResponse Int
pHttpStatus_ =
  ListStacksResponse' :: Maybe Text -> Maybe [StackSummary] -> Int -> ListStacksResponse
ListStacksResponse'
    { $sel:nextToken:ListStacksResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackSummaries:ListStacksResponse' :: Maybe [StackSummary]
stackSummaries = Maybe [StackSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListStacksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the output exceeds 1 MB in size, a string that identifies the next
-- page of stacks. If no additional page exists, this value is null.
listStacksResponse_nextToken :: Lens.Lens' ListStacksResponse (Prelude.Maybe Prelude.Text)
listStacksResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListStacksResponse -> f ListStacksResponse
listStacksResponse_nextToken = (ListStacksResponse -> Maybe Text)
-> (ListStacksResponse -> Maybe Text -> ListStacksResponse)
-> Lens' ListStacksResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStacksResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStacksResponse' :: ListStacksResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStacksResponse
s@ListStacksResponse' {} Maybe Text
a -> ListStacksResponse
s {$sel:nextToken:ListStacksResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListStacksResponse)

-- | A list of @StackSummary@ structures containing information about the
-- specified stacks.
listStacksResponse_stackSummaries :: Lens.Lens' ListStacksResponse (Prelude.Maybe [StackSummary])
listStacksResponse_stackSummaries :: (Maybe [StackSummary] -> f (Maybe [StackSummary]))
-> ListStacksResponse -> f ListStacksResponse
listStacksResponse_stackSummaries = (ListStacksResponse -> Maybe [StackSummary])
-> (ListStacksResponse
    -> Maybe [StackSummary] -> ListStacksResponse)
-> Lens' ListStacksResponse (Maybe [StackSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStacksResponse' {Maybe [StackSummary]
stackSummaries :: Maybe [StackSummary]
$sel:stackSummaries:ListStacksResponse' :: ListStacksResponse -> Maybe [StackSummary]
stackSummaries} -> Maybe [StackSummary]
stackSummaries) (\s :: ListStacksResponse
s@ListStacksResponse' {} Maybe [StackSummary]
a -> ListStacksResponse
s {$sel:stackSummaries:ListStacksResponse' :: Maybe [StackSummary]
stackSummaries = Maybe [StackSummary]
a} :: ListStacksResponse) ((Maybe [StackSummary] -> f (Maybe [StackSummary]))
 -> ListStacksResponse -> f ListStacksResponse)
-> ((Maybe [StackSummary] -> f (Maybe [StackSummary]))
    -> Maybe [StackSummary] -> f (Maybe [StackSummary]))
-> (Maybe [StackSummary] -> f (Maybe [StackSummary]))
-> ListStacksResponse
-> f ListStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [StackSummary] [StackSummary] [StackSummary] [StackSummary]
-> Iso
     (Maybe [StackSummary])
     (Maybe [StackSummary])
     (Maybe [StackSummary])
     (Maybe [StackSummary])
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 [StackSummary] [StackSummary] [StackSummary] [StackSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listStacksResponse_httpStatus :: Lens.Lens' ListStacksResponse Prelude.Int
listStacksResponse_httpStatus :: (Int -> f Int) -> ListStacksResponse -> f ListStacksResponse
listStacksResponse_httpStatus = (ListStacksResponse -> Int)
-> (ListStacksResponse -> Int -> ListStacksResponse)
-> Lens ListStacksResponse ListStacksResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStacksResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListStacksResponse' :: ListStacksResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListStacksResponse
s@ListStacksResponse' {} Int
a -> ListStacksResponse
s {$sel:httpStatus:ListStacksResponse' :: Int
httpStatus = Int
a} :: ListStacksResponse)

instance Prelude.NFData ListStacksResponse