{-# 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.WorkflowListItem
-- 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.WorkflowListItem 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.WorkflowStatus
import Amazonka.Omics.Types.WorkflowType
import qualified Amazonka.Prelude as Prelude

-- | A workflow.
--
-- /See:/ 'newWorkflowListItem' smart constructor.
data WorkflowListItem = WorkflowListItem'
  { -- | The workflow\'s ARN.
    WorkflowListItem -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | When the workflow was created.
    WorkflowListItem -> Maybe ISO8601
creationTime :: Prelude.Maybe Data.ISO8601,
    -- | The workflow\'s digest.
    WorkflowListItem -> Maybe Text
digest :: Prelude.Maybe Prelude.Text,
    -- | The workflow\'s ID.
    WorkflowListItem -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The workflow\'s name.
    WorkflowListItem -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The workflow\'s status.
    WorkflowListItem -> Maybe WorkflowStatus
status :: Prelude.Maybe WorkflowStatus,
    -- | The workflow\'s type.
    WorkflowListItem -> Maybe WorkflowType
type' :: Prelude.Maybe WorkflowType
  }
  deriving (WorkflowListItem -> WorkflowListItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowListItem -> WorkflowListItem -> Bool
$c/= :: WorkflowListItem -> WorkflowListItem -> Bool
== :: WorkflowListItem -> WorkflowListItem -> Bool
$c== :: WorkflowListItem -> WorkflowListItem -> Bool
Prelude.Eq, ReadPrec [WorkflowListItem]
ReadPrec WorkflowListItem
Int -> ReadS WorkflowListItem
ReadS [WorkflowListItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowListItem]
$creadListPrec :: ReadPrec [WorkflowListItem]
readPrec :: ReadPrec WorkflowListItem
$creadPrec :: ReadPrec WorkflowListItem
readList :: ReadS [WorkflowListItem]
$creadList :: ReadS [WorkflowListItem]
readsPrec :: Int -> ReadS WorkflowListItem
$creadsPrec :: Int -> ReadS WorkflowListItem
Prelude.Read, Int -> WorkflowListItem -> ShowS
[WorkflowListItem] -> ShowS
WorkflowListItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowListItem] -> ShowS
$cshowList :: [WorkflowListItem] -> ShowS
show :: WorkflowListItem -> String
$cshow :: WorkflowListItem -> String
showsPrec :: Int -> WorkflowListItem -> ShowS
$cshowsPrec :: Int -> WorkflowListItem -> ShowS
Prelude.Show, forall x. Rep WorkflowListItem x -> WorkflowListItem
forall x. WorkflowListItem -> Rep WorkflowListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowListItem x -> WorkflowListItem
$cfrom :: forall x. WorkflowListItem -> Rep WorkflowListItem x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowListItem' 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:
--
-- 'arn', 'workflowListItem_arn' - The workflow\'s ARN.
--
-- 'creationTime', 'workflowListItem_creationTime' - When the workflow was created.
--
-- 'digest', 'workflowListItem_digest' - The workflow\'s digest.
--
-- 'id', 'workflowListItem_id' - The workflow\'s ID.
--
-- 'name', 'workflowListItem_name' - The workflow\'s name.
--
-- 'status', 'workflowListItem_status' - The workflow\'s status.
--
-- 'type'', 'workflowListItem_type' - The workflow\'s type.
newWorkflowListItem ::
  WorkflowListItem
newWorkflowListItem :: WorkflowListItem
newWorkflowListItem =
  WorkflowListItem'
    { $sel:arn:WorkflowListItem' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:WorkflowListItem' :: Maybe ISO8601
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:digest:WorkflowListItem' :: Maybe Text
digest = forall a. Maybe a
Prelude.Nothing,
      $sel:id:WorkflowListItem' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:WorkflowListItem' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:WorkflowListItem' :: Maybe WorkflowStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:type':WorkflowListItem' :: Maybe WorkflowType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The workflow\'s ARN.
workflowListItem_arn :: Lens.Lens' WorkflowListItem (Prelude.Maybe Prelude.Text)
workflowListItem_arn :: Lens' WorkflowListItem (Maybe Text)
workflowListItem_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowListItem' {Maybe Text
arn :: Maybe Text
$sel:arn:WorkflowListItem' :: WorkflowListItem -> Maybe Text
arn} -> Maybe Text
arn) (\s :: WorkflowListItem
s@WorkflowListItem' {} Maybe Text
a -> WorkflowListItem
s {$sel:arn:WorkflowListItem' :: Maybe Text
arn = Maybe Text
a} :: WorkflowListItem)

-- | When the workflow was created.
workflowListItem_creationTime :: Lens.Lens' WorkflowListItem (Prelude.Maybe Prelude.UTCTime)
workflowListItem_creationTime :: Lens' WorkflowListItem (Maybe UTCTime)
workflowListItem_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowListItem' {Maybe ISO8601
creationTime :: Maybe ISO8601
$sel:creationTime:WorkflowListItem' :: WorkflowListItem -> Maybe ISO8601
creationTime} -> Maybe ISO8601
creationTime) (\s :: WorkflowListItem
s@WorkflowListItem' {} Maybe ISO8601
a -> WorkflowListItem
s {$sel:creationTime:WorkflowListItem' :: Maybe ISO8601
creationTime = Maybe ISO8601
a} :: WorkflowListItem) 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 workflow\'s digest.
workflowListItem_digest :: Lens.Lens' WorkflowListItem (Prelude.Maybe Prelude.Text)
workflowListItem_digest :: Lens' WorkflowListItem (Maybe Text)
workflowListItem_digest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowListItem' {Maybe Text
digest :: Maybe Text
$sel:digest:WorkflowListItem' :: WorkflowListItem -> Maybe Text
digest} -> Maybe Text
digest) (\s :: WorkflowListItem
s@WorkflowListItem' {} Maybe Text
a -> WorkflowListItem
s {$sel:digest:WorkflowListItem' :: Maybe Text
digest = Maybe Text
a} :: WorkflowListItem)

-- | The workflow\'s ID.
workflowListItem_id :: Lens.Lens' WorkflowListItem (Prelude.Maybe Prelude.Text)
workflowListItem_id :: Lens' WorkflowListItem (Maybe Text)
workflowListItem_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowListItem' {Maybe Text
id :: Maybe Text
$sel:id:WorkflowListItem' :: WorkflowListItem -> Maybe Text
id} -> Maybe Text
id) (\s :: WorkflowListItem
s@WorkflowListItem' {} Maybe Text
a -> WorkflowListItem
s {$sel:id:WorkflowListItem' :: Maybe Text
id = Maybe Text
a} :: WorkflowListItem)

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

-- | The workflow\'s status.
workflowListItem_status :: Lens.Lens' WorkflowListItem (Prelude.Maybe WorkflowStatus)
workflowListItem_status :: Lens' WorkflowListItem (Maybe WorkflowStatus)
workflowListItem_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowListItem' {Maybe WorkflowStatus
status :: Maybe WorkflowStatus
$sel:status:WorkflowListItem' :: WorkflowListItem -> Maybe WorkflowStatus
status} -> Maybe WorkflowStatus
status) (\s :: WorkflowListItem
s@WorkflowListItem' {} Maybe WorkflowStatus
a -> WorkflowListItem
s {$sel:status:WorkflowListItem' :: Maybe WorkflowStatus
status = Maybe WorkflowStatus
a} :: WorkflowListItem)

-- | The workflow\'s type.
workflowListItem_type :: Lens.Lens' WorkflowListItem (Prelude.Maybe WorkflowType)
workflowListItem_type :: Lens' WorkflowListItem (Maybe WorkflowType)
workflowListItem_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowListItem' {Maybe WorkflowType
type' :: Maybe WorkflowType
$sel:type':WorkflowListItem' :: WorkflowListItem -> Maybe WorkflowType
type'} -> Maybe WorkflowType
type') (\s :: WorkflowListItem
s@WorkflowListItem' {} Maybe WorkflowType
a -> WorkflowListItem
s {$sel:type':WorkflowListItem' :: Maybe WorkflowType
type' = Maybe WorkflowType
a} :: WorkflowListItem)

instance Data.FromJSON WorkflowListItem where
  parseJSON :: Value -> Parser WorkflowListItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkflowListItem"
      ( \Object
x ->
          Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe WorkflowStatus
-> Maybe WorkflowType
-> WorkflowListItem
WorkflowListItem'
            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
"arn")
            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
"digest")
            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
"id")
            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
"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
"type")
      )

instance Prelude.Hashable WorkflowListItem where
  hashWithSalt :: Int -> WorkflowListItem -> Int
hashWithSalt Int
_salt WorkflowListItem' {Maybe Text
Maybe ISO8601
Maybe WorkflowStatus
Maybe WorkflowType
type' :: Maybe WorkflowType
status :: Maybe WorkflowStatus
name :: Maybe Text
id :: Maybe Text
digest :: Maybe Text
creationTime :: Maybe ISO8601
arn :: Maybe Text
$sel:type':WorkflowListItem' :: WorkflowListItem -> Maybe WorkflowType
$sel:status:WorkflowListItem' :: WorkflowListItem -> Maybe WorkflowStatus
$sel:name:WorkflowListItem' :: WorkflowListItem -> Maybe Text
$sel:id:WorkflowListItem' :: WorkflowListItem -> Maybe Text
$sel:digest:WorkflowListItem' :: WorkflowListItem -> Maybe Text
$sel:creationTime:WorkflowListItem' :: WorkflowListItem -> Maybe ISO8601
$sel:arn:WorkflowListItem' :: WorkflowListItem -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
digest
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkflowStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkflowType
type'

instance Prelude.NFData WorkflowListItem where
  rnf :: WorkflowListItem -> ()
rnf WorkflowListItem' {Maybe Text
Maybe ISO8601
Maybe WorkflowStatus
Maybe WorkflowType
type' :: Maybe WorkflowType
status :: Maybe WorkflowStatus
name :: Maybe Text
id :: Maybe Text
digest :: Maybe Text
creationTime :: Maybe ISO8601
arn :: Maybe Text
$sel:type':WorkflowListItem' :: WorkflowListItem -> Maybe WorkflowType
$sel:status:WorkflowListItem' :: WorkflowListItem -> Maybe WorkflowStatus
$sel:name:WorkflowListItem' :: WorkflowListItem -> Maybe Text
$sel:id:WorkflowListItem' :: WorkflowListItem -> Maybe Text
$sel:digest:WorkflowListItem' :: WorkflowListItem -> Maybe Text
$sel:creationTime:WorkflowListItem' :: WorkflowListItem -> Maybe ISO8601
$sel:arn:WorkflowListItem' :: WorkflowListItem -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      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 Text
digest
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      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 WorkflowStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkflowType
type'