{-# 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.Glue.Types.Workflow where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.BlueprintDetails
import Amazonka.Glue.Types.WorkflowGraph
import Amazonka.Glue.Types.WorkflowRun
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Workflow = Workflow'
{
Workflow -> Maybe WorkflowGraph
graph :: Prelude.Maybe WorkflowGraph,
Workflow -> Maybe POSIX
lastModifiedOn :: Prelude.Maybe Core.POSIX,
Workflow -> Maybe BlueprintDetails
blueprintDetails :: Prelude.Maybe BlueprintDetails,
Workflow -> Maybe Int
maxConcurrentRuns :: Prelude.Maybe Prelude.Int,
Workflow -> Maybe (HashMap Text Text)
defaultRunProperties :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Workflow -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Workflow -> Maybe WorkflowRun
lastRun :: Prelude.Maybe WorkflowRun,
Workflow -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Workflow -> Maybe POSIX
createdOn :: Prelude.Maybe Core.POSIX
}
deriving (Workflow -> Workflow -> Bool
(Workflow -> Workflow -> Bool)
-> (Workflow -> Workflow -> Bool) -> Eq Workflow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Workflow -> Workflow -> Bool
$c/= :: Workflow -> Workflow -> Bool
== :: Workflow -> Workflow -> Bool
$c== :: Workflow -> Workflow -> Bool
Prelude.Eq, ReadPrec [Workflow]
ReadPrec Workflow
Int -> ReadS Workflow
ReadS [Workflow]
(Int -> ReadS Workflow)
-> ReadS [Workflow]
-> ReadPrec Workflow
-> ReadPrec [Workflow]
-> Read Workflow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Workflow]
$creadListPrec :: ReadPrec [Workflow]
readPrec :: ReadPrec Workflow
$creadPrec :: ReadPrec Workflow
readList :: ReadS [Workflow]
$creadList :: ReadS [Workflow]
readsPrec :: Int -> ReadS Workflow
$creadsPrec :: Int -> ReadS Workflow
Prelude.Read, Int -> Workflow -> ShowS
[Workflow] -> ShowS
Workflow -> String
(Int -> Workflow -> ShowS)
-> (Workflow -> String) -> ([Workflow] -> ShowS) -> Show Workflow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Workflow] -> ShowS
$cshowList :: [Workflow] -> ShowS
show :: Workflow -> String
$cshow :: Workflow -> String
showsPrec :: Int -> Workflow -> ShowS
$cshowsPrec :: Int -> Workflow -> ShowS
Prelude.Show, (forall x. Workflow -> Rep Workflow x)
-> (forall x. Rep Workflow x -> Workflow) -> Generic Workflow
forall x. Rep Workflow x -> Workflow
forall x. Workflow -> Rep Workflow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Workflow x -> Workflow
$cfrom :: forall x. Workflow -> Rep Workflow x
Prelude.Generic)
newWorkflow ::
Workflow
newWorkflow :: Workflow
newWorkflow =
Workflow' :: Maybe WorkflowGraph
-> Maybe POSIX
-> Maybe BlueprintDetails
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow
Workflow'
{ $sel:graph:Workflow' :: Maybe WorkflowGraph
graph = Maybe WorkflowGraph
forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedOn:Workflow' :: Maybe POSIX
lastModifiedOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:blueprintDetails:Workflow' :: Maybe BlueprintDetails
blueprintDetails = Maybe BlueprintDetails
forall a. Maybe a
Prelude.Nothing,
$sel:maxConcurrentRuns:Workflow' :: Maybe Int
maxConcurrentRuns = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:defaultRunProperties:Workflow' :: Maybe (HashMap Text Text)
defaultRunProperties = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:Workflow' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastRun:Workflow' :: Maybe WorkflowRun
lastRun = Maybe WorkflowRun
forall a. Maybe a
Prelude.Nothing,
$sel:description:Workflow' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdOn:Workflow' :: Maybe POSIX
createdOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
workflow_graph :: Lens.Lens' Workflow (Prelude.Maybe WorkflowGraph)
workflow_graph :: (Maybe WorkflowGraph -> f (Maybe WorkflowGraph))
-> Workflow -> f Workflow
workflow_graph = (Workflow -> Maybe WorkflowGraph)
-> (Workflow -> Maybe WorkflowGraph -> Workflow)
-> Lens
Workflow Workflow (Maybe WorkflowGraph) (Maybe WorkflowGraph)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workflow' {Maybe WorkflowGraph
graph :: Maybe WorkflowGraph
$sel:graph:Workflow' :: Workflow -> Maybe WorkflowGraph
graph} -> Maybe WorkflowGraph
graph) (\s :: Workflow
s@Workflow' {} Maybe WorkflowGraph
a -> Workflow
s {$sel:graph:Workflow' :: Maybe WorkflowGraph
graph = Maybe WorkflowGraph
a} :: Workflow)
workflow_lastModifiedOn :: Lens.Lens' Workflow (Prelude.Maybe Prelude.UTCTime)
workflow_lastModifiedOn :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Workflow -> f Workflow
workflow_lastModifiedOn = (Workflow -> Maybe POSIX)
-> (Workflow -> Maybe POSIX -> Workflow)
-> Lens Workflow Workflow (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workflow' {Maybe POSIX
lastModifiedOn :: Maybe POSIX
$sel:lastModifiedOn:Workflow' :: Workflow -> Maybe POSIX
lastModifiedOn} -> Maybe POSIX
lastModifiedOn) (\s :: Workflow
s@Workflow' {} Maybe POSIX
a -> Workflow
s {$sel:lastModifiedOn:Workflow' :: Maybe POSIX
lastModifiedOn = Maybe POSIX
a} :: Workflow) ((Maybe POSIX -> f (Maybe POSIX)) -> Workflow -> f Workflow)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Workflow
-> f Workflow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
workflow_blueprintDetails :: Lens.Lens' Workflow (Prelude.Maybe BlueprintDetails)
workflow_blueprintDetails :: (Maybe BlueprintDetails -> f (Maybe BlueprintDetails))
-> Workflow -> f Workflow
workflow_blueprintDetails = (Workflow -> Maybe BlueprintDetails)
-> (Workflow -> Maybe BlueprintDetails -> Workflow)
-> Lens
Workflow Workflow (Maybe BlueprintDetails) (Maybe BlueprintDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workflow' {Maybe BlueprintDetails
blueprintDetails :: Maybe BlueprintDetails
$sel:blueprintDetails:Workflow' :: Workflow -> Maybe BlueprintDetails
blueprintDetails} -> Maybe BlueprintDetails
blueprintDetails) (\s :: Workflow
s@Workflow' {} Maybe BlueprintDetails
a -> Workflow
s {$sel:blueprintDetails:Workflow' :: Maybe BlueprintDetails
blueprintDetails = Maybe BlueprintDetails
a} :: Workflow)
workflow_maxConcurrentRuns :: Lens.Lens' Workflow (Prelude.Maybe Prelude.Int)
workflow_maxConcurrentRuns :: (Maybe Int -> f (Maybe Int)) -> Workflow -> f Workflow
workflow_maxConcurrentRuns = (Workflow -> Maybe Int)
-> (Workflow -> Maybe Int -> Workflow)
-> Lens Workflow Workflow (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workflow' {Maybe Int
maxConcurrentRuns :: Maybe Int
$sel:maxConcurrentRuns:Workflow' :: Workflow -> Maybe Int
maxConcurrentRuns} -> Maybe Int
maxConcurrentRuns) (\s :: Workflow
s@Workflow' {} Maybe Int
a -> Workflow
s {$sel:maxConcurrentRuns:Workflow' :: Maybe Int
maxConcurrentRuns = Maybe Int
a} :: Workflow)
workflow_defaultRunProperties :: Lens.Lens' Workflow (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
workflow_defaultRunProperties :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Workflow -> f Workflow
workflow_defaultRunProperties = (Workflow -> Maybe (HashMap Text Text))
-> (Workflow -> Maybe (HashMap Text Text) -> Workflow)
-> Lens
Workflow
Workflow
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workflow' {Maybe (HashMap Text Text)
defaultRunProperties :: Maybe (HashMap Text Text)
$sel:defaultRunProperties:Workflow' :: Workflow -> Maybe (HashMap Text Text)
defaultRunProperties} -> Maybe (HashMap Text Text)
defaultRunProperties) (\s :: Workflow
s@Workflow' {} Maybe (HashMap Text Text)
a -> Workflow
s {$sel:defaultRunProperties:Workflow' :: Maybe (HashMap Text Text)
defaultRunProperties = Maybe (HashMap Text Text)
a} :: Workflow) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Workflow -> f Workflow)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Workflow
-> f Workflow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
workflow_name :: Lens.Lens' Workflow (Prelude.Maybe Prelude.Text)
workflow_name :: (Maybe Text -> f (Maybe Text)) -> Workflow -> f Workflow
workflow_name = (Workflow -> Maybe Text)
-> (Workflow -> Maybe Text -> Workflow)
-> Lens Workflow Workflow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workflow' {Maybe Text
name :: Maybe Text
$sel:name:Workflow' :: Workflow -> Maybe Text
name} -> Maybe Text
name) (\s :: Workflow
s@Workflow' {} Maybe Text
a -> Workflow
s {$sel:name:Workflow' :: Maybe Text
name = Maybe Text
a} :: Workflow)
workflow_lastRun :: Lens.Lens' Workflow (Prelude.Maybe WorkflowRun)
workflow_lastRun :: (Maybe WorkflowRun -> f (Maybe WorkflowRun))
-> Workflow -> f Workflow
workflow_lastRun = (Workflow -> Maybe WorkflowRun)
-> (Workflow -> Maybe WorkflowRun -> Workflow)
-> Lens Workflow Workflow (Maybe WorkflowRun) (Maybe WorkflowRun)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workflow' {Maybe WorkflowRun
lastRun :: Maybe WorkflowRun
$sel:lastRun:Workflow' :: Workflow -> Maybe WorkflowRun
lastRun} -> Maybe WorkflowRun
lastRun) (\s :: Workflow
s@Workflow' {} Maybe WorkflowRun
a -> Workflow
s {$sel:lastRun:Workflow' :: Maybe WorkflowRun
lastRun = Maybe WorkflowRun
a} :: Workflow)
workflow_description :: Lens.Lens' Workflow (Prelude.Maybe Prelude.Text)
workflow_description :: (Maybe Text -> f (Maybe Text)) -> Workflow -> f Workflow
workflow_description = (Workflow -> Maybe Text)
-> (Workflow -> Maybe Text -> Workflow)
-> Lens Workflow Workflow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workflow' {Maybe Text
description :: Maybe Text
$sel:description:Workflow' :: Workflow -> Maybe Text
description} -> Maybe Text
description) (\s :: Workflow
s@Workflow' {} Maybe Text
a -> Workflow
s {$sel:description:Workflow' :: Maybe Text
description = Maybe Text
a} :: Workflow)
workflow_createdOn :: Lens.Lens' Workflow (Prelude.Maybe Prelude.UTCTime)
workflow_createdOn :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Workflow -> f Workflow
workflow_createdOn = (Workflow -> Maybe POSIX)
-> (Workflow -> Maybe POSIX -> Workflow)
-> Lens Workflow Workflow (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workflow' {Maybe POSIX
createdOn :: Maybe POSIX
$sel:createdOn:Workflow' :: Workflow -> Maybe POSIX
createdOn} -> Maybe POSIX
createdOn) (\s :: Workflow
s@Workflow' {} Maybe POSIX
a -> Workflow
s {$sel:createdOn:Workflow' :: Maybe POSIX
createdOn = Maybe POSIX
a} :: Workflow) ((Maybe POSIX -> f (Maybe POSIX)) -> Workflow -> f Workflow)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Workflow
-> f Workflow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON Workflow where
parseJSON :: Value -> Parser Workflow
parseJSON =
String -> (Object -> Parser Workflow) -> Value -> Parser Workflow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Workflow"
( \Object
x ->
Maybe WorkflowGraph
-> Maybe POSIX
-> Maybe BlueprintDetails
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow
Workflow'
(Maybe WorkflowGraph
-> Maybe POSIX
-> Maybe BlueprintDetails
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow)
-> Parser (Maybe WorkflowGraph)
-> Parser
(Maybe POSIX
-> Maybe BlueprintDetails
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe WorkflowGraph)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Graph")
Parser
(Maybe POSIX
-> Maybe BlueprintDetails
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow)
-> Parser (Maybe POSIX)
-> Parser
(Maybe BlueprintDetails
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedOn")
Parser
(Maybe BlueprintDetails
-> Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow)
-> Parser (Maybe BlueprintDetails)
-> Parser
(Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BlueprintDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BlueprintDetails")
Parser
(Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow)
-> Parser (Maybe Int)
-> Parser
(Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxConcurrentRuns")
Parser
(Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe WorkflowRun
-> Maybe Text
-> Maybe POSIX
-> Workflow)
-> Parser (Maybe (HashMap Text Text))
-> Parser
(Maybe Text
-> Maybe WorkflowRun -> Maybe Text -> Maybe POSIX -> Workflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DefaultRunProperties"
Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe Text
-> Maybe WorkflowRun -> Maybe Text -> Maybe POSIX -> Workflow)
-> Parser (Maybe Text)
-> Parser
(Maybe WorkflowRun -> Maybe Text -> Maybe POSIX -> Workflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser (Maybe WorkflowRun -> Maybe Text -> Maybe POSIX -> Workflow)
-> Parser (Maybe WorkflowRun)
-> Parser (Maybe Text -> Maybe POSIX -> Workflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkflowRun)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastRun")
Parser (Maybe Text -> Maybe POSIX -> Workflow)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> Workflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
Parser (Maybe POSIX -> Workflow)
-> Parser (Maybe POSIX) -> Parser Workflow
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedOn")
)
instance Prelude.Hashable Workflow
instance Prelude.NFData Workflow