{-# 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 #-}
module Amazonka.MemoryDb.DescribeParameters
(
DescribeParameters (..),
newDescribeParameters,
describeParameters_nextToken,
describeParameters_maxResults,
describeParameters_parameterGroupName,
DescribeParametersResponse (..),
newDescribeParametersResponse,
describeParametersResponse_nextToken,
describeParametersResponse_parameters,
describeParametersResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeParameters = DescribeParameters'
{
DescribeParameters -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeParameters -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
DescribeParameters -> Text
parameterGroupName :: Prelude.Text
}
deriving (DescribeParameters -> DescribeParameters -> Bool
(DescribeParameters -> DescribeParameters -> Bool)
-> (DescribeParameters -> DescribeParameters -> Bool)
-> Eq DescribeParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeParameters -> DescribeParameters -> Bool
$c/= :: DescribeParameters -> DescribeParameters -> Bool
== :: DescribeParameters -> DescribeParameters -> Bool
$c== :: DescribeParameters -> DescribeParameters -> Bool
Prelude.Eq, ReadPrec [DescribeParameters]
ReadPrec DescribeParameters
Int -> ReadS DescribeParameters
ReadS [DescribeParameters]
(Int -> ReadS DescribeParameters)
-> ReadS [DescribeParameters]
-> ReadPrec DescribeParameters
-> ReadPrec [DescribeParameters]
-> Read DescribeParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeParameters]
$creadListPrec :: ReadPrec [DescribeParameters]
readPrec :: ReadPrec DescribeParameters
$creadPrec :: ReadPrec DescribeParameters
readList :: ReadS [DescribeParameters]
$creadList :: ReadS [DescribeParameters]
readsPrec :: Int -> ReadS DescribeParameters
$creadsPrec :: Int -> ReadS DescribeParameters
Prelude.Read, Int -> DescribeParameters -> ShowS
[DescribeParameters] -> ShowS
DescribeParameters -> String
(Int -> DescribeParameters -> ShowS)
-> (DescribeParameters -> String)
-> ([DescribeParameters] -> ShowS)
-> Show DescribeParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeParameters] -> ShowS
$cshowList :: [DescribeParameters] -> ShowS
show :: DescribeParameters -> String
$cshow :: DescribeParameters -> String
showsPrec :: Int -> DescribeParameters -> ShowS
$cshowsPrec :: Int -> DescribeParameters -> ShowS
Prelude.Show, (forall x. DescribeParameters -> Rep DescribeParameters x)
-> (forall x. Rep DescribeParameters x -> DescribeParameters)
-> Generic DescribeParameters
forall x. Rep DescribeParameters x -> DescribeParameters
forall x. DescribeParameters -> Rep DescribeParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeParameters x -> DescribeParameters
$cfrom :: forall x. DescribeParameters -> Rep DescribeParameters x
Prelude.Generic)
newDescribeParameters ::
Prelude.Text ->
DescribeParameters
newDescribeParameters :: Text -> DescribeParameters
newDescribeParameters Text
pParameterGroupName_ =
DescribeParameters' :: Maybe Text -> Maybe Int -> Text -> DescribeParameters
DescribeParameters'
{ $sel:nextToken:DescribeParameters' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:DescribeParameters' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:parameterGroupName:DescribeParameters' :: Text
parameterGroupName = Text
pParameterGroupName_
}
describeParameters_nextToken :: Lens.Lens' DescribeParameters (Prelude.Maybe Prelude.Text)
describeParameters_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeParameters -> f DescribeParameters
describeParameters_nextToken = (DescribeParameters -> Maybe Text)
-> (DescribeParameters -> Maybe Text -> DescribeParameters)
-> Lens
DescribeParameters DescribeParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameters' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeParameters' :: DescribeParameters -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeParameters
s@DescribeParameters' {} Maybe Text
a -> DescribeParameters
s {$sel:nextToken:DescribeParameters' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeParameters)
describeParameters_maxResults :: Lens.Lens' DescribeParameters (Prelude.Maybe Prelude.Int)
describeParameters_maxResults :: (Maybe Int -> f (Maybe Int))
-> DescribeParameters -> f DescribeParameters
describeParameters_maxResults = (DescribeParameters -> Maybe Int)
-> (DescribeParameters -> Maybe Int -> DescribeParameters)
-> Lens
DescribeParameters DescribeParameters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameters' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeParameters' :: DescribeParameters -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeParameters
s@DescribeParameters' {} Maybe Int
a -> DescribeParameters
s {$sel:maxResults:DescribeParameters' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeParameters)
describeParameters_parameterGroupName :: Lens.Lens' DescribeParameters Prelude.Text
describeParameters_parameterGroupName :: (Text -> f Text) -> DescribeParameters -> f DescribeParameters
describeParameters_parameterGroupName = (DescribeParameters -> Text)
-> (DescribeParameters -> Text -> DescribeParameters)
-> Lens DescribeParameters DescribeParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameters' {Text
parameterGroupName :: Text
$sel:parameterGroupName:DescribeParameters' :: DescribeParameters -> Text
parameterGroupName} -> Text
parameterGroupName) (\s :: DescribeParameters
s@DescribeParameters' {} Text
a -> DescribeParameters
s {$sel:parameterGroupName:DescribeParameters' :: Text
parameterGroupName = Text
a} :: DescribeParameters)
instance Core.AWSRequest DescribeParameters where
type
AWSResponse DescribeParameters =
DescribeParametersResponse
request :: DescribeParameters -> Request DescribeParameters
request = Service -> DescribeParameters -> Request DescribeParameters
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeParameters
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeParameters)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeParameters))
-> Logger
-> Service
-> Proxy DescribeParameters
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeParameters)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [Parameter] -> Int -> DescribeParametersResponse
DescribeParametersResponse'
(Maybe Text
-> Maybe [Parameter] -> Int -> DescribeParametersResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [Parameter] -> Int -> DescribeParametersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
Either
String (Maybe [Parameter] -> Int -> DescribeParametersResponse)
-> Either String (Maybe [Parameter])
-> Either String (Int -> DescribeParametersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Parameter]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Parameters" Either String (Maybe (Maybe [Parameter]))
-> Maybe [Parameter] -> Either String (Maybe [Parameter])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Parameter]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DescribeParametersResponse)
-> Either String Int -> Either String DescribeParametersResponse
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 DescribeParameters
instance Prelude.NFData DescribeParameters
instance Core.ToHeaders DescribeParameters where
toHeaders :: DescribeParameters -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeParameters -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonMemoryDB.DescribeParameters" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeParameters where
toJSON :: DescribeParameters -> Value
toJSON DescribeParameters' {Maybe Int
Maybe Text
Text
parameterGroupName :: Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:parameterGroupName:DescribeParameters' :: DescribeParameters -> Text
$sel:maxResults:DescribeParameters' :: DescribeParameters -> Maybe Int
$sel:nextToken:DescribeParameters' :: DescribeParameters -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Text
"MaxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ParameterGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
parameterGroupName)
]
)
instance Core.ToPath DescribeParameters where
toPath :: DescribeParameters -> ByteString
toPath = ByteString -> DescribeParameters -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeParameters where
toQuery :: DescribeParameters -> QueryString
toQuery = QueryString -> DescribeParameters -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeParametersResponse = DescribeParametersResponse'
{
DescribeParametersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeParametersResponse -> Maybe [Parameter]
parameters :: Prelude.Maybe [Parameter],
DescribeParametersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeParametersResponse -> DescribeParametersResponse -> Bool
(DescribeParametersResponse -> DescribeParametersResponse -> Bool)
-> (DescribeParametersResponse
-> DescribeParametersResponse -> Bool)
-> Eq DescribeParametersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeParametersResponse -> DescribeParametersResponse -> Bool
$c/= :: DescribeParametersResponse -> DescribeParametersResponse -> Bool
== :: DescribeParametersResponse -> DescribeParametersResponse -> Bool
$c== :: DescribeParametersResponse -> DescribeParametersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeParametersResponse]
ReadPrec DescribeParametersResponse
Int -> ReadS DescribeParametersResponse
ReadS [DescribeParametersResponse]
(Int -> ReadS DescribeParametersResponse)
-> ReadS [DescribeParametersResponse]
-> ReadPrec DescribeParametersResponse
-> ReadPrec [DescribeParametersResponse]
-> Read DescribeParametersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeParametersResponse]
$creadListPrec :: ReadPrec [DescribeParametersResponse]
readPrec :: ReadPrec DescribeParametersResponse
$creadPrec :: ReadPrec DescribeParametersResponse
readList :: ReadS [DescribeParametersResponse]
$creadList :: ReadS [DescribeParametersResponse]
readsPrec :: Int -> ReadS DescribeParametersResponse
$creadsPrec :: Int -> ReadS DescribeParametersResponse
Prelude.Read, Int -> DescribeParametersResponse -> ShowS
[DescribeParametersResponse] -> ShowS
DescribeParametersResponse -> String
(Int -> DescribeParametersResponse -> ShowS)
-> (DescribeParametersResponse -> String)
-> ([DescribeParametersResponse] -> ShowS)
-> Show DescribeParametersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeParametersResponse] -> ShowS
$cshowList :: [DescribeParametersResponse] -> ShowS
show :: DescribeParametersResponse -> String
$cshow :: DescribeParametersResponse -> String
showsPrec :: Int -> DescribeParametersResponse -> ShowS
$cshowsPrec :: Int -> DescribeParametersResponse -> ShowS
Prelude.Show, (forall x.
DescribeParametersResponse -> Rep DescribeParametersResponse x)
-> (forall x.
Rep DescribeParametersResponse x -> DescribeParametersResponse)
-> Generic DescribeParametersResponse
forall x.
Rep DescribeParametersResponse x -> DescribeParametersResponse
forall x.
DescribeParametersResponse -> Rep DescribeParametersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeParametersResponse x -> DescribeParametersResponse
$cfrom :: forall x.
DescribeParametersResponse -> Rep DescribeParametersResponse x
Prelude.Generic)
newDescribeParametersResponse ::
Prelude.Int ->
DescribeParametersResponse
newDescribeParametersResponse :: Int -> DescribeParametersResponse
newDescribeParametersResponse Int
pHttpStatus_ =
DescribeParametersResponse' :: Maybe Text
-> Maybe [Parameter] -> Int -> DescribeParametersResponse
DescribeParametersResponse'
{ $sel:nextToken:DescribeParametersResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parameters:DescribeParametersResponse' :: Maybe [Parameter]
parameters = Maybe [Parameter]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeParametersResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeParametersResponse_nextToken :: Lens.Lens' DescribeParametersResponse (Prelude.Maybe Prelude.Text)
describeParametersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeParametersResponse -> f DescribeParametersResponse
describeParametersResponse_nextToken = (DescribeParametersResponse -> Maybe Text)
-> (DescribeParametersResponse
-> Maybe Text -> DescribeParametersResponse)
-> Lens
DescribeParametersResponse
DescribeParametersResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParametersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeParametersResponse' :: DescribeParametersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeParametersResponse
s@DescribeParametersResponse' {} Maybe Text
a -> DescribeParametersResponse
s {$sel:nextToken:DescribeParametersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeParametersResponse)
describeParametersResponse_parameters :: Lens.Lens' DescribeParametersResponse (Prelude.Maybe [Parameter])
describeParametersResponse_parameters :: (Maybe [Parameter] -> f (Maybe [Parameter]))
-> DescribeParametersResponse -> f DescribeParametersResponse
describeParametersResponse_parameters = (DescribeParametersResponse -> Maybe [Parameter])
-> (DescribeParametersResponse
-> Maybe [Parameter] -> DescribeParametersResponse)
-> Lens
DescribeParametersResponse
DescribeParametersResponse
(Maybe [Parameter])
(Maybe [Parameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParametersResponse' {Maybe [Parameter]
parameters :: Maybe [Parameter]
$sel:parameters:DescribeParametersResponse' :: DescribeParametersResponse -> Maybe [Parameter]
parameters} -> Maybe [Parameter]
parameters) (\s :: DescribeParametersResponse
s@DescribeParametersResponse' {} Maybe [Parameter]
a -> DescribeParametersResponse
s {$sel:parameters:DescribeParametersResponse' :: Maybe [Parameter]
parameters = Maybe [Parameter]
a} :: DescribeParametersResponse) ((Maybe [Parameter] -> f (Maybe [Parameter]))
-> DescribeParametersResponse -> f DescribeParametersResponse)
-> ((Maybe [Parameter] -> f (Maybe [Parameter]))
-> Maybe [Parameter] -> f (Maybe [Parameter]))
-> (Maybe [Parameter] -> f (Maybe [Parameter]))
-> DescribeParametersResponse
-> f DescribeParametersResponse
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
describeParametersResponse_httpStatus :: Lens.Lens' DescribeParametersResponse Prelude.Int
describeParametersResponse_httpStatus :: (Int -> f Int)
-> DescribeParametersResponse -> f DescribeParametersResponse
describeParametersResponse_httpStatus = (DescribeParametersResponse -> Int)
-> (DescribeParametersResponse
-> Int -> DescribeParametersResponse)
-> Lens
DescribeParametersResponse DescribeParametersResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParametersResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeParametersResponse' :: DescribeParametersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeParametersResponse
s@DescribeParametersResponse' {} Int
a -> DescribeParametersResponse
s {$sel:httpStatus:DescribeParametersResponse' :: Int
httpStatus = Int
a} :: DescribeParametersResponse)
instance Prelude.NFData DescribeParametersResponse