{-# 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.DescribeDBParameterGroups
-- 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 a list of @DBParameterGroup@ descriptions. If a
-- @DBParameterGroupName@ is specified, the list will contain only the
-- description of the specified DB parameter group.
--
-- This operation returns paginated results.
module Amazonka.Neptune.DescribeDBParameterGroups
  ( -- * Creating a Request
    DescribeDBParameterGroups (..),
    newDescribeDBParameterGroups,

    -- * Request Lenses
    describeDBParameterGroups_filters,
    describeDBParameterGroups_dbParameterGroupName,
    describeDBParameterGroups_marker,
    describeDBParameterGroups_maxRecords,

    -- * Destructuring the Response
    DescribeDBParameterGroupsResponse (..),
    newDescribeDBParameterGroupsResponse,

    -- * Response Lenses
    describeDBParameterGroupsResponse_marker,
    describeDBParameterGroupsResponse_dbParameterGroups,
    describeDBParameterGroupsResponse_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:/ 'newDescribeDBParameterGroups' smart constructor.
data DescribeDBParameterGroups = DescribeDBParameterGroups'
  { -- | This parameter is not currently supported.
    DescribeDBParameterGroups -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The name of a specific DB parameter group to return details for.
    --
    -- Constraints:
    --
    -- -   If supplied, must match the name of an existing
    --     DBClusterParameterGroup.
    DescribeDBParameterGroups -> Maybe Text
dbParameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | An optional pagination token provided by a previous
    -- @DescribeDBParameterGroups@ request. If this parameter is specified, the
    -- response includes only records beyond the marker, up to the value
    -- specified by @MaxRecords@.
    DescribeDBParameterGroups -> 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.
    DescribeDBParameterGroups -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeDBParameterGroups -> DescribeDBParameterGroups -> Bool
(DescribeDBParameterGroups -> DescribeDBParameterGroups -> Bool)
-> (DescribeDBParameterGroups -> DescribeDBParameterGroups -> Bool)
-> Eq DescribeDBParameterGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBParameterGroups -> DescribeDBParameterGroups -> Bool
$c/= :: DescribeDBParameterGroups -> DescribeDBParameterGroups -> Bool
== :: DescribeDBParameterGroups -> DescribeDBParameterGroups -> Bool
$c== :: DescribeDBParameterGroups -> DescribeDBParameterGroups -> Bool
Prelude.Eq, ReadPrec [DescribeDBParameterGroups]
ReadPrec DescribeDBParameterGroups
Int -> ReadS DescribeDBParameterGroups
ReadS [DescribeDBParameterGroups]
(Int -> ReadS DescribeDBParameterGroups)
-> ReadS [DescribeDBParameterGroups]
-> ReadPrec DescribeDBParameterGroups
-> ReadPrec [DescribeDBParameterGroups]
-> Read DescribeDBParameterGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBParameterGroups]
$creadListPrec :: ReadPrec [DescribeDBParameterGroups]
readPrec :: ReadPrec DescribeDBParameterGroups
$creadPrec :: ReadPrec DescribeDBParameterGroups
readList :: ReadS [DescribeDBParameterGroups]
$creadList :: ReadS [DescribeDBParameterGroups]
readsPrec :: Int -> ReadS DescribeDBParameterGroups
$creadsPrec :: Int -> ReadS DescribeDBParameterGroups
Prelude.Read, Int -> DescribeDBParameterGroups -> ShowS
[DescribeDBParameterGroups] -> ShowS
DescribeDBParameterGroups -> String
(Int -> DescribeDBParameterGroups -> ShowS)
-> (DescribeDBParameterGroups -> String)
-> ([DescribeDBParameterGroups] -> ShowS)
-> Show DescribeDBParameterGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBParameterGroups] -> ShowS
$cshowList :: [DescribeDBParameterGroups] -> ShowS
show :: DescribeDBParameterGroups -> String
$cshow :: DescribeDBParameterGroups -> String
showsPrec :: Int -> DescribeDBParameterGroups -> ShowS
$cshowsPrec :: Int -> DescribeDBParameterGroups -> ShowS
Prelude.Show, (forall x.
 DescribeDBParameterGroups -> Rep DescribeDBParameterGroups x)
-> (forall x.
    Rep DescribeDBParameterGroups x -> DescribeDBParameterGroups)
-> Generic DescribeDBParameterGroups
forall x.
Rep DescribeDBParameterGroups x -> DescribeDBParameterGroups
forall x.
DescribeDBParameterGroups -> Rep DescribeDBParameterGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBParameterGroups x -> DescribeDBParameterGroups
$cfrom :: forall x.
DescribeDBParameterGroups -> Rep DescribeDBParameterGroups x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDBParameterGroups' 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', 'describeDBParameterGroups_filters' - This parameter is not currently supported.
--
-- 'dbParameterGroupName', 'describeDBParameterGroups_dbParameterGroupName' - The name of a specific DB parameter group to return details for.
--
-- Constraints:
--
-- -   If supplied, must match the name of an existing
--     DBClusterParameterGroup.
--
-- 'marker', 'describeDBParameterGroups_marker' - An optional pagination token provided by a previous
-- @DescribeDBParameterGroups@ request. If this parameter is specified, the
-- response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
--
-- 'maxRecords', 'describeDBParameterGroups_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.
newDescribeDBParameterGroups ::
  DescribeDBParameterGroups
newDescribeDBParameterGroups :: DescribeDBParameterGroups
newDescribeDBParameterGroups =
  DescribeDBParameterGroups' :: Maybe [Filter]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> DescribeDBParameterGroups
DescribeDBParameterGroups'
    { $sel:filters:DescribeDBParameterGroups' :: Maybe [Filter]
filters =
        Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:dbParameterGroupName:DescribeDBParameterGroups' :: Maybe Text
dbParameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDBParameterGroups' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeDBParameterGroups' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | This parameter is not currently supported.
describeDBParameterGroups_filters :: Lens.Lens' DescribeDBParameterGroups (Prelude.Maybe [Filter])
describeDBParameterGroups_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBParameterGroups -> f DescribeDBParameterGroups
describeDBParameterGroups_filters = (DescribeDBParameterGroups -> Maybe [Filter])
-> (DescribeDBParameterGroups
    -> Maybe [Filter] -> DescribeDBParameterGroups)
-> Lens
     DescribeDBParameterGroups
     DescribeDBParameterGroups
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameterGroups' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeDBParameterGroups' :: DescribeDBParameterGroups -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeDBParameterGroups
s@DescribeDBParameterGroups' {} Maybe [Filter]
a -> DescribeDBParameterGroups
s {$sel:filters:DescribeDBParameterGroups' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeDBParameterGroups) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeDBParameterGroups -> f DescribeDBParameterGroups)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBParameterGroups
-> f DescribeDBParameterGroups
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 name of a specific DB parameter group to return details for.
--
-- Constraints:
--
-- -   If supplied, must match the name of an existing
--     DBClusterParameterGroup.
describeDBParameterGroups_dbParameterGroupName :: Lens.Lens' DescribeDBParameterGroups (Prelude.Maybe Prelude.Text)
describeDBParameterGroups_dbParameterGroupName :: (Maybe Text -> f (Maybe Text))
-> DescribeDBParameterGroups -> f DescribeDBParameterGroups
describeDBParameterGroups_dbParameterGroupName = (DescribeDBParameterGroups -> Maybe Text)
-> (DescribeDBParameterGroups
    -> Maybe Text -> DescribeDBParameterGroups)
-> Lens
     DescribeDBParameterGroups
     DescribeDBParameterGroups
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameterGroups' {Maybe Text
dbParameterGroupName :: Maybe Text
$sel:dbParameterGroupName:DescribeDBParameterGroups' :: DescribeDBParameterGroups -> Maybe Text
dbParameterGroupName} -> Maybe Text
dbParameterGroupName) (\s :: DescribeDBParameterGroups
s@DescribeDBParameterGroups' {} Maybe Text
a -> DescribeDBParameterGroups
s {$sel:dbParameterGroupName:DescribeDBParameterGroups' :: Maybe Text
dbParameterGroupName = Maybe Text
a} :: DescribeDBParameterGroups)

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

-- | 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.
describeDBParameterGroups_maxRecords :: Lens.Lens' DescribeDBParameterGroups (Prelude.Maybe Prelude.Int)
describeDBParameterGroups_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeDBParameterGroups -> f DescribeDBParameterGroups
describeDBParameterGroups_maxRecords = (DescribeDBParameterGroups -> Maybe Int)
-> (DescribeDBParameterGroups
    -> Maybe Int -> DescribeDBParameterGroups)
-> Lens
     DescribeDBParameterGroups
     DescribeDBParameterGroups
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameterGroups' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeDBParameterGroups' :: DescribeDBParameterGroups -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeDBParameterGroups
s@DescribeDBParameterGroups' {} Maybe Int
a -> DescribeDBParameterGroups
s {$sel:maxRecords:DescribeDBParameterGroups' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeDBParameterGroups)

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

instance Prelude.NFData DescribeDBParameterGroups

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

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

instance Core.ToQuery DescribeDBParameterGroups where
  toQuery :: DescribeDBParameterGroups -> QueryString
toQuery DescribeDBParameterGroups' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
dbParameterGroupName :: Maybe Text
filters :: Maybe [Filter]
$sel:maxRecords:DescribeDBParameterGroups' :: DescribeDBParameterGroups -> Maybe Int
$sel:marker:DescribeDBParameterGroups' :: DescribeDBParameterGroups -> Maybe Text
$sel:dbParameterGroupName:DescribeDBParameterGroups' :: DescribeDBParameterGroups -> Maybe Text
$sel:filters:DescribeDBParameterGroups' :: DescribeDBParameterGroups -> 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
"DescribeDBParameterGroups" :: 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
"DBParameterGroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbParameterGroupName,
        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:/ 'newDescribeDBParameterGroupsResponse' smart constructor.
data DescribeDBParameterGroupsResponse = DescribeDBParameterGroupsResponse'
  { -- | 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@.
    DescribeDBParameterGroupsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | A list of DBParameterGroup instances.
    DescribeDBParameterGroupsResponse -> Maybe [DBParameterGroup]
dbParameterGroups :: Prelude.Maybe [DBParameterGroup],
    -- | The response's http status code.
    DescribeDBParameterGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDBParameterGroupsResponse
-> DescribeDBParameterGroupsResponse -> Bool
(DescribeDBParameterGroupsResponse
 -> DescribeDBParameterGroupsResponse -> Bool)
-> (DescribeDBParameterGroupsResponse
    -> DescribeDBParameterGroupsResponse -> Bool)
-> Eq DescribeDBParameterGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBParameterGroupsResponse
-> DescribeDBParameterGroupsResponse -> Bool
$c/= :: DescribeDBParameterGroupsResponse
-> DescribeDBParameterGroupsResponse -> Bool
== :: DescribeDBParameterGroupsResponse
-> DescribeDBParameterGroupsResponse -> Bool
$c== :: DescribeDBParameterGroupsResponse
-> DescribeDBParameterGroupsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDBParameterGroupsResponse]
ReadPrec DescribeDBParameterGroupsResponse
Int -> ReadS DescribeDBParameterGroupsResponse
ReadS [DescribeDBParameterGroupsResponse]
(Int -> ReadS DescribeDBParameterGroupsResponse)
-> ReadS [DescribeDBParameterGroupsResponse]
-> ReadPrec DescribeDBParameterGroupsResponse
-> ReadPrec [DescribeDBParameterGroupsResponse]
-> Read DescribeDBParameterGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBParameterGroupsResponse]
$creadListPrec :: ReadPrec [DescribeDBParameterGroupsResponse]
readPrec :: ReadPrec DescribeDBParameterGroupsResponse
$creadPrec :: ReadPrec DescribeDBParameterGroupsResponse
readList :: ReadS [DescribeDBParameterGroupsResponse]
$creadList :: ReadS [DescribeDBParameterGroupsResponse]
readsPrec :: Int -> ReadS DescribeDBParameterGroupsResponse
$creadsPrec :: Int -> ReadS DescribeDBParameterGroupsResponse
Prelude.Read, Int -> DescribeDBParameterGroupsResponse -> ShowS
[DescribeDBParameterGroupsResponse] -> ShowS
DescribeDBParameterGroupsResponse -> String
(Int -> DescribeDBParameterGroupsResponse -> ShowS)
-> (DescribeDBParameterGroupsResponse -> String)
-> ([DescribeDBParameterGroupsResponse] -> ShowS)
-> Show DescribeDBParameterGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBParameterGroupsResponse] -> ShowS
$cshowList :: [DescribeDBParameterGroupsResponse] -> ShowS
show :: DescribeDBParameterGroupsResponse -> String
$cshow :: DescribeDBParameterGroupsResponse -> String
showsPrec :: Int -> DescribeDBParameterGroupsResponse -> ShowS
$cshowsPrec :: Int -> DescribeDBParameterGroupsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDBParameterGroupsResponse
 -> Rep DescribeDBParameterGroupsResponse x)
-> (forall x.
    Rep DescribeDBParameterGroupsResponse x
    -> DescribeDBParameterGroupsResponse)
-> Generic DescribeDBParameterGroupsResponse
forall x.
Rep DescribeDBParameterGroupsResponse x
-> DescribeDBParameterGroupsResponse
forall x.
DescribeDBParameterGroupsResponse
-> Rep DescribeDBParameterGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBParameterGroupsResponse x
-> DescribeDBParameterGroupsResponse
$cfrom :: forall x.
DescribeDBParameterGroupsResponse
-> Rep DescribeDBParameterGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDBParameterGroupsResponse' 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:
--
-- 'marker', 'describeDBParameterGroupsResponse_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@.
--
-- 'dbParameterGroups', 'describeDBParameterGroupsResponse_dbParameterGroups' - A list of DBParameterGroup instances.
--
-- 'httpStatus', 'describeDBParameterGroupsResponse_httpStatus' - The response's http status code.
newDescribeDBParameterGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDBParameterGroupsResponse
newDescribeDBParameterGroupsResponse :: Int -> DescribeDBParameterGroupsResponse
newDescribeDBParameterGroupsResponse Int
pHttpStatus_ =
  DescribeDBParameterGroupsResponse' :: Maybe Text
-> Maybe [DBParameterGroup]
-> Int
-> DescribeDBParameterGroupsResponse
DescribeDBParameterGroupsResponse'
    { $sel:marker:DescribeDBParameterGroupsResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbParameterGroups:DescribeDBParameterGroupsResponse' :: Maybe [DBParameterGroup]
dbParameterGroups = Maybe [DBParameterGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDBParameterGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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@.
describeDBParameterGroupsResponse_marker :: Lens.Lens' DescribeDBParameterGroupsResponse (Prelude.Maybe Prelude.Text)
describeDBParameterGroupsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDBParameterGroupsResponse
-> f DescribeDBParameterGroupsResponse
describeDBParameterGroupsResponse_marker = (DescribeDBParameterGroupsResponse -> Maybe Text)
-> (DescribeDBParameterGroupsResponse
    -> Maybe Text -> DescribeDBParameterGroupsResponse)
-> Lens' DescribeDBParameterGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameterGroupsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDBParameterGroupsResponse' :: DescribeDBParameterGroupsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDBParameterGroupsResponse
s@DescribeDBParameterGroupsResponse' {} Maybe Text
a -> DescribeDBParameterGroupsResponse
s {$sel:marker:DescribeDBParameterGroupsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeDBParameterGroupsResponse)

-- | A list of DBParameterGroup instances.
describeDBParameterGroupsResponse_dbParameterGroups :: Lens.Lens' DescribeDBParameterGroupsResponse (Prelude.Maybe [DBParameterGroup])
describeDBParameterGroupsResponse_dbParameterGroups :: (Maybe [DBParameterGroup] -> f (Maybe [DBParameterGroup]))
-> DescribeDBParameterGroupsResponse
-> f DescribeDBParameterGroupsResponse
describeDBParameterGroupsResponse_dbParameterGroups = (DescribeDBParameterGroupsResponse -> Maybe [DBParameterGroup])
-> (DescribeDBParameterGroupsResponse
    -> Maybe [DBParameterGroup] -> DescribeDBParameterGroupsResponse)
-> Lens'
     DescribeDBParameterGroupsResponse (Maybe [DBParameterGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameterGroupsResponse' {Maybe [DBParameterGroup]
dbParameterGroups :: Maybe [DBParameterGroup]
$sel:dbParameterGroups:DescribeDBParameterGroupsResponse' :: DescribeDBParameterGroupsResponse -> Maybe [DBParameterGroup]
dbParameterGroups} -> Maybe [DBParameterGroup]
dbParameterGroups) (\s :: DescribeDBParameterGroupsResponse
s@DescribeDBParameterGroupsResponse' {} Maybe [DBParameterGroup]
a -> DescribeDBParameterGroupsResponse
s {$sel:dbParameterGroups:DescribeDBParameterGroupsResponse' :: Maybe [DBParameterGroup]
dbParameterGroups = Maybe [DBParameterGroup]
a} :: DescribeDBParameterGroupsResponse) ((Maybe [DBParameterGroup] -> f (Maybe [DBParameterGroup]))
 -> DescribeDBParameterGroupsResponse
 -> f DescribeDBParameterGroupsResponse)
-> ((Maybe [DBParameterGroup] -> f (Maybe [DBParameterGroup]))
    -> Maybe [DBParameterGroup] -> f (Maybe [DBParameterGroup]))
-> (Maybe [DBParameterGroup] -> f (Maybe [DBParameterGroup]))
-> DescribeDBParameterGroupsResponse
-> f DescribeDBParameterGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DBParameterGroup]
  [DBParameterGroup]
  [DBParameterGroup]
  [DBParameterGroup]
-> Iso
     (Maybe [DBParameterGroup])
     (Maybe [DBParameterGroup])
     (Maybe [DBParameterGroup])
     (Maybe [DBParameterGroup])
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
  [DBParameterGroup]
  [DBParameterGroup]
  [DBParameterGroup]
  [DBParameterGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeDBParameterGroupsResponse