{-# 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.Transfer.Types.DescribedWorkflow where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Transfer.Types.Tag
import Amazonka.Transfer.Types.WorkflowStep
data DescribedWorkflow = DescribedWorkflow'
{
DescribedWorkflow -> Maybe [WorkflowStep]
onExceptionSteps :: Prelude.Maybe [WorkflowStep],
DescribedWorkflow -> Maybe [WorkflowStep]
steps :: Prelude.Maybe [WorkflowStep],
DescribedWorkflow -> Maybe Text
workflowId :: Prelude.Maybe Prelude.Text,
DescribedWorkflow -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
DescribedWorkflow -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
DescribedWorkflow -> Text
arn :: Prelude.Text
}
deriving (DescribedWorkflow -> DescribedWorkflow -> Bool
(DescribedWorkflow -> DescribedWorkflow -> Bool)
-> (DescribedWorkflow -> DescribedWorkflow -> Bool)
-> Eq DescribedWorkflow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribedWorkflow -> DescribedWorkflow -> Bool
$c/= :: DescribedWorkflow -> DescribedWorkflow -> Bool
== :: DescribedWorkflow -> DescribedWorkflow -> Bool
$c== :: DescribedWorkflow -> DescribedWorkflow -> Bool
Prelude.Eq, ReadPrec [DescribedWorkflow]
ReadPrec DescribedWorkflow
Int -> ReadS DescribedWorkflow
ReadS [DescribedWorkflow]
(Int -> ReadS DescribedWorkflow)
-> ReadS [DescribedWorkflow]
-> ReadPrec DescribedWorkflow
-> ReadPrec [DescribedWorkflow]
-> Read DescribedWorkflow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribedWorkflow]
$creadListPrec :: ReadPrec [DescribedWorkflow]
readPrec :: ReadPrec DescribedWorkflow
$creadPrec :: ReadPrec DescribedWorkflow
readList :: ReadS [DescribedWorkflow]
$creadList :: ReadS [DescribedWorkflow]
readsPrec :: Int -> ReadS DescribedWorkflow
$creadsPrec :: Int -> ReadS DescribedWorkflow
Prelude.Read, Int -> DescribedWorkflow -> ShowS
[DescribedWorkflow] -> ShowS
DescribedWorkflow -> String
(Int -> DescribedWorkflow -> ShowS)
-> (DescribedWorkflow -> String)
-> ([DescribedWorkflow] -> ShowS)
-> Show DescribedWorkflow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribedWorkflow] -> ShowS
$cshowList :: [DescribedWorkflow] -> ShowS
show :: DescribedWorkflow -> String
$cshow :: DescribedWorkflow -> String
showsPrec :: Int -> DescribedWorkflow -> ShowS
$cshowsPrec :: Int -> DescribedWorkflow -> ShowS
Prelude.Show, (forall x. DescribedWorkflow -> Rep DescribedWorkflow x)
-> (forall x. Rep DescribedWorkflow x -> DescribedWorkflow)
-> Generic DescribedWorkflow
forall x. Rep DescribedWorkflow x -> DescribedWorkflow
forall x. DescribedWorkflow -> Rep DescribedWorkflow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribedWorkflow x -> DescribedWorkflow
$cfrom :: forall x. DescribedWorkflow -> Rep DescribedWorkflow x
Prelude.Generic)
newDescribedWorkflow ::
Prelude.Text ->
DescribedWorkflow
newDescribedWorkflow :: Text -> DescribedWorkflow
newDescribedWorkflow Text
pArn_ =
DescribedWorkflow' :: Maybe [WorkflowStep]
-> Maybe [WorkflowStep]
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> DescribedWorkflow
DescribedWorkflow'
{ $sel:onExceptionSteps:DescribedWorkflow' :: Maybe [WorkflowStep]
onExceptionSteps =
Maybe [WorkflowStep]
forall a. Maybe a
Prelude.Nothing,
$sel:steps:DescribedWorkflow' :: Maybe [WorkflowStep]
steps = Maybe [WorkflowStep]
forall a. Maybe a
Prelude.Nothing,
$sel:workflowId:DescribedWorkflow' :: Maybe Text
workflowId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:DescribedWorkflow' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:DescribedWorkflow' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:arn:DescribedWorkflow' :: Text
arn = Text
pArn_
}
describedWorkflow_onExceptionSteps :: Lens.Lens' DescribedWorkflow (Prelude.Maybe [WorkflowStep])
describedWorkflow_onExceptionSteps :: (Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> DescribedWorkflow -> f DescribedWorkflow
describedWorkflow_onExceptionSteps = (DescribedWorkflow -> Maybe [WorkflowStep])
-> (DescribedWorkflow -> Maybe [WorkflowStep] -> DescribedWorkflow)
-> Lens
DescribedWorkflow
DescribedWorkflow
(Maybe [WorkflowStep])
(Maybe [WorkflowStep])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedWorkflow' {Maybe [WorkflowStep]
onExceptionSteps :: Maybe [WorkflowStep]
$sel:onExceptionSteps:DescribedWorkflow' :: DescribedWorkflow -> Maybe [WorkflowStep]
onExceptionSteps} -> Maybe [WorkflowStep]
onExceptionSteps) (\s :: DescribedWorkflow
s@DescribedWorkflow' {} Maybe [WorkflowStep]
a -> DescribedWorkflow
s {$sel:onExceptionSteps:DescribedWorkflow' :: Maybe [WorkflowStep]
onExceptionSteps = Maybe [WorkflowStep]
a} :: DescribedWorkflow) ((Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> DescribedWorkflow -> f DescribedWorkflow)
-> ((Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> (Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> DescribedWorkflow
-> f DescribedWorkflow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [WorkflowStep] [WorkflowStep] [WorkflowStep] [WorkflowStep]
-> Iso
(Maybe [WorkflowStep])
(Maybe [WorkflowStep])
(Maybe [WorkflowStep])
(Maybe [WorkflowStep])
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 [WorkflowStep] [WorkflowStep] [WorkflowStep] [WorkflowStep]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describedWorkflow_steps :: Lens.Lens' DescribedWorkflow (Prelude.Maybe [WorkflowStep])
describedWorkflow_steps :: (Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> DescribedWorkflow -> f DescribedWorkflow
describedWorkflow_steps = (DescribedWorkflow -> Maybe [WorkflowStep])
-> (DescribedWorkflow -> Maybe [WorkflowStep] -> DescribedWorkflow)
-> Lens
DescribedWorkflow
DescribedWorkflow
(Maybe [WorkflowStep])
(Maybe [WorkflowStep])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedWorkflow' {Maybe [WorkflowStep]
steps :: Maybe [WorkflowStep]
$sel:steps:DescribedWorkflow' :: DescribedWorkflow -> Maybe [WorkflowStep]
steps} -> Maybe [WorkflowStep]
steps) (\s :: DescribedWorkflow
s@DescribedWorkflow' {} Maybe [WorkflowStep]
a -> DescribedWorkflow
s {$sel:steps:DescribedWorkflow' :: Maybe [WorkflowStep]
steps = Maybe [WorkflowStep]
a} :: DescribedWorkflow) ((Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> DescribedWorkflow -> f DescribedWorkflow)
-> ((Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> (Maybe [WorkflowStep] -> f (Maybe [WorkflowStep]))
-> DescribedWorkflow
-> f DescribedWorkflow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [WorkflowStep] [WorkflowStep] [WorkflowStep] [WorkflowStep]
-> Iso
(Maybe [WorkflowStep])
(Maybe [WorkflowStep])
(Maybe [WorkflowStep])
(Maybe [WorkflowStep])
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 [WorkflowStep] [WorkflowStep] [WorkflowStep] [WorkflowStep]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describedWorkflow_workflowId :: Lens.Lens' DescribedWorkflow (Prelude.Maybe Prelude.Text)
describedWorkflow_workflowId :: (Maybe Text -> f (Maybe Text))
-> DescribedWorkflow -> f DescribedWorkflow
describedWorkflow_workflowId = (DescribedWorkflow -> Maybe Text)
-> (DescribedWorkflow -> Maybe Text -> DescribedWorkflow)
-> Lens
DescribedWorkflow DescribedWorkflow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedWorkflow' {Maybe Text
workflowId :: Maybe Text
$sel:workflowId:DescribedWorkflow' :: DescribedWorkflow -> Maybe Text
workflowId} -> Maybe Text
workflowId) (\s :: DescribedWorkflow
s@DescribedWorkflow' {} Maybe Text
a -> DescribedWorkflow
s {$sel:workflowId:DescribedWorkflow' :: Maybe Text
workflowId = Maybe Text
a} :: DescribedWorkflow)
describedWorkflow_description :: Lens.Lens' DescribedWorkflow (Prelude.Maybe Prelude.Text)
describedWorkflow_description :: (Maybe Text -> f (Maybe Text))
-> DescribedWorkflow -> f DescribedWorkflow
describedWorkflow_description = (DescribedWorkflow -> Maybe Text)
-> (DescribedWorkflow -> Maybe Text -> DescribedWorkflow)
-> Lens
DescribedWorkflow DescribedWorkflow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedWorkflow' {Maybe Text
description :: Maybe Text
$sel:description:DescribedWorkflow' :: DescribedWorkflow -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribedWorkflow
s@DescribedWorkflow' {} Maybe Text
a -> DescribedWorkflow
s {$sel:description:DescribedWorkflow' :: Maybe Text
description = Maybe Text
a} :: DescribedWorkflow)
describedWorkflow_tags :: Lens.Lens' DescribedWorkflow (Prelude.Maybe (Prelude.NonEmpty Tag))
describedWorkflow_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> DescribedWorkflow -> f DescribedWorkflow
describedWorkflow_tags = (DescribedWorkflow -> Maybe (NonEmpty Tag))
-> (DescribedWorkflow -> Maybe (NonEmpty Tag) -> DescribedWorkflow)
-> Lens
DescribedWorkflow
DescribedWorkflow
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedWorkflow' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:DescribedWorkflow' :: DescribedWorkflow -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: DescribedWorkflow
s@DescribedWorkflow' {} Maybe (NonEmpty Tag)
a -> DescribedWorkflow
s {$sel:tags:DescribedWorkflow' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: DescribedWorkflow) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> DescribedWorkflow -> f DescribedWorkflow)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> DescribedWorkflow
-> f DescribedWorkflow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describedWorkflow_arn :: Lens.Lens' DescribedWorkflow Prelude.Text
describedWorkflow_arn :: (Text -> f Text) -> DescribedWorkflow -> f DescribedWorkflow
describedWorkflow_arn = (DescribedWorkflow -> Text)
-> (DescribedWorkflow -> Text -> DescribedWorkflow)
-> Lens DescribedWorkflow DescribedWorkflow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedWorkflow' {Text
arn :: Text
$sel:arn:DescribedWorkflow' :: DescribedWorkflow -> Text
arn} -> Text
arn) (\s :: DescribedWorkflow
s@DescribedWorkflow' {} Text
a -> DescribedWorkflow
s {$sel:arn:DescribedWorkflow' :: Text
arn = Text
a} :: DescribedWorkflow)
instance Core.FromJSON DescribedWorkflow where
parseJSON :: Value -> Parser DescribedWorkflow
parseJSON =
String
-> (Object -> Parser DescribedWorkflow)
-> Value
-> Parser DescribedWorkflow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DescribedWorkflow"
( \Object
x ->
Maybe [WorkflowStep]
-> Maybe [WorkflowStep]
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> DescribedWorkflow
DescribedWorkflow'
(Maybe [WorkflowStep]
-> Maybe [WorkflowStep]
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> DescribedWorkflow)
-> Parser (Maybe [WorkflowStep])
-> Parser
(Maybe [WorkflowStep]
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> DescribedWorkflow)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [WorkflowStep]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OnExceptionSteps"
Parser (Maybe (Maybe [WorkflowStep]))
-> Maybe [WorkflowStep] -> Parser (Maybe [WorkflowStep])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [WorkflowStep]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [WorkflowStep]
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> DescribedWorkflow)
-> Parser (Maybe [WorkflowStep])
-> Parser
(Maybe Text
-> Maybe Text -> Maybe (NonEmpty Tag) -> Text -> DescribedWorkflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [WorkflowStep]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Steps" Parser (Maybe (Maybe [WorkflowStep]))
-> Maybe [WorkflowStep] -> Parser (Maybe [WorkflowStep])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [WorkflowStep]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Text -> Maybe (NonEmpty Tag) -> Text -> DescribedWorkflow)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe (NonEmpty Tag) -> Text -> DescribedWorkflow)
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
"WorkflowId")
Parser
(Maybe Text -> Maybe (NonEmpty Tag) -> Text -> DescribedWorkflow)
-> Parser (Maybe Text)
-> Parser (Maybe (NonEmpty Tag) -> Text -> DescribedWorkflow)
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 (NonEmpty Tag) -> Text -> DescribedWorkflow)
-> Parser (Maybe (NonEmpty Tag))
-> Parser (Text -> DescribedWorkflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Tag))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags")
Parser (Text -> DescribedWorkflow)
-> Parser Text -> Parser DescribedWorkflow
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
)
instance Prelude.Hashable DescribedWorkflow
instance Prelude.NFData DescribedWorkflow