{-# 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.DataExchange.Types.JobEntry where
import qualified Amazonka.Core as Core
import Amazonka.DataExchange.Types.JobError
import Amazonka.DataExchange.Types.ResponseDetails
import Amazonka.DataExchange.Types.State
import Amazonka.DataExchange.Types.Type
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data JobEntry = JobEntry'
{
JobEntry -> Maybe [JobError]
errors :: Prelude.Maybe [JobError],
JobEntry -> Type
type' :: Type,
JobEntry -> ResponseDetails
details :: ResponseDetails,
JobEntry -> State
state :: State,
JobEntry -> POSIX
createdAt :: Core.POSIX,
JobEntry -> Text
id :: Prelude.Text,
JobEntry -> Text
arn :: Prelude.Text,
JobEntry -> POSIX
updatedAt :: Core.POSIX
}
deriving (JobEntry -> JobEntry -> Bool
(JobEntry -> JobEntry -> Bool)
-> (JobEntry -> JobEntry -> Bool) -> Eq JobEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobEntry -> JobEntry -> Bool
$c/= :: JobEntry -> JobEntry -> Bool
== :: JobEntry -> JobEntry -> Bool
$c== :: JobEntry -> JobEntry -> Bool
Prelude.Eq, ReadPrec [JobEntry]
ReadPrec JobEntry
Int -> ReadS JobEntry
ReadS [JobEntry]
(Int -> ReadS JobEntry)
-> ReadS [JobEntry]
-> ReadPrec JobEntry
-> ReadPrec [JobEntry]
-> Read JobEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobEntry]
$creadListPrec :: ReadPrec [JobEntry]
readPrec :: ReadPrec JobEntry
$creadPrec :: ReadPrec JobEntry
readList :: ReadS [JobEntry]
$creadList :: ReadS [JobEntry]
readsPrec :: Int -> ReadS JobEntry
$creadsPrec :: Int -> ReadS JobEntry
Prelude.Read, Int -> JobEntry -> ShowS
[JobEntry] -> ShowS
JobEntry -> String
(Int -> JobEntry -> ShowS)
-> (JobEntry -> String) -> ([JobEntry] -> ShowS) -> Show JobEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobEntry] -> ShowS
$cshowList :: [JobEntry] -> ShowS
show :: JobEntry -> String
$cshow :: JobEntry -> String
showsPrec :: Int -> JobEntry -> ShowS
$cshowsPrec :: Int -> JobEntry -> ShowS
Prelude.Show, (forall x. JobEntry -> Rep JobEntry x)
-> (forall x. Rep JobEntry x -> JobEntry) -> Generic JobEntry
forall x. Rep JobEntry x -> JobEntry
forall x. JobEntry -> Rep JobEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobEntry x -> JobEntry
$cfrom :: forall x. JobEntry -> Rep JobEntry x
Prelude.Generic)
newJobEntry ::
Type ->
ResponseDetails ->
State ->
Prelude.UTCTime ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
JobEntry
newJobEntry :: Type
-> ResponseDetails
-> State
-> UTCTime
-> Text
-> Text
-> UTCTime
-> JobEntry
newJobEntry
Type
pType_
ResponseDetails
pDetails_
State
pState_
UTCTime
pCreatedAt_
Text
pId_
Text
pArn_
UTCTime
pUpdatedAt_ =
JobEntry' :: Maybe [JobError]
-> Type
-> ResponseDetails
-> State
-> POSIX
-> Text
-> Text
-> POSIX
-> JobEntry
JobEntry'
{ $sel:errors:JobEntry' :: Maybe [JobError]
errors = Maybe [JobError]
forall a. Maybe a
Prelude.Nothing,
$sel:type':JobEntry' :: Type
type' = Type
pType_,
$sel:details:JobEntry' :: ResponseDetails
details = ResponseDetails
pDetails_,
$sel:state:JobEntry' :: State
state = State
pState_,
$sel:createdAt:JobEntry' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
$sel:id:JobEntry' :: Text
id = Text
pId_,
$sel:arn:JobEntry' :: Text
arn = Text
pArn_,
$sel:updatedAt:JobEntry' :: POSIX
updatedAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdatedAt_
}
jobEntry_errors :: Lens.Lens' JobEntry (Prelude.Maybe [JobError])
jobEntry_errors :: (Maybe [JobError] -> f (Maybe [JobError]))
-> JobEntry -> f JobEntry
jobEntry_errors = (JobEntry -> Maybe [JobError])
-> (JobEntry -> Maybe [JobError] -> JobEntry)
-> Lens JobEntry JobEntry (Maybe [JobError]) (Maybe [JobError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobEntry' {Maybe [JobError]
errors :: Maybe [JobError]
$sel:errors:JobEntry' :: JobEntry -> Maybe [JobError]
errors} -> Maybe [JobError]
errors) (\s :: JobEntry
s@JobEntry' {} Maybe [JobError]
a -> JobEntry
s {$sel:errors:JobEntry' :: Maybe [JobError]
errors = Maybe [JobError]
a} :: JobEntry) ((Maybe [JobError] -> f (Maybe [JobError]))
-> JobEntry -> f JobEntry)
-> ((Maybe [JobError] -> f (Maybe [JobError]))
-> Maybe [JobError] -> f (Maybe [JobError]))
-> (Maybe [JobError] -> f (Maybe [JobError]))
-> JobEntry
-> f JobEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [JobError] [JobError] [JobError] [JobError]
-> Iso
(Maybe [JobError])
(Maybe [JobError])
(Maybe [JobError])
(Maybe [JobError])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [JobError] [JobError] [JobError] [JobError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
jobEntry_type :: Lens.Lens' JobEntry Type
jobEntry_type :: (Type -> f Type) -> JobEntry -> f JobEntry
jobEntry_type = (JobEntry -> Type)
-> (JobEntry -> Type -> JobEntry)
-> Lens JobEntry JobEntry Type Type
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobEntry' {Type
type' :: Type
$sel:type':JobEntry' :: JobEntry -> Type
type'} -> Type
type') (\s :: JobEntry
s@JobEntry' {} Type
a -> JobEntry
s {$sel:type':JobEntry' :: Type
type' = Type
a} :: JobEntry)
jobEntry_details :: Lens.Lens' JobEntry ResponseDetails
jobEntry_details :: (ResponseDetails -> f ResponseDetails) -> JobEntry -> f JobEntry
jobEntry_details = (JobEntry -> ResponseDetails)
-> (JobEntry -> ResponseDetails -> JobEntry)
-> Lens JobEntry JobEntry ResponseDetails ResponseDetails
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobEntry' {ResponseDetails
details :: ResponseDetails
$sel:details:JobEntry' :: JobEntry -> ResponseDetails
details} -> ResponseDetails
details) (\s :: JobEntry
s@JobEntry' {} ResponseDetails
a -> JobEntry
s {$sel:details:JobEntry' :: ResponseDetails
details = ResponseDetails
a} :: JobEntry)
jobEntry_state :: Lens.Lens' JobEntry State
jobEntry_state :: (State -> f State) -> JobEntry -> f JobEntry
jobEntry_state = (JobEntry -> State)
-> (JobEntry -> State -> JobEntry)
-> Lens JobEntry JobEntry State State
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobEntry' {State
state :: State
$sel:state:JobEntry' :: JobEntry -> State
state} -> State
state) (\s :: JobEntry
s@JobEntry' {} State
a -> JobEntry
s {$sel:state:JobEntry' :: State
state = State
a} :: JobEntry)
jobEntry_createdAt :: Lens.Lens' JobEntry Prelude.UTCTime
jobEntry_createdAt :: (UTCTime -> f UTCTime) -> JobEntry -> f JobEntry
jobEntry_createdAt = (JobEntry -> POSIX)
-> (JobEntry -> POSIX -> JobEntry)
-> Lens JobEntry JobEntry POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobEntry' {POSIX
createdAt :: POSIX
$sel:createdAt:JobEntry' :: JobEntry -> POSIX
createdAt} -> POSIX
createdAt) (\s :: JobEntry
s@JobEntry' {} POSIX
a -> JobEntry
s {$sel:createdAt:JobEntry' :: POSIX
createdAt = POSIX
a} :: JobEntry) ((POSIX -> f POSIX) -> JobEntry -> f JobEntry)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> JobEntry
-> f JobEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
jobEntry_id :: Lens.Lens' JobEntry Prelude.Text
jobEntry_id :: (Text -> f Text) -> JobEntry -> f JobEntry
jobEntry_id = (JobEntry -> Text)
-> (JobEntry -> Text -> JobEntry)
-> Lens JobEntry JobEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobEntry' {Text
id :: Text
$sel:id:JobEntry' :: JobEntry -> Text
id} -> Text
id) (\s :: JobEntry
s@JobEntry' {} Text
a -> JobEntry
s {$sel:id:JobEntry' :: Text
id = Text
a} :: JobEntry)
jobEntry_arn :: Lens.Lens' JobEntry Prelude.Text
jobEntry_arn :: (Text -> f Text) -> JobEntry -> f JobEntry
jobEntry_arn = (JobEntry -> Text)
-> (JobEntry -> Text -> JobEntry)
-> Lens JobEntry JobEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobEntry' {Text
arn :: Text
$sel:arn:JobEntry' :: JobEntry -> Text
arn} -> Text
arn) (\s :: JobEntry
s@JobEntry' {} Text
a -> JobEntry
s {$sel:arn:JobEntry' :: Text
arn = Text
a} :: JobEntry)
jobEntry_updatedAt :: Lens.Lens' JobEntry Prelude.UTCTime
jobEntry_updatedAt :: (UTCTime -> f UTCTime) -> JobEntry -> f JobEntry
jobEntry_updatedAt = (JobEntry -> POSIX)
-> (JobEntry -> POSIX -> JobEntry)
-> Lens JobEntry JobEntry POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobEntry' {POSIX
updatedAt :: POSIX
$sel:updatedAt:JobEntry' :: JobEntry -> POSIX
updatedAt} -> POSIX
updatedAt) (\s :: JobEntry
s@JobEntry' {} POSIX
a -> JobEntry
s {$sel:updatedAt:JobEntry' :: POSIX
updatedAt = POSIX
a} :: JobEntry) ((POSIX -> f POSIX) -> JobEntry -> f JobEntry)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> JobEntry
-> f JobEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON JobEntry where
parseJSON :: Value -> Parser JobEntry
parseJSON =
String -> (Object -> Parser JobEntry) -> Value -> Parser JobEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"JobEntry"
( \Object
x ->
Maybe [JobError]
-> Type
-> ResponseDetails
-> State
-> POSIX
-> Text
-> Text
-> POSIX
-> JobEntry
JobEntry'
(Maybe [JobError]
-> Type
-> ResponseDetails
-> State
-> POSIX
-> Text
-> Text
-> POSIX
-> JobEntry)
-> Parser (Maybe [JobError])
-> Parser
(Type
-> ResponseDetails
-> State
-> POSIX
-> Text
-> Text
-> POSIX
-> JobEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [JobError]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Errors" Parser (Maybe (Maybe [JobError]))
-> Maybe [JobError] -> Parser (Maybe [JobError])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [JobError]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Type
-> ResponseDetails
-> State
-> POSIX
-> Text
-> Text
-> POSIX
-> JobEntry)
-> Parser Type
-> Parser
(ResponseDetails
-> State -> POSIX -> Text -> Text -> POSIX -> JobEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Type
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Type")
Parser
(ResponseDetails
-> State -> POSIX -> Text -> Text -> POSIX -> JobEntry)
-> Parser ResponseDetails
-> Parser (State -> POSIX -> Text -> Text -> POSIX -> JobEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ResponseDetails
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Details")
Parser (State -> POSIX -> Text -> Text -> POSIX -> JobEntry)
-> Parser State
-> Parser (POSIX -> Text -> Text -> POSIX -> JobEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser State
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"State")
Parser (POSIX -> Text -> Text -> POSIX -> JobEntry)
-> Parser POSIX -> Parser (Text -> Text -> POSIX -> JobEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreatedAt")
Parser (Text -> Text -> POSIX -> JobEntry)
-> Parser Text -> Parser (Text -> POSIX -> JobEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Id")
Parser (Text -> POSIX -> JobEntry)
-> Parser Text -> Parser (POSIX -> JobEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
Parser (POSIX -> JobEntry) -> Parser POSIX -> Parser JobEntry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UpdatedAt")
)
instance Prelude.Hashable JobEntry
instance Prelude.NFData JobEntry