{-# 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.GlobalAccelerator.ListListeners
-- 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)
--
-- List the listeners for an accelerator.
--
-- This operation returns paginated results.
module Amazonka.GlobalAccelerator.ListListeners
  ( -- * Creating a Request
    ListListeners (..),
    newListListeners,

    -- * Request Lenses
    listListeners_nextToken,
    listListeners_maxResults,
    listListeners_acceleratorArn,

    -- * Destructuring the Response
    ListListenersResponse (..),
    newListListenersResponse,

    -- * Response Lenses
    listListenersResponse_nextToken,
    listListenersResponse_listeners,
    listListenersResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GlobalAccelerator.Types
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:/ 'newListListeners' smart constructor.
data ListListeners = ListListeners'
  { -- | The token for the next set of results. You receive this token from a
    -- previous call.
    ListListeners -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of listener objects that you want to return with this call.
    -- The default value is 10.
    ListListeners -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the accelerator for which you want to
    -- list listener objects.
    ListListeners -> Text
acceleratorArn :: Prelude.Text
  }
  deriving (ListListeners -> ListListeners -> Bool
(ListListeners -> ListListeners -> Bool)
-> (ListListeners -> ListListeners -> Bool) -> Eq ListListeners
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListListeners -> ListListeners -> Bool
$c/= :: ListListeners -> ListListeners -> Bool
== :: ListListeners -> ListListeners -> Bool
$c== :: ListListeners -> ListListeners -> Bool
Prelude.Eq, ReadPrec [ListListeners]
ReadPrec ListListeners
Int -> ReadS ListListeners
ReadS [ListListeners]
(Int -> ReadS ListListeners)
-> ReadS [ListListeners]
-> ReadPrec ListListeners
-> ReadPrec [ListListeners]
-> Read ListListeners
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListListeners]
$creadListPrec :: ReadPrec [ListListeners]
readPrec :: ReadPrec ListListeners
$creadPrec :: ReadPrec ListListeners
readList :: ReadS [ListListeners]
$creadList :: ReadS [ListListeners]
readsPrec :: Int -> ReadS ListListeners
$creadsPrec :: Int -> ReadS ListListeners
Prelude.Read, Int -> ListListeners -> ShowS
[ListListeners] -> ShowS
ListListeners -> String
(Int -> ListListeners -> ShowS)
-> (ListListeners -> String)
-> ([ListListeners] -> ShowS)
-> Show ListListeners
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListListeners] -> ShowS
$cshowList :: [ListListeners] -> ShowS
show :: ListListeners -> String
$cshow :: ListListeners -> String
showsPrec :: Int -> ListListeners -> ShowS
$cshowsPrec :: Int -> ListListeners -> ShowS
Prelude.Show, (forall x. ListListeners -> Rep ListListeners x)
-> (forall x. Rep ListListeners x -> ListListeners)
-> Generic ListListeners
forall x. Rep ListListeners x -> ListListeners
forall x. ListListeners -> Rep ListListeners x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListListeners x -> ListListeners
$cfrom :: forall x. ListListeners -> Rep ListListeners x
Prelude.Generic)

-- |
-- Create a value of 'ListListeners' 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', 'listListeners_nextToken' - The token for the next set of results. You receive this token from a
-- previous call.
--
-- 'maxResults', 'listListeners_maxResults' - The number of listener objects that you want to return with this call.
-- The default value is 10.
--
-- 'acceleratorArn', 'listListeners_acceleratorArn' - The Amazon Resource Name (ARN) of the accelerator for which you want to
-- list listener objects.
newListListeners ::
  -- | 'acceleratorArn'
  Prelude.Text ->
  ListListeners
newListListeners :: Text -> ListListeners
newListListeners Text
pAcceleratorArn_ =
  ListListeners' :: Maybe Text -> Maybe Natural -> Text -> ListListeners
ListListeners'
    { $sel:nextToken:ListListeners' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListListeners' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:acceleratorArn:ListListeners' :: Text
acceleratorArn = Text
pAcceleratorArn_
    }

-- | The token for the next set of results. You receive this token from a
-- previous call.
listListeners_nextToken :: Lens.Lens' ListListeners (Prelude.Maybe Prelude.Text)
listListeners_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListListeners -> f ListListeners
listListeners_nextToken = (ListListeners -> Maybe Text)
-> (ListListeners -> Maybe Text -> ListListeners)
-> Lens ListListeners ListListeners (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListListeners' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListListeners' :: ListListeners -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListListeners
s@ListListeners' {} Maybe Text
a -> ListListeners
s {$sel:nextToken:ListListeners' :: Maybe Text
nextToken = Maybe Text
a} :: ListListeners)

-- | The number of listener objects that you want to return with this call.
-- The default value is 10.
listListeners_maxResults :: Lens.Lens' ListListeners (Prelude.Maybe Prelude.Natural)
listListeners_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListListeners -> f ListListeners
listListeners_maxResults = (ListListeners -> Maybe Natural)
-> (ListListeners -> Maybe Natural -> ListListeners)
-> Lens ListListeners ListListeners (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListListeners' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListListeners' :: ListListeners -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListListeners
s@ListListeners' {} Maybe Natural
a -> ListListeners
s {$sel:maxResults:ListListeners' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListListeners)

-- | The Amazon Resource Name (ARN) of the accelerator for which you want to
-- list listener objects.
listListeners_acceleratorArn :: Lens.Lens' ListListeners Prelude.Text
listListeners_acceleratorArn :: (Text -> f Text) -> ListListeners -> f ListListeners
listListeners_acceleratorArn = (ListListeners -> Text)
-> (ListListeners -> Text -> ListListeners)
-> Lens ListListeners ListListeners Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListListeners' {Text
acceleratorArn :: Text
$sel:acceleratorArn:ListListeners' :: ListListeners -> Text
acceleratorArn} -> Text
acceleratorArn) (\s :: ListListeners
s@ListListeners' {} Text
a -> ListListeners
s {$sel:acceleratorArn:ListListeners' :: Text
acceleratorArn = Text
a} :: ListListeners)

instance Core.AWSPager ListListeners where
  page :: ListListeners -> AWSResponse ListListeners -> Maybe ListListeners
page ListListeners
rq AWSResponse ListListeners
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListListeners
ListListenersResponse
rs
            ListListenersResponse
-> Getting (First Text) ListListenersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListListenersResponse
-> Const (First Text) ListListenersResponse
Lens' ListListenersResponse (Maybe Text)
listListenersResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListListenersResponse
 -> Const (First Text) ListListenersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListListenersResponse 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 ListListeners
forall a. Maybe a
Prelude.Nothing
    | Maybe [Listener] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListListeners
ListListenersResponse
rs
            ListListenersResponse
-> Getting (First [Listener]) ListListenersResponse [Listener]
-> Maybe [Listener]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Listener] -> Const (First [Listener]) (Maybe [Listener]))
-> ListListenersResponse
-> Const (First [Listener]) ListListenersResponse
Lens' ListListenersResponse (Maybe [Listener])
listListenersResponse_listeners ((Maybe [Listener] -> Const (First [Listener]) (Maybe [Listener]))
 -> ListListenersResponse
 -> Const (First [Listener]) ListListenersResponse)
-> (([Listener] -> Const (First [Listener]) [Listener])
    -> Maybe [Listener] -> Const (First [Listener]) (Maybe [Listener]))
-> Getting (First [Listener]) ListListenersResponse [Listener]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Listener] -> Const (First [Listener]) [Listener])
-> Maybe [Listener] -> Const (First [Listener]) (Maybe [Listener])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListListeners
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListListeners -> Maybe ListListeners
forall a. a -> Maybe a
Prelude.Just (ListListeners -> Maybe ListListeners)
-> ListListeners -> Maybe ListListeners
forall a b. (a -> b) -> a -> b
Prelude.$
        ListListeners
rq
          ListListeners -> (ListListeners -> ListListeners) -> ListListeners
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListListeners -> Identity ListListeners
Lens ListListeners ListListeners (Maybe Text) (Maybe Text)
listListeners_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListListeners -> Identity ListListeners)
-> Maybe Text -> ListListeners -> ListListeners
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListListeners
ListListenersResponse
rs
          ListListenersResponse
-> Getting (First Text) ListListenersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListListenersResponse
-> Const (First Text) ListListenersResponse
Lens' ListListenersResponse (Maybe Text)
listListenersResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListListenersResponse
 -> Const (First Text) ListListenersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListListenersResponse 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 ListListeners where
  type
    AWSResponse ListListeners =
      ListListenersResponse
  request :: ListListeners -> Request ListListeners
request = Service -> ListListeners -> Request ListListeners
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListListeners
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListListeners)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListListeners))
-> Logger
-> Service
-> Proxy ListListeners
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListListeners)))
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 [Listener] -> Int -> ListListenersResponse
ListListenersResponse'
            (Maybe Text -> Maybe [Listener] -> Int -> ListListenersResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Listener] -> Int -> ListListenersResponse)
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 [Listener] -> Int -> ListListenersResponse)
-> Either String (Maybe [Listener])
-> Either String (Int -> ListListenersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Listener]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Listeners" Either String (Maybe (Maybe [Listener]))
-> Maybe [Listener] -> Either String (Maybe [Listener])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Listener]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListListenersResponse)
-> Either String Int -> Either String ListListenersResponse
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 ListListeners

instance Prelude.NFData ListListeners

instance Core.ToHeaders ListListeners where
  toHeaders :: ListListeners -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListListeners -> 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
"GlobalAccelerator_V20180706.ListListeners" ::
                          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 ListListeners where
  toJSON :: ListListeners -> Value
toJSON ListListeners' {Maybe Natural
Maybe Text
Text
acceleratorArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:acceleratorArn:ListListeners' :: ListListeners -> Text
$sel:maxResults:ListListeners' :: ListListeners -> Maybe Natural
$sel:nextToken:ListListeners' :: ListListeners -> 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,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AcceleratorArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
acceleratorArn)
          ]
      )

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

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

-- | /See:/ 'newListListenersResponse' smart constructor.
data ListListenersResponse = ListListenersResponse'
  { -- | The token for the next set of results. You receive this token from a
    -- previous call.
    ListListenersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of listeners for an accelerator.
    ListListenersResponse -> Maybe [Listener]
listeners :: Prelude.Maybe [Listener],
    -- | The response's http status code.
    ListListenersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListListenersResponse -> ListListenersResponse -> Bool
(ListListenersResponse -> ListListenersResponse -> Bool)
-> (ListListenersResponse -> ListListenersResponse -> Bool)
-> Eq ListListenersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListListenersResponse -> ListListenersResponse -> Bool
$c/= :: ListListenersResponse -> ListListenersResponse -> Bool
== :: ListListenersResponse -> ListListenersResponse -> Bool
$c== :: ListListenersResponse -> ListListenersResponse -> Bool
Prelude.Eq, ReadPrec [ListListenersResponse]
ReadPrec ListListenersResponse
Int -> ReadS ListListenersResponse
ReadS [ListListenersResponse]
(Int -> ReadS ListListenersResponse)
-> ReadS [ListListenersResponse]
-> ReadPrec ListListenersResponse
-> ReadPrec [ListListenersResponse]
-> Read ListListenersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListListenersResponse]
$creadListPrec :: ReadPrec [ListListenersResponse]
readPrec :: ReadPrec ListListenersResponse
$creadPrec :: ReadPrec ListListenersResponse
readList :: ReadS [ListListenersResponse]
$creadList :: ReadS [ListListenersResponse]
readsPrec :: Int -> ReadS ListListenersResponse
$creadsPrec :: Int -> ReadS ListListenersResponse
Prelude.Read, Int -> ListListenersResponse -> ShowS
[ListListenersResponse] -> ShowS
ListListenersResponse -> String
(Int -> ListListenersResponse -> ShowS)
-> (ListListenersResponse -> String)
-> ([ListListenersResponse] -> ShowS)
-> Show ListListenersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListListenersResponse] -> ShowS
$cshowList :: [ListListenersResponse] -> ShowS
show :: ListListenersResponse -> String
$cshow :: ListListenersResponse -> String
showsPrec :: Int -> ListListenersResponse -> ShowS
$cshowsPrec :: Int -> ListListenersResponse -> ShowS
Prelude.Show, (forall x. ListListenersResponse -> Rep ListListenersResponse x)
-> (forall x. Rep ListListenersResponse x -> ListListenersResponse)
-> Generic ListListenersResponse
forall x. Rep ListListenersResponse x -> ListListenersResponse
forall x. ListListenersResponse -> Rep ListListenersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListListenersResponse x -> ListListenersResponse
$cfrom :: forall x. ListListenersResponse -> Rep ListListenersResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListListenersResponse' 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', 'listListenersResponse_nextToken' - The token for the next set of results. You receive this token from a
-- previous call.
--
-- 'listeners', 'listListenersResponse_listeners' - The list of listeners for an accelerator.
--
-- 'httpStatus', 'listListenersResponse_httpStatus' - The response's http status code.
newListListenersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListListenersResponse
newListListenersResponse :: Int -> ListListenersResponse
newListListenersResponse Int
pHttpStatus_ =
  ListListenersResponse' :: Maybe Text -> Maybe [Listener] -> Int -> ListListenersResponse
ListListenersResponse'
    { $sel:nextToken:ListListenersResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:listeners:ListListenersResponse' :: Maybe [Listener]
listeners = Maybe [Listener]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListListenersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token for the next set of results. You receive this token from a
-- previous call.
listListenersResponse_nextToken :: Lens.Lens' ListListenersResponse (Prelude.Maybe Prelude.Text)
listListenersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListListenersResponse -> f ListListenersResponse
listListenersResponse_nextToken = (ListListenersResponse -> Maybe Text)
-> (ListListenersResponse -> Maybe Text -> ListListenersResponse)
-> Lens' ListListenersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListListenersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListListenersResponse' :: ListListenersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListListenersResponse
s@ListListenersResponse' {} Maybe Text
a -> ListListenersResponse
s {$sel:nextToken:ListListenersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListListenersResponse)

-- | The list of listeners for an accelerator.
listListenersResponse_listeners :: Lens.Lens' ListListenersResponse (Prelude.Maybe [Listener])
listListenersResponse_listeners :: (Maybe [Listener] -> f (Maybe [Listener]))
-> ListListenersResponse -> f ListListenersResponse
listListenersResponse_listeners = (ListListenersResponse -> Maybe [Listener])
-> (ListListenersResponse
    -> Maybe [Listener] -> ListListenersResponse)
-> Lens' ListListenersResponse (Maybe [Listener])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListListenersResponse' {Maybe [Listener]
listeners :: Maybe [Listener]
$sel:listeners:ListListenersResponse' :: ListListenersResponse -> Maybe [Listener]
listeners} -> Maybe [Listener]
listeners) (\s :: ListListenersResponse
s@ListListenersResponse' {} Maybe [Listener]
a -> ListListenersResponse
s {$sel:listeners:ListListenersResponse' :: Maybe [Listener]
listeners = Maybe [Listener]
a} :: ListListenersResponse) ((Maybe [Listener] -> f (Maybe [Listener]))
 -> ListListenersResponse -> f ListListenersResponse)
-> ((Maybe [Listener] -> f (Maybe [Listener]))
    -> Maybe [Listener] -> f (Maybe [Listener]))
-> (Maybe [Listener] -> f (Maybe [Listener]))
-> ListListenersResponse
-> f ListListenersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Listener] [Listener] [Listener] [Listener]
-> Iso
     (Maybe [Listener])
     (Maybe [Listener])
     (Maybe [Listener])
     (Maybe [Listener])
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 [Listener] [Listener] [Listener] [Listener]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListListenersResponse