{-# 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.Braket.Types.JobSummary where
import Amazonka.Braket.Types.JobPrimaryStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data JobSummary = JobSummary'
{
JobSummary -> Maybe ISO8601
endedAt :: Prelude.Maybe Data.ISO8601,
JobSummary -> Maybe ISO8601
startedAt :: Prelude.Maybe Data.ISO8601,
JobSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
JobSummary -> ISO8601
createdAt :: Data.ISO8601,
JobSummary -> Text
device :: Prelude.Text,
JobSummary -> Text
jobArn :: Prelude.Text,
JobSummary -> Text
jobName :: Prelude.Text,
JobSummary -> JobPrimaryStatus
status :: JobPrimaryStatus
}
deriving (JobSummary -> JobSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobSummary -> JobSummary -> Bool
$c/= :: JobSummary -> JobSummary -> Bool
== :: JobSummary -> JobSummary -> Bool
$c== :: JobSummary -> JobSummary -> Bool
Prelude.Eq, ReadPrec [JobSummary]
ReadPrec JobSummary
Int -> ReadS JobSummary
ReadS [JobSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobSummary]
$creadListPrec :: ReadPrec [JobSummary]
readPrec :: ReadPrec JobSummary
$creadPrec :: ReadPrec JobSummary
readList :: ReadS [JobSummary]
$creadList :: ReadS [JobSummary]
readsPrec :: Int -> ReadS JobSummary
$creadsPrec :: Int -> ReadS JobSummary
Prelude.Read, Int -> JobSummary -> ShowS
[JobSummary] -> ShowS
JobSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobSummary] -> ShowS
$cshowList :: [JobSummary] -> ShowS
show :: JobSummary -> String
$cshow :: JobSummary -> String
showsPrec :: Int -> JobSummary -> ShowS
$cshowsPrec :: Int -> JobSummary -> ShowS
Prelude.Show, forall x. Rep JobSummary x -> JobSummary
forall x. JobSummary -> Rep JobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobSummary x -> JobSummary
$cfrom :: forall x. JobSummary -> Rep JobSummary x
Prelude.Generic)
newJobSummary ::
Prelude.UTCTime ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
JobPrimaryStatus ->
JobSummary
newJobSummary :: UTCTime -> Text -> Text -> Text -> JobPrimaryStatus -> JobSummary
newJobSummary
UTCTime
pCreatedAt_
Text
pDevice_
Text
pJobArn_
Text
pJobName_
JobPrimaryStatus
pStatus_ =
JobSummary'
{ $sel:endedAt:JobSummary' :: Maybe ISO8601
endedAt = forall a. Maybe a
Prelude.Nothing,
$sel:startedAt:JobSummary' :: Maybe ISO8601
startedAt = forall a. Maybe a
Prelude.Nothing,
$sel:tags:JobSummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:JobSummary' :: ISO8601
createdAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
$sel:device:JobSummary' :: Text
device = Text
pDevice_,
$sel:jobArn:JobSummary' :: Text
jobArn = Text
pJobArn_,
$sel:jobName:JobSummary' :: Text
jobName = Text
pJobName_,
$sel:status:JobSummary' :: JobPrimaryStatus
status = JobPrimaryStatus
pStatus_
}
jobSummary_endedAt :: Lens.Lens' JobSummary (Prelude.Maybe Prelude.UTCTime)
jobSummary_endedAt :: Lens' JobSummary (Maybe UTCTime)
jobSummary_endedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe ISO8601
endedAt :: Maybe ISO8601
$sel:endedAt:JobSummary' :: JobSummary -> Maybe ISO8601
endedAt} -> Maybe ISO8601
endedAt) (\s :: JobSummary
s@JobSummary' {} Maybe ISO8601
a -> JobSummary
s {$sel:endedAt:JobSummary' :: Maybe ISO8601
endedAt = Maybe ISO8601
a} :: JobSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
jobSummary_startedAt :: Lens.Lens' JobSummary (Prelude.Maybe Prelude.UTCTime)
jobSummary_startedAt :: Lens' JobSummary (Maybe UTCTime)
jobSummary_startedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe ISO8601
startedAt :: Maybe ISO8601
$sel:startedAt:JobSummary' :: JobSummary -> Maybe ISO8601
startedAt} -> Maybe ISO8601
startedAt) (\s :: JobSummary
s@JobSummary' {} Maybe ISO8601
a -> JobSummary
s {$sel:startedAt:JobSummary' :: Maybe ISO8601
startedAt = Maybe ISO8601
a} :: JobSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
jobSummary_tags :: Lens.Lens' JobSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
jobSummary_tags :: Lens' JobSummary (Maybe (HashMap Text Text))
jobSummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:JobSummary' :: JobSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: JobSummary
s@JobSummary' {} Maybe (HashMap Text Text)
a -> JobSummary
s {$sel:tags:JobSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: JobSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
jobSummary_createdAt :: Lens.Lens' JobSummary Prelude.UTCTime
jobSummary_createdAt :: Lens' JobSummary UTCTime
jobSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {ISO8601
createdAt :: ISO8601
$sel:createdAt:JobSummary' :: JobSummary -> ISO8601
createdAt} -> ISO8601
createdAt) (\s :: JobSummary
s@JobSummary' {} ISO8601
a -> JobSummary
s {$sel:createdAt:JobSummary' :: ISO8601
createdAt = ISO8601
a} :: JobSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
jobSummary_device :: Lens.Lens' JobSummary Prelude.Text
jobSummary_device :: Lens' JobSummary Text
jobSummary_device = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Text
device :: Text
$sel:device:JobSummary' :: JobSummary -> Text
device} -> Text
device) (\s :: JobSummary
s@JobSummary' {} Text
a -> JobSummary
s {$sel:device:JobSummary' :: Text
device = Text
a} :: JobSummary)
jobSummary_jobArn :: Lens.Lens' JobSummary Prelude.Text
jobSummary_jobArn :: Lens' JobSummary Text
jobSummary_jobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Text
jobArn :: Text
$sel:jobArn:JobSummary' :: JobSummary -> Text
jobArn} -> Text
jobArn) (\s :: JobSummary
s@JobSummary' {} Text
a -> JobSummary
s {$sel:jobArn:JobSummary' :: Text
jobArn = Text
a} :: JobSummary)
jobSummary_jobName :: Lens.Lens' JobSummary Prelude.Text
jobSummary_jobName :: Lens' JobSummary Text
jobSummary_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {Text
jobName :: Text
$sel:jobName:JobSummary' :: JobSummary -> Text
jobName} -> Text
jobName) (\s :: JobSummary
s@JobSummary' {} Text
a -> JobSummary
s {$sel:jobName:JobSummary' :: Text
jobName = Text
a} :: JobSummary)
jobSummary_status :: Lens.Lens' JobSummary JobPrimaryStatus
jobSummary_status :: Lens' JobSummary JobPrimaryStatus
jobSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobSummary' {JobPrimaryStatus
status :: JobPrimaryStatus
$sel:status:JobSummary' :: JobSummary -> JobPrimaryStatus
status} -> JobPrimaryStatus
status) (\s :: JobSummary
s@JobSummary' {} JobPrimaryStatus
a -> JobSummary
s {$sel:status:JobSummary' :: JobPrimaryStatus
status = JobPrimaryStatus
a} :: JobSummary)
instance Data.FromJSON JobSummary where
parseJSON :: Value -> Parser JobSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"JobSummary"
( \Object
x ->
Maybe ISO8601
-> Maybe ISO8601
-> Maybe (HashMap Text Text)
-> ISO8601
-> Text
-> Text
-> Text
-> JobPrimaryStatus
-> JobSummary
JobSummary'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"endedAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"startedAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"createdAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"device")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"jobArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"jobName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"status")
)
instance Prelude.Hashable JobSummary where
hashWithSalt :: Int -> JobSummary -> Int
hashWithSalt Int
_salt JobSummary' {Maybe (HashMap Text Text)
Maybe ISO8601
Text
ISO8601
JobPrimaryStatus
status :: JobPrimaryStatus
jobName :: Text
jobArn :: Text
device :: Text
createdAt :: ISO8601
tags :: Maybe (HashMap Text Text)
startedAt :: Maybe ISO8601
endedAt :: Maybe ISO8601
$sel:status:JobSummary' :: JobSummary -> JobPrimaryStatus
$sel:jobName:JobSummary' :: JobSummary -> Text
$sel:jobArn:JobSummary' :: JobSummary -> Text
$sel:device:JobSummary' :: JobSummary -> Text
$sel:createdAt:JobSummary' :: JobSummary -> ISO8601
$sel:tags:JobSummary' :: JobSummary -> Maybe (HashMap Text Text)
$sel:startedAt:JobSummary' :: JobSummary -> Maybe ISO8601
$sel:endedAt:JobSummary' :: JobSummary -> Maybe ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
endedAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
startedAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
device
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` JobPrimaryStatus
status
instance Prelude.NFData JobSummary where
rnf :: JobSummary -> ()
rnf JobSummary' {Maybe (HashMap Text Text)
Maybe ISO8601
Text
ISO8601
JobPrimaryStatus
status :: JobPrimaryStatus
jobName :: Text
jobArn :: Text
device :: Text
createdAt :: ISO8601
tags :: Maybe (HashMap Text Text)
startedAt :: Maybe ISO8601
endedAt :: Maybe ISO8601
$sel:status:JobSummary' :: JobSummary -> JobPrimaryStatus
$sel:jobName:JobSummary' :: JobSummary -> Text
$sel:jobArn:JobSummary' :: JobSummary -> Text
$sel:device:JobSummary' :: JobSummary -> Text
$sel:createdAt:JobSummary' :: JobSummary -> ISO8601
$sel:tags:JobSummary' :: JobSummary -> Maybe (HashMap Text Text)
$sel:startedAt:JobSummary' :: JobSummary -> Maybe ISO8601
$sel:endedAt:JobSummary' :: JobSummary -> Maybe ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
endedAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
startedAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
device
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf JobPrimaryStatus
status