{-# 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.ListEndpointGroups
-- 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 endpoint groups that are associated with a listener.
--
-- This operation returns paginated results.
module Amazonka.GlobalAccelerator.ListEndpointGroups
  ( -- * Creating a Request
    ListEndpointGroups (..),
    newListEndpointGroups,

    -- * Request Lenses
    listEndpointGroups_nextToken,
    listEndpointGroups_maxResults,
    listEndpointGroups_listenerArn,

    -- * Destructuring the Response
    ListEndpointGroupsResponse (..),
    newListEndpointGroupsResponse,

    -- * Response Lenses
    listEndpointGroupsResponse_nextToken,
    listEndpointGroupsResponse_endpointGroups,
    listEndpointGroupsResponse_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:/ 'newListEndpointGroups' smart constructor.
data ListEndpointGroups = ListEndpointGroups'
  { -- | The token for the next set of results. You receive this token from a
    -- previous call.
    ListEndpointGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of endpoint group objects that you want to return with this
    -- call. The default value is 10.
    ListEndpointGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the listener.
    ListEndpointGroups -> Text
listenerArn :: Prelude.Text
  }
  deriving (ListEndpointGroups -> ListEndpointGroups -> Bool
(ListEndpointGroups -> ListEndpointGroups -> Bool)
-> (ListEndpointGroups -> ListEndpointGroups -> Bool)
-> Eq ListEndpointGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEndpointGroups -> ListEndpointGroups -> Bool
$c/= :: ListEndpointGroups -> ListEndpointGroups -> Bool
== :: ListEndpointGroups -> ListEndpointGroups -> Bool
$c== :: ListEndpointGroups -> ListEndpointGroups -> Bool
Prelude.Eq, ReadPrec [ListEndpointGroups]
ReadPrec ListEndpointGroups
Int -> ReadS ListEndpointGroups
ReadS [ListEndpointGroups]
(Int -> ReadS ListEndpointGroups)
-> ReadS [ListEndpointGroups]
-> ReadPrec ListEndpointGroups
-> ReadPrec [ListEndpointGroups]
-> Read ListEndpointGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEndpointGroups]
$creadListPrec :: ReadPrec [ListEndpointGroups]
readPrec :: ReadPrec ListEndpointGroups
$creadPrec :: ReadPrec ListEndpointGroups
readList :: ReadS [ListEndpointGroups]
$creadList :: ReadS [ListEndpointGroups]
readsPrec :: Int -> ReadS ListEndpointGroups
$creadsPrec :: Int -> ReadS ListEndpointGroups
Prelude.Read, Int -> ListEndpointGroups -> ShowS
[ListEndpointGroups] -> ShowS
ListEndpointGroups -> String
(Int -> ListEndpointGroups -> ShowS)
-> (ListEndpointGroups -> String)
-> ([ListEndpointGroups] -> ShowS)
-> Show ListEndpointGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEndpointGroups] -> ShowS
$cshowList :: [ListEndpointGroups] -> ShowS
show :: ListEndpointGroups -> String
$cshow :: ListEndpointGroups -> String
showsPrec :: Int -> ListEndpointGroups -> ShowS
$cshowsPrec :: Int -> ListEndpointGroups -> ShowS
Prelude.Show, (forall x. ListEndpointGroups -> Rep ListEndpointGroups x)
-> (forall x. Rep ListEndpointGroups x -> ListEndpointGroups)
-> Generic ListEndpointGroups
forall x. Rep ListEndpointGroups x -> ListEndpointGroups
forall x. ListEndpointGroups -> Rep ListEndpointGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListEndpointGroups x -> ListEndpointGroups
$cfrom :: forall x. ListEndpointGroups -> Rep ListEndpointGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListEndpointGroups' 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', 'listEndpointGroups_nextToken' - The token for the next set of results. You receive this token from a
-- previous call.
--
-- 'maxResults', 'listEndpointGroups_maxResults' - The number of endpoint group objects that you want to return with this
-- call. The default value is 10.
--
-- 'listenerArn', 'listEndpointGroups_listenerArn' - The Amazon Resource Name (ARN) of the listener.
newListEndpointGroups ::
  -- | 'listenerArn'
  Prelude.Text ->
  ListEndpointGroups
newListEndpointGroups :: Text -> ListEndpointGroups
newListEndpointGroups Text
pListenerArn_ =
  ListEndpointGroups' :: Maybe Text -> Maybe Natural -> Text -> ListEndpointGroups
ListEndpointGroups'
    { $sel:nextToken:ListEndpointGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListEndpointGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:listenerArn:ListEndpointGroups' :: Text
listenerArn = Text
pListenerArn_
    }

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

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

-- | The Amazon Resource Name (ARN) of the listener.
listEndpointGroups_listenerArn :: Lens.Lens' ListEndpointGroups Prelude.Text
listEndpointGroups_listenerArn :: (Text -> f Text) -> ListEndpointGroups -> f ListEndpointGroups
listEndpointGroups_listenerArn = (ListEndpointGroups -> Text)
-> (ListEndpointGroups -> Text -> ListEndpointGroups)
-> Lens ListEndpointGroups ListEndpointGroups Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointGroups' {Text
listenerArn :: Text
$sel:listenerArn:ListEndpointGroups' :: ListEndpointGroups -> Text
listenerArn} -> Text
listenerArn) (\s :: ListEndpointGroups
s@ListEndpointGroups' {} Text
a -> ListEndpointGroups
s {$sel:listenerArn:ListEndpointGroups' :: Text
listenerArn = Text
a} :: ListEndpointGroups)

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

instance Prelude.NFData ListEndpointGroups

instance Core.ToHeaders ListEndpointGroups where
  toHeaders :: ListEndpointGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListEndpointGroups -> 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.ListEndpointGroups" ::
                          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 ListEndpointGroups where
  toJSON :: ListEndpointGroups -> Value
toJSON ListEndpointGroups' {Maybe Natural
Maybe Text
Text
listenerArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:listenerArn:ListEndpointGroups' :: ListEndpointGroups -> Text
$sel:maxResults:ListEndpointGroups' :: ListEndpointGroups -> Maybe Natural
$sel:nextToken:ListEndpointGroups' :: ListEndpointGroups -> 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
"ListenerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
listenerArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'ListEndpointGroupsResponse' 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', 'listEndpointGroupsResponse_nextToken' - The token for the next set of results. You receive this token from a
-- previous call.
--
-- 'endpointGroups', 'listEndpointGroupsResponse_endpointGroups' - The list of the endpoint groups associated with a listener.
--
-- 'httpStatus', 'listEndpointGroupsResponse_httpStatus' - The response's http status code.
newListEndpointGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListEndpointGroupsResponse
newListEndpointGroupsResponse :: Int -> ListEndpointGroupsResponse
newListEndpointGroupsResponse Int
pHttpStatus_ =
  ListEndpointGroupsResponse' :: Maybe Text
-> Maybe [EndpointGroup] -> Int -> ListEndpointGroupsResponse
ListEndpointGroupsResponse'
    { $sel:nextToken:ListEndpointGroupsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointGroups:ListEndpointGroupsResponse' :: Maybe [EndpointGroup]
endpointGroups = Maybe [EndpointGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListEndpointGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The list of the endpoint groups associated with a listener.
listEndpointGroupsResponse_endpointGroups :: Lens.Lens' ListEndpointGroupsResponse (Prelude.Maybe [EndpointGroup])
listEndpointGroupsResponse_endpointGroups :: (Maybe [EndpointGroup] -> f (Maybe [EndpointGroup]))
-> ListEndpointGroupsResponse -> f ListEndpointGroupsResponse
listEndpointGroupsResponse_endpointGroups = (ListEndpointGroupsResponse -> Maybe [EndpointGroup])
-> (ListEndpointGroupsResponse
    -> Maybe [EndpointGroup] -> ListEndpointGroupsResponse)
-> Lens' ListEndpointGroupsResponse (Maybe [EndpointGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEndpointGroupsResponse' {Maybe [EndpointGroup]
endpointGroups :: Maybe [EndpointGroup]
$sel:endpointGroups:ListEndpointGroupsResponse' :: ListEndpointGroupsResponse -> Maybe [EndpointGroup]
endpointGroups} -> Maybe [EndpointGroup]
endpointGroups) (\s :: ListEndpointGroupsResponse
s@ListEndpointGroupsResponse' {} Maybe [EndpointGroup]
a -> ListEndpointGroupsResponse
s {$sel:endpointGroups:ListEndpointGroupsResponse' :: Maybe [EndpointGroup]
endpointGroups = Maybe [EndpointGroup]
a} :: ListEndpointGroupsResponse) ((Maybe [EndpointGroup] -> f (Maybe [EndpointGroup]))
 -> ListEndpointGroupsResponse -> f ListEndpointGroupsResponse)
-> ((Maybe [EndpointGroup] -> f (Maybe [EndpointGroup]))
    -> Maybe [EndpointGroup] -> f (Maybe [EndpointGroup]))
-> (Maybe [EndpointGroup] -> f (Maybe [EndpointGroup]))
-> ListEndpointGroupsResponse
-> f ListEndpointGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EndpointGroup] [EndpointGroup] [EndpointGroup] [EndpointGroup]
-> Iso
     (Maybe [EndpointGroup])
     (Maybe [EndpointGroup])
     (Maybe [EndpointGroup])
     (Maybe [EndpointGroup])
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
  [EndpointGroup] [EndpointGroup] [EndpointGroup] [EndpointGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListEndpointGroupsResponse