{-# 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.CognitoIdentity.UnlinkIdentity
(
UnlinkIdentity (..),
newUnlinkIdentity,
unlinkIdentity_identityId,
unlinkIdentity_logins,
unlinkIdentity_loginsToRemove,
UnlinkIdentityResponse (..),
newUnlinkIdentityResponse,
)
where
import Amazonka.CognitoIdentity.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 UnlinkIdentity = UnlinkIdentity'
{
UnlinkIdentity -> Text
identityId :: Prelude.Text,
UnlinkIdentity -> HashMap Text Text
logins :: Prelude.HashMap Prelude.Text Prelude.Text,
UnlinkIdentity -> [Text]
loginsToRemove :: [Prelude.Text]
}
deriving (UnlinkIdentity -> UnlinkIdentity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnlinkIdentity -> UnlinkIdentity -> Bool
$c/= :: UnlinkIdentity -> UnlinkIdentity -> Bool
== :: UnlinkIdentity -> UnlinkIdentity -> Bool
$c== :: UnlinkIdentity -> UnlinkIdentity -> Bool
Prelude.Eq, ReadPrec [UnlinkIdentity]
ReadPrec UnlinkIdentity
Int -> ReadS UnlinkIdentity
ReadS [UnlinkIdentity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnlinkIdentity]
$creadListPrec :: ReadPrec [UnlinkIdentity]
readPrec :: ReadPrec UnlinkIdentity
$creadPrec :: ReadPrec UnlinkIdentity
readList :: ReadS [UnlinkIdentity]
$creadList :: ReadS [UnlinkIdentity]
readsPrec :: Int -> ReadS UnlinkIdentity
$creadsPrec :: Int -> ReadS UnlinkIdentity
Prelude.Read, Int -> UnlinkIdentity -> ShowS
[UnlinkIdentity] -> ShowS
UnlinkIdentity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnlinkIdentity] -> ShowS
$cshowList :: [UnlinkIdentity] -> ShowS
show :: UnlinkIdentity -> String
$cshow :: UnlinkIdentity -> String
showsPrec :: Int -> UnlinkIdentity -> ShowS
$cshowsPrec :: Int -> UnlinkIdentity -> ShowS
Prelude.Show, forall x. Rep UnlinkIdentity x -> UnlinkIdentity
forall x. UnlinkIdentity -> Rep UnlinkIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnlinkIdentity x -> UnlinkIdentity
$cfrom :: forall x. UnlinkIdentity -> Rep UnlinkIdentity x
Prelude.Generic)
newUnlinkIdentity ::
Prelude.Text ->
UnlinkIdentity
newUnlinkIdentity :: Text -> UnlinkIdentity
newUnlinkIdentity Text
pIdentityId_ =
UnlinkIdentity'
{ $sel:identityId:UnlinkIdentity' :: Text
identityId = Text
pIdentityId_,
$sel:logins:UnlinkIdentity' :: HashMap Text Text
logins = forall a. Monoid a => a
Prelude.mempty,
$sel:loginsToRemove:UnlinkIdentity' :: [Text]
loginsToRemove = forall a. Monoid a => a
Prelude.mempty
}
unlinkIdentity_identityId :: Lens.Lens' UnlinkIdentity Prelude.Text
unlinkIdentity_identityId :: Lens' UnlinkIdentity Text
unlinkIdentity_identityId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnlinkIdentity' {Text
identityId :: Text
$sel:identityId:UnlinkIdentity' :: UnlinkIdentity -> Text
identityId} -> Text
identityId) (\s :: UnlinkIdentity
s@UnlinkIdentity' {} Text
a -> UnlinkIdentity
s {$sel:identityId:UnlinkIdentity' :: Text
identityId = Text
a} :: UnlinkIdentity)
unlinkIdentity_logins :: Lens.Lens' UnlinkIdentity (Prelude.HashMap Prelude.Text Prelude.Text)
unlinkIdentity_logins :: Lens' UnlinkIdentity (HashMap Text Text)
unlinkIdentity_logins = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnlinkIdentity' {HashMap Text Text
logins :: HashMap Text Text
$sel:logins:UnlinkIdentity' :: UnlinkIdentity -> HashMap Text Text
logins} -> HashMap Text Text
logins) (\s :: UnlinkIdentity
s@UnlinkIdentity' {} HashMap Text Text
a -> UnlinkIdentity
s {$sel:logins:UnlinkIdentity' :: HashMap Text Text
logins = HashMap Text Text
a} :: UnlinkIdentity) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
unlinkIdentity_loginsToRemove :: Lens.Lens' UnlinkIdentity [Prelude.Text]
unlinkIdentity_loginsToRemove :: Lens' UnlinkIdentity [Text]
unlinkIdentity_loginsToRemove = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnlinkIdentity' {[Text]
loginsToRemove :: [Text]
$sel:loginsToRemove:UnlinkIdentity' :: UnlinkIdentity -> [Text]
loginsToRemove} -> [Text]
loginsToRemove) (\s :: UnlinkIdentity
s@UnlinkIdentity' {} [Text]
a -> UnlinkIdentity
s {$sel:loginsToRemove:UnlinkIdentity' :: [Text]
loginsToRemove = [Text]
a} :: UnlinkIdentity) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest UnlinkIdentity where
type
AWSResponse UnlinkIdentity =
UnlinkIdentityResponse
request :: (Service -> Service) -> UnlinkIdentity -> Request UnlinkIdentity
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 UnlinkIdentity
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UnlinkIdentity)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull UnlinkIdentityResponse
UnlinkIdentityResponse'
instance Prelude.Hashable UnlinkIdentity where
hashWithSalt :: Int -> UnlinkIdentity -> Int
hashWithSalt Int
_salt UnlinkIdentity' {[Text]
Text
HashMap Text Text
loginsToRemove :: [Text]
logins :: HashMap Text Text
identityId :: Text
$sel:loginsToRemove:UnlinkIdentity' :: UnlinkIdentity -> [Text]
$sel:logins:UnlinkIdentity' :: UnlinkIdentity -> HashMap Text Text
$sel:identityId:UnlinkIdentity' :: UnlinkIdentity -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
identityId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text Text
logins
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
loginsToRemove
instance Prelude.NFData UnlinkIdentity where
rnf :: UnlinkIdentity -> ()
rnf UnlinkIdentity' {[Text]
Text
HashMap Text Text
loginsToRemove :: [Text]
logins :: HashMap Text Text
identityId :: Text
$sel:loginsToRemove:UnlinkIdentity' :: UnlinkIdentity -> [Text]
$sel:logins:UnlinkIdentity' :: UnlinkIdentity -> HashMap Text Text
$sel:identityId:UnlinkIdentity' :: UnlinkIdentity -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
identityId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text Text
logins
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
loginsToRemove
instance Data.ToHeaders UnlinkIdentity where
toHeaders :: UnlinkIdentity -> [Header]
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 -> [Header]
Data.=# ( ByteString
"AWSCognitoIdentityService.UnlinkIdentity" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UnlinkIdentity where
toJSON :: UnlinkIdentity -> Value
toJSON UnlinkIdentity' {[Text]
Text
HashMap Text Text
loginsToRemove :: [Text]
logins :: HashMap Text Text
identityId :: Text
$sel:loginsToRemove:UnlinkIdentity' :: UnlinkIdentity -> [Text]
$sel:logins:UnlinkIdentity' :: UnlinkIdentity -> HashMap Text Text
$sel:identityId:UnlinkIdentity' :: UnlinkIdentity -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"IdentityId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
identityId),
forall a. a -> Maybe a
Prelude.Just (Key
"Logins" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text Text
logins),
forall a. a -> Maybe a
Prelude.Just
(Key
"LoginsToRemove" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
loginsToRemove)
]
)
instance Data.ToPath UnlinkIdentity where
toPath :: UnlinkIdentity -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UnlinkIdentity where
toQuery :: UnlinkIdentity -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UnlinkIdentityResponse = UnlinkIdentityResponse'
{
}
deriving (UnlinkIdentityResponse -> UnlinkIdentityResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnlinkIdentityResponse -> UnlinkIdentityResponse -> Bool
$c/= :: UnlinkIdentityResponse -> UnlinkIdentityResponse -> Bool
== :: UnlinkIdentityResponse -> UnlinkIdentityResponse -> Bool
$c== :: UnlinkIdentityResponse -> UnlinkIdentityResponse -> Bool
Prelude.Eq, ReadPrec [UnlinkIdentityResponse]
ReadPrec UnlinkIdentityResponse
Int -> ReadS UnlinkIdentityResponse
ReadS [UnlinkIdentityResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnlinkIdentityResponse]
$creadListPrec :: ReadPrec [UnlinkIdentityResponse]
readPrec :: ReadPrec UnlinkIdentityResponse
$creadPrec :: ReadPrec UnlinkIdentityResponse
readList :: ReadS [UnlinkIdentityResponse]
$creadList :: ReadS [UnlinkIdentityResponse]
readsPrec :: Int -> ReadS UnlinkIdentityResponse
$creadsPrec :: Int -> ReadS UnlinkIdentityResponse
Prelude.Read, Int -> UnlinkIdentityResponse -> ShowS
[UnlinkIdentityResponse] -> ShowS
UnlinkIdentityResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnlinkIdentityResponse] -> ShowS
$cshowList :: [UnlinkIdentityResponse] -> ShowS
show :: UnlinkIdentityResponse -> String
$cshow :: UnlinkIdentityResponse -> String
showsPrec :: Int -> UnlinkIdentityResponse -> ShowS
$cshowsPrec :: Int -> UnlinkIdentityResponse -> ShowS
Prelude.Show, forall x. Rep UnlinkIdentityResponse x -> UnlinkIdentityResponse
forall x. UnlinkIdentityResponse -> Rep UnlinkIdentityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnlinkIdentityResponse x -> UnlinkIdentityResponse
$cfrom :: forall x. UnlinkIdentityResponse -> Rep UnlinkIdentityResponse x
Prelude.Generic)
newUnlinkIdentityResponse ::
UnlinkIdentityResponse
newUnlinkIdentityResponse :: UnlinkIdentityResponse
newUnlinkIdentityResponse = UnlinkIdentityResponse
UnlinkIdentityResponse'
instance Prelude.NFData UnlinkIdentityResponse where
rnf :: UnlinkIdentityResponse -> ()
rnf UnlinkIdentityResponse
_ = ()