{-# 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.DescribeACLs
(
DescribeACLs (..),
newDescribeACLs,
describeACLs_nextToken,
describeACLs_maxResults,
describeACLs_aCLName,
DescribeACLsResponse (..),
newDescribeACLsResponse,
describeACLsResponse_nextToken,
describeACLsResponse_aCLs,
describeACLsResponse_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 DescribeACLs = DescribeACLs'
{
DescribeACLs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeACLs -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
DescribeACLs -> Maybe Text
aCLName :: Prelude.Maybe Prelude.Text
}
deriving (DescribeACLs -> DescribeACLs -> Bool
(DescribeACLs -> DescribeACLs -> Bool)
-> (DescribeACLs -> DescribeACLs -> Bool) -> Eq DescribeACLs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeACLs -> DescribeACLs -> Bool
$c/= :: DescribeACLs -> DescribeACLs -> Bool
== :: DescribeACLs -> DescribeACLs -> Bool
$c== :: DescribeACLs -> DescribeACLs -> Bool
Prelude.Eq, ReadPrec [DescribeACLs]
ReadPrec DescribeACLs
Int -> ReadS DescribeACLs
ReadS [DescribeACLs]
(Int -> ReadS DescribeACLs)
-> ReadS [DescribeACLs]
-> ReadPrec DescribeACLs
-> ReadPrec [DescribeACLs]
-> Read DescribeACLs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeACLs]
$creadListPrec :: ReadPrec [DescribeACLs]
readPrec :: ReadPrec DescribeACLs
$creadPrec :: ReadPrec DescribeACLs
readList :: ReadS [DescribeACLs]
$creadList :: ReadS [DescribeACLs]
readsPrec :: Int -> ReadS DescribeACLs
$creadsPrec :: Int -> ReadS DescribeACLs
Prelude.Read, Int -> DescribeACLs -> ShowS
[DescribeACLs] -> ShowS
DescribeACLs -> String
(Int -> DescribeACLs -> ShowS)
-> (DescribeACLs -> String)
-> ([DescribeACLs] -> ShowS)
-> Show DescribeACLs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeACLs] -> ShowS
$cshowList :: [DescribeACLs] -> ShowS
show :: DescribeACLs -> String
$cshow :: DescribeACLs -> String
showsPrec :: Int -> DescribeACLs -> ShowS
$cshowsPrec :: Int -> DescribeACLs -> ShowS
Prelude.Show, (forall x. DescribeACLs -> Rep DescribeACLs x)
-> (forall x. Rep DescribeACLs x -> DescribeACLs)
-> Generic DescribeACLs
forall x. Rep DescribeACLs x -> DescribeACLs
forall x. DescribeACLs -> Rep DescribeACLs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeACLs x -> DescribeACLs
$cfrom :: forall x. DescribeACLs -> Rep DescribeACLs x
Prelude.Generic)
newDescribeACLs ::
DescribeACLs
newDescribeACLs :: DescribeACLs
newDescribeACLs =
DescribeACLs' :: Maybe Text -> Maybe Int -> Maybe Text -> DescribeACLs
DescribeACLs'
{ $sel:nextToken:DescribeACLs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:DescribeACLs' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:aCLName:DescribeACLs' :: Maybe Text
aCLName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
describeACLs_nextToken :: Lens.Lens' DescribeACLs (Prelude.Maybe Prelude.Text)
describeACLs_nextToken :: (Maybe Text -> f (Maybe Text)) -> DescribeACLs -> f DescribeACLs
describeACLs_nextToken = (DescribeACLs -> Maybe Text)
-> (DescribeACLs -> Maybe Text -> DescribeACLs)
-> Lens DescribeACLs DescribeACLs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeACLs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeACLs' :: DescribeACLs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeACLs
s@DescribeACLs' {} Maybe Text
a -> DescribeACLs
s {$sel:nextToken:DescribeACLs' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeACLs)
describeACLs_maxResults :: Lens.Lens' DescribeACLs (Prelude.Maybe Prelude.Int)
describeACLs_maxResults :: (Maybe Int -> f (Maybe Int)) -> DescribeACLs -> f DescribeACLs
describeACLs_maxResults = (DescribeACLs -> Maybe Int)
-> (DescribeACLs -> Maybe Int -> DescribeACLs)
-> Lens DescribeACLs DescribeACLs (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeACLs' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeACLs' :: DescribeACLs -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeACLs
s@DescribeACLs' {} Maybe Int
a -> DescribeACLs
s {$sel:maxResults:DescribeACLs' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeACLs)
describeACLs_aCLName :: Lens.Lens' DescribeACLs (Prelude.Maybe Prelude.Text)
describeACLs_aCLName :: (Maybe Text -> f (Maybe Text)) -> DescribeACLs -> f DescribeACLs
describeACLs_aCLName = (DescribeACLs -> Maybe Text)
-> (DescribeACLs -> Maybe Text -> DescribeACLs)
-> Lens DescribeACLs DescribeACLs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeACLs' {Maybe Text
aCLName :: Maybe Text
$sel:aCLName:DescribeACLs' :: DescribeACLs -> Maybe Text
aCLName} -> Maybe Text
aCLName) (\s :: DescribeACLs
s@DescribeACLs' {} Maybe Text
a -> DescribeACLs
s {$sel:aCLName:DescribeACLs' :: Maybe Text
aCLName = Maybe Text
a} :: DescribeACLs)
instance Core.AWSRequest DescribeACLs where
type AWSResponse DescribeACLs = DescribeACLsResponse
request :: DescribeACLs -> Request DescribeACLs
request = Service -> DescribeACLs -> Request DescribeACLs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeACLs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeACLs)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeACLs))
-> Logger
-> Service
-> Proxy DescribeACLs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeACLs)))
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 [ACL] -> Int -> DescribeACLsResponse
DescribeACLsResponse'
(Maybe Text -> Maybe [ACL] -> Int -> DescribeACLsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [ACL] -> Int -> DescribeACLsResponse)
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 [ACL] -> Int -> DescribeACLsResponse)
-> Either String (Maybe [ACL])
-> Either String (Int -> DescribeACLsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [ACL]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ACLs" Either String (Maybe (Maybe [ACL]))
-> Maybe [ACL] -> Either String (Maybe [ACL])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ACL]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DescribeACLsResponse)
-> Either String Int -> Either String DescribeACLsResponse
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 DescribeACLs
instance Prelude.NFData DescribeACLs
instance Core.ToHeaders DescribeACLs where
toHeaders :: DescribeACLs -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeACLs -> 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.DescribeACLs" ::
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 DescribeACLs where
toJSON :: DescribeACLs -> Value
toJSON DescribeACLs' {Maybe Int
Maybe Text
aCLName :: Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:aCLName:DescribeACLs' :: DescribeACLs -> Maybe Text
$sel:maxResults:DescribeACLs' :: DescribeACLs -> Maybe Int
$sel:nextToken:DescribeACLs' :: DescribeACLs -> 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,
(Text
"ACLName" 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
aCLName
]
)
instance Core.ToPath DescribeACLs where
toPath :: DescribeACLs -> ByteString
toPath = ByteString -> DescribeACLs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeACLs where
toQuery :: DescribeACLs -> QueryString
toQuery = QueryString -> DescribeACLs -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeACLsResponse = DescribeACLsResponse'
{
DescribeACLsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeACLsResponse -> Maybe [ACL]
aCLs :: Prelude.Maybe [ACL],
DescribeACLsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeACLsResponse -> DescribeACLsResponse -> Bool
(DescribeACLsResponse -> DescribeACLsResponse -> Bool)
-> (DescribeACLsResponse -> DescribeACLsResponse -> Bool)
-> Eq DescribeACLsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeACLsResponse -> DescribeACLsResponse -> Bool
$c/= :: DescribeACLsResponse -> DescribeACLsResponse -> Bool
== :: DescribeACLsResponse -> DescribeACLsResponse -> Bool
$c== :: DescribeACLsResponse -> DescribeACLsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeACLsResponse]
ReadPrec DescribeACLsResponse
Int -> ReadS DescribeACLsResponse
ReadS [DescribeACLsResponse]
(Int -> ReadS DescribeACLsResponse)
-> ReadS [DescribeACLsResponse]
-> ReadPrec DescribeACLsResponse
-> ReadPrec [DescribeACLsResponse]
-> Read DescribeACLsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeACLsResponse]
$creadListPrec :: ReadPrec [DescribeACLsResponse]
readPrec :: ReadPrec DescribeACLsResponse
$creadPrec :: ReadPrec DescribeACLsResponse
readList :: ReadS [DescribeACLsResponse]
$creadList :: ReadS [DescribeACLsResponse]
readsPrec :: Int -> ReadS DescribeACLsResponse
$creadsPrec :: Int -> ReadS DescribeACLsResponse
Prelude.Read, Int -> DescribeACLsResponse -> ShowS
[DescribeACLsResponse] -> ShowS
DescribeACLsResponse -> String
(Int -> DescribeACLsResponse -> ShowS)
-> (DescribeACLsResponse -> String)
-> ([DescribeACLsResponse] -> ShowS)
-> Show DescribeACLsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeACLsResponse] -> ShowS
$cshowList :: [DescribeACLsResponse] -> ShowS
show :: DescribeACLsResponse -> String
$cshow :: DescribeACLsResponse -> String
showsPrec :: Int -> DescribeACLsResponse -> ShowS
$cshowsPrec :: Int -> DescribeACLsResponse -> ShowS
Prelude.Show, (forall x. DescribeACLsResponse -> Rep DescribeACLsResponse x)
-> (forall x. Rep DescribeACLsResponse x -> DescribeACLsResponse)
-> Generic DescribeACLsResponse
forall x. Rep DescribeACLsResponse x -> DescribeACLsResponse
forall x. DescribeACLsResponse -> Rep DescribeACLsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeACLsResponse x -> DescribeACLsResponse
$cfrom :: forall x. DescribeACLsResponse -> Rep DescribeACLsResponse x
Prelude.Generic)
newDescribeACLsResponse ::
Prelude.Int ->
DescribeACLsResponse
newDescribeACLsResponse :: Int -> DescribeACLsResponse
newDescribeACLsResponse Int
pHttpStatus_ =
DescribeACLsResponse' :: Maybe Text -> Maybe [ACL] -> Int -> DescribeACLsResponse
DescribeACLsResponse'
{ $sel:nextToken:DescribeACLsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:aCLs:DescribeACLsResponse' :: Maybe [ACL]
aCLs = Maybe [ACL]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeACLsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeACLsResponse_nextToken :: Lens.Lens' DescribeACLsResponse (Prelude.Maybe Prelude.Text)
describeACLsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeACLsResponse -> f DescribeACLsResponse
describeACLsResponse_nextToken = (DescribeACLsResponse -> Maybe Text)
-> (DescribeACLsResponse -> Maybe Text -> DescribeACLsResponse)
-> Lens
DescribeACLsResponse DescribeACLsResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeACLsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeACLsResponse' :: DescribeACLsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeACLsResponse
s@DescribeACLsResponse' {} Maybe Text
a -> DescribeACLsResponse
s {$sel:nextToken:DescribeACLsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeACLsResponse)
describeACLsResponse_aCLs :: Lens.Lens' DescribeACLsResponse (Prelude.Maybe [ACL])
describeACLsResponse_aCLs :: (Maybe [ACL] -> f (Maybe [ACL]))
-> DescribeACLsResponse -> f DescribeACLsResponse
describeACLsResponse_aCLs = (DescribeACLsResponse -> Maybe [ACL])
-> (DescribeACLsResponse -> Maybe [ACL] -> DescribeACLsResponse)
-> Lens
DescribeACLsResponse
DescribeACLsResponse
(Maybe [ACL])
(Maybe [ACL])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeACLsResponse' {Maybe [ACL]
aCLs :: Maybe [ACL]
$sel:aCLs:DescribeACLsResponse' :: DescribeACLsResponse -> Maybe [ACL]
aCLs} -> Maybe [ACL]
aCLs) (\s :: DescribeACLsResponse
s@DescribeACLsResponse' {} Maybe [ACL]
a -> DescribeACLsResponse
s {$sel:aCLs:DescribeACLsResponse' :: Maybe [ACL]
aCLs = Maybe [ACL]
a} :: DescribeACLsResponse) ((Maybe [ACL] -> f (Maybe [ACL]))
-> DescribeACLsResponse -> f DescribeACLsResponse)
-> ((Maybe [ACL] -> f (Maybe [ACL]))
-> Maybe [ACL] -> f (Maybe [ACL]))
-> (Maybe [ACL] -> f (Maybe [ACL]))
-> DescribeACLsResponse
-> f DescribeACLsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ACL] [ACL] [ACL] [ACL]
-> Iso (Maybe [ACL]) (Maybe [ACL]) (Maybe [ACL]) (Maybe [ACL])
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 [ACL] [ACL] [ACL] [ACL]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeACLsResponse_httpStatus :: Lens.Lens' DescribeACLsResponse Prelude.Int
describeACLsResponse_httpStatus :: (Int -> f Int) -> DescribeACLsResponse -> f DescribeACLsResponse
describeACLsResponse_httpStatus = (DescribeACLsResponse -> Int)
-> (DescribeACLsResponse -> Int -> DescribeACLsResponse)
-> Lens DescribeACLsResponse DescribeACLsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeACLsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeACLsResponse' :: DescribeACLsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeACLsResponse
s@DescribeACLsResponse' {} Int
a -> DescribeACLsResponse
s {$sel:httpStatus:DescribeACLsResponse' :: Int
httpStatus = Int
a} :: DescribeACLsResponse)
instance Prelude.NFData DescribeACLsResponse