{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Braket.Types.JobSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Provides summary information about an Amazon Braket job.
--
-- /See:/ 'newJobSummary' smart constructor.
data JobSummary = JobSummary'
  { -- | The date and time that the Amazon Braket job ended.
    JobSummary -> Maybe ISO8601
endedAt :: Prelude.Maybe Data.ISO8601,
    -- | The date and time that the Amazon Braket job was started.
    JobSummary -> Maybe ISO8601
startedAt :: Prelude.Maybe Data.ISO8601,
    -- | A tag object that consists of a key and an optional value, used to
    -- manage metadata for Amazon Braket resources.
    JobSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The date and time that the Amazon Braket job was created.
    JobSummary -> ISO8601
createdAt :: Data.ISO8601,
    -- | Provides summary information about the primary device used by an Amazon
    -- Braket job.
    JobSummary -> Text
device :: Prelude.Text,
    -- | The ARN of the Amazon Braket job.
    JobSummary -> Text
jobArn :: Prelude.Text,
    -- | The name of the Amazon Braket job.
    JobSummary -> Text
jobName :: Prelude.Text,
    -- | The status of the Amazon Braket job.
    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)

-- |
-- Create a value of 'JobSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'endedAt', 'jobSummary_endedAt' - The date and time that the Amazon Braket job ended.
--
-- 'startedAt', 'jobSummary_startedAt' - The date and time that the Amazon Braket job was started.
--
-- 'tags', 'jobSummary_tags' - A tag object that consists of a key and an optional value, used to
-- manage metadata for Amazon Braket resources.
--
-- 'createdAt', 'jobSummary_createdAt' - The date and time that the Amazon Braket job was created.
--
-- 'device', 'jobSummary_device' - Provides summary information about the primary device used by an Amazon
-- Braket job.
--
-- 'jobArn', 'jobSummary_jobArn' - The ARN of the Amazon Braket job.
--
-- 'jobName', 'jobSummary_jobName' - The name of the Amazon Braket job.
--
-- 'status', 'jobSummary_status' - The status of the Amazon Braket job.
newJobSummary ::
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'device'
  Prelude.Text ->
  -- | 'jobArn'
  Prelude.Text ->
  -- | 'jobName'
  Prelude.Text ->
  -- | 'status'
  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_
      }

-- | The date and time that the Amazon Braket job ended.
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

-- | The date and time that the Amazon Braket job was started.
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

-- | A tag object that consists of a key and an optional value, used to
-- manage metadata for Amazon Braket resources.
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

-- | The date and time that the Amazon Braket job was created.
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

-- | Provides summary information about the primary device used by an Amazon
-- Braket job.
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)

-- | The ARN of the Amazon Braket job.
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)

-- | The name of the Amazon Braket job.
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)

-- | The status of the Amazon Braket job.
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