{-# 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.CognitoIdentityProvider.AdminListDevices
(
AdminListDevices (..),
newAdminListDevices,
adminListDevices_paginationToken,
adminListDevices_limit,
adminListDevices_userPoolId,
adminListDevices_username,
AdminListDevicesResponse (..),
newAdminListDevicesResponse,
adminListDevicesResponse_paginationToken,
adminListDevicesResponse_devices,
adminListDevicesResponse_httpStatus,
)
where
import Amazonka.CognitoIdentityProvider.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AdminListDevices = AdminListDevices'
{
:: Prelude.Maybe Prelude.Text,
AdminListDevices -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
AdminListDevices -> Text
userPoolId :: Prelude.Text,
AdminListDevices -> Sensitive Text
username :: Core.Sensitive Prelude.Text
}
deriving (AdminListDevices -> AdminListDevices -> Bool
(AdminListDevices -> AdminListDevices -> Bool)
-> (AdminListDevices -> AdminListDevices -> Bool)
-> Eq AdminListDevices
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminListDevices -> AdminListDevices -> Bool
$c/= :: AdminListDevices -> AdminListDevices -> Bool
== :: AdminListDevices -> AdminListDevices -> Bool
$c== :: AdminListDevices -> AdminListDevices -> Bool
Prelude.Eq, Int -> AdminListDevices -> ShowS
[AdminListDevices] -> ShowS
AdminListDevices -> String
(Int -> AdminListDevices -> ShowS)
-> (AdminListDevices -> String)
-> ([AdminListDevices] -> ShowS)
-> Show AdminListDevices
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminListDevices] -> ShowS
$cshowList :: [AdminListDevices] -> ShowS
show :: AdminListDevices -> String
$cshow :: AdminListDevices -> String
showsPrec :: Int -> AdminListDevices -> ShowS
$cshowsPrec :: Int -> AdminListDevices -> ShowS
Prelude.Show, (forall x. AdminListDevices -> Rep AdminListDevices x)
-> (forall x. Rep AdminListDevices x -> AdminListDevices)
-> Generic AdminListDevices
forall x. Rep AdminListDevices x -> AdminListDevices
forall x. AdminListDevices -> Rep AdminListDevices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdminListDevices x -> AdminListDevices
$cfrom :: forall x. AdminListDevices -> Rep AdminListDevices x
Prelude.Generic)
newAdminListDevices ::
Prelude.Text ->
Prelude.Text ->
AdminListDevices
newAdminListDevices :: Text -> Text -> AdminListDevices
newAdminListDevices Text
pUserPoolId_ Text
pUsername_ =
AdminListDevices' :: Maybe Text
-> Maybe Natural -> Text -> Sensitive Text -> AdminListDevices
AdminListDevices'
{ $sel:paginationToken:AdminListDevices' :: Maybe Text
paginationToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:AdminListDevices' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:userPoolId:AdminListDevices' :: Text
userPoolId = Text
pUserPoolId_,
$sel:username:AdminListDevices' :: Sensitive Text
username = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pUsername_
}
adminListDevices_paginationToken :: Lens.Lens' AdminListDevices (Prelude.Maybe Prelude.Text)
= (AdminListDevices -> Maybe Text)
-> (AdminListDevices -> Maybe Text -> AdminListDevices)
-> Lens AdminListDevices AdminListDevices (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminListDevices' {Maybe Text
paginationToken :: Maybe Text
$sel:paginationToken:AdminListDevices' :: AdminListDevices -> Maybe Text
paginationToken} -> Maybe Text
paginationToken) (\s :: AdminListDevices
s@AdminListDevices' {} Maybe Text
a -> AdminListDevices
s {$sel:paginationToken:AdminListDevices' :: Maybe Text
paginationToken = Maybe Text
a} :: AdminListDevices)
adminListDevices_limit :: Lens.Lens' AdminListDevices (Prelude.Maybe Prelude.Natural)
adminListDevices_limit :: (Maybe Natural -> f (Maybe Natural))
-> AdminListDevices -> f AdminListDevices
adminListDevices_limit = (AdminListDevices -> Maybe Natural)
-> (AdminListDevices -> Maybe Natural -> AdminListDevices)
-> Lens
AdminListDevices AdminListDevices (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminListDevices' {Maybe Natural
limit :: Maybe Natural
$sel:limit:AdminListDevices' :: AdminListDevices -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: AdminListDevices
s@AdminListDevices' {} Maybe Natural
a -> AdminListDevices
s {$sel:limit:AdminListDevices' :: Maybe Natural
limit = Maybe Natural
a} :: AdminListDevices)
adminListDevices_userPoolId :: Lens.Lens' AdminListDevices Prelude.Text
adminListDevices_userPoolId :: (Text -> f Text) -> AdminListDevices -> f AdminListDevices
adminListDevices_userPoolId = (AdminListDevices -> Text)
-> (AdminListDevices -> Text -> AdminListDevices)
-> Lens AdminListDevices AdminListDevices Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminListDevices' {Text
userPoolId :: Text
$sel:userPoolId:AdminListDevices' :: AdminListDevices -> Text
userPoolId} -> Text
userPoolId) (\s :: AdminListDevices
s@AdminListDevices' {} Text
a -> AdminListDevices
s {$sel:userPoolId:AdminListDevices' :: Text
userPoolId = Text
a} :: AdminListDevices)
adminListDevices_username :: Lens.Lens' AdminListDevices Prelude.Text
adminListDevices_username :: (Text -> f Text) -> AdminListDevices -> f AdminListDevices
adminListDevices_username = (AdminListDevices -> Sensitive Text)
-> (AdminListDevices -> Sensitive Text -> AdminListDevices)
-> Lens
AdminListDevices AdminListDevices (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminListDevices' {Sensitive Text
username :: Sensitive Text
$sel:username:AdminListDevices' :: AdminListDevices -> Sensitive Text
username} -> Sensitive Text
username) (\s :: AdminListDevices
s@AdminListDevices' {} Sensitive Text
a -> AdminListDevices
s {$sel:username:AdminListDevices' :: Sensitive Text
username = Sensitive Text
a} :: AdminListDevices) ((Sensitive Text -> f (Sensitive Text))
-> AdminListDevices -> f AdminListDevices)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AdminListDevices
-> f AdminListDevices
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.AWSRequest AdminListDevices where
type
AWSResponse AdminListDevices =
AdminListDevicesResponse
request :: AdminListDevices -> Request AdminListDevices
request = Service -> AdminListDevices -> Request AdminListDevices
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AdminListDevices
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AdminListDevices)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse AdminListDevices))
-> Logger
-> Service
-> Proxy AdminListDevices
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AdminListDevices)))
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 [DeviceType] -> Int -> AdminListDevicesResponse
AdminListDevicesResponse'
(Maybe Text
-> Maybe [DeviceType] -> Int -> AdminListDevicesResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [DeviceType] -> Int -> AdminListDevicesResponse)
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
"PaginationToken")
Either
String (Maybe [DeviceType] -> Int -> AdminListDevicesResponse)
-> Either String (Maybe [DeviceType])
-> Either String (Int -> AdminListDevicesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [DeviceType]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Devices" Either String (Maybe (Maybe [DeviceType]))
-> Maybe [DeviceType] -> Either String (Maybe [DeviceType])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DeviceType]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> AdminListDevicesResponse)
-> Either String Int -> Either String AdminListDevicesResponse
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 AdminListDevices
instance Prelude.NFData AdminListDevices
instance Core.ToHeaders AdminListDevices where
toHeaders :: AdminListDevices -> ResponseHeaders
toHeaders =
ResponseHeaders -> AdminListDevices -> 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
"AWSCognitoIdentityProviderService.AdminListDevices" ::
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 AdminListDevices where
toJSON :: AdminListDevices -> Value
toJSON AdminListDevices' {Maybe Natural
Maybe Text
Text
Sensitive Text
username :: Sensitive Text
userPoolId :: Text
limit :: Maybe Natural
paginationToken :: Maybe Text
$sel:username:AdminListDevices' :: AdminListDevices -> Sensitive Text
$sel:userPoolId:AdminListDevices' :: AdminListDevices -> Text
$sel:limit:AdminListDevices' :: AdminListDevices -> Maybe Natural
$sel:paginationToken:AdminListDevices' :: AdminListDevices -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PaginationToken" 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
paginationToken,
(Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Username" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
username)
]
)
instance Core.ToPath AdminListDevices where
toPath :: AdminListDevices -> ByteString
toPath = ByteString -> AdminListDevices -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AdminListDevices where
toQuery :: AdminListDevices -> QueryString
toQuery = QueryString -> AdminListDevices -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AdminListDevicesResponse = AdminListDevicesResponse'
{
:: Prelude.Maybe Prelude.Text,
AdminListDevicesResponse -> Maybe [DeviceType]
devices :: Prelude.Maybe [DeviceType],
AdminListDevicesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AdminListDevicesResponse -> AdminListDevicesResponse -> Bool
(AdminListDevicesResponse -> AdminListDevicesResponse -> Bool)
-> (AdminListDevicesResponse -> AdminListDevicesResponse -> Bool)
-> Eq AdminListDevicesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminListDevicesResponse -> AdminListDevicesResponse -> Bool
$c/= :: AdminListDevicesResponse -> AdminListDevicesResponse -> Bool
== :: AdminListDevicesResponse -> AdminListDevicesResponse -> Bool
$c== :: AdminListDevicesResponse -> AdminListDevicesResponse -> Bool
Prelude.Eq, Int -> AdminListDevicesResponse -> ShowS
[AdminListDevicesResponse] -> ShowS
AdminListDevicesResponse -> String
(Int -> AdminListDevicesResponse -> ShowS)
-> (AdminListDevicesResponse -> String)
-> ([AdminListDevicesResponse] -> ShowS)
-> Show AdminListDevicesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminListDevicesResponse] -> ShowS
$cshowList :: [AdminListDevicesResponse] -> ShowS
show :: AdminListDevicesResponse -> String
$cshow :: AdminListDevicesResponse -> String
showsPrec :: Int -> AdminListDevicesResponse -> ShowS
$cshowsPrec :: Int -> AdminListDevicesResponse -> ShowS
Prelude.Show, (forall x.
AdminListDevicesResponse -> Rep AdminListDevicesResponse x)
-> (forall x.
Rep AdminListDevicesResponse x -> AdminListDevicesResponse)
-> Generic AdminListDevicesResponse
forall x.
Rep AdminListDevicesResponse x -> AdminListDevicesResponse
forall x.
AdminListDevicesResponse -> Rep AdminListDevicesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AdminListDevicesResponse x -> AdminListDevicesResponse
$cfrom :: forall x.
AdminListDevicesResponse -> Rep AdminListDevicesResponse x
Prelude.Generic)
newAdminListDevicesResponse ::
Prelude.Int ->
AdminListDevicesResponse
newAdminListDevicesResponse :: Int -> AdminListDevicesResponse
newAdminListDevicesResponse Int
pHttpStatus_ =
AdminListDevicesResponse' :: Maybe Text -> Maybe [DeviceType] -> Int -> AdminListDevicesResponse
AdminListDevicesResponse'
{ $sel:paginationToken:AdminListDevicesResponse' :: Maybe Text
paginationToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:devices:AdminListDevicesResponse' :: Maybe [DeviceType]
devices = Maybe [DeviceType]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AdminListDevicesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
adminListDevicesResponse_paginationToken :: Lens.Lens' AdminListDevicesResponse (Prelude.Maybe Prelude.Text)
= (AdminListDevicesResponse -> Maybe Text)
-> (AdminListDevicesResponse
-> Maybe Text -> AdminListDevicesResponse)
-> Lens
AdminListDevicesResponse
AdminListDevicesResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminListDevicesResponse' {Maybe Text
paginationToken :: Maybe Text
$sel:paginationToken:AdminListDevicesResponse' :: AdminListDevicesResponse -> Maybe Text
paginationToken} -> Maybe Text
paginationToken) (\s :: AdminListDevicesResponse
s@AdminListDevicesResponse' {} Maybe Text
a -> AdminListDevicesResponse
s {$sel:paginationToken:AdminListDevicesResponse' :: Maybe Text
paginationToken = Maybe Text
a} :: AdminListDevicesResponse)
adminListDevicesResponse_devices :: Lens.Lens' AdminListDevicesResponse (Prelude.Maybe [DeviceType])
adminListDevicesResponse_devices :: (Maybe [DeviceType] -> f (Maybe [DeviceType]))
-> AdminListDevicesResponse -> f AdminListDevicesResponse
adminListDevicesResponse_devices = (AdminListDevicesResponse -> Maybe [DeviceType])
-> (AdminListDevicesResponse
-> Maybe [DeviceType] -> AdminListDevicesResponse)
-> Lens
AdminListDevicesResponse
AdminListDevicesResponse
(Maybe [DeviceType])
(Maybe [DeviceType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminListDevicesResponse' {Maybe [DeviceType]
devices :: Maybe [DeviceType]
$sel:devices:AdminListDevicesResponse' :: AdminListDevicesResponse -> Maybe [DeviceType]
devices} -> Maybe [DeviceType]
devices) (\s :: AdminListDevicesResponse
s@AdminListDevicesResponse' {} Maybe [DeviceType]
a -> AdminListDevicesResponse
s {$sel:devices:AdminListDevicesResponse' :: Maybe [DeviceType]
devices = Maybe [DeviceType]
a} :: AdminListDevicesResponse) ((Maybe [DeviceType] -> f (Maybe [DeviceType]))
-> AdminListDevicesResponse -> f AdminListDevicesResponse)
-> ((Maybe [DeviceType] -> f (Maybe [DeviceType]))
-> Maybe [DeviceType] -> f (Maybe [DeviceType]))
-> (Maybe [DeviceType] -> f (Maybe [DeviceType]))
-> AdminListDevicesResponse
-> f AdminListDevicesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DeviceType] [DeviceType] [DeviceType] [DeviceType]
-> Iso
(Maybe [DeviceType])
(Maybe [DeviceType])
(Maybe [DeviceType])
(Maybe [DeviceType])
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 [DeviceType] [DeviceType] [DeviceType] [DeviceType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
adminListDevicesResponse_httpStatus :: Lens.Lens' AdminListDevicesResponse Prelude.Int
adminListDevicesResponse_httpStatus :: (Int -> f Int)
-> AdminListDevicesResponse -> f AdminListDevicesResponse
adminListDevicesResponse_httpStatus = (AdminListDevicesResponse -> Int)
-> (AdminListDevicesResponse -> Int -> AdminListDevicesResponse)
-> Lens AdminListDevicesResponse AdminListDevicesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminListDevicesResponse' {Int
httpStatus :: Int
$sel:httpStatus:AdminListDevicesResponse' :: AdminListDevicesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AdminListDevicesResponse
s@AdminListDevicesResponse' {} Int
a -> AdminListDevicesResponse
s {$sel:httpStatus:AdminListDevicesResponse' :: Int
httpStatus = Int
a} :: AdminListDevicesResponse)
instance Prelude.NFData AdminListDevicesResponse