{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data WorkflowDetail = WorkflowDetail'
{
WorkflowDetail -> Text
workflowId :: Prelude.Text,
WorkflowDetail -> Text
executionRole :: Prelude.Text
}
deriving (WorkflowDetail -> WorkflowDetail -> Bool
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]
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
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. 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'
{ $sel:workflowId:WorkflowDetail' :: Text
workflowId = Text
pWorkflowId_,
$sel:executionRole:WorkflowDetail' :: Text
executionRole = Text
pExecutionRole_
}
workflowDetail_workflowId :: Lens.Lens' WorkflowDetail Prelude.Text
workflowDetail_workflowId :: Lens' WorkflowDetail Text
workflowDetail_workflowId = 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 :: Lens' WorkflowDetail Text
workflowDetail_executionRole = 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 Data.FromJSON WorkflowDetail where
parseJSON :: Value -> Parser WorkflowDetail
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"WorkflowDetail"
( \Object
x ->
Text -> Text -> WorkflowDetail
WorkflowDetail'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"WorkflowId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ExecutionRole")
)
instance Prelude.Hashable WorkflowDetail where
hashWithSalt :: Int -> WorkflowDetail -> Int
hashWithSalt Int
_salt WorkflowDetail' {Text
executionRole :: Text
workflowId :: Text
$sel:executionRole:WorkflowDetail' :: WorkflowDetail -> Text
$sel:workflowId:WorkflowDetail' :: WorkflowDetail -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workflowId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
executionRole
instance Prelude.NFData WorkflowDetail where
rnf :: WorkflowDetail -> ()
rnf WorkflowDetail' {Text
executionRole :: Text
workflowId :: Text
$sel:executionRole:WorkflowDetail' :: WorkflowDetail -> Text
$sel:workflowId:WorkflowDetail' :: WorkflowDetail -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
workflowId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
executionRole
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"WorkflowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
workflowId),
forall a. a -> Maybe a
Prelude.Just
(Key
"ExecutionRole" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
executionRole)
]
)