{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.MechanicalTurk.Types.WorkerBlock where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data WorkerBlock = WorkerBlock'
{
WorkerBlock -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
WorkerBlock -> Maybe Text
workerId :: Prelude.Maybe Prelude.Text
}
deriving (WorkerBlock -> WorkerBlock -> Bool
(WorkerBlock -> WorkerBlock -> Bool)
-> (WorkerBlock -> WorkerBlock -> Bool) -> Eq WorkerBlock
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkerBlock -> WorkerBlock -> Bool
$c/= :: WorkerBlock -> WorkerBlock -> Bool
== :: WorkerBlock -> WorkerBlock -> Bool
$c== :: WorkerBlock -> WorkerBlock -> Bool
Prelude.Eq, ReadPrec [WorkerBlock]
ReadPrec WorkerBlock
Int -> ReadS WorkerBlock
ReadS [WorkerBlock]
(Int -> ReadS WorkerBlock)
-> ReadS [WorkerBlock]
-> ReadPrec WorkerBlock
-> ReadPrec [WorkerBlock]
-> Read WorkerBlock
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkerBlock]
$creadListPrec :: ReadPrec [WorkerBlock]
readPrec :: ReadPrec WorkerBlock
$creadPrec :: ReadPrec WorkerBlock
readList :: ReadS [WorkerBlock]
$creadList :: ReadS [WorkerBlock]
readsPrec :: Int -> ReadS WorkerBlock
$creadsPrec :: Int -> ReadS WorkerBlock
Prelude.Read, Int -> WorkerBlock -> ShowS
[WorkerBlock] -> ShowS
WorkerBlock -> String
(Int -> WorkerBlock -> ShowS)
-> (WorkerBlock -> String)
-> ([WorkerBlock] -> ShowS)
-> Show WorkerBlock
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkerBlock] -> ShowS
$cshowList :: [WorkerBlock] -> ShowS
show :: WorkerBlock -> String
$cshow :: WorkerBlock -> String
showsPrec :: Int -> WorkerBlock -> ShowS
$cshowsPrec :: Int -> WorkerBlock -> ShowS
Prelude.Show, (forall x. WorkerBlock -> Rep WorkerBlock x)
-> (forall x. Rep WorkerBlock x -> WorkerBlock)
-> Generic WorkerBlock
forall x. Rep WorkerBlock x -> WorkerBlock
forall x. WorkerBlock -> Rep WorkerBlock x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkerBlock x -> WorkerBlock
$cfrom :: forall x. WorkerBlock -> Rep WorkerBlock x
Prelude.Generic)
newWorkerBlock ::
WorkerBlock
newWorkerBlock :: WorkerBlock
newWorkerBlock =
WorkerBlock' :: Maybe Text -> Maybe Text -> WorkerBlock
WorkerBlock'
{ $sel:reason:WorkerBlock' :: Maybe Text
reason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:workerId:WorkerBlock' :: Maybe Text
workerId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
workerBlock_reason :: Lens.Lens' WorkerBlock (Prelude.Maybe Prelude.Text)
workerBlock_reason :: (Maybe Text -> f (Maybe Text)) -> WorkerBlock -> f WorkerBlock
workerBlock_reason = (WorkerBlock -> Maybe Text)
-> (WorkerBlock -> Maybe Text -> WorkerBlock)
-> Lens WorkerBlock WorkerBlock (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerBlock' {Maybe Text
reason :: Maybe Text
$sel:reason:WorkerBlock' :: WorkerBlock -> Maybe Text
reason} -> Maybe Text
reason) (\s :: WorkerBlock
s@WorkerBlock' {} Maybe Text
a -> WorkerBlock
s {$sel:reason:WorkerBlock' :: Maybe Text
reason = Maybe Text
a} :: WorkerBlock)
workerBlock_workerId :: Lens.Lens' WorkerBlock (Prelude.Maybe Prelude.Text)
workerBlock_workerId :: (Maybe Text -> f (Maybe Text)) -> WorkerBlock -> f WorkerBlock
workerBlock_workerId = (WorkerBlock -> Maybe Text)
-> (WorkerBlock -> Maybe Text -> WorkerBlock)
-> Lens WorkerBlock WorkerBlock (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkerBlock' {Maybe Text
workerId :: Maybe Text
$sel:workerId:WorkerBlock' :: WorkerBlock -> Maybe Text
workerId} -> Maybe Text
workerId) (\s :: WorkerBlock
s@WorkerBlock' {} Maybe Text
a -> WorkerBlock
s {$sel:workerId:WorkerBlock' :: Maybe Text
workerId = Maybe Text
a} :: WorkerBlock)
instance Core.FromJSON WorkerBlock where
parseJSON :: Value -> Parser WorkerBlock
parseJSON =
String
-> (Object -> Parser WorkerBlock) -> Value -> Parser WorkerBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WorkerBlock"
( \Object
x ->
Maybe Text -> Maybe Text -> WorkerBlock
WorkerBlock'
(Maybe Text -> Maybe Text -> WorkerBlock)
-> Parser (Maybe Text) -> Parser (Maybe Text -> WorkerBlock)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Reason")
Parser (Maybe Text -> WorkerBlock)
-> Parser (Maybe Text) -> Parser WorkerBlock
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkerId")
)
instance Prelude.Hashable WorkerBlock
instance Prelude.NFData WorkerBlock