{-# 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.ElastiCache.DescribeCacheParameters
-- 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 cache parameter
-- group.
--
-- This operation returns paginated results.
module Amazonka.ElastiCache.DescribeCacheParameters
  ( -- * Creating a Request
    DescribeCacheParameters (..),
    newDescribeCacheParameters,

    -- * Request Lenses
    describeCacheParameters_marker,
    describeCacheParameters_maxRecords,
    describeCacheParameters_source,
    describeCacheParameters_cacheParameterGroupName,

    -- * Destructuring the Response
    DescribeCacheParametersResponse (..),
    newDescribeCacheParametersResponse,

    -- * Response Lenses
    describeCacheParametersResponse_cacheNodeTypeSpecificParameters,
    describeCacheParametersResponse_marker,
    describeCacheParametersResponse_parameters,
    describeCacheParametersResponse_httpStatus,
  )
where

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

-- | Represents the input of a @DescribeCacheParameters@ operation.
--
-- /See:/ 'newDescribeCacheParameters' smart constructor.
data DescribeCacheParameters = DescribeCacheParameters'
  { -- | An optional marker returned from a prior request. Use this marker for
    -- pagination of results from this operation. If this parameter is
    -- specified, the response includes only records beyond the marker, up to
    -- the value specified by @MaxRecords@.
    DescribeCacheParameters -> 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 marker is
    -- included in the response so that the remaining results can be retrieved.
    --
    -- Default: 100
    --
    -- Constraints: minimum 20; maximum 100.
    DescribeCacheParameters -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The parameter types to return.
    --
    -- Valid values: @user@ | @system@ | @engine-default@
    DescribeCacheParameters -> Maybe Text
source :: Prelude.Maybe Prelude.Text,
    -- | The name of a specific cache parameter group to return details for.
    DescribeCacheParameters -> Text
cacheParameterGroupName :: Prelude.Text
  }
  deriving (DescribeCacheParameters -> DescribeCacheParameters -> Bool
(DescribeCacheParameters -> DescribeCacheParameters -> Bool)
-> (DescribeCacheParameters -> DescribeCacheParameters -> Bool)
-> Eq DescribeCacheParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCacheParameters -> DescribeCacheParameters -> Bool
$c/= :: DescribeCacheParameters -> DescribeCacheParameters -> Bool
== :: DescribeCacheParameters -> DescribeCacheParameters -> Bool
$c== :: DescribeCacheParameters -> DescribeCacheParameters -> Bool
Prelude.Eq, ReadPrec [DescribeCacheParameters]
ReadPrec DescribeCacheParameters
Int -> ReadS DescribeCacheParameters
ReadS [DescribeCacheParameters]
(Int -> ReadS DescribeCacheParameters)
-> ReadS [DescribeCacheParameters]
-> ReadPrec DescribeCacheParameters
-> ReadPrec [DescribeCacheParameters]
-> Read DescribeCacheParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCacheParameters]
$creadListPrec :: ReadPrec [DescribeCacheParameters]
readPrec :: ReadPrec DescribeCacheParameters
$creadPrec :: ReadPrec DescribeCacheParameters
readList :: ReadS [DescribeCacheParameters]
$creadList :: ReadS [DescribeCacheParameters]
readsPrec :: Int -> ReadS DescribeCacheParameters
$creadsPrec :: Int -> ReadS DescribeCacheParameters
Prelude.Read, Int -> DescribeCacheParameters -> ShowS
[DescribeCacheParameters] -> ShowS
DescribeCacheParameters -> String
(Int -> DescribeCacheParameters -> ShowS)
-> (DescribeCacheParameters -> String)
-> ([DescribeCacheParameters] -> ShowS)
-> Show DescribeCacheParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCacheParameters] -> ShowS
$cshowList :: [DescribeCacheParameters] -> ShowS
show :: DescribeCacheParameters -> String
$cshow :: DescribeCacheParameters -> String
showsPrec :: Int -> DescribeCacheParameters -> ShowS
$cshowsPrec :: Int -> DescribeCacheParameters -> ShowS
Prelude.Show, (forall x.
 DescribeCacheParameters -> Rep DescribeCacheParameters x)
-> (forall x.
    Rep DescribeCacheParameters x -> DescribeCacheParameters)
-> Generic DescribeCacheParameters
forall x. Rep DescribeCacheParameters x -> DescribeCacheParameters
forall x. DescribeCacheParameters -> Rep DescribeCacheParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCacheParameters x -> DescribeCacheParameters
$cfrom :: forall x. DescribeCacheParameters -> Rep DescribeCacheParameters x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCacheParameters' 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', 'describeCacheParameters_marker' - An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by @MaxRecords@.
--
-- 'maxRecords', 'describeCacheParameters_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a marker is
-- included in the response so that the remaining results can be retrieved.
--
-- Default: 100
--
-- Constraints: minimum 20; maximum 100.
--
-- 'source', 'describeCacheParameters_source' - The parameter types to return.
--
-- Valid values: @user@ | @system@ | @engine-default@
--
-- 'cacheParameterGroupName', 'describeCacheParameters_cacheParameterGroupName' - The name of a specific cache parameter group to return details for.
newDescribeCacheParameters ::
  -- | 'cacheParameterGroupName'
  Prelude.Text ->
  DescribeCacheParameters
newDescribeCacheParameters :: Text -> DescribeCacheParameters
newDescribeCacheParameters Text
pCacheParameterGroupName_ =
  DescribeCacheParameters' :: Maybe Text
-> Maybe Int -> Maybe Text -> Text -> DescribeCacheParameters
DescribeCacheParameters'
    { $sel:marker:DescribeCacheParameters' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeCacheParameters' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:source:DescribeCacheParameters' :: Maybe Text
source = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheParameterGroupName:DescribeCacheParameters' :: Text
cacheParameterGroupName =
        Text
pCacheParameterGroupName_
    }

-- | An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by @MaxRecords@.
describeCacheParameters_marker :: Lens.Lens' DescribeCacheParameters (Prelude.Maybe Prelude.Text)
describeCacheParameters_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeCacheParameters -> f DescribeCacheParameters
describeCacheParameters_marker = (DescribeCacheParameters -> Maybe Text)
-> (DescribeCacheParameters
    -> Maybe Text -> DescribeCacheParameters)
-> Lens
     DescribeCacheParameters
     DescribeCacheParameters
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheParameters' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeCacheParameters' :: DescribeCacheParameters -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeCacheParameters
s@DescribeCacheParameters' {} Maybe Text
a -> DescribeCacheParameters
s {$sel:marker:DescribeCacheParameters' :: Maybe Text
marker = Maybe Text
a} :: DescribeCacheParameters)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a marker is
-- included in the response so that the remaining results can be retrieved.
--
-- Default: 100
--
-- Constraints: minimum 20; maximum 100.
describeCacheParameters_maxRecords :: Lens.Lens' DescribeCacheParameters (Prelude.Maybe Prelude.Int)
describeCacheParameters_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeCacheParameters -> f DescribeCacheParameters
describeCacheParameters_maxRecords = (DescribeCacheParameters -> Maybe Int)
-> (DescribeCacheParameters
    -> Maybe Int -> DescribeCacheParameters)
-> Lens
     DescribeCacheParameters
     DescribeCacheParameters
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheParameters' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeCacheParameters' :: DescribeCacheParameters -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeCacheParameters
s@DescribeCacheParameters' {} Maybe Int
a -> DescribeCacheParameters
s {$sel:maxRecords:DescribeCacheParameters' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeCacheParameters)

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

-- | The name of a specific cache parameter group to return details for.
describeCacheParameters_cacheParameterGroupName :: Lens.Lens' DescribeCacheParameters Prelude.Text
describeCacheParameters_cacheParameterGroupName :: (Text -> f Text)
-> DescribeCacheParameters -> f DescribeCacheParameters
describeCacheParameters_cacheParameterGroupName = (DescribeCacheParameters -> Text)
-> (DescribeCacheParameters -> Text -> DescribeCacheParameters)
-> Lens DescribeCacheParameters DescribeCacheParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheParameters' {Text
cacheParameterGroupName :: Text
$sel:cacheParameterGroupName:DescribeCacheParameters' :: DescribeCacheParameters -> Text
cacheParameterGroupName} -> Text
cacheParameterGroupName) (\s :: DescribeCacheParameters
s@DescribeCacheParameters' {} Text
a -> DescribeCacheParameters
s {$sel:cacheParameterGroupName:DescribeCacheParameters' :: Text
cacheParameterGroupName = Text
a} :: DescribeCacheParameters)

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

instance Prelude.NFData DescribeCacheParameters

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

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

instance Core.ToQuery DescribeCacheParameters where
  toQuery :: DescribeCacheParameters -> QueryString
toQuery DescribeCacheParameters' {Maybe Int
Maybe Text
Text
cacheParameterGroupName :: Text
source :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
$sel:cacheParameterGroupName:DescribeCacheParameters' :: DescribeCacheParameters -> Text
$sel:source:DescribeCacheParameters' :: DescribeCacheParameters -> Maybe Text
$sel:maxRecords:DescribeCacheParameters' :: DescribeCacheParameters -> Maybe Int
$sel:marker:DescribeCacheParameters' :: DescribeCacheParameters -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeCacheParameters" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        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
"CacheParameterGroupName"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
cacheParameterGroupName
      ]

-- | Represents the output of a @DescribeCacheParameters@ operation.
--
-- /See:/ 'newDescribeCacheParametersResponse' smart constructor.
data DescribeCacheParametersResponse = DescribeCacheParametersResponse'
  { -- | A list of parameters specific to a particular cache node type. Each
    -- element in the list contains detailed information about one parameter.
    DescribeCacheParametersResponse
-> Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters :: Prelude.Maybe [CacheNodeTypeSpecificParameter],
    -- | Provides an identifier to allow retrieval of paginated results.
    DescribeCacheParametersResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | A list of Parameter instances.
    DescribeCacheParametersResponse -> Maybe [Parameter]
parameters :: Prelude.Maybe [Parameter],
    -- | The response's http status code.
    DescribeCacheParametersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCacheParametersResponse
-> DescribeCacheParametersResponse -> Bool
(DescribeCacheParametersResponse
 -> DescribeCacheParametersResponse -> Bool)
-> (DescribeCacheParametersResponse
    -> DescribeCacheParametersResponse -> Bool)
-> Eq DescribeCacheParametersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCacheParametersResponse
-> DescribeCacheParametersResponse -> Bool
$c/= :: DescribeCacheParametersResponse
-> DescribeCacheParametersResponse -> Bool
== :: DescribeCacheParametersResponse
-> DescribeCacheParametersResponse -> Bool
$c== :: DescribeCacheParametersResponse
-> DescribeCacheParametersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCacheParametersResponse]
ReadPrec DescribeCacheParametersResponse
Int -> ReadS DescribeCacheParametersResponse
ReadS [DescribeCacheParametersResponse]
(Int -> ReadS DescribeCacheParametersResponse)
-> ReadS [DescribeCacheParametersResponse]
-> ReadPrec DescribeCacheParametersResponse
-> ReadPrec [DescribeCacheParametersResponse]
-> Read DescribeCacheParametersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCacheParametersResponse]
$creadListPrec :: ReadPrec [DescribeCacheParametersResponse]
readPrec :: ReadPrec DescribeCacheParametersResponse
$creadPrec :: ReadPrec DescribeCacheParametersResponse
readList :: ReadS [DescribeCacheParametersResponse]
$creadList :: ReadS [DescribeCacheParametersResponse]
readsPrec :: Int -> ReadS DescribeCacheParametersResponse
$creadsPrec :: Int -> ReadS DescribeCacheParametersResponse
Prelude.Read, Int -> DescribeCacheParametersResponse -> ShowS
[DescribeCacheParametersResponse] -> ShowS
DescribeCacheParametersResponse -> String
(Int -> DescribeCacheParametersResponse -> ShowS)
-> (DescribeCacheParametersResponse -> String)
-> ([DescribeCacheParametersResponse] -> ShowS)
-> Show DescribeCacheParametersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCacheParametersResponse] -> ShowS
$cshowList :: [DescribeCacheParametersResponse] -> ShowS
show :: DescribeCacheParametersResponse -> String
$cshow :: DescribeCacheParametersResponse -> String
showsPrec :: Int -> DescribeCacheParametersResponse -> ShowS
$cshowsPrec :: Int -> DescribeCacheParametersResponse -> ShowS
Prelude.Show, (forall x.
 DescribeCacheParametersResponse
 -> Rep DescribeCacheParametersResponse x)
-> (forall x.
    Rep DescribeCacheParametersResponse x
    -> DescribeCacheParametersResponse)
-> Generic DescribeCacheParametersResponse
forall x.
Rep DescribeCacheParametersResponse x
-> DescribeCacheParametersResponse
forall x.
DescribeCacheParametersResponse
-> Rep DescribeCacheParametersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCacheParametersResponse x
-> DescribeCacheParametersResponse
$cfrom :: forall x.
DescribeCacheParametersResponse
-> Rep DescribeCacheParametersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCacheParametersResponse' 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:
--
-- 'cacheNodeTypeSpecificParameters', 'describeCacheParametersResponse_cacheNodeTypeSpecificParameters' - A list of parameters specific to a particular cache node type. Each
-- element in the list contains detailed information about one parameter.
--
-- 'marker', 'describeCacheParametersResponse_marker' - Provides an identifier to allow retrieval of paginated results.
--
-- 'parameters', 'describeCacheParametersResponse_parameters' - A list of Parameter instances.
--
-- 'httpStatus', 'describeCacheParametersResponse_httpStatus' - The response's http status code.
newDescribeCacheParametersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCacheParametersResponse
newDescribeCacheParametersResponse :: Int -> DescribeCacheParametersResponse
newDescribeCacheParametersResponse Int
pHttpStatus_ =
  DescribeCacheParametersResponse' :: Maybe [CacheNodeTypeSpecificParameter]
-> Maybe Text
-> Maybe [Parameter]
-> Int
-> DescribeCacheParametersResponse
DescribeCacheParametersResponse'
    { $sel:cacheNodeTypeSpecificParameters:DescribeCacheParametersResponse' :: Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters =
        Maybe [CacheNodeTypeSpecificParameter]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeCacheParametersResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:DescribeCacheParametersResponse' :: Maybe [Parameter]
parameters = Maybe [Parameter]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCacheParametersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of parameters specific to a particular cache node type. Each
-- element in the list contains detailed information about one parameter.
describeCacheParametersResponse_cacheNodeTypeSpecificParameters :: Lens.Lens' DescribeCacheParametersResponse (Prelude.Maybe [CacheNodeTypeSpecificParameter])
describeCacheParametersResponse_cacheNodeTypeSpecificParameters :: (Maybe [CacheNodeTypeSpecificParameter]
 -> f (Maybe [CacheNodeTypeSpecificParameter]))
-> DescribeCacheParametersResponse
-> f DescribeCacheParametersResponse
describeCacheParametersResponse_cacheNodeTypeSpecificParameters = (DescribeCacheParametersResponse
 -> Maybe [CacheNodeTypeSpecificParameter])
-> (DescribeCacheParametersResponse
    -> Maybe [CacheNodeTypeSpecificParameter]
    -> DescribeCacheParametersResponse)
-> Lens
     DescribeCacheParametersResponse
     DescribeCacheParametersResponse
     (Maybe [CacheNodeTypeSpecificParameter])
     (Maybe [CacheNodeTypeSpecificParameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheParametersResponse' {Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters :: Maybe [CacheNodeTypeSpecificParameter]
$sel:cacheNodeTypeSpecificParameters:DescribeCacheParametersResponse' :: DescribeCacheParametersResponse
-> Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters} -> Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters) (\s :: DescribeCacheParametersResponse
s@DescribeCacheParametersResponse' {} Maybe [CacheNodeTypeSpecificParameter]
a -> DescribeCacheParametersResponse
s {$sel:cacheNodeTypeSpecificParameters:DescribeCacheParametersResponse' :: Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters = Maybe [CacheNodeTypeSpecificParameter]
a} :: DescribeCacheParametersResponse) ((Maybe [CacheNodeTypeSpecificParameter]
  -> f (Maybe [CacheNodeTypeSpecificParameter]))
 -> DescribeCacheParametersResponse
 -> f DescribeCacheParametersResponse)
-> ((Maybe [CacheNodeTypeSpecificParameter]
     -> f (Maybe [CacheNodeTypeSpecificParameter]))
    -> Maybe [CacheNodeTypeSpecificParameter]
    -> f (Maybe [CacheNodeTypeSpecificParameter]))
-> (Maybe [CacheNodeTypeSpecificParameter]
    -> f (Maybe [CacheNodeTypeSpecificParameter]))
-> DescribeCacheParametersResponse
-> f DescribeCacheParametersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CacheNodeTypeSpecificParameter]
  [CacheNodeTypeSpecificParameter]
  [CacheNodeTypeSpecificParameter]
  [CacheNodeTypeSpecificParameter]
-> Iso
     (Maybe [CacheNodeTypeSpecificParameter])
     (Maybe [CacheNodeTypeSpecificParameter])
     (Maybe [CacheNodeTypeSpecificParameter])
     (Maybe [CacheNodeTypeSpecificParameter])
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
  [CacheNodeTypeSpecificParameter]
  [CacheNodeTypeSpecificParameter]
  [CacheNodeTypeSpecificParameter]
  [CacheNodeTypeSpecificParameter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Provides an identifier to allow retrieval of paginated results.
describeCacheParametersResponse_marker :: Lens.Lens' DescribeCacheParametersResponse (Prelude.Maybe Prelude.Text)
describeCacheParametersResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeCacheParametersResponse
-> f DescribeCacheParametersResponse
describeCacheParametersResponse_marker = (DescribeCacheParametersResponse -> Maybe Text)
-> (DescribeCacheParametersResponse
    -> Maybe Text -> DescribeCacheParametersResponse)
-> Lens' DescribeCacheParametersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheParametersResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeCacheParametersResponse' :: DescribeCacheParametersResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeCacheParametersResponse
s@DescribeCacheParametersResponse' {} Maybe Text
a -> DescribeCacheParametersResponse
s {$sel:marker:DescribeCacheParametersResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeCacheParametersResponse)

-- | A list of Parameter instances.
describeCacheParametersResponse_parameters :: Lens.Lens' DescribeCacheParametersResponse (Prelude.Maybe [Parameter])
describeCacheParametersResponse_parameters :: (Maybe [Parameter] -> f (Maybe [Parameter]))
-> DescribeCacheParametersResponse
-> f DescribeCacheParametersResponse
describeCacheParametersResponse_parameters = (DescribeCacheParametersResponse -> Maybe [Parameter])
-> (DescribeCacheParametersResponse
    -> Maybe [Parameter] -> DescribeCacheParametersResponse)
-> Lens' DescribeCacheParametersResponse (Maybe [Parameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheParametersResponse' {Maybe [Parameter]
parameters :: Maybe [Parameter]
$sel:parameters:DescribeCacheParametersResponse' :: DescribeCacheParametersResponse -> Maybe [Parameter]
parameters} -> Maybe [Parameter]
parameters) (\s :: DescribeCacheParametersResponse
s@DescribeCacheParametersResponse' {} Maybe [Parameter]
a -> DescribeCacheParametersResponse
s {$sel:parameters:DescribeCacheParametersResponse' :: Maybe [Parameter]
parameters = Maybe [Parameter]
a} :: DescribeCacheParametersResponse) ((Maybe [Parameter] -> f (Maybe [Parameter]))
 -> DescribeCacheParametersResponse
 -> f DescribeCacheParametersResponse)
-> ((Maybe [Parameter] -> f (Maybe [Parameter]))
    -> Maybe [Parameter] -> f (Maybe [Parameter]))
-> (Maybe [Parameter] -> f (Maybe [Parameter]))
-> DescribeCacheParametersResponse
-> f DescribeCacheParametersResponse
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.
describeCacheParametersResponse_httpStatus :: Lens.Lens' DescribeCacheParametersResponse Prelude.Int
describeCacheParametersResponse_httpStatus :: (Int -> f Int)
-> DescribeCacheParametersResponse
-> f DescribeCacheParametersResponse
describeCacheParametersResponse_httpStatus = (DescribeCacheParametersResponse -> Int)
-> (DescribeCacheParametersResponse
    -> Int -> DescribeCacheParametersResponse)
-> Lens
     DescribeCacheParametersResponse
     DescribeCacheParametersResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCacheParametersResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeCacheParametersResponse' :: DescribeCacheParametersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeCacheParametersResponse
s@DescribeCacheParametersResponse' {} Int
a -> DescribeCacheParametersResponse
s {$sel:httpStatus:DescribeCacheParametersResponse' :: Int
httpStatus = Int
a} :: DescribeCacheParametersResponse)

instance
  Prelude.NFData
    DescribeCacheParametersResponse