{-# 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.RDS.DescribeDBClusterEndpoints
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about endpoints for an Amazon Aurora DB cluster.
--
-- This action only applies to Aurora DB clusters.
--
-- This operation returns paginated results.
module Amazonka.RDS.DescribeDBClusterEndpoints
  ( -- * Creating a Request
    DescribeDBClusterEndpoints (..),
    newDescribeDBClusterEndpoints,

    -- * Request Lenses
    describeDBClusterEndpoints_dbClusterEndpointIdentifier,
    describeDBClusterEndpoints_dbClusterIdentifier,
    describeDBClusterEndpoints_filters,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeDBClusterEndpoints' smart constructor.
data DescribeDBClusterEndpoints = DescribeDBClusterEndpoints'
  { -- | The identifier of the endpoint to describe. This parameter is stored as
    -- a lowercase string.
    DescribeDBClusterEndpoints -> Maybe Text
dbClusterEndpointIdentifier :: Prelude.Maybe Prelude.Text,
    -- | 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],
    -- | 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
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]
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
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.
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:
--
-- 'dbClusterEndpointIdentifier', 'describeDBClusterEndpoints_dbClusterEndpointIdentifier' - The identifier of the endpoint to describe. This parameter is stored as
-- a lowercase string.
--
-- '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@.
--
-- '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'
    { $sel:dbClusterEndpointIdentifier:DescribeDBClusterEndpoints' :: Maybe Text
dbClusterEndpointIdentifier =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dbClusterIdentifier:DescribeDBClusterEndpoints' :: Maybe Text
dbClusterIdentifier = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeDBClusterEndpoints' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDBClusterEndpoints' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeDBClusterEndpoints' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' DescribeDBClusterEndpoints (Maybe Text)
describeDBClusterEndpoints_dbClusterEndpointIdentifier = 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)

-- | 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 :: Lens' DescribeDBClusterEndpoints (Maybe Text)
describeDBClusterEndpoints_dbClusterIdentifier = 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 :: Lens' DescribeDBClusterEndpoints (Maybe [Filter])
describeDBClusterEndpoints_filters = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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@.
describeDBClusterEndpoints_marker :: Lens.Lens' DescribeDBClusterEndpoints (Prelude.Maybe Prelude.Text)
describeDBClusterEndpoints_marker :: Lens' DescribeDBClusterEndpoints (Maybe Text)
describeDBClusterEndpoints_marker = 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 :: Lens' DescribeDBClusterEndpoints (Maybe Int)
describeDBClusterEndpoints_maxRecords = 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
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDBClusterEndpoints
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDBClusterEndpointsResponse (Maybe Text)
describeDBClusterEndpointsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDBClusterEndpoints
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeDBClusterEndpointsResponse (Maybe [DBClusterEndpoint])
describeDBClusterEndpointsResponse_dbClusterEndpoints
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeDBClusterEndpoints
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeDBClusterEndpoints (Maybe Text)
describeDBClusterEndpoints_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeDBClusterEndpoints
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeDBClusterEndpointsResponse (Maybe Text)
describeDBClusterEndpointsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeDBClusterEndpoints where
  type
    AWSResponse DescribeDBClusterEndpoints =
      DescribeDBClusterEndpointsResponse
  request :: (Service -> Service)
-> DescribeDBClusterEndpoints -> Request DescribeDBClusterEndpoints
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeDBClusterEndpoints
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDBClusterEndpoints)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DBClusterEndpoints"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"DBClusterEndpointList")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeDBClusterEndpoints where
  hashWithSalt :: Int -> DescribeDBClusterEndpoints -> Int
hashWithSalt Int
_salt DescribeDBClusterEndpoints' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
dbClusterIdentifier :: Maybe Text
dbClusterEndpointIdentifier :: Maybe Text
$sel:maxRecords:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Int
$sel:marker:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
$sel:filters:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe [Filter]
$sel:dbClusterIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
$sel:dbClusterEndpointIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dbClusterEndpointIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dbClusterIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords

instance Prelude.NFData DescribeDBClusterEndpoints where
  rnf :: DescribeDBClusterEndpoints -> ()
rnf DescribeDBClusterEndpoints' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
dbClusterIdentifier :: Maybe Text
dbClusterEndpointIdentifier :: Maybe Text
$sel:maxRecords:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Int
$sel:marker:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
$sel:filters:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe [Filter]
$sel:dbClusterIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
$sel:dbClusterEndpointIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dbClusterEndpointIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dbClusterIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords

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

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

instance Data.ToQuery DescribeDBClusterEndpoints where
  toQuery :: DescribeDBClusterEndpoints -> QueryString
toQuery DescribeDBClusterEndpoints' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
dbClusterIdentifier :: Maybe Text
dbClusterEndpointIdentifier :: Maybe Text
$sel:maxRecords:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Int
$sel:marker:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
$sel:filters:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe [Filter]
$sel:dbClusterIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
$sel:dbClusterEndpointIdentifier:DescribeDBClusterEndpoints' :: DescribeDBClusterEndpoints -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeDBClusterEndpoints" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"DBClusterEndpointIdentifier"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
dbClusterEndpointIdentifier,
        ByteString
"DBClusterIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
dbClusterIdentifier,
        ByteString
"Filters"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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
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]
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
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.
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'
    { $sel:dbClusterEndpoints:DescribeDBClusterEndpointsResponse' :: Maybe [DBClusterEndpoint]
dbClusterEndpoints =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDBClusterEndpointsResponse' :: Maybe Text
marker = 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 :: Lens'
  DescribeDBClusterEndpointsResponse (Maybe [DBClusterEndpoint])
describeDBClusterEndpointsResponse_dbClusterEndpoints = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' DescribeDBClusterEndpointsResponse (Maybe Text)
describeDBClusterEndpointsResponse_marker = 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 :: Lens' DescribeDBClusterEndpointsResponse Int
describeDBClusterEndpointsResponse_httpStatus = 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
  where
  rnf :: DescribeDBClusterEndpointsResponse -> ()
rnf DescribeDBClusterEndpointsResponse' {Int
Maybe [DBClusterEndpoint]
Maybe Text
httpStatus :: Int
marker :: Maybe Text
dbClusterEndpoints :: Maybe [DBClusterEndpoint]
$sel:httpStatus:DescribeDBClusterEndpointsResponse' :: DescribeDBClusterEndpointsResponse -> Int
$sel:marker:DescribeDBClusterEndpointsResponse' :: DescribeDBClusterEndpointsResponse -> Maybe Text
$sel:dbClusterEndpoints:DescribeDBClusterEndpointsResponse' :: DescribeDBClusterEndpointsResponse -> Maybe [DBClusterEndpoint]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [DBClusterEndpoint]
dbClusterEndpoints
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus