{-# 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.NotifyWorkersFailureStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MechanicalTurk.Types.NotifyWorkersFailureCode
import qualified Amazonka.Prelude as Prelude
data NotifyWorkersFailureStatus = NotifyWorkersFailureStatus'
{
NotifyWorkersFailureStatus -> Maybe Text
notifyWorkersFailureMessage :: Prelude.Maybe Prelude.Text,
NotifyWorkersFailureStatus -> Maybe NotifyWorkersFailureCode
notifyWorkersFailureCode :: Prelude.Maybe NotifyWorkersFailureCode,
NotifyWorkersFailureStatus -> Maybe Text
workerId :: Prelude.Maybe Prelude.Text
}
deriving (NotifyWorkersFailureStatus -> NotifyWorkersFailureStatus -> Bool
(NotifyWorkersFailureStatus -> NotifyWorkersFailureStatus -> Bool)
-> (NotifyWorkersFailureStatus
-> NotifyWorkersFailureStatus -> Bool)
-> Eq NotifyWorkersFailureStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotifyWorkersFailureStatus -> NotifyWorkersFailureStatus -> Bool
$c/= :: NotifyWorkersFailureStatus -> NotifyWorkersFailureStatus -> Bool
== :: NotifyWorkersFailureStatus -> NotifyWorkersFailureStatus -> Bool
$c== :: NotifyWorkersFailureStatus -> NotifyWorkersFailureStatus -> Bool
Prelude.Eq, ReadPrec [NotifyWorkersFailureStatus]
ReadPrec NotifyWorkersFailureStatus
Int -> ReadS NotifyWorkersFailureStatus
ReadS [NotifyWorkersFailureStatus]
(Int -> ReadS NotifyWorkersFailureStatus)
-> ReadS [NotifyWorkersFailureStatus]
-> ReadPrec NotifyWorkersFailureStatus
-> ReadPrec [NotifyWorkersFailureStatus]
-> Read NotifyWorkersFailureStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotifyWorkersFailureStatus]
$creadListPrec :: ReadPrec [NotifyWorkersFailureStatus]
readPrec :: ReadPrec NotifyWorkersFailureStatus
$creadPrec :: ReadPrec NotifyWorkersFailureStatus
readList :: ReadS [NotifyWorkersFailureStatus]
$creadList :: ReadS [NotifyWorkersFailureStatus]
readsPrec :: Int -> ReadS NotifyWorkersFailureStatus
$creadsPrec :: Int -> ReadS NotifyWorkersFailureStatus
Prelude.Read, Int -> NotifyWorkersFailureStatus -> ShowS
[NotifyWorkersFailureStatus] -> ShowS
NotifyWorkersFailureStatus -> String
(Int -> NotifyWorkersFailureStatus -> ShowS)
-> (NotifyWorkersFailureStatus -> String)
-> ([NotifyWorkersFailureStatus] -> ShowS)
-> Show NotifyWorkersFailureStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotifyWorkersFailureStatus] -> ShowS
$cshowList :: [NotifyWorkersFailureStatus] -> ShowS
show :: NotifyWorkersFailureStatus -> String
$cshow :: NotifyWorkersFailureStatus -> String
showsPrec :: Int -> NotifyWorkersFailureStatus -> ShowS
$cshowsPrec :: Int -> NotifyWorkersFailureStatus -> ShowS
Prelude.Show, (forall x.
NotifyWorkersFailureStatus -> Rep NotifyWorkersFailureStatus x)
-> (forall x.
Rep NotifyWorkersFailureStatus x -> NotifyWorkersFailureStatus)
-> Generic NotifyWorkersFailureStatus
forall x.
Rep NotifyWorkersFailureStatus x -> NotifyWorkersFailureStatus
forall x.
NotifyWorkersFailureStatus -> Rep NotifyWorkersFailureStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NotifyWorkersFailureStatus x -> NotifyWorkersFailureStatus
$cfrom :: forall x.
NotifyWorkersFailureStatus -> Rep NotifyWorkersFailureStatus x
Prelude.Generic)
newNotifyWorkersFailureStatus ::
NotifyWorkersFailureStatus
newNotifyWorkersFailureStatus :: NotifyWorkersFailureStatus
newNotifyWorkersFailureStatus =
NotifyWorkersFailureStatus' :: Maybe Text
-> Maybe NotifyWorkersFailureCode
-> Maybe Text
-> NotifyWorkersFailureStatus
NotifyWorkersFailureStatus'
{ $sel:notifyWorkersFailureMessage:NotifyWorkersFailureStatus' :: Maybe Text
notifyWorkersFailureMessage =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:notifyWorkersFailureCode:NotifyWorkersFailureStatus' :: Maybe NotifyWorkersFailureCode
notifyWorkersFailureCode = Maybe NotifyWorkersFailureCode
forall a. Maybe a
Prelude.Nothing,
$sel:workerId:NotifyWorkersFailureStatus' :: Maybe Text
workerId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
notifyWorkersFailureStatus_notifyWorkersFailureMessage :: Lens.Lens' NotifyWorkersFailureStatus (Prelude.Maybe Prelude.Text)
notifyWorkersFailureStatus_notifyWorkersFailureMessage :: (Maybe Text -> f (Maybe Text))
-> NotifyWorkersFailureStatus -> f NotifyWorkersFailureStatus
notifyWorkersFailureStatus_notifyWorkersFailureMessage = (NotifyWorkersFailureStatus -> Maybe Text)
-> (NotifyWorkersFailureStatus
-> Maybe Text -> NotifyWorkersFailureStatus)
-> Lens
NotifyWorkersFailureStatus
NotifyWorkersFailureStatus
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyWorkersFailureStatus' {Maybe Text
notifyWorkersFailureMessage :: Maybe Text
$sel:notifyWorkersFailureMessage:NotifyWorkersFailureStatus' :: NotifyWorkersFailureStatus -> Maybe Text
notifyWorkersFailureMessage} -> Maybe Text
notifyWorkersFailureMessage) (\s :: NotifyWorkersFailureStatus
s@NotifyWorkersFailureStatus' {} Maybe Text
a -> NotifyWorkersFailureStatus
s {$sel:notifyWorkersFailureMessage:NotifyWorkersFailureStatus' :: Maybe Text
notifyWorkersFailureMessage = Maybe Text
a} :: NotifyWorkersFailureStatus)
notifyWorkersFailureStatus_notifyWorkersFailureCode :: Lens.Lens' NotifyWorkersFailureStatus (Prelude.Maybe NotifyWorkersFailureCode)
notifyWorkersFailureStatus_notifyWorkersFailureCode :: (Maybe NotifyWorkersFailureCode
-> f (Maybe NotifyWorkersFailureCode))
-> NotifyWorkersFailureStatus -> f NotifyWorkersFailureStatus
notifyWorkersFailureStatus_notifyWorkersFailureCode = (NotifyWorkersFailureStatus -> Maybe NotifyWorkersFailureCode)
-> (NotifyWorkersFailureStatus
-> Maybe NotifyWorkersFailureCode -> NotifyWorkersFailureStatus)
-> Lens
NotifyWorkersFailureStatus
NotifyWorkersFailureStatus
(Maybe NotifyWorkersFailureCode)
(Maybe NotifyWorkersFailureCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyWorkersFailureStatus' {Maybe NotifyWorkersFailureCode
notifyWorkersFailureCode :: Maybe NotifyWorkersFailureCode
$sel:notifyWorkersFailureCode:NotifyWorkersFailureStatus' :: NotifyWorkersFailureStatus -> Maybe NotifyWorkersFailureCode
notifyWorkersFailureCode} -> Maybe NotifyWorkersFailureCode
notifyWorkersFailureCode) (\s :: NotifyWorkersFailureStatus
s@NotifyWorkersFailureStatus' {} Maybe NotifyWorkersFailureCode
a -> NotifyWorkersFailureStatus
s {$sel:notifyWorkersFailureCode:NotifyWorkersFailureStatus' :: Maybe NotifyWorkersFailureCode
notifyWorkersFailureCode = Maybe NotifyWorkersFailureCode
a} :: NotifyWorkersFailureStatus)
notifyWorkersFailureStatus_workerId :: Lens.Lens' NotifyWorkersFailureStatus (Prelude.Maybe Prelude.Text)
notifyWorkersFailureStatus_workerId :: (Maybe Text -> f (Maybe Text))
-> NotifyWorkersFailureStatus -> f NotifyWorkersFailureStatus
notifyWorkersFailureStatus_workerId = (NotifyWorkersFailureStatus -> Maybe Text)
-> (NotifyWorkersFailureStatus
-> Maybe Text -> NotifyWorkersFailureStatus)
-> Lens
NotifyWorkersFailureStatus
NotifyWorkersFailureStatus
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotifyWorkersFailureStatus' {Maybe Text
workerId :: Maybe Text
$sel:workerId:NotifyWorkersFailureStatus' :: NotifyWorkersFailureStatus -> Maybe Text
workerId} -> Maybe Text
workerId) (\s :: NotifyWorkersFailureStatus
s@NotifyWorkersFailureStatus' {} Maybe Text
a -> NotifyWorkersFailureStatus
s {$sel:workerId:NotifyWorkersFailureStatus' :: Maybe Text
workerId = Maybe Text
a} :: NotifyWorkersFailureStatus)
instance Core.FromJSON NotifyWorkersFailureStatus where
parseJSON :: Value -> Parser NotifyWorkersFailureStatus
parseJSON =
String
-> (Object -> Parser NotifyWorkersFailureStatus)
-> Value
-> Parser NotifyWorkersFailureStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NotifyWorkersFailureStatus"
( \Object
x ->
Maybe Text
-> Maybe NotifyWorkersFailureCode
-> Maybe Text
-> NotifyWorkersFailureStatus
NotifyWorkersFailureStatus'
(Maybe Text
-> Maybe NotifyWorkersFailureCode
-> Maybe Text
-> NotifyWorkersFailureStatus)
-> Parser (Maybe Text)
-> Parser
(Maybe NotifyWorkersFailureCode
-> Maybe Text -> NotifyWorkersFailureStatus)
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
"NotifyWorkersFailureMessage")
Parser
(Maybe NotifyWorkersFailureCode
-> Maybe Text -> NotifyWorkersFailureStatus)
-> Parser (Maybe NotifyWorkersFailureCode)
-> Parser (Maybe Text -> NotifyWorkersFailureStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NotifyWorkersFailureCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NotifyWorkersFailureCode")
Parser (Maybe Text -> NotifyWorkersFailureStatus)
-> Parser (Maybe Text) -> Parser NotifyWorkersFailureStatus
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 NotifyWorkersFailureStatus
instance Prelude.NFData NotifyWorkersFailureStatus