{-# 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.AssociateQualificationWithWorker
(
AssociateQualificationWithWorker (..),
newAssociateQualificationWithWorker,
associateQualificationWithWorker_integerValue,
associateQualificationWithWorker_sendNotification,
associateQualificationWithWorker_qualificationTypeId,
associateQualificationWithWorker_workerId,
AssociateQualificationWithWorkerResponse (..),
newAssociateQualificationWithWorkerResponse,
associateQualificationWithWorkerResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MechanicalTurk.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AssociateQualificationWithWorker = AssociateQualificationWithWorker'
{
AssociateQualificationWithWorker -> Maybe Int
integerValue :: Prelude.Maybe Prelude.Int,
AssociateQualificationWithWorker -> Maybe Bool
sendNotification :: Prelude.Maybe Prelude.Bool,
AssociateQualificationWithWorker -> Text
qualificationTypeId :: Prelude.Text,
AssociateQualificationWithWorker -> Text
workerId :: Prelude.Text
}
deriving (AssociateQualificationWithWorker
-> AssociateQualificationWithWorker -> Bool
(AssociateQualificationWithWorker
-> AssociateQualificationWithWorker -> Bool)
-> (AssociateQualificationWithWorker
-> AssociateQualificationWithWorker -> Bool)
-> Eq AssociateQualificationWithWorker
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateQualificationWithWorker
-> AssociateQualificationWithWorker -> Bool
$c/= :: AssociateQualificationWithWorker
-> AssociateQualificationWithWorker -> Bool
== :: AssociateQualificationWithWorker
-> AssociateQualificationWithWorker -> Bool
$c== :: AssociateQualificationWithWorker
-> AssociateQualificationWithWorker -> Bool
Prelude.Eq, ReadPrec [AssociateQualificationWithWorker]
ReadPrec AssociateQualificationWithWorker
Int -> ReadS AssociateQualificationWithWorker
ReadS [AssociateQualificationWithWorker]
(Int -> ReadS AssociateQualificationWithWorker)
-> ReadS [AssociateQualificationWithWorker]
-> ReadPrec AssociateQualificationWithWorker
-> ReadPrec [AssociateQualificationWithWorker]
-> Read AssociateQualificationWithWorker
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateQualificationWithWorker]
$creadListPrec :: ReadPrec [AssociateQualificationWithWorker]
readPrec :: ReadPrec AssociateQualificationWithWorker
$creadPrec :: ReadPrec AssociateQualificationWithWorker
readList :: ReadS [AssociateQualificationWithWorker]
$creadList :: ReadS [AssociateQualificationWithWorker]
readsPrec :: Int -> ReadS AssociateQualificationWithWorker
$creadsPrec :: Int -> ReadS AssociateQualificationWithWorker
Prelude.Read, Int -> AssociateQualificationWithWorker -> ShowS
[AssociateQualificationWithWorker] -> ShowS
AssociateQualificationWithWorker -> String
(Int -> AssociateQualificationWithWorker -> ShowS)
-> (AssociateQualificationWithWorker -> String)
-> ([AssociateQualificationWithWorker] -> ShowS)
-> Show AssociateQualificationWithWorker
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateQualificationWithWorker] -> ShowS
$cshowList :: [AssociateQualificationWithWorker] -> ShowS
show :: AssociateQualificationWithWorker -> String
$cshow :: AssociateQualificationWithWorker -> String
showsPrec :: Int -> AssociateQualificationWithWorker -> ShowS
$cshowsPrec :: Int -> AssociateQualificationWithWorker -> ShowS
Prelude.Show, (forall x.
AssociateQualificationWithWorker
-> Rep AssociateQualificationWithWorker x)
-> (forall x.
Rep AssociateQualificationWithWorker x
-> AssociateQualificationWithWorker)
-> Generic AssociateQualificationWithWorker
forall x.
Rep AssociateQualificationWithWorker x
-> AssociateQualificationWithWorker
forall x.
AssociateQualificationWithWorker
-> Rep AssociateQualificationWithWorker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateQualificationWithWorker x
-> AssociateQualificationWithWorker
$cfrom :: forall x.
AssociateQualificationWithWorker
-> Rep AssociateQualificationWithWorker x
Prelude.Generic)
newAssociateQualificationWithWorker ::
Prelude.Text ->
Prelude.Text ->
AssociateQualificationWithWorker
newAssociateQualificationWithWorker :: Text -> Text -> AssociateQualificationWithWorker
newAssociateQualificationWithWorker
Text
pQualificationTypeId_
Text
pWorkerId_ =
AssociateQualificationWithWorker' :: Maybe Int
-> Maybe Bool -> Text -> Text -> AssociateQualificationWithWorker
AssociateQualificationWithWorker'
{ $sel:integerValue:AssociateQualificationWithWorker' :: Maybe Int
integerValue =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:sendNotification:AssociateQualificationWithWorker' :: Maybe Bool
sendNotification = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:qualificationTypeId:AssociateQualificationWithWorker' :: Text
qualificationTypeId =
Text
pQualificationTypeId_,
$sel:workerId:AssociateQualificationWithWorker' :: Text
workerId = Text
pWorkerId_
}
associateQualificationWithWorker_integerValue :: Lens.Lens' AssociateQualificationWithWorker (Prelude.Maybe Prelude.Int)
associateQualificationWithWorker_integerValue :: (Maybe Int -> f (Maybe Int))
-> AssociateQualificationWithWorker
-> f AssociateQualificationWithWorker
associateQualificationWithWorker_integerValue = (AssociateQualificationWithWorker -> Maybe Int)
-> (AssociateQualificationWithWorker
-> Maybe Int -> AssociateQualificationWithWorker)
-> Lens
AssociateQualificationWithWorker
AssociateQualificationWithWorker
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateQualificationWithWorker' {Maybe Int
integerValue :: Maybe Int
$sel:integerValue:AssociateQualificationWithWorker' :: AssociateQualificationWithWorker -> Maybe Int
integerValue} -> Maybe Int
integerValue) (\s :: AssociateQualificationWithWorker
s@AssociateQualificationWithWorker' {} Maybe Int
a -> AssociateQualificationWithWorker
s {$sel:integerValue:AssociateQualificationWithWorker' :: Maybe Int
integerValue = Maybe Int
a} :: AssociateQualificationWithWorker)
associateQualificationWithWorker_sendNotification :: Lens.Lens' AssociateQualificationWithWorker (Prelude.Maybe Prelude.Bool)
associateQualificationWithWorker_sendNotification :: (Maybe Bool -> f (Maybe Bool))
-> AssociateQualificationWithWorker
-> f AssociateQualificationWithWorker
associateQualificationWithWorker_sendNotification = (AssociateQualificationWithWorker -> Maybe Bool)
-> (AssociateQualificationWithWorker
-> Maybe Bool -> AssociateQualificationWithWorker)
-> Lens
AssociateQualificationWithWorker
AssociateQualificationWithWorker
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateQualificationWithWorker' {Maybe Bool
sendNotification :: Maybe Bool
$sel:sendNotification:AssociateQualificationWithWorker' :: AssociateQualificationWithWorker -> Maybe Bool
sendNotification} -> Maybe Bool
sendNotification) (\s :: AssociateQualificationWithWorker
s@AssociateQualificationWithWorker' {} Maybe Bool
a -> AssociateQualificationWithWorker
s {$sel:sendNotification:AssociateQualificationWithWorker' :: Maybe Bool
sendNotification = Maybe Bool
a} :: AssociateQualificationWithWorker)
associateQualificationWithWorker_qualificationTypeId :: Lens.Lens' AssociateQualificationWithWorker Prelude.Text
associateQualificationWithWorker_qualificationTypeId :: (Text -> f Text)
-> AssociateQualificationWithWorker
-> f AssociateQualificationWithWorker
associateQualificationWithWorker_qualificationTypeId = (AssociateQualificationWithWorker -> Text)
-> (AssociateQualificationWithWorker
-> Text -> AssociateQualificationWithWorker)
-> Lens
AssociateQualificationWithWorker
AssociateQualificationWithWorker
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateQualificationWithWorker' {Text
qualificationTypeId :: Text
$sel:qualificationTypeId:AssociateQualificationWithWorker' :: AssociateQualificationWithWorker -> Text
qualificationTypeId} -> Text
qualificationTypeId) (\s :: AssociateQualificationWithWorker
s@AssociateQualificationWithWorker' {} Text
a -> AssociateQualificationWithWorker
s {$sel:qualificationTypeId:AssociateQualificationWithWorker' :: Text
qualificationTypeId = Text
a} :: AssociateQualificationWithWorker)
associateQualificationWithWorker_workerId :: Lens.Lens' AssociateQualificationWithWorker Prelude.Text
associateQualificationWithWorker_workerId :: (Text -> f Text)
-> AssociateQualificationWithWorker
-> f AssociateQualificationWithWorker
associateQualificationWithWorker_workerId = (AssociateQualificationWithWorker -> Text)
-> (AssociateQualificationWithWorker
-> Text -> AssociateQualificationWithWorker)
-> Lens
AssociateQualificationWithWorker
AssociateQualificationWithWorker
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateQualificationWithWorker' {Text
workerId :: Text
$sel:workerId:AssociateQualificationWithWorker' :: AssociateQualificationWithWorker -> Text
workerId} -> Text
workerId) (\s :: AssociateQualificationWithWorker
s@AssociateQualificationWithWorker' {} Text
a -> AssociateQualificationWithWorker
s {$sel:workerId:AssociateQualificationWithWorker' :: Text
workerId = Text
a} :: AssociateQualificationWithWorker)
instance
Core.AWSRequest
AssociateQualificationWithWorker
where
type
AWSResponse AssociateQualificationWithWorker =
AssociateQualificationWithWorkerResponse
request :: AssociateQualificationWithWorker
-> Request AssociateQualificationWithWorker
request = Service
-> AssociateQualificationWithWorker
-> Request AssociateQualificationWithWorker
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateQualificationWithWorker
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateQualificationWithWorker)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse AssociateQualificationWithWorker))
-> Logger
-> Service
-> Proxy AssociateQualificationWithWorker
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateQualificationWithWorker)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> AssociateQualificationWithWorkerResponse
AssociateQualificationWithWorkerResponse'
(Int -> AssociateQualificationWithWorkerResponse)
-> Either String Int
-> Either String AssociateQualificationWithWorkerResponse
forall (f :: * -> *) a b. Functor 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
AssociateQualificationWithWorker
instance
Prelude.NFData
AssociateQualificationWithWorker
instance
Core.ToHeaders
AssociateQualificationWithWorker
where
toHeaders :: AssociateQualificationWithWorker -> ResponseHeaders
toHeaders =
ResponseHeaders
-> AssociateQualificationWithWorker -> 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
"MTurkRequesterServiceV20170117.AssociateQualificationWithWorker" ::
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 AssociateQualificationWithWorker where
toJSON :: AssociateQualificationWithWorker -> Value
toJSON AssociateQualificationWithWorker' {Maybe Bool
Maybe Int
Text
workerId :: Text
qualificationTypeId :: Text
sendNotification :: Maybe Bool
integerValue :: Maybe Int
$sel:workerId:AssociateQualificationWithWorker' :: AssociateQualificationWithWorker -> Text
$sel:qualificationTypeId:AssociateQualificationWithWorker' :: AssociateQualificationWithWorker -> Text
$sel:sendNotification:AssociateQualificationWithWorker' :: AssociateQualificationWithWorker -> Maybe Bool
$sel:integerValue:AssociateQualificationWithWorker' :: AssociateQualificationWithWorker -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IntegerValue" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
integerValue,
(Text
"SendNotification" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
sendNotification,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"QualificationTypeId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
qualificationTypeId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WorkerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workerId)
]
)
instance Core.ToPath AssociateQualificationWithWorker where
toPath :: AssociateQualificationWithWorker -> ByteString
toPath = ByteString -> AssociateQualificationWithWorker -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
AssociateQualificationWithWorker
where
toQuery :: AssociateQualificationWithWorker -> QueryString
toQuery = QueryString -> AssociateQualificationWithWorker -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AssociateQualificationWithWorkerResponse = AssociateQualificationWithWorkerResponse'
{
AssociateQualificationWithWorkerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateQualificationWithWorkerResponse
-> AssociateQualificationWithWorkerResponse -> Bool
(AssociateQualificationWithWorkerResponse
-> AssociateQualificationWithWorkerResponse -> Bool)
-> (AssociateQualificationWithWorkerResponse
-> AssociateQualificationWithWorkerResponse -> Bool)
-> Eq AssociateQualificationWithWorkerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateQualificationWithWorkerResponse
-> AssociateQualificationWithWorkerResponse -> Bool
$c/= :: AssociateQualificationWithWorkerResponse
-> AssociateQualificationWithWorkerResponse -> Bool
== :: AssociateQualificationWithWorkerResponse
-> AssociateQualificationWithWorkerResponse -> Bool
$c== :: AssociateQualificationWithWorkerResponse
-> AssociateQualificationWithWorkerResponse -> Bool
Prelude.Eq, ReadPrec [AssociateQualificationWithWorkerResponse]
ReadPrec AssociateQualificationWithWorkerResponse
Int -> ReadS AssociateQualificationWithWorkerResponse
ReadS [AssociateQualificationWithWorkerResponse]
(Int -> ReadS AssociateQualificationWithWorkerResponse)
-> ReadS [AssociateQualificationWithWorkerResponse]
-> ReadPrec AssociateQualificationWithWorkerResponse
-> ReadPrec [AssociateQualificationWithWorkerResponse]
-> Read AssociateQualificationWithWorkerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateQualificationWithWorkerResponse]
$creadListPrec :: ReadPrec [AssociateQualificationWithWorkerResponse]
readPrec :: ReadPrec AssociateQualificationWithWorkerResponse
$creadPrec :: ReadPrec AssociateQualificationWithWorkerResponse
readList :: ReadS [AssociateQualificationWithWorkerResponse]
$creadList :: ReadS [AssociateQualificationWithWorkerResponse]
readsPrec :: Int -> ReadS AssociateQualificationWithWorkerResponse
$creadsPrec :: Int -> ReadS AssociateQualificationWithWorkerResponse
Prelude.Read, Int -> AssociateQualificationWithWorkerResponse -> ShowS
[AssociateQualificationWithWorkerResponse] -> ShowS
AssociateQualificationWithWorkerResponse -> String
(Int -> AssociateQualificationWithWorkerResponse -> ShowS)
-> (AssociateQualificationWithWorkerResponse -> String)
-> ([AssociateQualificationWithWorkerResponse] -> ShowS)
-> Show AssociateQualificationWithWorkerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateQualificationWithWorkerResponse] -> ShowS
$cshowList :: [AssociateQualificationWithWorkerResponse] -> ShowS
show :: AssociateQualificationWithWorkerResponse -> String
$cshow :: AssociateQualificationWithWorkerResponse -> String
showsPrec :: Int -> AssociateQualificationWithWorkerResponse -> ShowS
$cshowsPrec :: Int -> AssociateQualificationWithWorkerResponse -> ShowS
Prelude.Show, (forall x.
AssociateQualificationWithWorkerResponse
-> Rep AssociateQualificationWithWorkerResponse x)
-> (forall x.
Rep AssociateQualificationWithWorkerResponse x
-> AssociateQualificationWithWorkerResponse)
-> Generic AssociateQualificationWithWorkerResponse
forall x.
Rep AssociateQualificationWithWorkerResponse x
-> AssociateQualificationWithWorkerResponse
forall x.
AssociateQualificationWithWorkerResponse
-> Rep AssociateQualificationWithWorkerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateQualificationWithWorkerResponse x
-> AssociateQualificationWithWorkerResponse
$cfrom :: forall x.
AssociateQualificationWithWorkerResponse
-> Rep AssociateQualificationWithWorkerResponse x
Prelude.Generic)
newAssociateQualificationWithWorkerResponse ::
Prelude.Int ->
AssociateQualificationWithWorkerResponse
newAssociateQualificationWithWorkerResponse :: Int -> AssociateQualificationWithWorkerResponse
newAssociateQualificationWithWorkerResponse
Int
pHttpStatus_ =
AssociateQualificationWithWorkerResponse' :: Int -> AssociateQualificationWithWorkerResponse
AssociateQualificationWithWorkerResponse'
{ $sel:httpStatus:AssociateQualificationWithWorkerResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
associateQualificationWithWorkerResponse_httpStatus :: Lens.Lens' AssociateQualificationWithWorkerResponse Prelude.Int
associateQualificationWithWorkerResponse_httpStatus :: (Int -> f Int)
-> AssociateQualificationWithWorkerResponse
-> f AssociateQualificationWithWorkerResponse
associateQualificationWithWorkerResponse_httpStatus = (AssociateQualificationWithWorkerResponse -> Int)
-> (AssociateQualificationWithWorkerResponse
-> Int -> AssociateQualificationWithWorkerResponse)
-> Lens
AssociateQualificationWithWorkerResponse
AssociateQualificationWithWorkerResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateQualificationWithWorkerResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateQualificationWithWorkerResponse' :: AssociateQualificationWithWorkerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateQualificationWithWorkerResponse
s@AssociateQualificationWithWorkerResponse' {} Int
a -> AssociateQualificationWithWorkerResponse
s {$sel:httpStatus:AssociateQualificationWithWorkerResponse' :: Int
httpStatus = Int
a} :: AssociateQualificationWithWorkerResponse)
instance
Prelude.NFData
AssociateQualificationWithWorkerResponse