{-# 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.ListStackResources
-- 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 descriptions of all resources of the specified stack.
--
-- For deleted stacks, ListStackResources returns resource information for
-- up to 90 days after the stack has been deleted.
--
-- This operation returns paginated results.
module Amazonka.CloudFormation.ListStackResources
  ( -- * Creating a Request
    ListStackResources (..),
    newListStackResources,

    -- * Request Lenses
    listStackResources_nextToken,
    listStackResources_stackName,

    -- * Destructuring the Response
    ListStackResourcesResponse (..),
    newListStackResourcesResponse,

    -- * Response Lenses
    listStackResourcesResponse_nextToken,
    listStackResourcesResponse_stackResourceSummaries,
    listStackResourcesResponse_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 the ListStackResource action.
--
-- /See:/ 'newListStackResources' smart constructor.
data ListStackResources = ListStackResources'
  { -- | A string that identifies the next page of stack resources that you want
    -- to retrieve.
    ListStackResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name or the unique stack ID that is associated with the stack, which
    -- are not always interchangeable:
    --
    -- -   Running stacks: You can specify either the stack\'s name or its
    --     unique stack ID.
    --
    -- -   Deleted stacks: You must specify the unique stack ID.
    --
    -- Default: There is no default value.
    ListStackResources -> Text
stackName :: Prelude.Text
  }
  deriving (ListStackResources -> ListStackResources -> Bool
(ListStackResources -> ListStackResources -> Bool)
-> (ListStackResources -> ListStackResources -> Bool)
-> Eq ListStackResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStackResources -> ListStackResources -> Bool
$c/= :: ListStackResources -> ListStackResources -> Bool
== :: ListStackResources -> ListStackResources -> Bool
$c== :: ListStackResources -> ListStackResources -> Bool
Prelude.Eq, ReadPrec [ListStackResources]
ReadPrec ListStackResources
Int -> ReadS ListStackResources
ReadS [ListStackResources]
(Int -> ReadS ListStackResources)
-> ReadS [ListStackResources]
-> ReadPrec ListStackResources
-> ReadPrec [ListStackResources]
-> Read ListStackResources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStackResources]
$creadListPrec :: ReadPrec [ListStackResources]
readPrec :: ReadPrec ListStackResources
$creadPrec :: ReadPrec ListStackResources
readList :: ReadS [ListStackResources]
$creadList :: ReadS [ListStackResources]
readsPrec :: Int -> ReadS ListStackResources
$creadsPrec :: Int -> ReadS ListStackResources
Prelude.Read, Int -> ListStackResources -> ShowS
[ListStackResources] -> ShowS
ListStackResources -> String
(Int -> ListStackResources -> ShowS)
-> (ListStackResources -> String)
-> ([ListStackResources] -> ShowS)
-> Show ListStackResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStackResources] -> ShowS
$cshowList :: [ListStackResources] -> ShowS
show :: ListStackResources -> String
$cshow :: ListStackResources -> String
showsPrec :: Int -> ListStackResources -> ShowS
$cshowsPrec :: Int -> ListStackResources -> ShowS
Prelude.Show, (forall x. ListStackResources -> Rep ListStackResources x)
-> (forall x. Rep ListStackResources x -> ListStackResources)
-> Generic ListStackResources
forall x. Rep ListStackResources x -> ListStackResources
forall x. ListStackResources -> Rep ListStackResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListStackResources x -> ListStackResources
$cfrom :: forall x. ListStackResources -> Rep ListStackResources x
Prelude.Generic)

-- |
-- Create a value of 'ListStackResources' 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', 'listStackResources_nextToken' - A string that identifies the next page of stack resources that you want
-- to retrieve.
--
-- 'stackName', 'listStackResources_stackName' - The name or the unique stack ID that is associated with the stack, which
-- are not always interchangeable:
--
-- -   Running stacks: You can specify either the stack\'s name or its
--     unique stack ID.
--
-- -   Deleted stacks: You must specify the unique stack ID.
--
-- Default: There is no default value.
newListStackResources ::
  -- | 'stackName'
  Prelude.Text ->
  ListStackResources
newListStackResources :: Text -> ListStackResources
newListStackResources Text
pStackName_ =
  ListStackResources' :: Maybe Text -> Text -> ListStackResources
ListStackResources'
    { $sel:nextToken:ListStackResources' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackName:ListStackResources' :: Text
stackName = Text
pStackName_
    }

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

-- | The name or the unique stack ID that is associated with the stack, which
-- are not always interchangeable:
--
-- -   Running stacks: You can specify either the stack\'s name or its
--     unique stack ID.
--
-- -   Deleted stacks: You must specify the unique stack ID.
--
-- Default: There is no default value.
listStackResources_stackName :: Lens.Lens' ListStackResources Prelude.Text
listStackResources_stackName :: (Text -> f Text) -> ListStackResources -> f ListStackResources
listStackResources_stackName = (ListStackResources -> Text)
-> (ListStackResources -> Text -> ListStackResources)
-> Lens ListStackResources ListStackResources Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackResources' {Text
stackName :: Text
$sel:stackName:ListStackResources' :: ListStackResources -> Text
stackName} -> Text
stackName) (\s :: ListStackResources
s@ListStackResources' {} Text
a -> ListStackResources
s {$sel:stackName:ListStackResources' :: Text
stackName = Text
a} :: ListStackResources)

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

instance Prelude.NFData ListStackResources

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

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

instance Core.ToQuery ListStackResources where
  toQuery :: ListStackResources -> QueryString
toQuery ListStackResources' {Maybe Text
Text
stackName :: Text
nextToken :: Maybe Text
$sel:stackName:ListStackResources' :: ListStackResources -> Text
$sel:nextToken:ListStackResources' :: ListStackResources -> 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
"ListStackResources" :: 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
"StackName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackName
      ]

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

-- |
-- Create a value of 'ListStackResourcesResponse' 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', 'listStackResourcesResponse_nextToken' - If the output exceeds 1 MB, a string that identifies the next page of
-- stack resources. If no additional page exists, this value is null.
--
-- 'stackResourceSummaries', 'listStackResourcesResponse_stackResourceSummaries' - A list of @StackResourceSummary@ structures.
--
-- 'httpStatus', 'listStackResourcesResponse_httpStatus' - The response's http status code.
newListStackResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListStackResourcesResponse
newListStackResourcesResponse :: Int -> ListStackResourcesResponse
newListStackResourcesResponse Int
pHttpStatus_ =
  ListStackResourcesResponse' :: Maybe Text
-> Maybe [StackResourceSummary]
-> Int
-> ListStackResourcesResponse
ListStackResourcesResponse'
    { $sel:nextToken:ListStackResourcesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackResourceSummaries:ListStackResourcesResponse' :: Maybe [StackResourceSummary]
stackResourceSummaries = Maybe [StackResourceSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListStackResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | A list of @StackResourceSummary@ structures.
listStackResourcesResponse_stackResourceSummaries :: Lens.Lens' ListStackResourcesResponse (Prelude.Maybe [StackResourceSummary])
listStackResourcesResponse_stackResourceSummaries :: (Maybe [StackResourceSummary] -> f (Maybe [StackResourceSummary]))
-> ListStackResourcesResponse -> f ListStackResourcesResponse
listStackResourcesResponse_stackResourceSummaries = (ListStackResourcesResponse -> Maybe [StackResourceSummary])
-> (ListStackResourcesResponse
    -> Maybe [StackResourceSummary] -> ListStackResourcesResponse)
-> Lens' ListStackResourcesResponse (Maybe [StackResourceSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackResourcesResponse' {Maybe [StackResourceSummary]
stackResourceSummaries :: Maybe [StackResourceSummary]
$sel:stackResourceSummaries:ListStackResourcesResponse' :: ListStackResourcesResponse -> Maybe [StackResourceSummary]
stackResourceSummaries} -> Maybe [StackResourceSummary]
stackResourceSummaries) (\s :: ListStackResourcesResponse
s@ListStackResourcesResponse' {} Maybe [StackResourceSummary]
a -> ListStackResourcesResponse
s {$sel:stackResourceSummaries:ListStackResourcesResponse' :: Maybe [StackResourceSummary]
stackResourceSummaries = Maybe [StackResourceSummary]
a} :: ListStackResourcesResponse) ((Maybe [StackResourceSummary] -> f (Maybe [StackResourceSummary]))
 -> ListStackResourcesResponse -> f ListStackResourcesResponse)
-> ((Maybe [StackResourceSummary]
     -> f (Maybe [StackResourceSummary]))
    -> Maybe [StackResourceSummary]
    -> f (Maybe [StackResourceSummary]))
-> (Maybe [StackResourceSummary]
    -> f (Maybe [StackResourceSummary]))
-> ListStackResourcesResponse
-> f ListStackResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [StackResourceSummary]
  [StackResourceSummary]
  [StackResourceSummary]
  [StackResourceSummary]
-> Iso
     (Maybe [StackResourceSummary])
     (Maybe [StackResourceSummary])
     (Maybe [StackResourceSummary])
     (Maybe [StackResourceSummary])
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
  [StackResourceSummary]
  [StackResourceSummary]
  [StackResourceSummary]
  [StackResourceSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListStackResourcesResponse