{-# 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.AdminForgetDevice
(
AdminForgetDevice (..),
newAdminForgetDevice,
adminForgetDevice_userPoolId,
adminForgetDevice_username,
adminForgetDevice_deviceKey,
AdminForgetDeviceResponse (..),
newAdminForgetDeviceResponse,
)
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 AdminForgetDevice = AdminForgetDevice'
{
AdminForgetDevice -> Text
userPoolId :: Prelude.Text,
AdminForgetDevice -> Sensitive Text
username :: Core.Sensitive Prelude.Text,
AdminForgetDevice -> Text
deviceKey :: Prelude.Text
}
deriving (AdminForgetDevice -> AdminForgetDevice -> Bool
(AdminForgetDevice -> AdminForgetDevice -> Bool)
-> (AdminForgetDevice -> AdminForgetDevice -> Bool)
-> Eq AdminForgetDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminForgetDevice -> AdminForgetDevice -> Bool
$c/= :: AdminForgetDevice -> AdminForgetDevice -> Bool
== :: AdminForgetDevice -> AdminForgetDevice -> Bool
$c== :: AdminForgetDevice -> AdminForgetDevice -> Bool
Prelude.Eq, Int -> AdminForgetDevice -> ShowS
[AdminForgetDevice] -> ShowS
AdminForgetDevice -> String
(Int -> AdminForgetDevice -> ShowS)
-> (AdminForgetDevice -> String)
-> ([AdminForgetDevice] -> ShowS)
-> Show AdminForgetDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminForgetDevice] -> ShowS
$cshowList :: [AdminForgetDevice] -> ShowS
show :: AdminForgetDevice -> String
$cshow :: AdminForgetDevice -> String
showsPrec :: Int -> AdminForgetDevice -> ShowS
$cshowsPrec :: Int -> AdminForgetDevice -> ShowS
Prelude.Show, (forall x. AdminForgetDevice -> Rep AdminForgetDevice x)
-> (forall x. Rep AdminForgetDevice x -> AdminForgetDevice)
-> Generic AdminForgetDevice
forall x. Rep AdminForgetDevice x -> AdminForgetDevice
forall x. AdminForgetDevice -> Rep AdminForgetDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdminForgetDevice x -> AdminForgetDevice
$cfrom :: forall x. AdminForgetDevice -> Rep AdminForgetDevice x
Prelude.Generic)
newAdminForgetDevice ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AdminForgetDevice
newAdminForgetDevice :: Text -> Text -> Text -> AdminForgetDevice
newAdminForgetDevice
Text
pUserPoolId_
Text
pUsername_
Text
pDeviceKey_ =
AdminForgetDevice' :: Text -> Sensitive Text -> Text -> AdminForgetDevice
AdminForgetDevice'
{ $sel:userPoolId:AdminForgetDevice' :: Text
userPoolId = Text
pUserPoolId_,
$sel:username:AdminForgetDevice' :: 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_,
$sel:deviceKey:AdminForgetDevice' :: Text
deviceKey = Text
pDeviceKey_
}
adminForgetDevice_userPoolId :: Lens.Lens' AdminForgetDevice Prelude.Text
adminForgetDevice_userPoolId :: (Text -> f Text) -> AdminForgetDevice -> f AdminForgetDevice
adminForgetDevice_userPoolId = (AdminForgetDevice -> Text)
-> (AdminForgetDevice -> Text -> AdminForgetDevice)
-> Lens AdminForgetDevice AdminForgetDevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminForgetDevice' {Text
userPoolId :: Text
$sel:userPoolId:AdminForgetDevice' :: AdminForgetDevice -> Text
userPoolId} -> Text
userPoolId) (\s :: AdminForgetDevice
s@AdminForgetDevice' {} Text
a -> AdminForgetDevice
s {$sel:userPoolId:AdminForgetDevice' :: Text
userPoolId = Text
a} :: AdminForgetDevice)
adminForgetDevice_username :: Lens.Lens' AdminForgetDevice Prelude.Text
adminForgetDevice_username :: (Text -> f Text) -> AdminForgetDevice -> f AdminForgetDevice
adminForgetDevice_username = (AdminForgetDevice -> Sensitive Text)
-> (AdminForgetDevice -> Sensitive Text -> AdminForgetDevice)
-> Lens
AdminForgetDevice
AdminForgetDevice
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminForgetDevice' {Sensitive Text
username :: Sensitive Text
$sel:username:AdminForgetDevice' :: AdminForgetDevice -> Sensitive Text
username} -> Sensitive Text
username) (\s :: AdminForgetDevice
s@AdminForgetDevice' {} Sensitive Text
a -> AdminForgetDevice
s {$sel:username:AdminForgetDevice' :: Sensitive Text
username = Sensitive Text
a} :: AdminForgetDevice) ((Sensitive Text -> f (Sensitive Text))
-> AdminForgetDevice -> f AdminForgetDevice)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AdminForgetDevice
-> f AdminForgetDevice
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
adminForgetDevice_deviceKey :: Lens.Lens' AdminForgetDevice Prelude.Text
adminForgetDevice_deviceKey :: (Text -> f Text) -> AdminForgetDevice -> f AdminForgetDevice
adminForgetDevice_deviceKey = (AdminForgetDevice -> Text)
-> (AdminForgetDevice -> Text -> AdminForgetDevice)
-> Lens AdminForgetDevice AdminForgetDevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminForgetDevice' {Text
deviceKey :: Text
$sel:deviceKey:AdminForgetDevice' :: AdminForgetDevice -> Text
deviceKey} -> Text
deviceKey) (\s :: AdminForgetDevice
s@AdminForgetDevice' {} Text
a -> AdminForgetDevice
s {$sel:deviceKey:AdminForgetDevice' :: Text
deviceKey = Text
a} :: AdminForgetDevice)
instance Core.AWSRequest AdminForgetDevice where
type
AWSResponse AdminForgetDevice =
AdminForgetDeviceResponse
request :: AdminForgetDevice -> Request AdminForgetDevice
request = Service -> AdminForgetDevice -> Request AdminForgetDevice
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AdminForgetDevice
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AdminForgetDevice)))
response =
AWSResponse AdminForgetDevice
-> Logger
-> Service
-> Proxy AdminForgetDevice
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AdminForgetDevice)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse AdminForgetDevice
AdminForgetDeviceResponse
AdminForgetDeviceResponse'
instance Prelude.Hashable AdminForgetDevice
instance Prelude.NFData AdminForgetDevice
instance Core.ToHeaders AdminForgetDevice where
toHeaders :: AdminForgetDevice -> [Header]
toHeaders =
[Header] -> AdminForgetDevice -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"AWSCognitoIdentityProviderService.AdminForgetDevice" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON AdminForgetDevice where
toJSON :: AdminForgetDevice -> Value
toJSON AdminForgetDevice' {Text
Sensitive Text
deviceKey :: Text
username :: Sensitive Text
userPoolId :: Text
$sel:deviceKey:AdminForgetDevice' :: AdminForgetDevice -> Text
$sel:username:AdminForgetDevice' :: AdminForgetDevice -> Sensitive Text
$sel:userPoolId:AdminForgetDevice' :: AdminForgetDevice -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DeviceKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceKey)
]
)
instance Core.ToPath AdminForgetDevice where
toPath :: AdminForgetDevice -> ByteString
toPath = ByteString -> AdminForgetDevice -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AdminForgetDevice where
toQuery :: AdminForgetDevice -> QueryString
toQuery = QueryString -> AdminForgetDevice -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AdminForgetDeviceResponse = AdminForgetDeviceResponse'
{
}
deriving (AdminForgetDeviceResponse -> AdminForgetDeviceResponse -> Bool
(AdminForgetDeviceResponse -> AdminForgetDeviceResponse -> Bool)
-> (AdminForgetDeviceResponse -> AdminForgetDeviceResponse -> Bool)
-> Eq AdminForgetDeviceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminForgetDeviceResponse -> AdminForgetDeviceResponse -> Bool
$c/= :: AdminForgetDeviceResponse -> AdminForgetDeviceResponse -> Bool
== :: AdminForgetDeviceResponse -> AdminForgetDeviceResponse -> Bool
$c== :: AdminForgetDeviceResponse -> AdminForgetDeviceResponse -> Bool
Prelude.Eq, ReadPrec [AdminForgetDeviceResponse]
ReadPrec AdminForgetDeviceResponse
Int -> ReadS AdminForgetDeviceResponse
ReadS [AdminForgetDeviceResponse]
(Int -> ReadS AdminForgetDeviceResponse)
-> ReadS [AdminForgetDeviceResponse]
-> ReadPrec AdminForgetDeviceResponse
-> ReadPrec [AdminForgetDeviceResponse]
-> Read AdminForgetDeviceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdminForgetDeviceResponse]
$creadListPrec :: ReadPrec [AdminForgetDeviceResponse]
readPrec :: ReadPrec AdminForgetDeviceResponse
$creadPrec :: ReadPrec AdminForgetDeviceResponse
readList :: ReadS [AdminForgetDeviceResponse]
$creadList :: ReadS [AdminForgetDeviceResponse]
readsPrec :: Int -> ReadS AdminForgetDeviceResponse
$creadsPrec :: Int -> ReadS AdminForgetDeviceResponse
Prelude.Read, Int -> AdminForgetDeviceResponse -> ShowS
[AdminForgetDeviceResponse] -> ShowS
AdminForgetDeviceResponse -> String
(Int -> AdminForgetDeviceResponse -> ShowS)
-> (AdminForgetDeviceResponse -> String)
-> ([AdminForgetDeviceResponse] -> ShowS)
-> Show AdminForgetDeviceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminForgetDeviceResponse] -> ShowS
$cshowList :: [AdminForgetDeviceResponse] -> ShowS
show :: AdminForgetDeviceResponse -> String
$cshow :: AdminForgetDeviceResponse -> String
showsPrec :: Int -> AdminForgetDeviceResponse -> ShowS
$cshowsPrec :: Int -> AdminForgetDeviceResponse -> ShowS
Prelude.Show, (forall x.
AdminForgetDeviceResponse -> Rep AdminForgetDeviceResponse x)
-> (forall x.
Rep AdminForgetDeviceResponse x -> AdminForgetDeviceResponse)
-> Generic AdminForgetDeviceResponse
forall x.
Rep AdminForgetDeviceResponse x -> AdminForgetDeviceResponse
forall x.
AdminForgetDeviceResponse -> Rep AdminForgetDeviceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AdminForgetDeviceResponse x -> AdminForgetDeviceResponse
$cfrom :: forall x.
AdminForgetDeviceResponse -> Rep AdminForgetDeviceResponse x
Prelude.Generic)
newAdminForgetDeviceResponse ::
AdminForgetDeviceResponse
newAdminForgetDeviceResponse :: AdminForgetDeviceResponse
newAdminForgetDeviceResponse =
AdminForgetDeviceResponse
AdminForgetDeviceResponse'
instance Prelude.NFData AdminForgetDeviceResponse