{-# 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.DescribeParameterGroups
(
DescribeParameterGroups (..),
newDescribeParameterGroups,
describeParameterGroups_maxResults,
describeParameterGroups_nextToken,
describeParameterGroups_parameterGroupName,
DescribeParameterGroupsResponse (..),
newDescribeParameterGroupsResponse,
describeParameterGroupsResponse_nextToken,
describeParameterGroupsResponse_parameterGroups,
describeParameterGroupsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MemoryDb.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeParameterGroups = DescribeParameterGroups'
{
DescribeParameterGroups -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
DescribeParameterGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeParameterGroups -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text
}
deriving (DescribeParameterGroups -> DescribeParameterGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeParameterGroups -> DescribeParameterGroups -> Bool
$c/= :: DescribeParameterGroups -> DescribeParameterGroups -> Bool
== :: DescribeParameterGroups -> DescribeParameterGroups -> Bool
$c== :: DescribeParameterGroups -> DescribeParameterGroups -> Bool
Prelude.Eq, ReadPrec [DescribeParameterGroups]
ReadPrec DescribeParameterGroups
Int -> ReadS DescribeParameterGroups
ReadS [DescribeParameterGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeParameterGroups]
$creadListPrec :: ReadPrec [DescribeParameterGroups]
readPrec :: ReadPrec DescribeParameterGroups
$creadPrec :: ReadPrec DescribeParameterGroups
readList :: ReadS [DescribeParameterGroups]
$creadList :: ReadS [DescribeParameterGroups]
readsPrec :: Int -> ReadS DescribeParameterGroups
$creadsPrec :: Int -> ReadS DescribeParameterGroups
Prelude.Read, Int -> DescribeParameterGroups -> ShowS
[DescribeParameterGroups] -> ShowS
DescribeParameterGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeParameterGroups] -> ShowS
$cshowList :: [DescribeParameterGroups] -> ShowS
show :: DescribeParameterGroups -> String
$cshow :: DescribeParameterGroups -> String
showsPrec :: Int -> DescribeParameterGroups -> ShowS
$cshowsPrec :: Int -> DescribeParameterGroups -> ShowS
Prelude.Show, forall x. Rep DescribeParameterGroups x -> DescribeParameterGroups
forall x. DescribeParameterGroups -> Rep DescribeParameterGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeParameterGroups x -> DescribeParameterGroups
$cfrom :: forall x. DescribeParameterGroups -> Rep DescribeParameterGroups x
Prelude.Generic)
newDescribeParameterGroups ::
DescribeParameterGroups
newDescribeParameterGroups :: DescribeParameterGroups
newDescribeParameterGroups =
DescribeParameterGroups'
{ $sel:maxResults:DescribeParameterGroups' :: Maybe Int
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:DescribeParameterGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:parameterGroupName:DescribeParameterGroups' :: Maybe Text
parameterGroupName = forall a. Maybe a
Prelude.Nothing
}
describeParameterGroups_maxResults :: Lens.Lens' DescribeParameterGroups (Prelude.Maybe Prelude.Int)
describeParameterGroups_maxResults :: Lens' DescribeParameterGroups (Maybe Int)
describeParameterGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroups' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeParameterGroups
s@DescribeParameterGroups' {} Maybe Int
a -> DescribeParameterGroups
s {$sel:maxResults:DescribeParameterGroups' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeParameterGroups)
describeParameterGroups_nextToken :: Lens.Lens' DescribeParameterGroups (Prelude.Maybe Prelude.Text)
describeParameterGroups_nextToken :: Lens' DescribeParameterGroups (Maybe Text)
describeParameterGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeParameterGroups
s@DescribeParameterGroups' {} Maybe Text
a -> DescribeParameterGroups
s {$sel:nextToken:DescribeParameterGroups' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeParameterGroups)
describeParameterGroups_parameterGroupName :: Lens.Lens' DescribeParameterGroups (Prelude.Maybe Prelude.Text)
describeParameterGroups_parameterGroupName :: Lens' DescribeParameterGroups (Maybe Text)
describeParameterGroups_parameterGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroups' {Maybe Text
parameterGroupName :: Maybe Text
$sel:parameterGroupName:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
parameterGroupName} -> Maybe Text
parameterGroupName) (\s :: DescribeParameterGroups
s@DescribeParameterGroups' {} Maybe Text
a -> DescribeParameterGroups
s {$sel:parameterGroupName:DescribeParameterGroups' :: Maybe Text
parameterGroupName = Maybe Text
a} :: DescribeParameterGroups)
instance Core.AWSPager DescribeParameterGroups where
page :: DescribeParameterGroups
-> AWSResponse DescribeParameterGroups
-> Maybe DescribeParameterGroups
page DescribeParameterGroups
rq AWSResponse DescribeParameterGroups
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeParameterGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeParameterGroupsResponse (Maybe Text)
describeParameterGroupsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeParameterGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeParameterGroupsResponse (Maybe [ParameterGroup])
describeParameterGroupsResponse_parameterGroups
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ DescribeParameterGroups
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeParameterGroups (Maybe Text)
describeParameterGroups_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeParameterGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeParameterGroupsResponse (Maybe Text)
describeParameterGroupsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest DescribeParameterGroups where
type
AWSResponse DescribeParameterGroups =
DescribeParameterGroupsResponse
request :: (Service -> Service)
-> DescribeParameterGroups -> Request DescribeParameterGroups
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeParameterGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeParameterGroups)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [ParameterGroup] -> Int -> DescribeParameterGroupsResponse
DescribeParameterGroupsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ParameterGroups"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeParameterGroups where
hashWithSalt :: Int -> DescribeParameterGroups -> Int
hashWithSalt Int
_salt DescribeParameterGroups' {Maybe Int
Maybe Text
parameterGroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:parameterGroupName:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
$sel:nextToken:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
$sel:maxResults:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterGroupName
instance Prelude.NFData DescribeParameterGroups where
rnf :: DescribeParameterGroups -> ()
rnf DescribeParameterGroups' {Maybe Int
Maybe Text
parameterGroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:parameterGroupName:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
$sel:nextToken:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
$sel:maxResults:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterGroupName
instance Data.ToHeaders DescribeParameterGroups where
toHeaders :: DescribeParameterGroups -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonMemoryDB.DescribeParameterGroups" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DescribeParameterGroups where
toJSON :: DescribeParameterGroups -> Value
toJSON DescribeParameterGroups' {Maybe Int
Maybe Text
parameterGroupName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:parameterGroupName:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
$sel:nextToken:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
$sel:maxResults:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Key
"ParameterGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterGroupName
]
)
instance Data.ToPath DescribeParameterGroups where
toPath :: DescribeParameterGroups -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeParameterGroups where
toQuery :: DescribeParameterGroups -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeParameterGroupsResponse = DescribeParameterGroupsResponse'
{
DescribeParameterGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeParameterGroupsResponse -> Maybe [ParameterGroup]
parameterGroups :: Prelude.Maybe [ParameterGroup],
DescribeParameterGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
$c/= :: DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
== :: DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
$c== :: DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeParameterGroupsResponse]
ReadPrec DescribeParameterGroupsResponse
Int -> ReadS DescribeParameterGroupsResponse
ReadS [DescribeParameterGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeParameterGroupsResponse]
$creadListPrec :: ReadPrec [DescribeParameterGroupsResponse]
readPrec :: ReadPrec DescribeParameterGroupsResponse
$creadPrec :: ReadPrec DescribeParameterGroupsResponse
readList :: ReadS [DescribeParameterGroupsResponse]
$creadList :: ReadS [DescribeParameterGroupsResponse]
readsPrec :: Int -> ReadS DescribeParameterGroupsResponse
$creadsPrec :: Int -> ReadS DescribeParameterGroupsResponse
Prelude.Read, Int -> DescribeParameterGroupsResponse -> ShowS
[DescribeParameterGroupsResponse] -> ShowS
DescribeParameterGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeParameterGroupsResponse] -> ShowS
$cshowList :: [DescribeParameterGroupsResponse] -> ShowS
show :: DescribeParameterGroupsResponse -> String
$cshow :: DescribeParameterGroupsResponse -> String
showsPrec :: Int -> DescribeParameterGroupsResponse -> ShowS
$cshowsPrec :: Int -> DescribeParameterGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeParameterGroupsResponse x
-> DescribeParameterGroupsResponse
forall x.
DescribeParameterGroupsResponse
-> Rep DescribeParameterGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeParameterGroupsResponse x
-> DescribeParameterGroupsResponse
$cfrom :: forall x.
DescribeParameterGroupsResponse
-> Rep DescribeParameterGroupsResponse x
Prelude.Generic)
newDescribeParameterGroupsResponse ::
Prelude.Int ->
DescribeParameterGroupsResponse
newDescribeParameterGroupsResponse :: Int -> DescribeParameterGroupsResponse
newDescribeParameterGroupsResponse Int
pHttpStatus_ =
DescribeParameterGroupsResponse'
{ $sel:nextToken:DescribeParameterGroupsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:parameterGroups:DescribeParameterGroupsResponse' :: Maybe [ParameterGroup]
parameterGroups = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeParameterGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeParameterGroupsResponse_nextToken :: Lens.Lens' DescribeParameterGroupsResponse (Prelude.Maybe Prelude.Text)
describeParameterGroupsResponse_nextToken :: Lens' DescribeParameterGroupsResponse (Maybe Text)
describeParameterGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeParameterGroupsResponse' :: DescribeParameterGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeParameterGroupsResponse
s@DescribeParameterGroupsResponse' {} Maybe Text
a -> DescribeParameterGroupsResponse
s {$sel:nextToken:DescribeParameterGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeParameterGroupsResponse)
describeParameterGroupsResponse_parameterGroups :: Lens.Lens' DescribeParameterGroupsResponse (Prelude.Maybe [ParameterGroup])
describeParameterGroupsResponse_parameterGroups :: Lens' DescribeParameterGroupsResponse (Maybe [ParameterGroup])
describeParameterGroupsResponse_parameterGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroupsResponse' {Maybe [ParameterGroup]
parameterGroups :: Maybe [ParameterGroup]
$sel:parameterGroups:DescribeParameterGroupsResponse' :: DescribeParameterGroupsResponse -> Maybe [ParameterGroup]
parameterGroups} -> Maybe [ParameterGroup]
parameterGroups) (\s :: DescribeParameterGroupsResponse
s@DescribeParameterGroupsResponse' {} Maybe [ParameterGroup]
a -> DescribeParameterGroupsResponse
s {$sel:parameterGroups:DescribeParameterGroupsResponse' :: Maybe [ParameterGroup]
parameterGroups = Maybe [ParameterGroup]
a} :: DescribeParameterGroupsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeParameterGroupsResponse_httpStatus :: Lens.Lens' DescribeParameterGroupsResponse Prelude.Int
describeParameterGroupsResponse_httpStatus :: Lens' DescribeParameterGroupsResponse Int
describeParameterGroupsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeParameterGroupsResponse' :: DescribeParameterGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeParameterGroupsResponse
s@DescribeParameterGroupsResponse' {} Int
a -> DescribeParameterGroupsResponse
s {$sel:httpStatus:DescribeParameterGroupsResponse' :: Int
httpStatus = Int
a} :: DescribeParameterGroupsResponse)
instance
Prelude.NFData
DescribeParameterGroupsResponse
where
rnf :: DescribeParameterGroupsResponse -> ()
rnf DescribeParameterGroupsResponse' {Int
Maybe [ParameterGroup]
Maybe Text
httpStatus :: Int
parameterGroups :: Maybe [ParameterGroup]
nextToken :: Maybe Text
$sel:httpStatus:DescribeParameterGroupsResponse' :: DescribeParameterGroupsResponse -> Int
$sel:parameterGroups:DescribeParameterGroupsResponse' :: DescribeParameterGroupsResponse -> Maybe [ParameterGroup]
$sel:nextToken:DescribeParameterGroupsResponse' :: DescribeParameterGroupsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ParameterGroup]
parameterGroups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus