{-# 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.MediaConvert.DescribeEndpoints
-- 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)
--
-- Send an request with an empty body to the regional API endpoint to get
-- your account API endpoint.
--
-- This operation returns paginated results.
module Amazonka.MediaConvert.DescribeEndpoints
  ( -- * Creating a Request
    DescribeEndpoints (..),
    newDescribeEndpoints,

    -- * Request Lenses
    describeEndpoints_mode,
    describeEndpoints_nextToken,
    describeEndpoints_maxResults,

    -- * Destructuring the Response
    DescribeEndpointsResponse (..),
    newDescribeEndpointsResponse,

    -- * Response Lenses
    describeEndpointsResponse_nextToken,
    describeEndpointsResponse_endpoints,
    describeEndpointsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | DescribeEndpointsRequest
--
-- /See:/ 'newDescribeEndpoints' smart constructor.
data DescribeEndpoints = DescribeEndpoints'
  { -- | Optional field, defaults to DEFAULT. Specify DEFAULT for this operation
    -- to return your endpoints if any exist, or to create an endpoint for you
    -- and return it if one doesn\'t already exist. Specify GET_ONLY to return
    -- your endpoints if any exist, or an empty list if none exist.
    DescribeEndpoints -> Maybe DescribeEndpointsMode
mode :: Prelude.Maybe DescribeEndpointsMode,
    -- | Use this string, provided with the response to a previous request, to
    -- request the next batch of endpoints.
    DescribeEndpoints -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Optional. Max number of endpoints, up to twenty, that will be returned
    -- at one time.
    DescribeEndpoints -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeEndpoints -> DescribeEndpoints -> Bool
(DescribeEndpoints -> DescribeEndpoints -> Bool)
-> (DescribeEndpoints -> DescribeEndpoints -> Bool)
-> Eq DescribeEndpoints
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEndpoints -> DescribeEndpoints -> Bool
$c/= :: DescribeEndpoints -> DescribeEndpoints -> Bool
== :: DescribeEndpoints -> DescribeEndpoints -> Bool
$c== :: DescribeEndpoints -> DescribeEndpoints -> Bool
Prelude.Eq, ReadPrec [DescribeEndpoints]
ReadPrec DescribeEndpoints
Int -> ReadS DescribeEndpoints
ReadS [DescribeEndpoints]
(Int -> ReadS DescribeEndpoints)
-> ReadS [DescribeEndpoints]
-> ReadPrec DescribeEndpoints
-> ReadPrec [DescribeEndpoints]
-> Read DescribeEndpoints
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEndpoints]
$creadListPrec :: ReadPrec [DescribeEndpoints]
readPrec :: ReadPrec DescribeEndpoints
$creadPrec :: ReadPrec DescribeEndpoints
readList :: ReadS [DescribeEndpoints]
$creadList :: ReadS [DescribeEndpoints]
readsPrec :: Int -> ReadS DescribeEndpoints
$creadsPrec :: Int -> ReadS DescribeEndpoints
Prelude.Read, Int -> DescribeEndpoints -> ShowS
[DescribeEndpoints] -> ShowS
DescribeEndpoints -> String
(Int -> DescribeEndpoints -> ShowS)
-> (DescribeEndpoints -> String)
-> ([DescribeEndpoints] -> ShowS)
-> Show DescribeEndpoints
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEndpoints] -> ShowS
$cshowList :: [DescribeEndpoints] -> ShowS
show :: DescribeEndpoints -> String
$cshow :: DescribeEndpoints -> String
showsPrec :: Int -> DescribeEndpoints -> ShowS
$cshowsPrec :: Int -> DescribeEndpoints -> ShowS
Prelude.Show, (forall x. DescribeEndpoints -> Rep DescribeEndpoints x)
-> (forall x. Rep DescribeEndpoints x -> DescribeEndpoints)
-> Generic DescribeEndpoints
forall x. Rep DescribeEndpoints x -> DescribeEndpoints
forall x. DescribeEndpoints -> Rep DescribeEndpoints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeEndpoints x -> DescribeEndpoints
$cfrom :: forall x. DescribeEndpoints -> Rep DescribeEndpoints x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEndpoints' 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:
--
-- 'mode', 'describeEndpoints_mode' - Optional field, defaults to DEFAULT. Specify DEFAULT for this operation
-- to return your endpoints if any exist, or to create an endpoint for you
-- and return it if one doesn\'t already exist. Specify GET_ONLY to return
-- your endpoints if any exist, or an empty list if none exist.
--
-- 'nextToken', 'describeEndpoints_nextToken' - Use this string, provided with the response to a previous request, to
-- request the next batch of endpoints.
--
-- 'maxResults', 'describeEndpoints_maxResults' - Optional. Max number of endpoints, up to twenty, that will be returned
-- at one time.
newDescribeEndpoints ::
  DescribeEndpoints
newDescribeEndpoints :: DescribeEndpoints
newDescribeEndpoints =
  DescribeEndpoints' :: Maybe DescribeEndpointsMode
-> Maybe Text -> Maybe Int -> DescribeEndpoints
DescribeEndpoints'
    { $sel:mode:DescribeEndpoints' :: Maybe DescribeEndpointsMode
mode = Maybe DescribeEndpointsMode
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeEndpoints' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeEndpoints' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional field, defaults to DEFAULT. Specify DEFAULT for this operation
-- to return your endpoints if any exist, or to create an endpoint for you
-- and return it if one doesn\'t already exist. Specify GET_ONLY to return
-- your endpoints if any exist, or an empty list if none exist.
describeEndpoints_mode :: Lens.Lens' DescribeEndpoints (Prelude.Maybe DescribeEndpointsMode)
describeEndpoints_mode :: (Maybe DescribeEndpointsMode -> f (Maybe DescribeEndpointsMode))
-> DescribeEndpoints -> f DescribeEndpoints
describeEndpoints_mode = (DescribeEndpoints -> Maybe DescribeEndpointsMode)
-> (DescribeEndpoints
    -> Maybe DescribeEndpointsMode -> DescribeEndpoints)
-> Lens
     DescribeEndpoints
     DescribeEndpoints
     (Maybe DescribeEndpointsMode)
     (Maybe DescribeEndpointsMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpoints' {Maybe DescribeEndpointsMode
mode :: Maybe DescribeEndpointsMode
$sel:mode:DescribeEndpoints' :: DescribeEndpoints -> Maybe DescribeEndpointsMode
mode} -> Maybe DescribeEndpointsMode
mode) (\s :: DescribeEndpoints
s@DescribeEndpoints' {} Maybe DescribeEndpointsMode
a -> DescribeEndpoints
s {$sel:mode:DescribeEndpoints' :: Maybe DescribeEndpointsMode
mode = Maybe DescribeEndpointsMode
a} :: DescribeEndpoints)

-- | Use this string, provided with the response to a previous request, to
-- request the next batch of endpoints.
describeEndpoints_nextToken :: Lens.Lens' DescribeEndpoints (Prelude.Maybe Prelude.Text)
describeEndpoints_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeEndpoints -> f DescribeEndpoints
describeEndpoints_nextToken = (DescribeEndpoints -> Maybe Text)
-> (DescribeEndpoints -> Maybe Text -> DescribeEndpoints)
-> Lens
     DescribeEndpoints DescribeEndpoints (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpoints' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeEndpoints' :: DescribeEndpoints -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeEndpoints
s@DescribeEndpoints' {} Maybe Text
a -> DescribeEndpoints
s {$sel:nextToken:DescribeEndpoints' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeEndpoints)

-- | Optional. Max number of endpoints, up to twenty, that will be returned
-- at one time.
describeEndpoints_maxResults :: Lens.Lens' DescribeEndpoints (Prelude.Maybe Prelude.Int)
describeEndpoints_maxResults :: (Maybe Int -> f (Maybe Int))
-> DescribeEndpoints -> f DescribeEndpoints
describeEndpoints_maxResults = (DescribeEndpoints -> Maybe Int)
-> (DescribeEndpoints -> Maybe Int -> DescribeEndpoints)
-> Lens DescribeEndpoints DescribeEndpoints (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpoints' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeEndpoints' :: DescribeEndpoints -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeEndpoints
s@DescribeEndpoints' {} Maybe Int
a -> DescribeEndpoints
s {$sel:maxResults:DescribeEndpoints' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeEndpoints)

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

instance Prelude.NFData DescribeEndpoints

instance Core.ToHeaders DescribeEndpoints where
  toHeaders :: DescribeEndpoints -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeEndpoints -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 DescribeEndpoints where
  toJSON :: DescribeEndpoints -> Value
toJSON DescribeEndpoints' {Maybe Int
Maybe Text
Maybe DescribeEndpointsMode
maxResults :: Maybe Int
nextToken :: Maybe Text
mode :: Maybe DescribeEndpointsMode
$sel:maxResults:DescribeEndpoints' :: DescribeEndpoints -> Maybe Int
$sel:nextToken:DescribeEndpoints' :: DescribeEndpoints -> Maybe Text
$sel:mode:DescribeEndpoints' :: DescribeEndpoints -> Maybe DescribeEndpointsMode
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"mode" Text -> DescribeEndpointsMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DescribeEndpointsMode -> Pair)
-> Maybe DescribeEndpointsMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DescribeEndpointsMode
mode,
            (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 -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

instance Core.ToPath DescribeEndpoints where
  toPath :: DescribeEndpoints -> ByteString
toPath = ByteString -> DescribeEndpoints -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2017-08-29/endpoints"

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

-- | /See:/ 'newDescribeEndpointsResponse' smart constructor.
data DescribeEndpointsResponse = DescribeEndpointsResponse'
  { -- | Use this string to request the next batch of endpoints.
    DescribeEndpointsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | List of endpoints
    DescribeEndpointsResponse -> Maybe [Endpoint]
endpoints :: Prelude.Maybe [Endpoint],
    -- | The response's http status code.
    DescribeEndpointsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeEndpointsResponse -> DescribeEndpointsResponse -> Bool
(DescribeEndpointsResponse -> DescribeEndpointsResponse -> Bool)
-> (DescribeEndpointsResponse -> DescribeEndpointsResponse -> Bool)
-> Eq DescribeEndpointsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEndpointsResponse -> DescribeEndpointsResponse -> Bool
$c/= :: DescribeEndpointsResponse -> DescribeEndpointsResponse -> Bool
== :: DescribeEndpointsResponse -> DescribeEndpointsResponse -> Bool
$c== :: DescribeEndpointsResponse -> DescribeEndpointsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEndpointsResponse]
ReadPrec DescribeEndpointsResponse
Int -> ReadS DescribeEndpointsResponse
ReadS [DescribeEndpointsResponse]
(Int -> ReadS DescribeEndpointsResponse)
-> ReadS [DescribeEndpointsResponse]
-> ReadPrec DescribeEndpointsResponse
-> ReadPrec [DescribeEndpointsResponse]
-> Read DescribeEndpointsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEndpointsResponse]
$creadListPrec :: ReadPrec [DescribeEndpointsResponse]
readPrec :: ReadPrec DescribeEndpointsResponse
$creadPrec :: ReadPrec DescribeEndpointsResponse
readList :: ReadS [DescribeEndpointsResponse]
$creadList :: ReadS [DescribeEndpointsResponse]
readsPrec :: Int -> ReadS DescribeEndpointsResponse
$creadsPrec :: Int -> ReadS DescribeEndpointsResponse
Prelude.Read, Int -> DescribeEndpointsResponse -> ShowS
[DescribeEndpointsResponse] -> ShowS
DescribeEndpointsResponse -> String
(Int -> DescribeEndpointsResponse -> ShowS)
-> (DescribeEndpointsResponse -> String)
-> ([DescribeEndpointsResponse] -> ShowS)
-> Show DescribeEndpointsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEndpointsResponse] -> ShowS
$cshowList :: [DescribeEndpointsResponse] -> ShowS
show :: DescribeEndpointsResponse -> String
$cshow :: DescribeEndpointsResponse -> String
showsPrec :: Int -> DescribeEndpointsResponse -> ShowS
$cshowsPrec :: Int -> DescribeEndpointsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeEndpointsResponse -> Rep DescribeEndpointsResponse x)
-> (forall x.
    Rep DescribeEndpointsResponse x -> DescribeEndpointsResponse)
-> Generic DescribeEndpointsResponse
forall x.
Rep DescribeEndpointsResponse x -> DescribeEndpointsResponse
forall x.
DescribeEndpointsResponse -> Rep DescribeEndpointsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEndpointsResponse x -> DescribeEndpointsResponse
$cfrom :: forall x.
DescribeEndpointsResponse -> Rep DescribeEndpointsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEndpointsResponse' 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', 'describeEndpointsResponse_nextToken' - Use this string to request the next batch of endpoints.
--
-- 'endpoints', 'describeEndpointsResponse_endpoints' - List of endpoints
--
-- 'httpStatus', 'describeEndpointsResponse_httpStatus' - The response's http status code.
newDescribeEndpointsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeEndpointsResponse
newDescribeEndpointsResponse :: Int -> DescribeEndpointsResponse
newDescribeEndpointsResponse Int
pHttpStatus_ =
  DescribeEndpointsResponse' :: Maybe Text -> Maybe [Endpoint] -> Int -> DescribeEndpointsResponse
DescribeEndpointsResponse'
    { $sel:nextToken:DescribeEndpointsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpoints:DescribeEndpointsResponse' :: Maybe [Endpoint]
endpoints = Maybe [Endpoint]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeEndpointsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Use this string to request the next batch of endpoints.
describeEndpointsResponse_nextToken :: Lens.Lens' DescribeEndpointsResponse (Prelude.Maybe Prelude.Text)
describeEndpointsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeEndpointsResponse -> f DescribeEndpointsResponse
describeEndpointsResponse_nextToken = (DescribeEndpointsResponse -> Maybe Text)
-> (DescribeEndpointsResponse
    -> Maybe Text -> DescribeEndpointsResponse)
-> Lens' DescribeEndpointsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeEndpointsResponse' :: DescribeEndpointsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeEndpointsResponse
s@DescribeEndpointsResponse' {} Maybe Text
a -> DescribeEndpointsResponse
s {$sel:nextToken:DescribeEndpointsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeEndpointsResponse)

-- | List of endpoints
describeEndpointsResponse_endpoints :: Lens.Lens' DescribeEndpointsResponse (Prelude.Maybe [Endpoint])
describeEndpointsResponse_endpoints :: (Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> DescribeEndpointsResponse -> f DescribeEndpointsResponse
describeEndpointsResponse_endpoints = (DescribeEndpointsResponse -> Maybe [Endpoint])
-> (DescribeEndpointsResponse
    -> Maybe [Endpoint] -> DescribeEndpointsResponse)
-> Lens' DescribeEndpointsResponse (Maybe [Endpoint])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEndpointsResponse' {Maybe [Endpoint]
endpoints :: Maybe [Endpoint]
$sel:endpoints:DescribeEndpointsResponse' :: DescribeEndpointsResponse -> Maybe [Endpoint]
endpoints} -> Maybe [Endpoint]
endpoints) (\s :: DescribeEndpointsResponse
s@DescribeEndpointsResponse' {} Maybe [Endpoint]
a -> DescribeEndpointsResponse
s {$sel:endpoints:DescribeEndpointsResponse' :: Maybe [Endpoint]
endpoints = Maybe [Endpoint]
a} :: DescribeEndpointsResponse) ((Maybe [Endpoint] -> f (Maybe [Endpoint]))
 -> DescribeEndpointsResponse -> f DescribeEndpointsResponse)
-> ((Maybe [Endpoint] -> f (Maybe [Endpoint]))
    -> Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> (Maybe [Endpoint] -> f (Maybe [Endpoint]))
-> DescribeEndpointsResponse
-> f DescribeEndpointsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Endpoint] [Endpoint] [Endpoint] [Endpoint]
-> Iso
     (Maybe [Endpoint])
     (Maybe [Endpoint])
     (Maybe [Endpoint])
     (Maybe [Endpoint])
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 [Endpoint] [Endpoint] [Endpoint] [Endpoint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeEndpointsResponse