{-# 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.DataPipeline.Types.TaskObject where
import qualified Amazonka.Core as Core
import Amazonka.DataPipeline.Types.PipelineObject
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TaskObject = TaskObject'
{
TaskObject -> Maybe Text
pipelineId :: Prelude.Maybe Prelude.Text,
TaskObject -> Maybe Text
attemptId :: Prelude.Maybe Prelude.Text,
TaskObject -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
TaskObject -> Maybe (HashMap Text PipelineObject)
objects :: Prelude.Maybe (Prelude.HashMap Prelude.Text PipelineObject)
}
deriving (TaskObject -> TaskObject -> Bool
(TaskObject -> TaskObject -> Bool)
-> (TaskObject -> TaskObject -> Bool) -> Eq TaskObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaskObject -> TaskObject -> Bool
$c/= :: TaskObject -> TaskObject -> Bool
== :: TaskObject -> TaskObject -> Bool
$c== :: TaskObject -> TaskObject -> Bool
Prelude.Eq, ReadPrec [TaskObject]
ReadPrec TaskObject
Int -> ReadS TaskObject
ReadS [TaskObject]
(Int -> ReadS TaskObject)
-> ReadS [TaskObject]
-> ReadPrec TaskObject
-> ReadPrec [TaskObject]
-> Read TaskObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TaskObject]
$creadListPrec :: ReadPrec [TaskObject]
readPrec :: ReadPrec TaskObject
$creadPrec :: ReadPrec TaskObject
readList :: ReadS [TaskObject]
$creadList :: ReadS [TaskObject]
readsPrec :: Int -> ReadS TaskObject
$creadsPrec :: Int -> ReadS TaskObject
Prelude.Read, Int -> TaskObject -> ShowS
[TaskObject] -> ShowS
TaskObject -> String
(Int -> TaskObject -> ShowS)
-> (TaskObject -> String)
-> ([TaskObject] -> ShowS)
-> Show TaskObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaskObject] -> ShowS
$cshowList :: [TaskObject] -> ShowS
show :: TaskObject -> String
$cshow :: TaskObject -> String
showsPrec :: Int -> TaskObject -> ShowS
$cshowsPrec :: Int -> TaskObject -> ShowS
Prelude.Show, (forall x. TaskObject -> Rep TaskObject x)
-> (forall x. Rep TaskObject x -> TaskObject) -> Generic TaskObject
forall x. Rep TaskObject x -> TaskObject
forall x. TaskObject -> Rep TaskObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TaskObject x -> TaskObject
$cfrom :: forall x. TaskObject -> Rep TaskObject x
Prelude.Generic)
newTaskObject ::
TaskObject
newTaskObject :: TaskObject
newTaskObject =
TaskObject' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text PipelineObject)
-> TaskObject
TaskObject'
{ $sel:pipelineId:TaskObject' :: Maybe Text
pipelineId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attemptId:TaskObject' :: Maybe Text
attemptId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:taskId:TaskObject' :: Maybe Text
taskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:objects:TaskObject' :: Maybe (HashMap Text PipelineObject)
objects = Maybe (HashMap Text PipelineObject)
forall a. Maybe a
Prelude.Nothing
}
taskObject_pipelineId :: Lens.Lens' TaskObject (Prelude.Maybe Prelude.Text)
taskObject_pipelineId :: (Maybe Text -> f (Maybe Text)) -> TaskObject -> f TaskObject
taskObject_pipelineId = (TaskObject -> Maybe Text)
-> (TaskObject -> Maybe Text -> TaskObject)
-> Lens TaskObject TaskObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskObject' {Maybe Text
pipelineId :: Maybe Text
$sel:pipelineId:TaskObject' :: TaskObject -> Maybe Text
pipelineId} -> Maybe Text
pipelineId) (\s :: TaskObject
s@TaskObject' {} Maybe Text
a -> TaskObject
s {$sel:pipelineId:TaskObject' :: Maybe Text
pipelineId = Maybe Text
a} :: TaskObject)
taskObject_attemptId :: Lens.Lens' TaskObject (Prelude.Maybe Prelude.Text)
taskObject_attemptId :: (Maybe Text -> f (Maybe Text)) -> TaskObject -> f TaskObject
taskObject_attemptId = (TaskObject -> Maybe Text)
-> (TaskObject -> Maybe Text -> TaskObject)
-> Lens TaskObject TaskObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskObject' {Maybe Text
attemptId :: Maybe Text
$sel:attemptId:TaskObject' :: TaskObject -> Maybe Text
attemptId} -> Maybe Text
attemptId) (\s :: TaskObject
s@TaskObject' {} Maybe Text
a -> TaskObject
s {$sel:attemptId:TaskObject' :: Maybe Text
attemptId = Maybe Text
a} :: TaskObject)
taskObject_taskId :: Lens.Lens' TaskObject (Prelude.Maybe Prelude.Text)
taskObject_taskId :: (Maybe Text -> f (Maybe Text)) -> TaskObject -> f TaskObject
taskObject_taskId = (TaskObject -> Maybe Text)
-> (TaskObject -> Maybe Text -> TaskObject)
-> Lens TaskObject TaskObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskObject' {Maybe Text
taskId :: Maybe Text
$sel:taskId:TaskObject' :: TaskObject -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: TaskObject
s@TaskObject' {} Maybe Text
a -> TaskObject
s {$sel:taskId:TaskObject' :: Maybe Text
taskId = Maybe Text
a} :: TaskObject)
taskObject_objects :: Lens.Lens' TaskObject (Prelude.Maybe (Prelude.HashMap Prelude.Text PipelineObject))
taskObject_objects :: (Maybe (HashMap Text PipelineObject)
-> f (Maybe (HashMap Text PipelineObject)))
-> TaskObject -> f TaskObject
taskObject_objects = (TaskObject -> Maybe (HashMap Text PipelineObject))
-> (TaskObject
-> Maybe (HashMap Text PipelineObject) -> TaskObject)
-> Lens
TaskObject
TaskObject
(Maybe (HashMap Text PipelineObject))
(Maybe (HashMap Text PipelineObject))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TaskObject' {Maybe (HashMap Text PipelineObject)
objects :: Maybe (HashMap Text PipelineObject)
$sel:objects:TaskObject' :: TaskObject -> Maybe (HashMap Text PipelineObject)
objects} -> Maybe (HashMap Text PipelineObject)
objects) (\s :: TaskObject
s@TaskObject' {} Maybe (HashMap Text PipelineObject)
a -> TaskObject
s {$sel:objects:TaskObject' :: Maybe (HashMap Text PipelineObject)
objects = Maybe (HashMap Text PipelineObject)
a} :: TaskObject) ((Maybe (HashMap Text PipelineObject)
-> f (Maybe (HashMap Text PipelineObject)))
-> TaskObject -> f TaskObject)
-> ((Maybe (HashMap Text PipelineObject)
-> f (Maybe (HashMap Text PipelineObject)))
-> Maybe (HashMap Text PipelineObject)
-> f (Maybe (HashMap Text PipelineObject)))
-> (Maybe (HashMap Text PipelineObject)
-> f (Maybe (HashMap Text PipelineObject)))
-> TaskObject
-> f TaskObject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text PipelineObject)
(HashMap Text PipelineObject)
(HashMap Text PipelineObject)
(HashMap Text PipelineObject)
-> Iso
(Maybe (HashMap Text PipelineObject))
(Maybe (HashMap Text PipelineObject))
(Maybe (HashMap Text PipelineObject))
(Maybe (HashMap Text PipelineObject))
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 PipelineObject)
(HashMap Text PipelineObject)
(HashMap Text PipelineObject)
(HashMap Text PipelineObject)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON TaskObject where
parseJSON :: Value -> Parser TaskObject
parseJSON =
String
-> (Object -> Parser TaskObject) -> Value -> Parser TaskObject
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TaskObject"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text PipelineObject)
-> TaskObject
TaskObject'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text PipelineObject)
-> TaskObject)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe (HashMap Text PipelineObject) -> TaskObject)
forall (f :: * -> *) a b. Functor 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
"pipelineId")
Parser
(Maybe Text
-> Maybe Text -> Maybe (HashMap Text PipelineObject) -> TaskObject)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe (HashMap Text PipelineObject) -> TaskObject)
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
"attemptId")
Parser
(Maybe Text -> Maybe (HashMap Text PipelineObject) -> TaskObject)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text PipelineObject) -> TaskObject)
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
"taskId")
Parser (Maybe (HashMap Text PipelineObject) -> TaskObject)
-> Parser (Maybe (HashMap Text PipelineObject))
-> Parser TaskObject
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap Text PipelineObject)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"objects" Parser (Maybe (Maybe (HashMap Text PipelineObject)))
-> Maybe (HashMap Text PipelineObject)
-> Parser (Maybe (HashMap Text PipelineObject))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text PipelineObject)
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable TaskObject
instance Prelude.NFData TaskObject