{-# 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.Omics.Types.TaskListItem
-- 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.Omics.Types.TaskListItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Omics.Types.TaskStatus
import qualified Amazonka.Prelude as Prelude

-- | A workflow run task.
--
-- /See:/ 'newTaskListItem' smart constructor.
data TaskListItem = TaskListItem'
  { -- | The task\'s CPU count.
    TaskListItem -> Maybe Natural
cpus :: Prelude.Maybe Prelude.Natural,
    -- | When the task was created.
    TaskListItem -> Maybe ISO8601
creationTime :: Prelude.Maybe Data.ISO8601,
    -- | The task\'s memory.
    TaskListItem -> Maybe Natural
memory :: Prelude.Maybe Prelude.Natural,
    -- | The task\'s name.
    TaskListItem -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | When the task started.
    TaskListItem -> Maybe ISO8601
startTime :: Prelude.Maybe Data.ISO8601,
    -- | The task\'s status.
    TaskListItem -> Maybe TaskStatus
status :: Prelude.Maybe TaskStatus,
    -- | When the task stopped.
    TaskListItem -> Maybe ISO8601
stopTime :: Prelude.Maybe Data.ISO8601,
    -- | The task\'s ID.
    TaskListItem -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text
  }
  deriving (TaskListItem -> TaskListItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaskListItem -> TaskListItem -> Bool
$c/= :: TaskListItem -> TaskListItem -> Bool
== :: TaskListItem -> TaskListItem -> Bool
$c== :: TaskListItem -> TaskListItem -> Bool
Prelude.Eq, ReadPrec [TaskListItem]
ReadPrec TaskListItem
Int -> ReadS TaskListItem
ReadS [TaskListItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TaskListItem]
$creadListPrec :: ReadPrec [TaskListItem]
readPrec :: ReadPrec TaskListItem
$creadPrec :: ReadPrec TaskListItem
readList :: ReadS [TaskListItem]
$creadList :: ReadS [TaskListItem]
readsPrec :: Int -> ReadS TaskListItem
$creadsPrec :: Int -> ReadS TaskListItem
Prelude.Read, Int -> TaskListItem -> ShowS
[TaskListItem] -> ShowS
TaskListItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaskListItem] -> ShowS
$cshowList :: [TaskListItem] -> ShowS
show :: TaskListItem -> String
$cshow :: TaskListItem -> String
showsPrec :: Int -> TaskListItem -> ShowS
$cshowsPrec :: Int -> TaskListItem -> ShowS
Prelude.Show, forall x. Rep TaskListItem x -> TaskListItem
forall x. TaskListItem -> Rep TaskListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TaskListItem x -> TaskListItem
$cfrom :: forall x. TaskListItem -> Rep TaskListItem x
Prelude.Generic)

-- |
-- Create a value of 'TaskListItem' 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:
--
-- 'cpus', 'taskListItem_cpus' - The task\'s CPU count.
--
-- 'creationTime', 'taskListItem_creationTime' - When the task was created.
--
-- 'memory', 'taskListItem_memory' - The task\'s memory.
--
-- 'name', 'taskListItem_name' - The task\'s name.
--
-- 'startTime', 'taskListItem_startTime' - When the task started.
--
-- 'status', 'taskListItem_status' - The task\'s status.
--
-- 'stopTime', 'taskListItem_stopTime' - When the task stopped.
--
-- 'taskId', 'taskListItem_taskId' - The task\'s ID.
newTaskListItem ::
  TaskListItem
newTaskListItem :: TaskListItem
newTaskListItem =
  TaskListItem'
    { $sel:cpus:TaskListItem' :: Maybe Natural
cpus = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:TaskListItem' :: Maybe ISO8601
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:memory:TaskListItem' :: Maybe Natural
memory = forall a. Maybe a
Prelude.Nothing,
      $sel:name:TaskListItem' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:TaskListItem' :: Maybe ISO8601
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:TaskListItem' :: Maybe TaskStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:stopTime:TaskListItem' :: Maybe ISO8601
stopTime = forall a. Maybe a
Prelude.Nothing,
      $sel:taskId:TaskListItem' :: Maybe Text
taskId = forall a. Maybe a
Prelude.Nothing
    }

-- | The task\'s CPU count.
taskListItem_cpus :: Lens.Lens' TaskListItem (Prelude.Maybe Prelude.Natural)
taskListItem_cpus :: Lens' TaskListItem (Maybe Natural)
taskListItem_cpus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskListItem' {Maybe Natural
cpus :: Maybe Natural
$sel:cpus:TaskListItem' :: TaskListItem -> Maybe Natural
cpus} -> Maybe Natural
cpus) (\s :: TaskListItem
s@TaskListItem' {} Maybe Natural
a -> TaskListItem
s {$sel:cpus:TaskListItem' :: Maybe Natural
cpus = Maybe Natural
a} :: TaskListItem)

-- | When the task was created.
taskListItem_creationTime :: Lens.Lens' TaskListItem (Prelude.Maybe Prelude.UTCTime)
taskListItem_creationTime :: Lens' TaskListItem (Maybe UTCTime)
taskListItem_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskListItem' {Maybe ISO8601
creationTime :: Maybe ISO8601
$sel:creationTime:TaskListItem' :: TaskListItem -> Maybe ISO8601
creationTime} -> Maybe ISO8601
creationTime) (\s :: TaskListItem
s@TaskListItem' {} Maybe ISO8601
a -> TaskListItem
s {$sel:creationTime:TaskListItem' :: Maybe ISO8601
creationTime = Maybe ISO8601
a} :: TaskListItem) 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 task\'s memory.
taskListItem_memory :: Lens.Lens' TaskListItem (Prelude.Maybe Prelude.Natural)
taskListItem_memory :: Lens' TaskListItem (Maybe Natural)
taskListItem_memory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskListItem' {Maybe Natural
memory :: Maybe Natural
$sel:memory:TaskListItem' :: TaskListItem -> Maybe Natural
memory} -> Maybe Natural
memory) (\s :: TaskListItem
s@TaskListItem' {} Maybe Natural
a -> TaskListItem
s {$sel:memory:TaskListItem' :: Maybe Natural
memory = Maybe Natural
a} :: TaskListItem)

-- | The task\'s name.
taskListItem_name :: Lens.Lens' TaskListItem (Prelude.Maybe Prelude.Text)
taskListItem_name :: Lens' TaskListItem (Maybe Text)
taskListItem_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskListItem' {Maybe Text
name :: Maybe Text
$sel:name:TaskListItem' :: TaskListItem -> Maybe Text
name} -> Maybe Text
name) (\s :: TaskListItem
s@TaskListItem' {} Maybe Text
a -> TaskListItem
s {$sel:name:TaskListItem' :: Maybe Text
name = Maybe Text
a} :: TaskListItem)

-- | When the task started.
taskListItem_startTime :: Lens.Lens' TaskListItem (Prelude.Maybe Prelude.UTCTime)
taskListItem_startTime :: Lens' TaskListItem (Maybe UTCTime)
taskListItem_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskListItem' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:TaskListItem' :: TaskListItem -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: TaskListItem
s@TaskListItem' {} Maybe ISO8601
a -> TaskListItem
s {$sel:startTime:TaskListItem' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: TaskListItem) 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 task\'s status.
taskListItem_status :: Lens.Lens' TaskListItem (Prelude.Maybe TaskStatus)
taskListItem_status :: Lens' TaskListItem (Maybe TaskStatus)
taskListItem_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskListItem' {Maybe TaskStatus
status :: Maybe TaskStatus
$sel:status:TaskListItem' :: TaskListItem -> Maybe TaskStatus
status} -> Maybe TaskStatus
status) (\s :: TaskListItem
s@TaskListItem' {} Maybe TaskStatus
a -> TaskListItem
s {$sel:status:TaskListItem' :: Maybe TaskStatus
status = Maybe TaskStatus
a} :: TaskListItem)

-- | When the task stopped.
taskListItem_stopTime :: Lens.Lens' TaskListItem (Prelude.Maybe Prelude.UTCTime)
taskListItem_stopTime :: Lens' TaskListItem (Maybe UTCTime)
taskListItem_stopTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskListItem' {Maybe ISO8601
stopTime :: Maybe ISO8601
$sel:stopTime:TaskListItem' :: TaskListItem -> Maybe ISO8601
stopTime} -> Maybe ISO8601
stopTime) (\s :: TaskListItem
s@TaskListItem' {} Maybe ISO8601
a -> TaskListItem
s {$sel:stopTime:TaskListItem' :: Maybe ISO8601
stopTime = Maybe ISO8601
a} :: TaskListItem) 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 task\'s ID.
taskListItem_taskId :: Lens.Lens' TaskListItem (Prelude.Maybe Prelude.Text)
taskListItem_taskId :: Lens' TaskListItem (Maybe Text)
taskListItem_taskId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskListItem' {Maybe Text
taskId :: Maybe Text
$sel:taskId:TaskListItem' :: TaskListItem -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: TaskListItem
s@TaskListItem' {} Maybe Text
a -> TaskListItem
s {$sel:taskId:TaskListItem' :: Maybe Text
taskId = Maybe Text
a} :: TaskListItem)

instance Data.FromJSON TaskListItem where
  parseJSON :: Value -> Parser TaskListItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TaskListItem"
      ( \Object
x ->
          Maybe Natural
-> Maybe ISO8601
-> Maybe Natural
-> Maybe Text
-> Maybe ISO8601
-> Maybe TaskStatus
-> Maybe ISO8601
-> Maybe Text
-> TaskListItem
TaskListItem'
            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
"cpus")
            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
"creationTime")
            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
"memory")
            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
"name")
            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
"startTime")
            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
"status")
            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
"stopTime")
            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
"taskId")
      )

instance Prelude.Hashable TaskListItem where
  hashWithSalt :: Int -> TaskListItem -> Int
hashWithSalt Int
_salt TaskListItem' {Maybe Natural
Maybe Text
Maybe ISO8601
Maybe TaskStatus
taskId :: Maybe Text
stopTime :: Maybe ISO8601
status :: Maybe TaskStatus
startTime :: Maybe ISO8601
name :: Maybe Text
memory :: Maybe Natural
creationTime :: Maybe ISO8601
cpus :: Maybe Natural
$sel:taskId:TaskListItem' :: TaskListItem -> Maybe Text
$sel:stopTime:TaskListItem' :: TaskListItem -> Maybe ISO8601
$sel:status:TaskListItem' :: TaskListItem -> Maybe TaskStatus
$sel:startTime:TaskListItem' :: TaskListItem -> Maybe ISO8601
$sel:name:TaskListItem' :: TaskListItem -> Maybe Text
$sel:memory:TaskListItem' :: TaskListItem -> Maybe Natural
$sel:creationTime:TaskListItem' :: TaskListItem -> Maybe ISO8601
$sel:cpus:TaskListItem' :: TaskListItem -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
cpus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
memory
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TaskStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
stopTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
taskId

instance Prelude.NFData TaskListItem where
  rnf :: TaskListItem -> ()
rnf TaskListItem' {Maybe Natural
Maybe Text
Maybe ISO8601
Maybe TaskStatus
taskId :: Maybe Text
stopTime :: Maybe ISO8601
status :: Maybe TaskStatus
startTime :: Maybe ISO8601
name :: Maybe Text
memory :: Maybe Natural
creationTime :: Maybe ISO8601
cpus :: Maybe Natural
$sel:taskId:TaskListItem' :: TaskListItem -> Maybe Text
$sel:stopTime:TaskListItem' :: TaskListItem -> Maybe ISO8601
$sel:status:TaskListItem' :: TaskListItem -> Maybe TaskStatus
$sel:startTime:TaskListItem' :: TaskListItem -> Maybe ISO8601
$sel:name:TaskListItem' :: TaskListItem -> Maybe Text
$sel:memory:TaskListItem' :: TaskListItem -> Maybe Natural
$sel:creationTime:TaskListItem' :: TaskListItem -> Maybe ISO8601
$sel:cpus:TaskListItem' :: TaskListItem -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
cpus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
memory
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TaskStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
stopTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
taskId