{-# 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.UpdateHITTypeOfHIT
(
UpdateHITTypeOfHIT (..),
newUpdateHITTypeOfHIT,
updateHITTypeOfHIT_hITId,
updateHITTypeOfHIT_hITTypeId,
UpdateHITTypeOfHITResponse (..),
newUpdateHITTypeOfHITResponse,
updateHITTypeOfHITResponse_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 UpdateHITTypeOfHIT = UpdateHITTypeOfHIT'
{
UpdateHITTypeOfHIT -> Text
hITId :: Prelude.Text,
UpdateHITTypeOfHIT -> Text
hITTypeId :: Prelude.Text
}
deriving (UpdateHITTypeOfHIT -> UpdateHITTypeOfHIT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateHITTypeOfHIT -> UpdateHITTypeOfHIT -> Bool
$c/= :: UpdateHITTypeOfHIT -> UpdateHITTypeOfHIT -> Bool
== :: UpdateHITTypeOfHIT -> UpdateHITTypeOfHIT -> Bool
$c== :: UpdateHITTypeOfHIT -> UpdateHITTypeOfHIT -> Bool
Prelude.Eq, ReadPrec [UpdateHITTypeOfHIT]
ReadPrec UpdateHITTypeOfHIT
Int -> ReadS UpdateHITTypeOfHIT
ReadS [UpdateHITTypeOfHIT]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateHITTypeOfHIT]
$creadListPrec :: ReadPrec [UpdateHITTypeOfHIT]
readPrec :: ReadPrec UpdateHITTypeOfHIT
$creadPrec :: ReadPrec UpdateHITTypeOfHIT
readList :: ReadS [UpdateHITTypeOfHIT]
$creadList :: ReadS [UpdateHITTypeOfHIT]
readsPrec :: Int -> ReadS UpdateHITTypeOfHIT
$creadsPrec :: Int -> ReadS UpdateHITTypeOfHIT
Prelude.Read, Int -> UpdateHITTypeOfHIT -> ShowS
[UpdateHITTypeOfHIT] -> ShowS
UpdateHITTypeOfHIT -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateHITTypeOfHIT] -> ShowS
$cshowList :: [UpdateHITTypeOfHIT] -> ShowS
show :: UpdateHITTypeOfHIT -> String
$cshow :: UpdateHITTypeOfHIT -> String
showsPrec :: Int -> UpdateHITTypeOfHIT -> ShowS
$cshowsPrec :: Int -> UpdateHITTypeOfHIT -> ShowS
Prelude.Show, forall x. Rep UpdateHITTypeOfHIT x -> UpdateHITTypeOfHIT
forall x. UpdateHITTypeOfHIT -> Rep UpdateHITTypeOfHIT x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateHITTypeOfHIT x -> UpdateHITTypeOfHIT
$cfrom :: forall x. UpdateHITTypeOfHIT -> Rep UpdateHITTypeOfHIT x
Prelude.Generic)
newUpdateHITTypeOfHIT ::
Prelude.Text ->
Prelude.Text ->
UpdateHITTypeOfHIT
newUpdateHITTypeOfHIT :: Text -> Text -> UpdateHITTypeOfHIT
newUpdateHITTypeOfHIT Text
pHITId_ Text
pHITTypeId_ =
UpdateHITTypeOfHIT'
{ $sel:hITId:UpdateHITTypeOfHIT' :: Text
hITId = Text
pHITId_,
$sel:hITTypeId:UpdateHITTypeOfHIT' :: Text
hITTypeId = Text
pHITTypeId_
}
updateHITTypeOfHIT_hITId :: Lens.Lens' UpdateHITTypeOfHIT Prelude.Text
updateHITTypeOfHIT_hITId :: Lens' UpdateHITTypeOfHIT Text
updateHITTypeOfHIT_hITId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateHITTypeOfHIT' {Text
hITId :: Text
$sel:hITId:UpdateHITTypeOfHIT' :: UpdateHITTypeOfHIT -> Text
hITId} -> Text
hITId) (\s :: UpdateHITTypeOfHIT
s@UpdateHITTypeOfHIT' {} Text
a -> UpdateHITTypeOfHIT
s {$sel:hITId:UpdateHITTypeOfHIT' :: Text
hITId = Text
a} :: UpdateHITTypeOfHIT)
updateHITTypeOfHIT_hITTypeId :: Lens.Lens' UpdateHITTypeOfHIT Prelude.Text
updateHITTypeOfHIT_hITTypeId :: Lens' UpdateHITTypeOfHIT Text
updateHITTypeOfHIT_hITTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateHITTypeOfHIT' {Text
hITTypeId :: Text
$sel:hITTypeId:UpdateHITTypeOfHIT' :: UpdateHITTypeOfHIT -> Text
hITTypeId} -> Text
hITTypeId) (\s :: UpdateHITTypeOfHIT
s@UpdateHITTypeOfHIT' {} Text
a -> UpdateHITTypeOfHIT
s {$sel:hITTypeId:UpdateHITTypeOfHIT' :: Text
hITTypeId = Text
a} :: UpdateHITTypeOfHIT)
instance Core.AWSRequest UpdateHITTypeOfHIT where
type
AWSResponse UpdateHITTypeOfHIT =
UpdateHITTypeOfHITResponse
request :: (Service -> Service)
-> UpdateHITTypeOfHIT -> Request UpdateHITTypeOfHIT
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 UpdateHITTypeOfHIT
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateHITTypeOfHIT)))
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 -> UpdateHITTypeOfHITResponse
UpdateHITTypeOfHITResponse'
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 UpdateHITTypeOfHIT where
hashWithSalt :: Int -> UpdateHITTypeOfHIT -> Int
hashWithSalt Int
_salt UpdateHITTypeOfHIT' {Text
hITTypeId :: Text
hITId :: Text
$sel:hITTypeId:UpdateHITTypeOfHIT' :: UpdateHITTypeOfHIT -> Text
$sel:hITId:UpdateHITTypeOfHIT' :: UpdateHITTypeOfHIT -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hITId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hITTypeId
instance Prelude.NFData UpdateHITTypeOfHIT where
rnf :: UpdateHITTypeOfHIT -> ()
rnf UpdateHITTypeOfHIT' {Text
hITTypeId :: Text
hITId :: Text
$sel:hITTypeId:UpdateHITTypeOfHIT' :: UpdateHITTypeOfHIT -> Text
$sel:hITId:UpdateHITTypeOfHIT' :: UpdateHITTypeOfHIT -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
hITId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
hITTypeId
instance Data.ToHeaders UpdateHITTypeOfHIT where
toHeaders :: UpdateHITTypeOfHIT -> 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.UpdateHITTypeOfHIT" ::
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 UpdateHITTypeOfHIT where
toJSON :: UpdateHITTypeOfHIT -> Value
toJSON UpdateHITTypeOfHIT' {Text
hITTypeId :: Text
hITId :: Text
$sel:hITTypeId:UpdateHITTypeOfHIT' :: UpdateHITTypeOfHIT -> Text
$sel:hITId:UpdateHITTypeOfHIT' :: UpdateHITTypeOfHIT -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"HITId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
hITId),
forall a. a -> Maybe a
Prelude.Just (Key
"HITTypeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
hITTypeId)
]
)
instance Data.ToPath UpdateHITTypeOfHIT where
toPath :: UpdateHITTypeOfHIT -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateHITTypeOfHIT where
toQuery :: UpdateHITTypeOfHIT -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateHITTypeOfHITResponse = UpdateHITTypeOfHITResponse'
{
UpdateHITTypeOfHITResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateHITTypeOfHITResponse -> UpdateHITTypeOfHITResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateHITTypeOfHITResponse -> UpdateHITTypeOfHITResponse -> Bool
$c/= :: UpdateHITTypeOfHITResponse -> UpdateHITTypeOfHITResponse -> Bool
== :: UpdateHITTypeOfHITResponse -> UpdateHITTypeOfHITResponse -> Bool
$c== :: UpdateHITTypeOfHITResponse -> UpdateHITTypeOfHITResponse -> Bool
Prelude.Eq, ReadPrec [UpdateHITTypeOfHITResponse]
ReadPrec UpdateHITTypeOfHITResponse
Int -> ReadS UpdateHITTypeOfHITResponse
ReadS [UpdateHITTypeOfHITResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateHITTypeOfHITResponse]
$creadListPrec :: ReadPrec [UpdateHITTypeOfHITResponse]
readPrec :: ReadPrec UpdateHITTypeOfHITResponse
$creadPrec :: ReadPrec UpdateHITTypeOfHITResponse
readList :: ReadS [UpdateHITTypeOfHITResponse]
$creadList :: ReadS [UpdateHITTypeOfHITResponse]
readsPrec :: Int -> ReadS UpdateHITTypeOfHITResponse
$creadsPrec :: Int -> ReadS UpdateHITTypeOfHITResponse
Prelude.Read, Int -> UpdateHITTypeOfHITResponse -> ShowS
[UpdateHITTypeOfHITResponse] -> ShowS
UpdateHITTypeOfHITResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateHITTypeOfHITResponse] -> ShowS
$cshowList :: [UpdateHITTypeOfHITResponse] -> ShowS
show :: UpdateHITTypeOfHITResponse -> String
$cshow :: UpdateHITTypeOfHITResponse -> String
showsPrec :: Int -> UpdateHITTypeOfHITResponse -> ShowS
$cshowsPrec :: Int -> UpdateHITTypeOfHITResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateHITTypeOfHITResponse x -> UpdateHITTypeOfHITResponse
forall x.
UpdateHITTypeOfHITResponse -> Rep UpdateHITTypeOfHITResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateHITTypeOfHITResponse x -> UpdateHITTypeOfHITResponse
$cfrom :: forall x.
UpdateHITTypeOfHITResponse -> Rep UpdateHITTypeOfHITResponse x
Prelude.Generic)
newUpdateHITTypeOfHITResponse ::
Prelude.Int ->
UpdateHITTypeOfHITResponse
newUpdateHITTypeOfHITResponse :: Int -> UpdateHITTypeOfHITResponse
newUpdateHITTypeOfHITResponse Int
pHttpStatus_ =
UpdateHITTypeOfHITResponse'
{ $sel:httpStatus:UpdateHITTypeOfHITResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateHITTypeOfHITResponse_httpStatus :: Lens.Lens' UpdateHITTypeOfHITResponse Prelude.Int
updateHITTypeOfHITResponse_httpStatus :: Lens' UpdateHITTypeOfHITResponse Int
updateHITTypeOfHITResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateHITTypeOfHITResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateHITTypeOfHITResponse' :: UpdateHITTypeOfHITResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateHITTypeOfHITResponse
s@UpdateHITTypeOfHITResponse' {} Int
a -> UpdateHITTypeOfHITResponse
s {$sel:httpStatus:UpdateHITTypeOfHITResponse' :: Int
httpStatus = Int
a} :: UpdateHITTypeOfHITResponse)
instance Prelude.NFData UpdateHITTypeOfHITResponse where
rnf :: UpdateHITTypeOfHITResponse -> ()
rnf UpdateHITTypeOfHITResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateHITTypeOfHITResponse' :: UpdateHITTypeOfHITResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus