{-# 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.DescribeDBParameters
-- 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 the detailed parameter list for a particular DB parameter group.
--
-- This operation returns paginated results.
module Amazonka.RDS.DescribeDBParameters
  ( -- * Creating a Request
    DescribeDBParameters (..),
    newDescribeDBParameters,

    -- * Request Lenses
    describeDBParameters_filters,
    describeDBParameters_marker,
    describeDBParameters_maxRecords,
    describeDBParameters_source,
    describeDBParameters_dbParameterGroupName,

    -- * Destructuring the Response
    DescribeDBParametersResponse (..),
    newDescribeDBParametersResponse,

    -- * Response Lenses
    describeDBParametersResponse_marker,
    describeDBParametersResponse_parameters,
    describeDBParametersResponse_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:/ 'newDescribeDBParameters' smart constructor.
data DescribeDBParameters = DescribeDBParameters'
  { -- | This parameter isn\'t currently supported.
    DescribeDBParameters -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous
    -- @DescribeDBParameters@ request. If this parameter is specified, the
    -- response includes only records beyond the marker, up to the value
    -- specified by @MaxRecords@.
    DescribeDBParameters -> 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 you can retrieve the
    -- remaining results.
    --
    -- Default: 100
    --
    -- Constraints: Minimum 20, maximum 100.
    DescribeDBParameters -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The parameter types to return.
    --
    -- Default: All parameter types returned
    --
    -- Valid Values: @user | system | engine-default@
    DescribeDBParameters -> Maybe Text
source :: Prelude.Maybe Prelude.Text,
    -- | The name of a specific DB parameter group to return details for.
    --
    -- Constraints:
    --
    -- -   If supplied, must match the name of an existing DBParameterGroup.
    DescribeDBParameters -> Text
dbParameterGroupName :: Prelude.Text
  }
  deriving (DescribeDBParameters -> DescribeDBParameters -> Bool
(DescribeDBParameters -> DescribeDBParameters -> Bool)
-> (DescribeDBParameters -> DescribeDBParameters -> Bool)
-> Eq DescribeDBParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBParameters -> DescribeDBParameters -> Bool
$c/= :: DescribeDBParameters -> DescribeDBParameters -> Bool
== :: DescribeDBParameters -> DescribeDBParameters -> Bool
$c== :: DescribeDBParameters -> DescribeDBParameters -> Bool
Prelude.Eq, ReadPrec [DescribeDBParameters]
ReadPrec DescribeDBParameters
Int -> ReadS DescribeDBParameters
ReadS [DescribeDBParameters]
(Int -> ReadS DescribeDBParameters)
-> ReadS [DescribeDBParameters]
-> ReadPrec DescribeDBParameters
-> ReadPrec [DescribeDBParameters]
-> Read DescribeDBParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBParameters]
$creadListPrec :: ReadPrec [DescribeDBParameters]
readPrec :: ReadPrec DescribeDBParameters
$creadPrec :: ReadPrec DescribeDBParameters
readList :: ReadS [DescribeDBParameters]
$creadList :: ReadS [DescribeDBParameters]
readsPrec :: Int -> ReadS DescribeDBParameters
$creadsPrec :: Int -> ReadS DescribeDBParameters
Prelude.Read, Int -> DescribeDBParameters -> ShowS
[DescribeDBParameters] -> ShowS
DescribeDBParameters -> String
(Int -> DescribeDBParameters -> ShowS)
-> (DescribeDBParameters -> String)
-> ([DescribeDBParameters] -> ShowS)
-> Show DescribeDBParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBParameters] -> ShowS
$cshowList :: [DescribeDBParameters] -> ShowS
show :: DescribeDBParameters -> String
$cshow :: DescribeDBParameters -> String
showsPrec :: Int -> DescribeDBParameters -> ShowS
$cshowsPrec :: Int -> DescribeDBParameters -> ShowS
Prelude.Show, (forall x. DescribeDBParameters -> Rep DescribeDBParameters x)
-> (forall x. Rep DescribeDBParameters x -> DescribeDBParameters)
-> Generic DescribeDBParameters
forall x. Rep DescribeDBParameters x -> DescribeDBParameters
forall x. DescribeDBParameters -> Rep DescribeDBParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDBParameters x -> DescribeDBParameters
$cfrom :: forall x. DescribeDBParameters -> Rep DescribeDBParameters x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDBParameters' 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', 'describeDBParameters_filters' - This parameter isn\'t currently supported.
--
-- 'marker', 'describeDBParameters_marker' - An optional pagination token provided by a previous
-- @DescribeDBParameters@ request. If this parameter is specified, the
-- response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
--
-- 'maxRecords', 'describeDBParameters_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 you can retrieve the
-- remaining results.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
--
-- 'source', 'describeDBParameters_source' - The parameter types to return.
--
-- Default: All parameter types returned
--
-- Valid Values: @user | system | engine-default@
--
-- 'dbParameterGroupName', 'describeDBParameters_dbParameterGroupName' - The name of a specific DB parameter group to return details for.
--
-- Constraints:
--
-- -   If supplied, must match the name of an existing DBParameterGroup.
newDescribeDBParameters ::
  -- | 'dbParameterGroupName'
  Prelude.Text ->
  DescribeDBParameters
newDescribeDBParameters :: Text -> DescribeDBParameters
newDescribeDBParameters Text
pDBParameterGroupName_ =
  DescribeDBParameters' :: Maybe [Filter]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Text
-> DescribeDBParameters
DescribeDBParameters'
    { $sel:filters:DescribeDBParameters' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeDBParameters' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeDBParameters' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:source:DescribeDBParameters' :: Maybe Text
source = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbParameterGroupName:DescribeDBParameters' :: Text
dbParameterGroupName = Text
pDBParameterGroupName_
    }

-- | This parameter isn\'t currently supported.
describeDBParameters_filters :: Lens.Lens' DescribeDBParameters (Prelude.Maybe [Filter])
describeDBParameters_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBParameters -> f DescribeDBParameters
describeDBParameters_filters = (DescribeDBParameters -> Maybe [Filter])
-> (DescribeDBParameters -> Maybe [Filter] -> DescribeDBParameters)
-> Lens
     DescribeDBParameters
     DescribeDBParameters
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameters' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeDBParameters' :: DescribeDBParameters -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeDBParameters
s@DescribeDBParameters' {} Maybe [Filter]
a -> DescribeDBParameters
s {$sel:filters:DescribeDBParameters' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeDBParameters) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeDBParameters -> f DescribeDBParameters)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBParameters
-> f DescribeDBParameters
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
-- @DescribeDBParameters@ request. If this parameter is specified, the
-- response includes only records beyond the marker, up to the value
-- specified by @MaxRecords@.
describeDBParameters_marker :: Lens.Lens' DescribeDBParameters (Prelude.Maybe Prelude.Text)
describeDBParameters_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDBParameters -> f DescribeDBParameters
describeDBParameters_marker = (DescribeDBParameters -> Maybe Text)
-> (DescribeDBParameters -> Maybe Text -> DescribeDBParameters)
-> Lens
     DescribeDBParameters DescribeDBParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameters' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDBParameters' :: DescribeDBParameters -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDBParameters
s@DescribeDBParameters' {} Maybe Text
a -> DescribeDBParameters
s {$sel:marker:DescribeDBParameters' :: Maybe Text
marker = Maybe Text
a} :: DescribeDBParameters)

-- | 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 you can retrieve the
-- remaining results.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
describeDBParameters_maxRecords :: Lens.Lens' DescribeDBParameters (Prelude.Maybe Prelude.Int)
describeDBParameters_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeDBParameters -> f DescribeDBParameters
describeDBParameters_maxRecords = (DescribeDBParameters -> Maybe Int)
-> (DescribeDBParameters -> Maybe Int -> DescribeDBParameters)
-> Lens
     DescribeDBParameters DescribeDBParameters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameters' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeDBParameters' :: DescribeDBParameters -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeDBParameters
s@DescribeDBParameters' {} Maybe Int
a -> DescribeDBParameters
s {$sel:maxRecords:DescribeDBParameters' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeDBParameters)

-- | The parameter types to return.
--
-- Default: All parameter types returned
--
-- Valid Values: @user | system | engine-default@
describeDBParameters_source :: Lens.Lens' DescribeDBParameters (Prelude.Maybe Prelude.Text)
describeDBParameters_source :: (Maybe Text -> f (Maybe Text))
-> DescribeDBParameters -> f DescribeDBParameters
describeDBParameters_source = (DescribeDBParameters -> Maybe Text)
-> (DescribeDBParameters -> Maybe Text -> DescribeDBParameters)
-> Lens
     DescribeDBParameters DescribeDBParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameters' {Maybe Text
source :: Maybe Text
$sel:source:DescribeDBParameters' :: DescribeDBParameters -> Maybe Text
source} -> Maybe Text
source) (\s :: DescribeDBParameters
s@DescribeDBParameters' {} Maybe Text
a -> DescribeDBParameters
s {$sel:source:DescribeDBParameters' :: Maybe Text
source = Maybe Text
a} :: DescribeDBParameters)

-- | The name of a specific DB parameter group to return details for.
--
-- Constraints:
--
-- -   If supplied, must match the name of an existing DBParameterGroup.
describeDBParameters_dbParameterGroupName :: Lens.Lens' DescribeDBParameters Prelude.Text
describeDBParameters_dbParameterGroupName :: (Text -> f Text) -> DescribeDBParameters -> f DescribeDBParameters
describeDBParameters_dbParameterGroupName = (DescribeDBParameters -> Text)
-> (DescribeDBParameters -> Text -> DescribeDBParameters)
-> Lens DescribeDBParameters DescribeDBParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParameters' {Text
dbParameterGroupName :: Text
$sel:dbParameterGroupName:DescribeDBParameters' :: DescribeDBParameters -> Text
dbParameterGroupName} -> Text
dbParameterGroupName) (\s :: DescribeDBParameters
s@DescribeDBParameters' {} Text
a -> DescribeDBParameters
s {$sel:dbParameterGroupName:DescribeDBParameters' :: Text
dbParameterGroupName = Text
a} :: DescribeDBParameters)

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

instance Prelude.NFData DescribeDBParameters

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

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

instance Core.ToQuery DescribeDBParameters where
  toQuery :: DescribeDBParameters -> QueryString
toQuery DescribeDBParameters' {Maybe Int
Maybe [Filter]
Maybe Text
Text
dbParameterGroupName :: Text
source :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:dbParameterGroupName:DescribeDBParameters' :: DescribeDBParameters -> Text
$sel:source:DescribeDBParameters' :: DescribeDBParameters -> Maybe Text
$sel:maxRecords:DescribeDBParameters' :: DescribeDBParameters -> Maybe Int
$sel:marker:DescribeDBParameters' :: DescribeDBParameters -> Maybe Text
$sel:filters:DescribeDBParameters' :: DescribeDBParameters -> 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
"DescribeDBParameters" :: 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 Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords,
        ByteString
"Source" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
source,
        ByteString
"DBParameterGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbParameterGroupName
      ]

-- | Contains the result of a successful invocation of the
-- @DescribeDBParameters@ action.
--
-- /See:/ 'newDescribeDBParametersResponse' smart constructor.
data DescribeDBParametersResponse = DescribeDBParametersResponse'
  { -- | 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@.
    DescribeDBParametersResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | A list of @Parameter@ values.
    DescribeDBParametersResponse -> Maybe [Parameter]
parameters :: Prelude.Maybe [Parameter],
    -- | The response's http status code.
    DescribeDBParametersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDBParametersResponse
-> DescribeDBParametersResponse -> Bool
(DescribeDBParametersResponse
 -> DescribeDBParametersResponse -> Bool)
-> (DescribeDBParametersResponse
    -> DescribeDBParametersResponse -> Bool)
-> Eq DescribeDBParametersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBParametersResponse
-> DescribeDBParametersResponse -> Bool
$c/= :: DescribeDBParametersResponse
-> DescribeDBParametersResponse -> Bool
== :: DescribeDBParametersResponse
-> DescribeDBParametersResponse -> Bool
$c== :: DescribeDBParametersResponse
-> DescribeDBParametersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDBParametersResponse]
ReadPrec DescribeDBParametersResponse
Int -> ReadS DescribeDBParametersResponse
ReadS [DescribeDBParametersResponse]
(Int -> ReadS DescribeDBParametersResponse)
-> ReadS [DescribeDBParametersResponse]
-> ReadPrec DescribeDBParametersResponse
-> ReadPrec [DescribeDBParametersResponse]
-> Read DescribeDBParametersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBParametersResponse]
$creadListPrec :: ReadPrec [DescribeDBParametersResponse]
readPrec :: ReadPrec DescribeDBParametersResponse
$creadPrec :: ReadPrec DescribeDBParametersResponse
readList :: ReadS [DescribeDBParametersResponse]
$creadList :: ReadS [DescribeDBParametersResponse]
readsPrec :: Int -> ReadS DescribeDBParametersResponse
$creadsPrec :: Int -> ReadS DescribeDBParametersResponse
Prelude.Read, Int -> DescribeDBParametersResponse -> ShowS
[DescribeDBParametersResponse] -> ShowS
DescribeDBParametersResponse -> String
(Int -> DescribeDBParametersResponse -> ShowS)
-> (DescribeDBParametersResponse -> String)
-> ([DescribeDBParametersResponse] -> ShowS)
-> Show DescribeDBParametersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBParametersResponse] -> ShowS
$cshowList :: [DescribeDBParametersResponse] -> ShowS
show :: DescribeDBParametersResponse -> String
$cshow :: DescribeDBParametersResponse -> String
showsPrec :: Int -> DescribeDBParametersResponse -> ShowS
$cshowsPrec :: Int -> DescribeDBParametersResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDBParametersResponse -> Rep DescribeDBParametersResponse x)
-> (forall x.
    Rep DescribeDBParametersResponse x -> DescribeDBParametersResponse)
-> Generic DescribeDBParametersResponse
forall x.
Rep DescribeDBParametersResponse x -> DescribeDBParametersResponse
forall x.
DescribeDBParametersResponse -> Rep DescribeDBParametersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBParametersResponse x -> DescribeDBParametersResponse
$cfrom :: forall x.
DescribeDBParametersResponse -> Rep DescribeDBParametersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDBParametersResponse' 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', 'describeDBParametersResponse_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@.
--
-- 'parameters', 'describeDBParametersResponse_parameters' - A list of @Parameter@ values.
--
-- 'httpStatus', 'describeDBParametersResponse_httpStatus' - The response's http status code.
newDescribeDBParametersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDBParametersResponse
newDescribeDBParametersResponse :: Int -> DescribeDBParametersResponse
newDescribeDBParametersResponse Int
pHttpStatus_ =
  DescribeDBParametersResponse' :: Maybe Text
-> Maybe [Parameter] -> Int -> DescribeDBParametersResponse
DescribeDBParametersResponse'
    { $sel:marker:DescribeDBParametersResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:DescribeDBParametersResponse' :: Maybe [Parameter]
parameters = Maybe [Parameter]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDBParametersResponse' :: 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@.
describeDBParametersResponse_marker :: Lens.Lens' DescribeDBParametersResponse (Prelude.Maybe Prelude.Text)
describeDBParametersResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDBParametersResponse -> f DescribeDBParametersResponse
describeDBParametersResponse_marker = (DescribeDBParametersResponse -> Maybe Text)
-> (DescribeDBParametersResponse
    -> Maybe Text -> DescribeDBParametersResponse)
-> Lens' DescribeDBParametersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBParametersResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDBParametersResponse' :: DescribeDBParametersResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDBParametersResponse
s@DescribeDBParametersResponse' {} Maybe Text
a -> DescribeDBParametersResponse
s {$sel:marker:DescribeDBParametersResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeDBParametersResponse)

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

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

instance Prelude.NFData DescribeDBParametersResponse