{-# 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.DescribeDBProxyTargets
-- 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 @DBProxyTarget@ objects. This API supports
-- pagination.
--
-- This operation returns paginated results.
module Amazonka.RDS.DescribeDBProxyTargets
  ( -- * Creating a Request
    DescribeDBProxyTargets (..),
    newDescribeDBProxyTargets,

    -- * Request Lenses
    describeDBProxyTargets_filters,
    describeDBProxyTargets_marker,
    describeDBProxyTargets_maxRecords,
    describeDBProxyTargets_targetGroupName,
    describeDBProxyTargets_dbProxyName,

    -- * Destructuring the Response
    DescribeDBProxyTargetsResponse (..),
    newDescribeDBProxyTargetsResponse,

    -- * Response Lenses
    describeDBProxyTargetsResponse_targets,
    describeDBProxyTargetsResponse_marker,
    describeDBProxyTargetsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeDBProxyTargets' smart constructor.
data DescribeDBProxyTargets = DescribeDBProxyTargets'
  { -- | This parameter is not currently supported.
    DescribeDBProxyTargets -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeDBProxyTargets -> 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 that the remaining
    -- results can be retrieved.
    --
    -- Default: 100
    --
    -- Constraints: Minimum 20, maximum 100.
    DescribeDBProxyTargets -> Maybe Natural
maxRecords :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the @DBProxyTargetGroup@ to describe.
    DescribeDBProxyTargets -> Maybe Text
targetGroupName :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the @DBProxyTarget@ to describe.
    DescribeDBProxyTargets -> Text
dbProxyName :: Prelude.Text
  }
  deriving (DescribeDBProxyTargets -> DescribeDBProxyTargets -> Bool
(DescribeDBProxyTargets -> DescribeDBProxyTargets -> Bool)
-> (DescribeDBProxyTargets -> DescribeDBProxyTargets -> Bool)
-> Eq DescribeDBProxyTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBProxyTargets -> DescribeDBProxyTargets -> Bool
$c/= :: DescribeDBProxyTargets -> DescribeDBProxyTargets -> Bool
== :: DescribeDBProxyTargets -> DescribeDBProxyTargets -> Bool
$c== :: DescribeDBProxyTargets -> DescribeDBProxyTargets -> Bool
Prelude.Eq, ReadPrec [DescribeDBProxyTargets]
ReadPrec DescribeDBProxyTargets
Int -> ReadS DescribeDBProxyTargets
ReadS [DescribeDBProxyTargets]
(Int -> ReadS DescribeDBProxyTargets)
-> ReadS [DescribeDBProxyTargets]
-> ReadPrec DescribeDBProxyTargets
-> ReadPrec [DescribeDBProxyTargets]
-> Read DescribeDBProxyTargets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBProxyTargets]
$creadListPrec :: ReadPrec [DescribeDBProxyTargets]
readPrec :: ReadPrec DescribeDBProxyTargets
$creadPrec :: ReadPrec DescribeDBProxyTargets
readList :: ReadS [DescribeDBProxyTargets]
$creadList :: ReadS [DescribeDBProxyTargets]
readsPrec :: Int -> ReadS DescribeDBProxyTargets
$creadsPrec :: Int -> ReadS DescribeDBProxyTargets
Prelude.Read, Int -> DescribeDBProxyTargets -> ShowS
[DescribeDBProxyTargets] -> ShowS
DescribeDBProxyTargets -> String
(Int -> DescribeDBProxyTargets -> ShowS)
-> (DescribeDBProxyTargets -> String)
-> ([DescribeDBProxyTargets] -> ShowS)
-> Show DescribeDBProxyTargets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBProxyTargets] -> ShowS
$cshowList :: [DescribeDBProxyTargets] -> ShowS
show :: DescribeDBProxyTargets -> String
$cshow :: DescribeDBProxyTargets -> String
showsPrec :: Int -> DescribeDBProxyTargets -> ShowS
$cshowsPrec :: Int -> DescribeDBProxyTargets -> ShowS
Prelude.Show, (forall x. DescribeDBProxyTargets -> Rep DescribeDBProxyTargets x)
-> (forall x.
    Rep DescribeDBProxyTargets x -> DescribeDBProxyTargets)
-> Generic DescribeDBProxyTargets
forall x. Rep DescribeDBProxyTargets x -> DescribeDBProxyTargets
forall x. DescribeDBProxyTargets -> Rep DescribeDBProxyTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDBProxyTargets x -> DescribeDBProxyTargets
$cfrom :: forall x. DescribeDBProxyTargets -> Rep DescribeDBProxyTargets x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDBProxyTargets' 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:
--
-- 'filters', 'describeDBProxyTargets_filters' - This parameter is not currently supported.
--
-- 'marker', 'describeDBProxyTargets_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'maxRecords', 'describeDBProxyTargets_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 that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
--
-- 'targetGroupName', 'describeDBProxyTargets_targetGroupName' - The identifier of the @DBProxyTargetGroup@ to describe.
--
-- 'dbProxyName', 'describeDBProxyTargets_dbProxyName' - The identifier of the @DBProxyTarget@ to describe.
newDescribeDBProxyTargets ::
  -- | 'dbProxyName'
  Prelude.Text ->
  DescribeDBProxyTargets
newDescribeDBProxyTargets :: Text -> DescribeDBProxyTargets
newDescribeDBProxyTargets Text
pDBProxyName_ =
  DescribeDBProxyTargets' :: Maybe [Filter]
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Text
-> DescribeDBProxyTargets
DescribeDBProxyTargets'
    { $sel:filters:DescribeDBProxyTargets' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDBProxyTargets' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeDBProxyTargets' :: Maybe Natural
maxRecords = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:targetGroupName:DescribeDBProxyTargets' :: Maybe Text
targetGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbProxyName:DescribeDBProxyTargets' :: Text
dbProxyName = Text
pDBProxyName_
    }

-- | This parameter is not currently supported.
describeDBProxyTargets_filters :: Lens.Lens' DescribeDBProxyTargets (Prelude.Maybe [Filter])
describeDBProxyTargets_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBProxyTargets -> f DescribeDBProxyTargets
describeDBProxyTargets_filters = (DescribeDBProxyTargets -> Maybe [Filter])
-> (DescribeDBProxyTargets
    -> Maybe [Filter] -> DescribeDBProxyTargets)
-> Lens
     DescribeDBProxyTargets
     DescribeDBProxyTargets
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBProxyTargets' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeDBProxyTargets' :: DescribeDBProxyTargets -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeDBProxyTargets
s@DescribeDBProxyTargets' {} Maybe [Filter]
a -> DescribeDBProxyTargets
s {$sel:filters:DescribeDBProxyTargets' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeDBProxyTargets) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeDBProxyTargets -> f DescribeDBProxyTargets)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBProxyTargets
-> f DescribeDBProxyTargets
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

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

-- | 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 that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
describeDBProxyTargets_maxRecords :: Lens.Lens' DescribeDBProxyTargets (Prelude.Maybe Prelude.Natural)
describeDBProxyTargets_maxRecords :: (Maybe Natural -> f (Maybe Natural))
-> DescribeDBProxyTargets -> f DescribeDBProxyTargets
describeDBProxyTargets_maxRecords = (DescribeDBProxyTargets -> Maybe Natural)
-> (DescribeDBProxyTargets
    -> Maybe Natural -> DescribeDBProxyTargets)
-> Lens
     DescribeDBProxyTargets
     DescribeDBProxyTargets
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBProxyTargets' {Maybe Natural
maxRecords :: Maybe Natural
$sel:maxRecords:DescribeDBProxyTargets' :: DescribeDBProxyTargets -> Maybe Natural
maxRecords} -> Maybe Natural
maxRecords) (\s :: DescribeDBProxyTargets
s@DescribeDBProxyTargets' {} Maybe Natural
a -> DescribeDBProxyTargets
s {$sel:maxRecords:DescribeDBProxyTargets' :: Maybe Natural
maxRecords = Maybe Natural
a} :: DescribeDBProxyTargets)

-- | The identifier of the @DBProxyTargetGroup@ to describe.
describeDBProxyTargets_targetGroupName :: Lens.Lens' DescribeDBProxyTargets (Prelude.Maybe Prelude.Text)
describeDBProxyTargets_targetGroupName :: (Maybe Text -> f (Maybe Text))
-> DescribeDBProxyTargets -> f DescribeDBProxyTargets
describeDBProxyTargets_targetGroupName = (DescribeDBProxyTargets -> Maybe Text)
-> (DescribeDBProxyTargets -> Maybe Text -> DescribeDBProxyTargets)
-> Lens
     DescribeDBProxyTargets
     DescribeDBProxyTargets
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBProxyTargets' {Maybe Text
targetGroupName :: Maybe Text
$sel:targetGroupName:DescribeDBProxyTargets' :: DescribeDBProxyTargets -> Maybe Text
targetGroupName} -> Maybe Text
targetGroupName) (\s :: DescribeDBProxyTargets
s@DescribeDBProxyTargets' {} Maybe Text
a -> DescribeDBProxyTargets
s {$sel:targetGroupName:DescribeDBProxyTargets' :: Maybe Text
targetGroupName = Maybe Text
a} :: DescribeDBProxyTargets)

-- | The identifier of the @DBProxyTarget@ to describe.
describeDBProxyTargets_dbProxyName :: Lens.Lens' DescribeDBProxyTargets Prelude.Text
describeDBProxyTargets_dbProxyName :: (Text -> f Text)
-> DescribeDBProxyTargets -> f DescribeDBProxyTargets
describeDBProxyTargets_dbProxyName = (DescribeDBProxyTargets -> Text)
-> (DescribeDBProxyTargets -> Text -> DescribeDBProxyTargets)
-> Lens DescribeDBProxyTargets DescribeDBProxyTargets Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBProxyTargets' {Text
dbProxyName :: Text
$sel:dbProxyName:DescribeDBProxyTargets' :: DescribeDBProxyTargets -> Text
dbProxyName} -> Text
dbProxyName) (\s :: DescribeDBProxyTargets
s@DescribeDBProxyTargets' {} Text
a -> DescribeDBProxyTargets
s {$sel:dbProxyName:DescribeDBProxyTargets' :: Text
dbProxyName = Text
a} :: DescribeDBProxyTargets)

instance Core.AWSPager DescribeDBProxyTargets where
  page :: DescribeDBProxyTargets
-> AWSResponse DescribeDBProxyTargets
-> Maybe DescribeDBProxyTargets
page DescribeDBProxyTargets
rq AWSResponse DescribeDBProxyTargets
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDBProxyTargets
DescribeDBProxyTargetsResponse
rs
            DescribeDBProxyTargetsResponse
-> Getting (First Text) DescribeDBProxyTargetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDBProxyTargetsResponse
-> Const (First Text) DescribeDBProxyTargetsResponse
Lens' DescribeDBProxyTargetsResponse (Maybe Text)
describeDBProxyTargetsResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeDBProxyTargetsResponse
 -> Const (First Text) DescribeDBProxyTargetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDBProxyTargetsResponse 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 DescribeDBProxyTargets
forall a. Maybe a
Prelude.Nothing
    | Maybe [DBProxyTarget] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDBProxyTargets
DescribeDBProxyTargetsResponse
rs
            DescribeDBProxyTargetsResponse
-> Getting
     (First [DBProxyTarget])
     DescribeDBProxyTargetsResponse
     [DBProxyTarget]
-> Maybe [DBProxyTarget]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DBProxyTarget]
 -> Const (First [DBProxyTarget]) (Maybe [DBProxyTarget]))
-> DescribeDBProxyTargetsResponse
-> Const (First [DBProxyTarget]) DescribeDBProxyTargetsResponse
Lens' DescribeDBProxyTargetsResponse (Maybe [DBProxyTarget])
describeDBProxyTargetsResponse_targets
              ((Maybe [DBProxyTarget]
  -> Const (First [DBProxyTarget]) (Maybe [DBProxyTarget]))
 -> DescribeDBProxyTargetsResponse
 -> Const (First [DBProxyTarget]) DescribeDBProxyTargetsResponse)
-> (([DBProxyTarget]
     -> Const (First [DBProxyTarget]) [DBProxyTarget])
    -> Maybe [DBProxyTarget]
    -> Const (First [DBProxyTarget]) (Maybe [DBProxyTarget]))
-> Getting
     (First [DBProxyTarget])
     DescribeDBProxyTargetsResponse
     [DBProxyTarget]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DBProxyTarget] -> Const (First [DBProxyTarget]) [DBProxyTarget])
-> Maybe [DBProxyTarget]
-> Const (First [DBProxyTarget]) (Maybe [DBProxyTarget])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeDBProxyTargets
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeDBProxyTargets -> Maybe DescribeDBProxyTargets
forall a. a -> Maybe a
Prelude.Just (DescribeDBProxyTargets -> Maybe DescribeDBProxyTargets)
-> DescribeDBProxyTargets -> Maybe DescribeDBProxyTargets
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeDBProxyTargets
rq
          DescribeDBProxyTargets
-> (DescribeDBProxyTargets -> DescribeDBProxyTargets)
-> DescribeDBProxyTargets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeDBProxyTargets -> Identity DescribeDBProxyTargets
Lens
  DescribeDBProxyTargets
  DescribeDBProxyTargets
  (Maybe Text)
  (Maybe Text)
describeDBProxyTargets_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeDBProxyTargets -> Identity DescribeDBProxyTargets)
-> Maybe Text -> DescribeDBProxyTargets -> DescribeDBProxyTargets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeDBProxyTargets
DescribeDBProxyTargetsResponse
rs
          DescribeDBProxyTargetsResponse
-> Getting (First Text) DescribeDBProxyTargetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDBProxyTargetsResponse
-> Const (First Text) DescribeDBProxyTargetsResponse
Lens' DescribeDBProxyTargetsResponse (Maybe Text)
describeDBProxyTargetsResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeDBProxyTargetsResponse
 -> Const (First Text) DescribeDBProxyTargetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDBProxyTargetsResponse 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 DescribeDBProxyTargets where
  type
    AWSResponse DescribeDBProxyTargets =
      DescribeDBProxyTargetsResponse
  request :: DescribeDBProxyTargets -> Request DescribeDBProxyTargets
request = Service -> DescribeDBProxyTargets -> Request DescribeDBProxyTargets
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeDBProxyTargets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDBProxyTargets)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeDBProxyTargets))
-> Logger
-> Service
-> Proxy DescribeDBProxyTargets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeDBProxyTargets)))
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
"DescribeDBProxyTargetsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [DBProxyTarget]
-> Maybe Text -> Int -> DescribeDBProxyTargetsResponse
DescribeDBProxyTargetsResponse'
            (Maybe [DBProxyTarget]
 -> Maybe Text -> Int -> DescribeDBProxyTargetsResponse)
-> Either String (Maybe [DBProxyTarget])
-> Either
     String (Maybe Text -> Int -> DescribeDBProxyTargetsResponse)
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
"Targets" 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 [DBProxyTarget]))
-> Either String (Maybe [DBProxyTarget])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [DBProxyTarget])
-> [Node] -> Either String (Maybe [DBProxyTarget])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [DBProxyTarget]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Maybe Text -> Int -> DescribeDBProxyTargetsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeDBProxyTargetsResponse)
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 -> DescribeDBProxyTargetsResponse)
-> Either String Int
-> Either String DescribeDBProxyTargetsResponse
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 DescribeDBProxyTargets

instance Prelude.NFData DescribeDBProxyTargets

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

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

instance Core.ToQuery DescribeDBProxyTargets where
  toQuery :: DescribeDBProxyTargets -> QueryString
toQuery DescribeDBProxyTargets' {Maybe Natural
Maybe [Filter]
Maybe Text
Text
dbProxyName :: Text
targetGroupName :: Maybe Text
maxRecords :: Maybe Natural
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:dbProxyName:DescribeDBProxyTargets' :: DescribeDBProxyTargets -> Text
$sel:targetGroupName:DescribeDBProxyTargets' :: DescribeDBProxyTargets -> Maybe Text
$sel:maxRecords:DescribeDBProxyTargets' :: DescribeDBProxyTargets -> Maybe Natural
$sel:marker:DescribeDBProxyTargets' :: DescribeDBProxyTargets -> Maybe Text
$sel:filters:DescribeDBProxyTargets' :: DescribeDBProxyTargets -> Maybe [Filter]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeDBProxyTargets" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        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
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxRecords" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxRecords,
        ByteString
"TargetGroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
targetGroupName,
        ByteString
"DBProxyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbProxyName
      ]

-- | /See:/ 'newDescribeDBProxyTargetsResponse' smart constructor.
data DescribeDBProxyTargetsResponse = DescribeDBProxyTargetsResponse'
  { -- | An arbitrary number of @DBProxyTarget@ objects, containing details of
    -- the corresponding targets.
    DescribeDBProxyTargetsResponse -> Maybe [DBProxyTarget]
targets :: Prelude.Maybe [DBProxyTarget],
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeDBProxyTargetsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeDBProxyTargetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDBProxyTargetsResponse
-> DescribeDBProxyTargetsResponse -> Bool
(DescribeDBProxyTargetsResponse
 -> DescribeDBProxyTargetsResponse -> Bool)
-> (DescribeDBProxyTargetsResponse
    -> DescribeDBProxyTargetsResponse -> Bool)
-> Eq DescribeDBProxyTargetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBProxyTargetsResponse
-> DescribeDBProxyTargetsResponse -> Bool
$c/= :: DescribeDBProxyTargetsResponse
-> DescribeDBProxyTargetsResponse -> Bool
== :: DescribeDBProxyTargetsResponse
-> DescribeDBProxyTargetsResponse -> Bool
$c== :: DescribeDBProxyTargetsResponse
-> DescribeDBProxyTargetsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDBProxyTargetsResponse]
ReadPrec DescribeDBProxyTargetsResponse
Int -> ReadS DescribeDBProxyTargetsResponse
ReadS [DescribeDBProxyTargetsResponse]
(Int -> ReadS DescribeDBProxyTargetsResponse)
-> ReadS [DescribeDBProxyTargetsResponse]
-> ReadPrec DescribeDBProxyTargetsResponse
-> ReadPrec [DescribeDBProxyTargetsResponse]
-> Read DescribeDBProxyTargetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBProxyTargetsResponse]
$creadListPrec :: ReadPrec [DescribeDBProxyTargetsResponse]
readPrec :: ReadPrec DescribeDBProxyTargetsResponse
$creadPrec :: ReadPrec DescribeDBProxyTargetsResponse
readList :: ReadS [DescribeDBProxyTargetsResponse]
$creadList :: ReadS [DescribeDBProxyTargetsResponse]
readsPrec :: Int -> ReadS DescribeDBProxyTargetsResponse
$creadsPrec :: Int -> ReadS DescribeDBProxyTargetsResponse
Prelude.Read, Int -> DescribeDBProxyTargetsResponse -> ShowS
[DescribeDBProxyTargetsResponse] -> ShowS
DescribeDBProxyTargetsResponse -> String
(Int -> DescribeDBProxyTargetsResponse -> ShowS)
-> (DescribeDBProxyTargetsResponse -> String)
-> ([DescribeDBProxyTargetsResponse] -> ShowS)
-> Show DescribeDBProxyTargetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBProxyTargetsResponse] -> ShowS
$cshowList :: [DescribeDBProxyTargetsResponse] -> ShowS
show :: DescribeDBProxyTargetsResponse -> String
$cshow :: DescribeDBProxyTargetsResponse -> String
showsPrec :: Int -> DescribeDBProxyTargetsResponse -> ShowS
$cshowsPrec :: Int -> DescribeDBProxyTargetsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDBProxyTargetsResponse
 -> Rep DescribeDBProxyTargetsResponse x)
-> (forall x.
    Rep DescribeDBProxyTargetsResponse x
    -> DescribeDBProxyTargetsResponse)
-> Generic DescribeDBProxyTargetsResponse
forall x.
Rep DescribeDBProxyTargetsResponse x
-> DescribeDBProxyTargetsResponse
forall x.
DescribeDBProxyTargetsResponse
-> Rep DescribeDBProxyTargetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBProxyTargetsResponse x
-> DescribeDBProxyTargetsResponse
$cfrom :: forall x.
DescribeDBProxyTargetsResponse
-> Rep DescribeDBProxyTargetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDBProxyTargetsResponse' 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:
--
-- 'targets', 'describeDBProxyTargetsResponse_targets' - An arbitrary number of @DBProxyTarget@ objects, containing details of
-- the corresponding targets.
--
-- 'marker', 'describeDBProxyTargetsResponse_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'httpStatus', 'describeDBProxyTargetsResponse_httpStatus' - The response's http status code.
newDescribeDBProxyTargetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDBProxyTargetsResponse
newDescribeDBProxyTargetsResponse :: Int -> DescribeDBProxyTargetsResponse
newDescribeDBProxyTargetsResponse Int
pHttpStatus_ =
  DescribeDBProxyTargetsResponse' :: Maybe [DBProxyTarget]
-> Maybe Text -> Int -> DescribeDBProxyTargetsResponse
DescribeDBProxyTargetsResponse'
    { $sel:targets:DescribeDBProxyTargetsResponse' :: Maybe [DBProxyTarget]
targets =
        Maybe [DBProxyTarget]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDBProxyTargetsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDBProxyTargetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An arbitrary number of @DBProxyTarget@ objects, containing details of
-- the corresponding targets.
describeDBProxyTargetsResponse_targets :: Lens.Lens' DescribeDBProxyTargetsResponse (Prelude.Maybe [DBProxyTarget])
describeDBProxyTargetsResponse_targets :: (Maybe [DBProxyTarget] -> f (Maybe [DBProxyTarget]))
-> DescribeDBProxyTargetsResponse
-> f DescribeDBProxyTargetsResponse
describeDBProxyTargetsResponse_targets = (DescribeDBProxyTargetsResponse -> Maybe [DBProxyTarget])
-> (DescribeDBProxyTargetsResponse
    -> Maybe [DBProxyTarget] -> DescribeDBProxyTargetsResponse)
-> Lens' DescribeDBProxyTargetsResponse (Maybe [DBProxyTarget])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBProxyTargetsResponse' {Maybe [DBProxyTarget]
targets :: Maybe [DBProxyTarget]
$sel:targets:DescribeDBProxyTargetsResponse' :: DescribeDBProxyTargetsResponse -> Maybe [DBProxyTarget]
targets} -> Maybe [DBProxyTarget]
targets) (\s :: DescribeDBProxyTargetsResponse
s@DescribeDBProxyTargetsResponse' {} Maybe [DBProxyTarget]
a -> DescribeDBProxyTargetsResponse
s {$sel:targets:DescribeDBProxyTargetsResponse' :: Maybe [DBProxyTarget]
targets = Maybe [DBProxyTarget]
a} :: DescribeDBProxyTargetsResponse) ((Maybe [DBProxyTarget] -> f (Maybe [DBProxyTarget]))
 -> DescribeDBProxyTargetsResponse
 -> f DescribeDBProxyTargetsResponse)
-> ((Maybe [DBProxyTarget] -> f (Maybe [DBProxyTarget]))
    -> Maybe [DBProxyTarget] -> f (Maybe [DBProxyTarget]))
-> (Maybe [DBProxyTarget] -> f (Maybe [DBProxyTarget]))
-> DescribeDBProxyTargetsResponse
-> f DescribeDBProxyTargetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DBProxyTarget] [DBProxyTarget] [DBProxyTarget] [DBProxyTarget]
-> Iso
     (Maybe [DBProxyTarget])
     (Maybe [DBProxyTarget])
     (Maybe [DBProxyTarget])
     (Maybe [DBProxyTarget])
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
  [DBProxyTarget] [DBProxyTarget] [DBProxyTarget] [DBProxyTarget]
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 request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
describeDBProxyTargetsResponse_marker :: Lens.Lens' DescribeDBProxyTargetsResponse (Prelude.Maybe Prelude.Text)
describeDBProxyTargetsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDBProxyTargetsResponse
-> f DescribeDBProxyTargetsResponse
describeDBProxyTargetsResponse_marker = (DescribeDBProxyTargetsResponse -> Maybe Text)
-> (DescribeDBProxyTargetsResponse
    -> Maybe Text -> DescribeDBProxyTargetsResponse)
-> Lens' DescribeDBProxyTargetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBProxyTargetsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDBProxyTargetsResponse' :: DescribeDBProxyTargetsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDBProxyTargetsResponse
s@DescribeDBProxyTargetsResponse' {} Maybe Text
a -> DescribeDBProxyTargetsResponse
s {$sel:marker:DescribeDBProxyTargetsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeDBProxyTargetsResponse)

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

instance
  Prelude.NFData
    DescribeDBProxyTargetsResponse