{-# 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.Neptune.DescribeDBClusterEndpoints
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about endpoints for an Amazon Neptune DB cluster.
--
-- This operation can also return information for Amazon RDS clusters and
-- Amazon DocDB clusters.
--
-- This operation returns paginated results.
module Amazonka.Neptune.DescribeDBClusterEndpoints
  ( -- * Creating a Request
    DescribeDBClusterEndpoints (..),
    newDescribeDBClusterEndpoints,

    -- * Request Lenses
    describeDBClusterEndpoints_dbClusterIdentifier,
    describeDBClusterEndpoints_filters,
    describeDBClusterEndpoints_dbClusterEndpointIdentifier,
    describeDBClusterEndpoints_marker,
    describeDBClusterEndpoints_maxRecords,

    -- * Destructuring the Response
    DescribeDBClusterEndpointsResponse (..),
    newDescribeDBClusterEndpointsResponse,

    -- * Response Lenses
    describeDBClusterEndpointsResponse_dbClusterEndpoints,
    describeDBClusterEndpointsResponse_marker,
    describeDBClusterEndpointsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeDBClusterEndpoints' smart constructor.
data DescribeDBClusterEndpoints = DescribeDBClusterEndpoints'
  { -- | The DB cluster identifier of the DB cluster associated with the
    -- endpoint. This parameter is stored as a lowercase string.
    DescribeDBClusterEndpoints -> Maybe Text
dbClusterIdentifier :: Prelude.Maybe Prelude.Text,
    -- | A set of name-value pairs that define which endpoints to include in the
    -- output. The filters are specified as name-value pairs, in the format
    -- @Name=endpoint_type,Values=endpoint_type1,endpoint_type2,...@. @Name@
    -- can be one of: @db-cluster-endpoint-type@,
    -- @db-cluster-endpoint-custom-type@, @db-cluster-endpoint-id@,
    -- @db-cluster-endpoint-status@. @Values@ for the
    -- @ db-cluster-endpoint-type@ filter can be one or more of: @reader@,
    -- @writer@, @custom@. @Values@ for the @db-cluster-endpoint-custom-type@
    -- filter can be one or more of: @reader@, @any@. @Values@ for the
    -- @db-cluster-endpoint-status@ filter can be one or more of: @available@,
    -- @creating@, @deleting@, @inactive@, @modifying@.
    DescribeDBClusterEndpoints -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The identifier of the endpoint to describe. This parameter is stored as
    -- a lowercase string.
    DescribeDBClusterEndpoints -> Maybe Text
dbClusterEndpointIdentifier :: Prelude.Maybe Prelude.Text,
    -- | An optional pagination token provided by a previous
    -- @DescribeDBClusterEndpoints@ request. If this parameter is specified,
    -- the response includes only records beyond the marker, up to the value
    -- specified by @MaxRecords@.
    DescribeDBClusterEndpoints -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified @MaxRecords@ value, a pagination token
    -- called a marker is included in the response so you can retrieve the
    -- remaining results.
    --
    -- Default: 100
    --
    -- Constraints: Minimum 20, maximum 100.
    DescribeDBClusterEndpoints -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeDBClusterEndpoints -> DescribeDBClusterEndpoints -> Bool
(DescribeDBClusterEndpoints -> DescribeDBClusterEndpoints -> Bool)
-> (DescribeDBClusterEndpoints
    -> DescribeDBClusterEndpoints -> Bool)
-> Eq DescribeDBClusterEndpoints
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBClusterEndpoints -> DescribeDBClusterEndpoints -> Bool
$c/= :: DescribeDBClusterEndpoints -> DescribeDBClusterEndpoints -> Bool
== :: DescribeDBClusterEndpoints -> DescribeDBClusterEndpoints -> Bool
$c== :: DescribeDBClusterEndpoints -> DescribeDBClusterEndpoints -> Bool
Prelude.Eq, ReadPrec [DescribeDBClusterEndpoints]
ReadPrec DescribeDBClusterEndpoints
Int -> ReadS DescribeDBClusterEndpoints
ReadS [DescribeDBClusterEndpoints]
(Int -> ReadS DescribeDBClusterEndpoints)
-> ReadS [DescribeDBClusterEndpoints]
-> ReadPrec DescribeDBClusterEndpoints
-> ReadPrec [DescribeDBClusterEndpoints]
-> Read DescribeDBClusterEndpoints
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBClusterEndpoints]
$creadListPrec :: ReadPrec [DescribeDBClusterEndpoints]
readPrec :: ReadPrec DescribeDBClusterEndpoints
$creadPrec :: ReadPrec DescribeDBClusterEndpoints
readList :: ReadS [DescribeDBClusterEndpoints]
$creadList :: ReadS [DescribeDBClusterEndpoints]
readsPrec :: Int -> ReadS DescribeDBClusterEndpoints
$creadsPrec :: Int -> ReadS DescribeDBClusterEndpoints
Prelude.Read, Int -> DescribeDBClusterEndpoints -> ShowS
[DescribeDBClusterEndpoints] -> ShowS
DescribeDBClusterEndpoints -> String
(Int -> DescribeDBClusterEndpoints -> ShowS)
-> (DescribeDBClusterEndpoints -> String)
-> ([DescribeDBClusterEndpoints] -> ShowS)
-> Show DescribeDBClusterEndpoints
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBClusterEndpoints] -> ShowS
$cshowList :: [DescribeDBClusterEndpoints] -> ShowS
show :: DescribeDBClusterEndpoints -> String
$cshow :: DescribeDBClusterEndpoints -> String
showsPrec :: Int -> DescribeDBClusterEndpoints -> ShowS
$cshowsPrec :: Int -> DescribeDBClusterEndpoints -> ShowS
Prelude.Show, (forall x.
 DescribeDBClusterEndpoints -> Rep DescribeDBClusterEndpoints x)
-> (forall x.
    Rep DescribeDBClusterEndpoints x -> DescribeDBClusterEndpoints)
-> Generic DescribeDBClusterEndpoints
forall x.
Rep DescribeDBClusterEndpoints x -> DescribeDBClusterEndpoints
forall x.
DescribeDBClusterEndpoints -> Rep DescribeDBClusterEndpoints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBClusterEndpoints x -> DescribeDBClusterEndpoints
$cfrom :: forall x.
DescribeDBClusterEndpoints -> Rep DescribeDBClusterEndpoints x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDBClusterEndpoints' 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:
--
-- 'dbClusterIdentifier', 'describeDBClusterEndpoints_dbClusterIdentifier' - The DB cluster identifier of the DB cluster associated with the
-- endpoint. This parameter is stored as a lowercase string.
--
-- 'filters', 'describeDBClusterEndpoints_filters' - A set of name-value pairs that define which endpoints to include in the
-- output. The filters are specified as name-value pairs, in the format
-- @Name=endpoint_type,Values=endpoint_type1,endpoint_type2,...@. @Name@
-- can be one of: @db-cluster-endpoint-type@,
-- @db-cluster-endpoint-custom-type@, @db-cluster-endpoint-id@,
-- @db-cluster-endpoint-status@. @Values@ for the
-- @ db-cluster-endpoint-type@ filter can be one or more of: @reader@,
-- @writer@, @custom@. @Values@ for the @db-cluster-endpoint-custom-type@
-- filter can be one or more of: @reader@, @any@. @Values@ for the
-- @db-cluster-endpoint-status@ filter can be one or more of: @available@,
-- @creating@, @deleting@, @inactive@, @modifying@.
--
-- 'dbClusterEndpointIdentifier', 'describeDBClusterEndpoints_dbClusterEndpointIdentifier' - The identifier of the endpoint to describe. This parameter is stored as
-- a lowercase string.
--
-- 'marker', 'describeDBClusterEndpoints_marker' - An optional pagination token provided by a previous
-- @DescribeDBClusterEndpoints@ request. If this parameter is specified,
-- the response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
--
-- 'maxRecords', 'describeDBClusterEndpoints_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so you can retrieve the
-- remaining results.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
newDescribeDBClusterEndpoints ::
  DescribeDBClusterEndpoints
newDescribeDBClusterEndpoints :: DescribeDBClusterEndpoints
newDescribeDBClusterEndpoints =
  DescribeDBClusterEndpoints' :: Maybe Text
-> Maybe [Filter]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> DescribeDBClusterEndpoints
DescribeDBClusterEndpoints'
    { $sel:dbClusterIdentifier:DescribeDBClusterEndpoints' :: Maybe Text
dbClusterIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeDBClusterEndpoints' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:dbClusterEndpointIdentifier:DescribeDBClusterEndpoints' :: Maybe Text
dbClusterEndpointIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDBClusterEndpoints' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeDBClusterEndpoints' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The DB cluster identifier of the DB cluster associated with the
-- endpoint. This parameter is stored as a lowercase string.
describeDBClusterEndpoints_dbClusterIdentifier :: Lens.Lens' DescribeDBClusterEndpoints (Prelude.Maybe Prelude.Text)
describeDBClusterEndpoints_dbClusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> DescribeDBClusterEndpoints -> f DescribeDBClusterEndpoints
describeDBClusterEndpoints_dbClusterIdentifier = (DescribeDBClusterEndpoints -> Maybe Text)
-> (DescribeDBClusterEndpoints
    -> Maybe Text -> DescribeDBClusterEndpoints)
-> Lens
     DescribeDBClusterEndpoints
     DescribeDBClusterEndpoints
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBClusterEndpoints' {Maybe Text
dbClusterIdentifier :: Maybe Text
$sel:dbClusterIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
dbClusterIdentifier} -> Maybe Text
dbClusterIdentifier) (\s :: DescribeDBClusterEndpoints
s@DescribeDBClusterEndpoints' {} Maybe Text
a -> DescribeDBClusterEndpoints
s {$sel:dbClusterIdentifier:DescribeDBClusterEndpoints' :: Maybe Text
dbClusterIdentifier = Maybe Text
a} :: DescribeDBClusterEndpoints)

-- | A set of name-value pairs that define which endpoints to include in the
-- output. The filters are specified as name-value pairs, in the format
-- @Name=endpoint_type,Values=endpoint_type1,endpoint_type2,...@. @Name@
-- can be one of: @db-cluster-endpoint-type@,
-- @db-cluster-endpoint-custom-type@, @db-cluster-endpoint-id@,
-- @db-cluster-endpoint-status@. @Values@ for the
-- @ db-cluster-endpoint-type@ filter can be one or more of: @reader@,
-- @writer@, @custom@. @Values@ for the @db-cluster-endpoint-custom-type@
-- filter can be one or more of: @reader@, @any@. @Values@ for the
-- @db-cluster-endpoint-status@ filter can be one or more of: @available@,
-- @creating@, @deleting@, @inactive@, @modifying@.
describeDBClusterEndpoints_filters :: Lens.Lens' DescribeDBClusterEndpoints (Prelude.Maybe [Filter])
describeDBClusterEndpoints_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBClusterEndpoints -> f DescribeDBClusterEndpoints
describeDBClusterEndpoints_filters = (DescribeDBClusterEndpoints -> Maybe [Filter])
-> (DescribeDBClusterEndpoints
    -> Maybe [Filter] -> DescribeDBClusterEndpoints)
-> Lens
     DescribeDBClusterEndpoints
     DescribeDBClusterEndpoints
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBClusterEndpoints' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeDBClusterEndpoints
s@DescribeDBClusterEndpoints' {} Maybe [Filter]
a -> DescribeDBClusterEndpoints
s {$sel:filters:DescribeDBClusterEndpoints' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeDBClusterEndpoints) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeDBClusterEndpoints -> f DescribeDBClusterEndpoints)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBClusterEndpoints
-> f DescribeDBClusterEndpoints
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the endpoint to describe. This parameter is stored as
-- a lowercase string.
describeDBClusterEndpoints_dbClusterEndpointIdentifier :: Lens.Lens' DescribeDBClusterEndpoints (Prelude.Maybe Prelude.Text)
describeDBClusterEndpoints_dbClusterEndpointIdentifier :: (Maybe Text -> f (Maybe Text))
-> DescribeDBClusterEndpoints -> f DescribeDBClusterEndpoints
describeDBClusterEndpoints_dbClusterEndpointIdentifier = (DescribeDBClusterEndpoints -> Maybe Text)
-> (DescribeDBClusterEndpoints
    -> Maybe Text -> DescribeDBClusterEndpoints)
-> Lens
     DescribeDBClusterEndpoints
     DescribeDBClusterEndpoints
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBClusterEndpoints' {Maybe Text
dbClusterEndpointIdentifier :: Maybe Text
$sel:dbClusterEndpointIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
dbClusterEndpointIdentifier} -> Maybe Text
dbClusterEndpointIdentifier) (\s :: DescribeDBClusterEndpoints
s@DescribeDBClusterEndpoints' {} Maybe Text
a -> DescribeDBClusterEndpoints
s {$sel:dbClusterEndpointIdentifier:DescribeDBClusterEndpoints' :: Maybe Text
dbClusterEndpointIdentifier = Maybe Text
a} :: DescribeDBClusterEndpoints)

-- | An optional pagination token provided by a previous
-- @DescribeDBClusterEndpoints@ request. If this parameter is specified,
-- the response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
describeDBClusterEndpoints_marker :: Lens.Lens' DescribeDBClusterEndpoints (Prelude.Maybe Prelude.Text)
describeDBClusterEndpoints_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDBClusterEndpoints -> f DescribeDBClusterEndpoints
describeDBClusterEndpoints_marker = (DescribeDBClusterEndpoints -> Maybe Text)
-> (DescribeDBClusterEndpoints
    -> Maybe Text -> DescribeDBClusterEndpoints)
-> Lens
     DescribeDBClusterEndpoints
     DescribeDBClusterEndpoints
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBClusterEndpoints' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDBClusterEndpoints
s@DescribeDBClusterEndpoints' {} Maybe Text
a -> DescribeDBClusterEndpoints
s {$sel:marker:DescribeDBClusterEndpoints' :: Maybe Text
marker = Maybe Text
a} :: DescribeDBClusterEndpoints)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so you can retrieve the
-- remaining results.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
describeDBClusterEndpoints_maxRecords :: Lens.Lens' DescribeDBClusterEndpoints (Prelude.Maybe Prelude.Int)
describeDBClusterEndpoints_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeDBClusterEndpoints -> f DescribeDBClusterEndpoints
describeDBClusterEndpoints_maxRecords = (DescribeDBClusterEndpoints -> Maybe Int)
-> (DescribeDBClusterEndpoints
    -> Maybe Int -> DescribeDBClusterEndpoints)
-> Lens
     DescribeDBClusterEndpoints
     DescribeDBClusterEndpoints
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBClusterEndpoints' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeDBClusterEndpoints
s@DescribeDBClusterEndpoints' {} Maybe Int
a -> DescribeDBClusterEndpoints
s {$sel:maxRecords:DescribeDBClusterEndpoints' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeDBClusterEndpoints)

instance Core.AWSPager DescribeDBClusterEndpoints where
  page :: DescribeDBClusterEndpoints
-> AWSResponse DescribeDBClusterEndpoints
-> Maybe DescribeDBClusterEndpoints
page DescribeDBClusterEndpoints
rq AWSResponse DescribeDBClusterEndpoints
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDBClusterEndpoints
DescribeDBClusterEndpointsResponse
rs
            DescribeDBClusterEndpointsResponse
-> Getting (First Text) DescribeDBClusterEndpointsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDBClusterEndpointsResponse
-> Const (First Text) DescribeDBClusterEndpointsResponse
Lens' DescribeDBClusterEndpointsResponse (Maybe Text)
describeDBClusterEndpointsResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeDBClusterEndpointsResponse
 -> Const (First Text) DescribeDBClusterEndpointsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDBClusterEndpointsResponse 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 DescribeDBClusterEndpoints
forall a. Maybe a
Prelude.Nothing
    | Maybe [DBClusterEndpoint] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDBClusterEndpoints
DescribeDBClusterEndpointsResponse
rs
            DescribeDBClusterEndpointsResponse
-> Getting
     (First [DBClusterEndpoint])
     DescribeDBClusterEndpointsResponse
     [DBClusterEndpoint]
-> Maybe [DBClusterEndpoint]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DBClusterEndpoint]
 -> Const (First [DBClusterEndpoint]) (Maybe [DBClusterEndpoint]))
-> DescribeDBClusterEndpointsResponse
-> Const
     (First [DBClusterEndpoint]) DescribeDBClusterEndpointsResponse
Lens'
  DescribeDBClusterEndpointsResponse (Maybe [DBClusterEndpoint])
describeDBClusterEndpointsResponse_dbClusterEndpoints
              ((Maybe [DBClusterEndpoint]
  -> Const (First [DBClusterEndpoint]) (Maybe [DBClusterEndpoint]))
 -> DescribeDBClusterEndpointsResponse
 -> Const
      (First [DBClusterEndpoint]) DescribeDBClusterEndpointsResponse)
-> (([DBClusterEndpoint]
     -> Const (First [DBClusterEndpoint]) [DBClusterEndpoint])
    -> Maybe [DBClusterEndpoint]
    -> Const (First [DBClusterEndpoint]) (Maybe [DBClusterEndpoint]))
-> Getting
     (First [DBClusterEndpoint])
     DescribeDBClusterEndpointsResponse
     [DBClusterEndpoint]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DBClusterEndpoint]
 -> Const (First [DBClusterEndpoint]) [DBClusterEndpoint])
-> Maybe [DBClusterEndpoint]
-> Const (First [DBClusterEndpoint]) (Maybe [DBClusterEndpoint])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeDBClusterEndpoints
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeDBClusterEndpoints -> Maybe DescribeDBClusterEndpoints
forall a. a -> Maybe a
Prelude.Just (DescribeDBClusterEndpoints -> Maybe DescribeDBClusterEndpoints)
-> DescribeDBClusterEndpoints -> Maybe DescribeDBClusterEndpoints
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeDBClusterEndpoints
rq
          DescribeDBClusterEndpoints
-> (DescribeDBClusterEndpoints -> DescribeDBClusterEndpoints)
-> DescribeDBClusterEndpoints
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeDBClusterEndpoints
-> Identity DescribeDBClusterEndpoints
Lens
  DescribeDBClusterEndpoints
  DescribeDBClusterEndpoints
  (Maybe Text)
  (Maybe Text)
describeDBClusterEndpoints_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeDBClusterEndpoints
 -> Identity DescribeDBClusterEndpoints)
-> Maybe Text
-> DescribeDBClusterEndpoints
-> DescribeDBClusterEndpoints
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeDBClusterEndpoints
DescribeDBClusterEndpointsResponse
rs
          DescribeDBClusterEndpointsResponse
-> Getting (First Text) DescribeDBClusterEndpointsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDBClusterEndpointsResponse
-> Const (First Text) DescribeDBClusterEndpointsResponse
Lens' DescribeDBClusterEndpointsResponse (Maybe Text)
describeDBClusterEndpointsResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeDBClusterEndpointsResponse
 -> Const (First Text) DescribeDBClusterEndpointsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDBClusterEndpointsResponse 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 DescribeDBClusterEndpoints where
  type
    AWSResponse DescribeDBClusterEndpoints =
      DescribeDBClusterEndpointsResponse
  request :: DescribeDBClusterEndpoints -> Request DescribeDBClusterEndpoints
request = Service
-> DescribeDBClusterEndpoints -> Request DescribeDBClusterEndpoints
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeDBClusterEndpoints
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDBClusterEndpoints)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeDBClusterEndpoints))
-> Logger
-> Service
-> Proxy DescribeDBClusterEndpoints
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDBClusterEndpoints)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeDBClusterEndpointsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [DBClusterEndpoint]
-> Maybe Text -> Int -> DescribeDBClusterEndpointsResponse
DescribeDBClusterEndpointsResponse'
            (Maybe [DBClusterEndpoint]
 -> Maybe Text -> Int -> DescribeDBClusterEndpointsResponse)
-> Either String (Maybe [DBClusterEndpoint])
-> Either
     String (Maybe Text -> Int -> DescribeDBClusterEndpointsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBClusterEndpoints"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [DBClusterEndpoint]))
-> Either String (Maybe [DBClusterEndpoint])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [DBClusterEndpoint])
-> [Node] -> Either String (Maybe [DBClusterEndpoint])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [DBClusterEndpoint]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"DBClusterEndpointList")
                        )
            Either
  String (Maybe Text -> Int -> DescribeDBClusterEndpointsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeDBClusterEndpointsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Marker")
            Either String (Int -> DescribeDBClusterEndpointsResponse)
-> Either String Int
-> Either String DescribeDBClusterEndpointsResponse
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 DescribeDBClusterEndpoints

instance Prelude.NFData DescribeDBClusterEndpoints

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

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

instance Core.ToQuery DescribeDBClusterEndpoints where
  toQuery :: DescribeDBClusterEndpoints -> QueryString
toQuery DescribeDBClusterEndpoints' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
dbClusterEndpointIdentifier :: Maybe Text
filters :: Maybe [Filter]
dbClusterIdentifier :: Maybe Text
$sel:maxRecords:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Int
$sel:marker:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
$sel:dbClusterEndpointIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
$sel:filters:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe [Filter]
$sel:dbClusterIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeDBClusterEndpoints" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"DBClusterIdentifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbClusterIdentifier,
        ByteString
"Filters"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Filter] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Filter" ([Filter] -> QueryString) -> Maybe [Filter] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"DBClusterEndpointIdentifier"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbClusterEndpointIdentifier,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords
      ]

-- | /See:/ 'newDescribeDBClusterEndpointsResponse' smart constructor.
data DescribeDBClusterEndpointsResponse = DescribeDBClusterEndpointsResponse'
  { -- | Contains the details of the endpoints associated with the cluster and
    -- matching any filter conditions.
    DescribeDBClusterEndpointsResponse -> Maybe [DBClusterEndpoint]
dbClusterEndpoints :: Prelude.Maybe [DBClusterEndpoint],
    -- | An optional pagination token provided by a previous
    -- @DescribeDBClusterEndpoints@ request. If this parameter is specified,
    -- the response includes only records beyond the marker, up to the value
    -- specified by @MaxRecords@.
    DescribeDBClusterEndpointsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeDBClusterEndpointsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDBClusterEndpointsResponse
-> DescribeDBClusterEndpointsResponse -> Bool
(DescribeDBClusterEndpointsResponse
 -> DescribeDBClusterEndpointsResponse -> Bool)
-> (DescribeDBClusterEndpointsResponse
    -> DescribeDBClusterEndpointsResponse -> Bool)
-> Eq DescribeDBClusterEndpointsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBClusterEndpointsResponse
-> DescribeDBClusterEndpointsResponse -> Bool
$c/= :: DescribeDBClusterEndpointsResponse
-> DescribeDBClusterEndpointsResponse -> Bool
== :: DescribeDBClusterEndpointsResponse
-> DescribeDBClusterEndpointsResponse -> Bool
$c== :: DescribeDBClusterEndpointsResponse
-> DescribeDBClusterEndpointsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDBClusterEndpointsResponse]
ReadPrec DescribeDBClusterEndpointsResponse
Int -> ReadS DescribeDBClusterEndpointsResponse
ReadS [DescribeDBClusterEndpointsResponse]
(Int -> ReadS DescribeDBClusterEndpointsResponse)
-> ReadS [DescribeDBClusterEndpointsResponse]
-> ReadPrec DescribeDBClusterEndpointsResponse
-> ReadPrec [DescribeDBClusterEndpointsResponse]
-> Read DescribeDBClusterEndpointsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBClusterEndpointsResponse]
$creadListPrec :: ReadPrec [DescribeDBClusterEndpointsResponse]
readPrec :: ReadPrec DescribeDBClusterEndpointsResponse
$creadPrec :: ReadPrec DescribeDBClusterEndpointsResponse
readList :: ReadS [DescribeDBClusterEndpointsResponse]
$creadList :: ReadS [DescribeDBClusterEndpointsResponse]
readsPrec :: Int -> ReadS DescribeDBClusterEndpointsResponse
$creadsPrec :: Int -> ReadS DescribeDBClusterEndpointsResponse
Prelude.Read, Int -> DescribeDBClusterEndpointsResponse -> ShowS
[DescribeDBClusterEndpointsResponse] -> ShowS
DescribeDBClusterEndpointsResponse -> String
(Int -> DescribeDBClusterEndpointsResponse -> ShowS)
-> (DescribeDBClusterEndpointsResponse -> String)
-> ([DescribeDBClusterEndpointsResponse] -> ShowS)
-> Show DescribeDBClusterEndpointsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBClusterEndpointsResponse] -> ShowS
$cshowList :: [DescribeDBClusterEndpointsResponse] -> ShowS
show :: DescribeDBClusterEndpointsResponse -> String
$cshow :: DescribeDBClusterEndpointsResponse -> String
showsPrec :: Int -> DescribeDBClusterEndpointsResponse -> ShowS
$cshowsPrec :: Int -> DescribeDBClusterEndpointsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDBClusterEndpointsResponse
 -> Rep DescribeDBClusterEndpointsResponse x)
-> (forall x.
    Rep DescribeDBClusterEndpointsResponse x
    -> DescribeDBClusterEndpointsResponse)
-> Generic DescribeDBClusterEndpointsResponse
forall x.
Rep DescribeDBClusterEndpointsResponse x
-> DescribeDBClusterEndpointsResponse
forall x.
DescribeDBClusterEndpointsResponse
-> Rep DescribeDBClusterEndpointsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBClusterEndpointsResponse x
-> DescribeDBClusterEndpointsResponse
$cfrom :: forall x.
DescribeDBClusterEndpointsResponse
-> Rep DescribeDBClusterEndpointsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDBClusterEndpointsResponse' 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:
--
-- 'dbClusterEndpoints', 'describeDBClusterEndpointsResponse_dbClusterEndpoints' - Contains the details of the endpoints associated with the cluster and
-- matching any filter conditions.
--
-- 'marker', 'describeDBClusterEndpointsResponse_marker' - An optional pagination token provided by a previous
-- @DescribeDBClusterEndpoints@ request. If this parameter is specified,
-- the response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
--
-- 'httpStatus', 'describeDBClusterEndpointsResponse_httpStatus' - The response's http status code.
newDescribeDBClusterEndpointsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDBClusterEndpointsResponse
newDescribeDBClusterEndpointsResponse :: Int -> DescribeDBClusterEndpointsResponse
newDescribeDBClusterEndpointsResponse Int
pHttpStatus_ =
  DescribeDBClusterEndpointsResponse' :: Maybe [DBClusterEndpoint]
-> Maybe Text -> Int -> DescribeDBClusterEndpointsResponse
DescribeDBClusterEndpointsResponse'
    { $sel:dbClusterEndpoints:DescribeDBClusterEndpointsResponse' :: Maybe [DBClusterEndpoint]
dbClusterEndpoints =
        Maybe [DBClusterEndpoint]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDBClusterEndpointsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDBClusterEndpointsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Contains the details of the endpoints associated with the cluster and
-- matching any filter conditions.
describeDBClusterEndpointsResponse_dbClusterEndpoints :: Lens.Lens' DescribeDBClusterEndpointsResponse (Prelude.Maybe [DBClusterEndpoint])
describeDBClusterEndpointsResponse_dbClusterEndpoints :: (Maybe [DBClusterEndpoint] -> f (Maybe [DBClusterEndpoint]))
-> DescribeDBClusterEndpointsResponse
-> f DescribeDBClusterEndpointsResponse
describeDBClusterEndpointsResponse_dbClusterEndpoints = (DescribeDBClusterEndpointsResponse -> Maybe [DBClusterEndpoint])
-> (DescribeDBClusterEndpointsResponse
    -> Maybe [DBClusterEndpoint] -> DescribeDBClusterEndpointsResponse)
-> Lens'
     DescribeDBClusterEndpointsResponse (Maybe [DBClusterEndpoint])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBClusterEndpointsResponse' {Maybe [DBClusterEndpoint]
dbClusterEndpoints :: Maybe [DBClusterEndpoint]
$sel:dbClusterEndpoints:DescribeDBClusterEndpointsResponse' :: DescribeDBClusterEndpointsResponse -> Maybe [DBClusterEndpoint]
dbClusterEndpoints} -> Maybe [DBClusterEndpoint]
dbClusterEndpoints) (\s :: DescribeDBClusterEndpointsResponse
s@DescribeDBClusterEndpointsResponse' {} Maybe [DBClusterEndpoint]
a -> DescribeDBClusterEndpointsResponse
s {$sel:dbClusterEndpoints:DescribeDBClusterEndpointsResponse' :: Maybe [DBClusterEndpoint]
dbClusterEndpoints = Maybe [DBClusterEndpoint]
a} :: DescribeDBClusterEndpointsResponse) ((Maybe [DBClusterEndpoint] -> f (Maybe [DBClusterEndpoint]))
 -> DescribeDBClusterEndpointsResponse
 -> f DescribeDBClusterEndpointsResponse)
-> ((Maybe [DBClusterEndpoint] -> f (Maybe [DBClusterEndpoint]))
    -> Maybe [DBClusterEndpoint] -> f (Maybe [DBClusterEndpoint]))
-> (Maybe [DBClusterEndpoint] -> f (Maybe [DBClusterEndpoint]))
-> DescribeDBClusterEndpointsResponse
-> f DescribeDBClusterEndpointsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DBClusterEndpoint]
  [DBClusterEndpoint]
  [DBClusterEndpoint]
  [DBClusterEndpoint]
-> Iso
     (Maybe [DBClusterEndpoint])
     (Maybe [DBClusterEndpoint])
     (Maybe [DBClusterEndpoint])
     (Maybe [DBClusterEndpoint])
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
  [DBClusterEndpoint]
  [DBClusterEndpoint]
  [DBClusterEndpoint]
  [DBClusterEndpoint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional pagination token provided by a previous
-- @DescribeDBClusterEndpoints@ request. If this parameter is specified,
-- the response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
describeDBClusterEndpointsResponse_marker :: Lens.Lens' DescribeDBClusterEndpointsResponse (Prelude.Maybe Prelude.Text)
describeDBClusterEndpointsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDBClusterEndpointsResponse
-> f DescribeDBClusterEndpointsResponse
describeDBClusterEndpointsResponse_marker = (DescribeDBClusterEndpointsResponse -> Maybe Text)
-> (DescribeDBClusterEndpointsResponse
    -> Maybe Text -> DescribeDBClusterEndpointsResponse)
-> Lens' DescribeDBClusterEndpointsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBClusterEndpointsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDBClusterEndpointsResponse' :: DescribeDBClusterEndpointsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDBClusterEndpointsResponse
s@DescribeDBClusterEndpointsResponse' {} Maybe Text
a -> DescribeDBClusterEndpointsResponse
s {$sel:marker:DescribeDBClusterEndpointsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeDBClusterEndpointsResponse)

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

instance
  Prelude.NFData
    DescribeDBClusterEndpointsResponse