{-# 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.MechanicalTurk.DisassociateQualificationFromWorker
(
DisassociateQualificationFromWorker (..),
newDisassociateQualificationFromWorker,
disassociateQualificationFromWorker_reason,
disassociateQualificationFromWorker_workerId,
disassociateQualificationFromWorker_qualificationTypeId,
DisassociateQualificationFromWorkerResponse (..),
newDisassociateQualificationFromWorkerResponse,
disassociateQualificationFromWorkerResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MechanicalTurk.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DisassociateQualificationFromWorker = DisassociateQualificationFromWorker'
{
DisassociateQualificationFromWorker -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
DisassociateQualificationFromWorker -> Text
workerId :: Prelude.Text,
DisassociateQualificationFromWorker -> Text
qualificationTypeId :: Prelude.Text
}
deriving (DisassociateQualificationFromWorker
-> DisassociateQualificationFromWorker -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateQualificationFromWorker
-> DisassociateQualificationFromWorker -> Bool
$c/= :: DisassociateQualificationFromWorker
-> DisassociateQualificationFromWorker -> Bool
== :: DisassociateQualificationFromWorker
-> DisassociateQualificationFromWorker -> Bool
$c== :: DisassociateQualificationFromWorker
-> DisassociateQualificationFromWorker -> Bool
Prelude.Eq, ReadPrec [DisassociateQualificationFromWorker]
ReadPrec DisassociateQualificationFromWorker
Int -> ReadS DisassociateQualificationFromWorker
ReadS [DisassociateQualificationFromWorker]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateQualificationFromWorker]
$creadListPrec :: ReadPrec [DisassociateQualificationFromWorker]
readPrec :: ReadPrec DisassociateQualificationFromWorker
$creadPrec :: ReadPrec DisassociateQualificationFromWorker
readList :: ReadS [DisassociateQualificationFromWorker]
$creadList :: ReadS [DisassociateQualificationFromWorker]
readsPrec :: Int -> ReadS DisassociateQualificationFromWorker
$creadsPrec :: Int -> ReadS DisassociateQualificationFromWorker
Prelude.Read, Int -> DisassociateQualificationFromWorker -> ShowS
[DisassociateQualificationFromWorker] -> ShowS
DisassociateQualificationFromWorker -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateQualificationFromWorker] -> ShowS
$cshowList :: [DisassociateQualificationFromWorker] -> ShowS
show :: DisassociateQualificationFromWorker -> String
$cshow :: DisassociateQualificationFromWorker -> String
showsPrec :: Int -> DisassociateQualificationFromWorker -> ShowS
$cshowsPrec :: Int -> DisassociateQualificationFromWorker -> ShowS
Prelude.Show, forall x.
Rep DisassociateQualificationFromWorker x
-> DisassociateQualificationFromWorker
forall x.
DisassociateQualificationFromWorker
-> Rep DisassociateQualificationFromWorker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateQualificationFromWorker x
-> DisassociateQualificationFromWorker
$cfrom :: forall x.
DisassociateQualificationFromWorker
-> Rep DisassociateQualificationFromWorker x
Prelude.Generic)
newDisassociateQualificationFromWorker ::
Prelude.Text ->
Prelude.Text ->
DisassociateQualificationFromWorker
newDisassociateQualificationFromWorker :: Text -> Text -> DisassociateQualificationFromWorker
newDisassociateQualificationFromWorker
Text
pWorkerId_
Text
pQualificationTypeId_ =
DisassociateQualificationFromWorker'
{ $sel:reason:DisassociateQualificationFromWorker' :: Maybe Text
reason =
forall a. Maybe a
Prelude.Nothing,
$sel:workerId:DisassociateQualificationFromWorker' :: Text
workerId = Text
pWorkerId_,
$sel:qualificationTypeId:DisassociateQualificationFromWorker' :: Text
qualificationTypeId =
Text
pQualificationTypeId_
}
disassociateQualificationFromWorker_reason :: Lens.Lens' DisassociateQualificationFromWorker (Prelude.Maybe Prelude.Text)
disassociateQualificationFromWorker_reason :: Lens' DisassociateQualificationFromWorker (Maybe Text)
disassociateQualificationFromWorker_reason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateQualificationFromWorker' {Maybe Text
reason :: Maybe Text
$sel:reason:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Maybe Text
reason} -> Maybe Text
reason) (\s :: DisassociateQualificationFromWorker
s@DisassociateQualificationFromWorker' {} Maybe Text
a -> DisassociateQualificationFromWorker
s {$sel:reason:DisassociateQualificationFromWorker' :: Maybe Text
reason = Maybe Text
a} :: DisassociateQualificationFromWorker)
disassociateQualificationFromWorker_workerId :: Lens.Lens' DisassociateQualificationFromWorker Prelude.Text
disassociateQualificationFromWorker_workerId :: Lens' DisassociateQualificationFromWorker Text
disassociateQualificationFromWorker_workerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateQualificationFromWorker' {Text
workerId :: Text
$sel:workerId:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Text
workerId} -> Text
workerId) (\s :: DisassociateQualificationFromWorker
s@DisassociateQualificationFromWorker' {} Text
a -> DisassociateQualificationFromWorker
s {$sel:workerId:DisassociateQualificationFromWorker' :: Text
workerId = Text
a} :: DisassociateQualificationFromWorker)
disassociateQualificationFromWorker_qualificationTypeId :: Lens.Lens' DisassociateQualificationFromWorker Prelude.Text
disassociateQualificationFromWorker_qualificationTypeId :: Lens' DisassociateQualificationFromWorker Text
disassociateQualificationFromWorker_qualificationTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateQualificationFromWorker' {Text
qualificationTypeId :: Text
$sel:qualificationTypeId:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Text
qualificationTypeId} -> Text
qualificationTypeId) (\s :: DisassociateQualificationFromWorker
s@DisassociateQualificationFromWorker' {} Text
a -> DisassociateQualificationFromWorker
s {$sel:qualificationTypeId:DisassociateQualificationFromWorker' :: Text
qualificationTypeId = Text
a} :: DisassociateQualificationFromWorker)
instance
Core.AWSRequest
DisassociateQualificationFromWorker
where
type
AWSResponse DisassociateQualificationFromWorker =
DisassociateQualificationFromWorkerResponse
request :: (Service -> Service)
-> DisassociateQualificationFromWorker
-> Request DisassociateQualificationFromWorker
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 DisassociateQualificationFromWorker
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DisassociateQualificationFromWorker)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DisassociateQualificationFromWorkerResponse
DisassociateQualificationFromWorkerResponse'
forall (f :: * -> *) a b. Functor 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
DisassociateQualificationFromWorker
where
hashWithSalt :: Int -> DisassociateQualificationFromWorker -> Int
hashWithSalt
Int
_salt
DisassociateQualificationFromWorker' {Maybe Text
Text
qualificationTypeId :: Text
workerId :: Text
reason :: Maybe Text
$sel:qualificationTypeId:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Text
$sel:workerId:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Text
$sel:reason:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reason
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workerId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
qualificationTypeId
instance
Prelude.NFData
DisassociateQualificationFromWorker
where
rnf :: DisassociateQualificationFromWorker -> ()
rnf DisassociateQualificationFromWorker' {Maybe Text
Text
qualificationTypeId :: Text
workerId :: Text
reason :: Maybe Text
$sel:qualificationTypeId:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Text
$sel:workerId:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Text
$sel:reason:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reason
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workerId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
qualificationTypeId
instance
Data.ToHeaders
DisassociateQualificationFromWorker
where
toHeaders :: DisassociateQualificationFromWorker -> 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
"MTurkRequesterServiceV20170117.DisassociateQualificationFromWorker" ::
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
DisassociateQualificationFromWorker
where
toJSON :: DisassociateQualificationFromWorker -> Value
toJSON DisassociateQualificationFromWorker' {Maybe Text
Text
qualificationTypeId :: Text
workerId :: Text
reason :: Maybe Text
$sel:qualificationTypeId:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Text
$sel:workerId:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Text
$sel:reason:DisassociateQualificationFromWorker' :: DisassociateQualificationFromWorker -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Reason" 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
reason,
forall a. a -> Maybe a
Prelude.Just (Key
"WorkerId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
workerId),
forall a. a -> Maybe a
Prelude.Just
(Key
"QualificationTypeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
qualificationTypeId)
]
)
instance
Data.ToPath
DisassociateQualificationFromWorker
where
toPath :: DisassociateQualificationFromWorker -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
DisassociateQualificationFromWorker
where
toQuery :: DisassociateQualificationFromWorker -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisassociateQualificationFromWorkerResponse = DisassociateQualificationFromWorkerResponse'
{
DisassociateQualificationFromWorkerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateQualificationFromWorkerResponse
-> DisassociateQualificationFromWorkerResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateQualificationFromWorkerResponse
-> DisassociateQualificationFromWorkerResponse -> Bool
$c/= :: DisassociateQualificationFromWorkerResponse
-> DisassociateQualificationFromWorkerResponse -> Bool
== :: DisassociateQualificationFromWorkerResponse
-> DisassociateQualificationFromWorkerResponse -> Bool
$c== :: DisassociateQualificationFromWorkerResponse
-> DisassociateQualificationFromWorkerResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateQualificationFromWorkerResponse]
ReadPrec DisassociateQualificationFromWorkerResponse
Int -> ReadS DisassociateQualificationFromWorkerResponse
ReadS [DisassociateQualificationFromWorkerResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateQualificationFromWorkerResponse]
$creadListPrec :: ReadPrec [DisassociateQualificationFromWorkerResponse]
readPrec :: ReadPrec DisassociateQualificationFromWorkerResponse
$creadPrec :: ReadPrec DisassociateQualificationFromWorkerResponse
readList :: ReadS [DisassociateQualificationFromWorkerResponse]
$creadList :: ReadS [DisassociateQualificationFromWorkerResponse]
readsPrec :: Int -> ReadS DisassociateQualificationFromWorkerResponse
$creadsPrec :: Int -> ReadS DisassociateQualificationFromWorkerResponse
Prelude.Read, Int -> DisassociateQualificationFromWorkerResponse -> ShowS
[DisassociateQualificationFromWorkerResponse] -> ShowS
DisassociateQualificationFromWorkerResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateQualificationFromWorkerResponse] -> ShowS
$cshowList :: [DisassociateQualificationFromWorkerResponse] -> ShowS
show :: DisassociateQualificationFromWorkerResponse -> String
$cshow :: DisassociateQualificationFromWorkerResponse -> String
showsPrec :: Int -> DisassociateQualificationFromWorkerResponse -> ShowS
$cshowsPrec :: Int -> DisassociateQualificationFromWorkerResponse -> ShowS
Prelude.Show, forall x.
Rep DisassociateQualificationFromWorkerResponse x
-> DisassociateQualificationFromWorkerResponse
forall x.
DisassociateQualificationFromWorkerResponse
-> Rep DisassociateQualificationFromWorkerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateQualificationFromWorkerResponse x
-> DisassociateQualificationFromWorkerResponse
$cfrom :: forall x.
DisassociateQualificationFromWorkerResponse
-> Rep DisassociateQualificationFromWorkerResponse x
Prelude.Generic)
newDisassociateQualificationFromWorkerResponse ::
Prelude.Int ->
DisassociateQualificationFromWorkerResponse
newDisassociateQualificationFromWorkerResponse :: Int -> DisassociateQualificationFromWorkerResponse
newDisassociateQualificationFromWorkerResponse
Int
pHttpStatus_ =
DisassociateQualificationFromWorkerResponse'
{ $sel:httpStatus:DisassociateQualificationFromWorkerResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociateQualificationFromWorkerResponse_httpStatus :: Lens.Lens' DisassociateQualificationFromWorkerResponse Prelude.Int
disassociateQualificationFromWorkerResponse_httpStatus :: Lens' DisassociateQualificationFromWorkerResponse Int
disassociateQualificationFromWorkerResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateQualificationFromWorkerResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateQualificationFromWorkerResponse' :: DisassociateQualificationFromWorkerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateQualificationFromWorkerResponse
s@DisassociateQualificationFromWorkerResponse' {} Int
a -> DisassociateQualificationFromWorkerResponse
s {$sel:httpStatus:DisassociateQualificationFromWorkerResponse' :: Int
httpStatus = Int
a} :: DisassociateQualificationFromWorkerResponse)
instance
Prelude.NFData
DisassociateQualificationFromWorkerResponse
where
rnf :: DisassociateQualificationFromWorkerResponse -> ()
rnf DisassociateQualificationFromWorkerResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateQualificationFromWorkerResponse' :: DisassociateQualificationFromWorkerResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus