{-# 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.AppStream.ListAssociatedStacks
-- 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)
--
-- Retrieves the name of the stack with which the specified fleet is
-- associated.
--
-- This operation returns paginated results.
module Amazonka.AppStream.ListAssociatedStacks
  ( -- * Creating a Request
    ListAssociatedStacks (..),
    newListAssociatedStacks,

    -- * Request Lenses
    listAssociatedStacks_nextToken,
    listAssociatedStacks_fleetName,

    -- * Destructuring the Response
    ListAssociatedStacksResponse (..),
    newListAssociatedStacksResponse,

    -- * Response Lenses
    listAssociatedStacksResponse_nextToken,
    listAssociatedStacksResponse_names,
    listAssociatedStacksResponse_httpStatus,
  )
where

import Amazonka.AppStream.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:/ 'newListAssociatedStacks' smart constructor.
data ListAssociatedStacks = ListAssociatedStacks'
  { -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If this value is null, it retrieves the first page.
    ListAssociatedStacks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the fleet.
    ListAssociatedStacks -> Text
fleetName :: Prelude.Text
  }
  deriving (ListAssociatedStacks -> ListAssociatedStacks -> Bool
(ListAssociatedStacks -> ListAssociatedStacks -> Bool)
-> (ListAssociatedStacks -> ListAssociatedStacks -> Bool)
-> Eq ListAssociatedStacks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociatedStacks -> ListAssociatedStacks -> Bool
$c/= :: ListAssociatedStacks -> ListAssociatedStacks -> Bool
== :: ListAssociatedStacks -> ListAssociatedStacks -> Bool
$c== :: ListAssociatedStacks -> ListAssociatedStacks -> Bool
Prelude.Eq, ReadPrec [ListAssociatedStacks]
ReadPrec ListAssociatedStacks
Int -> ReadS ListAssociatedStacks
ReadS [ListAssociatedStacks]
(Int -> ReadS ListAssociatedStacks)
-> ReadS [ListAssociatedStacks]
-> ReadPrec ListAssociatedStacks
-> ReadPrec [ListAssociatedStacks]
-> Read ListAssociatedStacks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociatedStacks]
$creadListPrec :: ReadPrec [ListAssociatedStacks]
readPrec :: ReadPrec ListAssociatedStacks
$creadPrec :: ReadPrec ListAssociatedStacks
readList :: ReadS [ListAssociatedStacks]
$creadList :: ReadS [ListAssociatedStacks]
readsPrec :: Int -> ReadS ListAssociatedStacks
$creadsPrec :: Int -> ReadS ListAssociatedStacks
Prelude.Read, Int -> ListAssociatedStacks -> ShowS
[ListAssociatedStacks] -> ShowS
ListAssociatedStacks -> String
(Int -> ListAssociatedStacks -> ShowS)
-> (ListAssociatedStacks -> String)
-> ([ListAssociatedStacks] -> ShowS)
-> Show ListAssociatedStacks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociatedStacks] -> ShowS
$cshowList :: [ListAssociatedStacks] -> ShowS
show :: ListAssociatedStacks -> String
$cshow :: ListAssociatedStacks -> String
showsPrec :: Int -> ListAssociatedStacks -> ShowS
$cshowsPrec :: Int -> ListAssociatedStacks -> ShowS
Prelude.Show, (forall x. ListAssociatedStacks -> Rep ListAssociatedStacks x)
-> (forall x. Rep ListAssociatedStacks x -> ListAssociatedStacks)
-> Generic ListAssociatedStacks
forall x. Rep ListAssociatedStacks x -> ListAssociatedStacks
forall x. ListAssociatedStacks -> Rep ListAssociatedStacks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssociatedStacks x -> ListAssociatedStacks
$cfrom :: forall x. ListAssociatedStacks -> Rep ListAssociatedStacks x
Prelude.Generic)

-- |
-- Create a value of 'ListAssociatedStacks' 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', 'listAssociatedStacks_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
--
-- 'fleetName', 'listAssociatedStacks_fleetName' - The name of the fleet.
newListAssociatedStacks ::
  -- | 'fleetName'
  Prelude.Text ->
  ListAssociatedStacks
newListAssociatedStacks :: Text -> ListAssociatedStacks
newListAssociatedStacks Text
pFleetName_ =
  ListAssociatedStacks' :: Maybe Text -> Text -> ListAssociatedStacks
ListAssociatedStacks'
    { $sel:nextToken:ListAssociatedStacks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetName:ListAssociatedStacks' :: Text
fleetName = Text
pFleetName_
    }

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
listAssociatedStacks_nextToken :: Lens.Lens' ListAssociatedStacks (Prelude.Maybe Prelude.Text)
listAssociatedStacks_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssociatedStacks -> f ListAssociatedStacks
listAssociatedStacks_nextToken = (ListAssociatedStacks -> Maybe Text)
-> (ListAssociatedStacks -> Maybe Text -> ListAssociatedStacks)
-> Lens
     ListAssociatedStacks ListAssociatedStacks (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedStacks' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociatedStacks' :: ListAssociatedStacks -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociatedStacks
s@ListAssociatedStacks' {} Maybe Text
a -> ListAssociatedStacks
s {$sel:nextToken:ListAssociatedStacks' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociatedStacks)

-- | The name of the fleet.
listAssociatedStacks_fleetName :: Lens.Lens' ListAssociatedStacks Prelude.Text
listAssociatedStacks_fleetName :: (Text -> f Text) -> ListAssociatedStacks -> f ListAssociatedStacks
listAssociatedStacks_fleetName = (ListAssociatedStacks -> Text)
-> (ListAssociatedStacks -> Text -> ListAssociatedStacks)
-> Lens ListAssociatedStacks ListAssociatedStacks Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedStacks' {Text
fleetName :: Text
$sel:fleetName:ListAssociatedStacks' :: ListAssociatedStacks -> Text
fleetName} -> Text
fleetName) (\s :: ListAssociatedStacks
s@ListAssociatedStacks' {} Text
a -> ListAssociatedStacks
s {$sel:fleetName:ListAssociatedStacks' :: Text
fleetName = Text
a} :: ListAssociatedStacks)

instance Core.AWSPager ListAssociatedStacks where
  page :: ListAssociatedStacks
-> AWSResponse ListAssociatedStacks -> Maybe ListAssociatedStacks
page ListAssociatedStacks
rq AWSResponse ListAssociatedStacks
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssociatedStacks
ListAssociatedStacksResponse
rs
            ListAssociatedStacksResponse
-> Getting (First Text) ListAssociatedStacksResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociatedStacksResponse
-> Const (First Text) ListAssociatedStacksResponse
Lens' ListAssociatedStacksResponse (Maybe Text)
listAssociatedStacksResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssociatedStacksResponse
 -> Const (First Text) ListAssociatedStacksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssociatedStacksResponse 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 ListAssociatedStacks
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssociatedStacks
ListAssociatedStacksResponse
rs
            ListAssociatedStacksResponse
-> Getting (First [Text]) ListAssociatedStacksResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListAssociatedStacksResponse
-> Const (First [Text]) ListAssociatedStacksResponse
Lens' ListAssociatedStacksResponse (Maybe [Text])
listAssociatedStacksResponse_names
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListAssociatedStacksResponse
 -> Const (First [Text]) ListAssociatedStacksResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListAssociatedStacksResponse [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 ListAssociatedStacks
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAssociatedStacks -> Maybe ListAssociatedStacks
forall a. a -> Maybe a
Prelude.Just (ListAssociatedStacks -> Maybe ListAssociatedStacks)
-> ListAssociatedStacks -> Maybe ListAssociatedStacks
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAssociatedStacks
rq
          ListAssociatedStacks
-> (ListAssociatedStacks -> ListAssociatedStacks)
-> ListAssociatedStacks
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAssociatedStacks -> Identity ListAssociatedStacks
Lens
  ListAssociatedStacks ListAssociatedStacks (Maybe Text) (Maybe Text)
listAssociatedStacks_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAssociatedStacks -> Identity ListAssociatedStacks)
-> Maybe Text -> ListAssociatedStacks -> ListAssociatedStacks
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAssociatedStacks
ListAssociatedStacksResponse
rs
          ListAssociatedStacksResponse
-> Getting (First Text) ListAssociatedStacksResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociatedStacksResponse
-> Const (First Text) ListAssociatedStacksResponse
Lens' ListAssociatedStacksResponse (Maybe Text)
listAssociatedStacksResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssociatedStacksResponse
 -> Const (First Text) ListAssociatedStacksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssociatedStacksResponse 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 ListAssociatedStacks where
  type
    AWSResponse ListAssociatedStacks =
      ListAssociatedStacksResponse
  request :: ListAssociatedStacks -> Request ListAssociatedStacks
request = Service -> ListAssociatedStacks -> Request ListAssociatedStacks
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAssociatedStacks
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAssociatedStacks)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAssociatedStacks))
-> Logger
-> Service
-> Proxy ListAssociatedStacks
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAssociatedStacks)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe [Text] -> Int -> ListAssociatedStacksResponse
ListAssociatedStacksResponse'
            (Maybe Text -> Maybe [Text] -> Int -> ListAssociatedStacksResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Text] -> Int -> ListAssociatedStacksResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Maybe [Text] -> Int -> ListAssociatedStacksResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ListAssociatedStacksResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Names" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListAssociatedStacksResponse)
-> Either String Int -> Either String ListAssociatedStacksResponse
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 ListAssociatedStacks

instance Prelude.NFData ListAssociatedStacks

instance Core.ToHeaders ListAssociatedStacks where
  toHeaders :: ListAssociatedStacks -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAssociatedStacks -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"PhotonAdminProxyService.ListAssociatedStacks" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListAssociatedStacks where
  toJSON :: ListAssociatedStacks -> Value
toJSON ListAssociatedStacks' {Maybe Text
Text
fleetName :: Text
nextToken :: Maybe Text
$sel:fleetName:ListAssociatedStacks' :: ListAssociatedStacks -> Text
$sel:nextToken:ListAssociatedStacks' :: ListAssociatedStacks -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetName)
          ]
      )

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

instance Core.ToQuery ListAssociatedStacks where
  toQuery :: ListAssociatedStacks -> QueryString
toQuery = QueryString -> ListAssociatedStacks -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListAssociatedStacksResponse' smart constructor.
data ListAssociatedStacksResponse = ListAssociatedStacksResponse'
  { -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If there are no more pages, this value is null.
    ListAssociatedStacksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the stack.
    ListAssociatedStacksResponse -> Maybe [Text]
names :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListAssociatedStacksResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAssociatedStacksResponse
-> ListAssociatedStacksResponse -> Bool
(ListAssociatedStacksResponse
 -> ListAssociatedStacksResponse -> Bool)
-> (ListAssociatedStacksResponse
    -> ListAssociatedStacksResponse -> Bool)
-> Eq ListAssociatedStacksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociatedStacksResponse
-> ListAssociatedStacksResponse -> Bool
$c/= :: ListAssociatedStacksResponse
-> ListAssociatedStacksResponse -> Bool
== :: ListAssociatedStacksResponse
-> ListAssociatedStacksResponse -> Bool
$c== :: ListAssociatedStacksResponse
-> ListAssociatedStacksResponse -> Bool
Prelude.Eq, ReadPrec [ListAssociatedStacksResponse]
ReadPrec ListAssociatedStacksResponse
Int -> ReadS ListAssociatedStacksResponse
ReadS [ListAssociatedStacksResponse]
(Int -> ReadS ListAssociatedStacksResponse)
-> ReadS [ListAssociatedStacksResponse]
-> ReadPrec ListAssociatedStacksResponse
-> ReadPrec [ListAssociatedStacksResponse]
-> Read ListAssociatedStacksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociatedStacksResponse]
$creadListPrec :: ReadPrec [ListAssociatedStacksResponse]
readPrec :: ReadPrec ListAssociatedStacksResponse
$creadPrec :: ReadPrec ListAssociatedStacksResponse
readList :: ReadS [ListAssociatedStacksResponse]
$creadList :: ReadS [ListAssociatedStacksResponse]
readsPrec :: Int -> ReadS ListAssociatedStacksResponse
$creadsPrec :: Int -> ReadS ListAssociatedStacksResponse
Prelude.Read, Int -> ListAssociatedStacksResponse -> ShowS
[ListAssociatedStacksResponse] -> ShowS
ListAssociatedStacksResponse -> String
(Int -> ListAssociatedStacksResponse -> ShowS)
-> (ListAssociatedStacksResponse -> String)
-> ([ListAssociatedStacksResponse] -> ShowS)
-> Show ListAssociatedStacksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociatedStacksResponse] -> ShowS
$cshowList :: [ListAssociatedStacksResponse] -> ShowS
show :: ListAssociatedStacksResponse -> String
$cshow :: ListAssociatedStacksResponse -> String
showsPrec :: Int -> ListAssociatedStacksResponse -> ShowS
$cshowsPrec :: Int -> ListAssociatedStacksResponse -> ShowS
Prelude.Show, (forall x.
 ListAssociatedStacksResponse -> Rep ListAssociatedStacksResponse x)
-> (forall x.
    Rep ListAssociatedStacksResponse x -> ListAssociatedStacksResponse)
-> Generic ListAssociatedStacksResponse
forall x.
Rep ListAssociatedStacksResponse x -> ListAssociatedStacksResponse
forall x.
ListAssociatedStacksResponse -> Rep ListAssociatedStacksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAssociatedStacksResponse x -> ListAssociatedStacksResponse
$cfrom :: forall x.
ListAssociatedStacksResponse -> Rep ListAssociatedStacksResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAssociatedStacksResponse' 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', 'listAssociatedStacksResponse_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
--
-- 'names', 'listAssociatedStacksResponse_names' - The name of the stack.
--
-- 'httpStatus', 'listAssociatedStacksResponse_httpStatus' - The response's http status code.
newListAssociatedStacksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAssociatedStacksResponse
newListAssociatedStacksResponse :: Int -> ListAssociatedStacksResponse
newListAssociatedStacksResponse Int
pHttpStatus_ =
  ListAssociatedStacksResponse' :: Maybe Text -> Maybe [Text] -> Int -> ListAssociatedStacksResponse
ListAssociatedStacksResponse'
    { $sel:nextToken:ListAssociatedStacksResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:names:ListAssociatedStacksResponse' :: Maybe [Text]
names = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAssociatedStacksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
listAssociatedStacksResponse_nextToken :: Lens.Lens' ListAssociatedStacksResponse (Prelude.Maybe Prelude.Text)
listAssociatedStacksResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssociatedStacksResponse -> f ListAssociatedStacksResponse
listAssociatedStacksResponse_nextToken = (ListAssociatedStacksResponse -> Maybe Text)
-> (ListAssociatedStacksResponse
    -> Maybe Text -> ListAssociatedStacksResponse)
-> Lens' ListAssociatedStacksResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedStacksResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociatedStacksResponse' :: ListAssociatedStacksResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociatedStacksResponse
s@ListAssociatedStacksResponse' {} Maybe Text
a -> ListAssociatedStacksResponse
s {$sel:nextToken:ListAssociatedStacksResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociatedStacksResponse)

-- | The name of the stack.
listAssociatedStacksResponse_names :: Lens.Lens' ListAssociatedStacksResponse (Prelude.Maybe [Prelude.Text])
listAssociatedStacksResponse_names :: (Maybe [Text] -> f (Maybe [Text]))
-> ListAssociatedStacksResponse -> f ListAssociatedStacksResponse
listAssociatedStacksResponse_names = (ListAssociatedStacksResponse -> Maybe [Text])
-> (ListAssociatedStacksResponse
    -> Maybe [Text] -> ListAssociatedStacksResponse)
-> Lens' ListAssociatedStacksResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedStacksResponse' {Maybe [Text]
names :: Maybe [Text]
$sel:names:ListAssociatedStacksResponse' :: ListAssociatedStacksResponse -> Maybe [Text]
names} -> Maybe [Text]
names) (\s :: ListAssociatedStacksResponse
s@ListAssociatedStacksResponse' {} Maybe [Text]
a -> ListAssociatedStacksResponse
s {$sel:names:ListAssociatedStacksResponse' :: Maybe [Text]
names = Maybe [Text]
a} :: ListAssociatedStacksResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListAssociatedStacksResponse -> f ListAssociatedStacksResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListAssociatedStacksResponse
-> f ListAssociatedStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListAssociatedStacksResponse