{-# 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.WorkflowDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data WorkflowDetail = WorkflowDetail'
{
WorkflowDetail -> Text
workflowId :: Prelude.Text,
WorkflowDetail -> Text
executionRole :: Prelude.Text
}
deriving (WorkflowDetail -> WorkflowDetail -> Bool
(WorkflowDetail -> WorkflowDetail -> Bool)
-> (WorkflowDetail -> WorkflowDetail -> Bool) -> Eq WorkflowDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowDetail -> WorkflowDetail -> Bool
$c/= :: WorkflowDetail -> WorkflowDetail -> Bool
== :: WorkflowDetail -> WorkflowDetail -> Bool
$c== :: WorkflowDetail -> WorkflowDetail -> Bool
Prelude.Eq, ReadPrec [WorkflowDetail]
ReadPrec WorkflowDetail
Int -> ReadS WorkflowDetail
ReadS [WorkflowDetail]
(Int -> ReadS WorkflowDetail)
-> ReadS [WorkflowDetail]
-> ReadPrec WorkflowDetail
-> ReadPrec [WorkflowDetail]
-> Read WorkflowDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowDetail]
$creadListPrec :: ReadPrec [WorkflowDetail]
readPrec :: ReadPrec WorkflowDetail
$creadPrec :: ReadPrec WorkflowDetail
readList :: ReadS [WorkflowDetail]
$creadList :: ReadS [WorkflowDetail]
readsPrec :: Int -> ReadS WorkflowDetail
$creadsPrec :: Int -> ReadS WorkflowDetail
Prelude.Read, Int -> WorkflowDetail -> ShowS
[WorkflowDetail] -> ShowS
WorkflowDetail -> String
(Int -> WorkflowDetail -> ShowS)
-> (WorkflowDetail -> String)
-> ([WorkflowDetail] -> ShowS)
-> Show WorkflowDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowDetail] -> ShowS
$cshowList :: [WorkflowDetail] -> ShowS
show :: WorkflowDetail -> String
$cshow :: WorkflowDetail -> String
showsPrec :: Int -> WorkflowDetail -> ShowS
$cshowsPrec :: Int -> WorkflowDetail -> ShowS
Prelude.Show, (forall x. WorkflowDetail -> Rep WorkflowDetail x)
-> (forall x. Rep WorkflowDetail x -> WorkflowDetail)
-> Generic WorkflowDetail
forall x. Rep WorkflowDetail x -> WorkflowDetail
forall x. WorkflowDetail -> Rep WorkflowDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowDetail x -> WorkflowDetail
$cfrom :: forall x. WorkflowDetail -> Rep WorkflowDetail x
Prelude.Generic)
newWorkflowDetail ::
Prelude.Text ->
Prelude.Text ->
WorkflowDetail
newWorkflowDetail :: Text -> Text -> WorkflowDetail
newWorkflowDetail Text
pWorkflowId_ Text
pExecutionRole_ =
WorkflowDetail' :: Text -> Text -> WorkflowDetail
WorkflowDetail'
{ $sel:workflowId:WorkflowDetail' :: Text
workflowId = Text
pWorkflowId_,
$sel:executionRole:WorkflowDetail' :: Text
executionRole = Text
pExecutionRole_
}
workflowDetail_workflowId :: Lens.Lens' WorkflowDetail Prelude.Text
workflowDetail_workflowId :: (Text -> f Text) -> WorkflowDetail -> f WorkflowDetail
workflowDetail_workflowId = (WorkflowDetail -> Text)
-> (WorkflowDetail -> Text -> WorkflowDetail)
-> Lens WorkflowDetail WorkflowDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowDetail' {Text
workflowId :: Text
$sel:workflowId:WorkflowDetail' :: WorkflowDetail -> Text
workflowId} -> Text
workflowId) (\s :: WorkflowDetail
s@WorkflowDetail' {} Text
a -> WorkflowDetail
s {$sel:workflowId:WorkflowDetail' :: Text
workflowId = Text
a} :: WorkflowDetail)
workflowDetail_executionRole :: Lens.Lens' WorkflowDetail Prelude.Text
workflowDetail_executionRole :: (Text -> f Text) -> WorkflowDetail -> f WorkflowDetail
workflowDetail_executionRole = (WorkflowDetail -> Text)
-> (WorkflowDetail -> Text -> WorkflowDetail)
-> Lens WorkflowDetail WorkflowDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowDetail' {Text
executionRole :: Text
$sel:executionRole:WorkflowDetail' :: WorkflowDetail -> Text
executionRole} -> Text
executionRole) (\s :: WorkflowDetail
s@WorkflowDetail' {} Text
a -> WorkflowDetail
s {$sel:executionRole:WorkflowDetail' :: Text
executionRole = Text
a} :: WorkflowDetail)
instance Core.FromJSON WorkflowDetail where
parseJSON :: Value -> Parser WorkflowDetail
parseJSON =
String
-> (Object -> Parser WorkflowDetail)
-> Value
-> Parser WorkflowDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WorkflowDetail"
( \Object
x ->
Text -> Text -> WorkflowDetail
WorkflowDetail'
(Text -> Text -> WorkflowDetail)
-> Parser Text -> Parser (Text -> WorkflowDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"WorkflowId")
Parser (Text -> WorkflowDetail)
-> Parser Text -> Parser WorkflowDetail
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
"ExecutionRole")
)
instance Prelude.Hashable WorkflowDetail
instance Prelude.NFData WorkflowDetail
instance Core.ToJSON WorkflowDetail where
toJSON :: WorkflowDetail -> Value
toJSON WorkflowDetail' {Text
executionRole :: Text
workflowId :: Text
$sel:executionRole:WorkflowDetail' :: WorkflowDetail -> Text
$sel:workflowId:WorkflowDetail' :: WorkflowDetail -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WorkflowId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workflowId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ExecutionRole" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
executionRole)
]
)