{-# 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_limit,
adminListDevices_paginationToken,
adminListDevices_userPoolId,
adminListDevices_username,
AdminListDevicesResponse (..),
newAdminListDevicesResponse,
adminListDevicesResponse_devices,
adminListDevicesResponse_paginationToken,
adminListDevicesResponse_httpStatus,
)
where
import Amazonka.CognitoIdentityProvider.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AdminListDevices = AdminListDevices'
{
AdminListDevices -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
:: Prelude.Maybe Prelude.Text,
AdminListDevices -> Text
userPoolId :: Prelude.Text,
AdminListDevices -> Sensitive Text
username :: Data.Sensitive Prelude.Text
}
deriving (AdminListDevices -> AdminListDevices -> Bool
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
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. 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'
{ $sel:limit:AdminListDevices' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:paginationToken:AdminListDevices' :: Maybe Text
paginationToken = forall a. Maybe a
Prelude.Nothing,
$sel:userPoolId:AdminListDevices' :: Text
userPoolId = Text
pUserPoolId_,
$sel:username:AdminListDevices' :: Sensitive Text
username = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pUsername_
}
adminListDevices_limit :: Lens.Lens' AdminListDevices (Prelude.Maybe Prelude.Natural)
adminListDevices_limit :: Lens' AdminListDevices (Maybe Natural)
adminListDevices_limit = 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_paginationToken :: Lens.Lens' AdminListDevices (Prelude.Maybe Prelude.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_userPoolId :: Lens.Lens' AdminListDevices Prelude.Text
adminListDevices_userPoolId :: Lens' AdminListDevices Text
adminListDevices_userPoolId = 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 :: Lens' AdminListDevices Text
adminListDevices_username = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Core.AWSRequest AdminListDevices where
type
AWSResponse AdminListDevices =
AdminListDevicesResponse
request :: (Service -> Service)
-> AdminListDevices -> Request AdminListDevices
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 AdminListDevices
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AdminListDevices)))
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 [DeviceType] -> Maybe Text -> Int -> AdminListDevicesResponse
AdminListDevicesResponse'
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
"Devices" 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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"PaginationToken")
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 AdminListDevices where
hashWithSalt :: Int -> AdminListDevices -> Int
hashWithSalt Int
_salt AdminListDevices' {Maybe Natural
Maybe Text
Text
Sensitive Text
username :: Sensitive Text
userPoolId :: Text
paginationToken :: Maybe Text
limit :: Maybe Natural
$sel:username:AdminListDevices' :: AdminListDevices -> Sensitive Text
$sel:userPoolId:AdminListDevices' :: AdminListDevices -> Text
$sel:paginationToken:AdminListDevices' :: AdminListDevices -> Maybe Text
$sel:limit:AdminListDevices' :: AdminListDevices -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
paginationToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userPoolId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
username
instance Prelude.NFData AdminListDevices where
rnf :: AdminListDevices -> ()
rnf AdminListDevices' {Maybe Natural
Maybe Text
Text
Sensitive Text
username :: Sensitive Text
userPoolId :: Text
paginationToken :: Maybe Text
limit :: Maybe Natural
$sel:username:AdminListDevices' :: AdminListDevices -> Sensitive Text
$sel:userPoolId:AdminListDevices' :: AdminListDevices -> Text
$sel:paginationToken:AdminListDevices' :: AdminListDevices -> Maybe Text
$sel:limit:AdminListDevices' :: AdminListDevices -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
paginationToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userPoolId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
username
instance Data.ToHeaders AdminListDevices where
toHeaders :: AdminListDevices -> 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
"AWSCognitoIdentityProviderService.AdminListDevices" ::
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 AdminListDevices where
toJSON :: AdminListDevices -> Value
toJSON AdminListDevices' {Maybe Natural
Maybe Text
Text
Sensitive Text
username :: Sensitive Text
userPoolId :: Text
paginationToken :: Maybe Text
limit :: Maybe Natural
$sel:username:AdminListDevices' :: AdminListDevices -> Sensitive Text
$sel:userPoolId:AdminListDevices' :: AdminListDevices -> Text
$sel:paginationToken:AdminListDevices' :: AdminListDevices -> Maybe Text
$sel:limit:AdminListDevices' :: AdminListDevices -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Limit" 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 Natural
limit,
(Key
"PaginationToken" 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
paginationToken,
forall a. a -> Maybe a
Prelude.Just (Key
"UserPoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userPoolId),
forall a. a -> Maybe a
Prelude.Just (Key
"Username" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
username)
]
)
instance Data.ToPath AdminListDevices where
toPath :: AdminListDevices -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AdminListDevices where
toQuery :: AdminListDevices -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data AdminListDevicesResponse = AdminListDevicesResponse'
{
AdminListDevicesResponse -> Maybe [DeviceType]
devices :: Prelude.Maybe [DeviceType],
:: Prelude.Maybe Prelude.Text,
AdminListDevicesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AdminListDevicesResponse -> AdminListDevicesResponse -> Bool
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
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.
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'
{ $sel:devices:AdminListDevicesResponse' :: Maybe [DeviceType]
devices =
forall a. Maybe a
Prelude.Nothing,
$sel:paginationToken:AdminListDevicesResponse' :: Maybe Text
paginationToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AdminListDevicesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
adminListDevicesResponse_devices :: Lens.Lens' AdminListDevicesResponse (Prelude.Maybe [DeviceType])
adminListDevicesResponse_devices :: Lens' AdminListDevicesResponse (Maybe [DeviceType])
adminListDevicesResponse_devices = 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) 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
adminListDevicesResponse_paginationToken :: Lens.Lens' AdminListDevicesResponse (Prelude.Maybe Prelude.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_httpStatus :: Lens.Lens' AdminListDevicesResponse Prelude.Int
adminListDevicesResponse_httpStatus :: Lens' AdminListDevicesResponse Int
adminListDevicesResponse_httpStatus = 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 where
rnf :: AdminListDevicesResponse -> ()
rnf AdminListDevicesResponse' {Int
Maybe [DeviceType]
Maybe Text
httpStatus :: Int
paginationToken :: Maybe Text
devices :: Maybe [DeviceType]
$sel:httpStatus:AdminListDevicesResponse' :: AdminListDevicesResponse -> Int
$sel:paginationToken:AdminListDevicesResponse' :: AdminListDevicesResponse -> Maybe Text
$sel:devices:AdminListDevicesResponse' :: AdminListDevicesResponse -> Maybe [DeviceType]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [DeviceType]
devices
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
paginationToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus