{-# 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.WorkflowDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Transfer.Types.WorkflowDetail
data WorkflowDetails = WorkflowDetails'
{
WorkflowDetails -> [WorkflowDetail]
onUpload :: [WorkflowDetail]
}
deriving (WorkflowDetails -> WorkflowDetails -> Bool
(WorkflowDetails -> WorkflowDetails -> Bool)
-> (WorkflowDetails -> WorkflowDetails -> Bool)
-> Eq WorkflowDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowDetails -> WorkflowDetails -> Bool
$c/= :: WorkflowDetails -> WorkflowDetails -> Bool
== :: WorkflowDetails -> WorkflowDetails -> Bool
$c== :: WorkflowDetails -> WorkflowDetails -> Bool
Prelude.Eq, ReadPrec [WorkflowDetails]
ReadPrec WorkflowDetails
Int -> ReadS WorkflowDetails
ReadS [WorkflowDetails]
(Int -> ReadS WorkflowDetails)
-> ReadS [WorkflowDetails]
-> ReadPrec WorkflowDetails
-> ReadPrec [WorkflowDetails]
-> Read WorkflowDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowDetails]
$creadListPrec :: ReadPrec [WorkflowDetails]
readPrec :: ReadPrec WorkflowDetails
$creadPrec :: ReadPrec WorkflowDetails
readList :: ReadS [WorkflowDetails]
$creadList :: ReadS [WorkflowDetails]
readsPrec :: Int -> ReadS WorkflowDetails
$creadsPrec :: Int -> ReadS WorkflowDetails
Prelude.Read, Int -> WorkflowDetails -> ShowS
[WorkflowDetails] -> ShowS
WorkflowDetails -> String
(Int -> WorkflowDetails -> ShowS)
-> (WorkflowDetails -> String)
-> ([WorkflowDetails] -> ShowS)
-> Show WorkflowDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowDetails] -> ShowS
$cshowList :: [WorkflowDetails] -> ShowS
show :: WorkflowDetails -> String
$cshow :: WorkflowDetails -> String
showsPrec :: Int -> WorkflowDetails -> ShowS
$cshowsPrec :: Int -> WorkflowDetails -> ShowS
Prelude.Show, (forall x. WorkflowDetails -> Rep WorkflowDetails x)
-> (forall x. Rep WorkflowDetails x -> WorkflowDetails)
-> Generic WorkflowDetails
forall x. Rep WorkflowDetails x -> WorkflowDetails
forall x. WorkflowDetails -> Rep WorkflowDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowDetails x -> WorkflowDetails
$cfrom :: forall x. WorkflowDetails -> Rep WorkflowDetails x
Prelude.Generic)
newWorkflowDetails ::
WorkflowDetails
newWorkflowDetails :: WorkflowDetails
newWorkflowDetails =
WorkflowDetails' :: [WorkflowDetail] -> WorkflowDetails
WorkflowDetails' {$sel:onUpload:WorkflowDetails' :: [WorkflowDetail]
onUpload = [WorkflowDetail]
forall a. Monoid a => a
Prelude.mempty}
workflowDetails_onUpload :: Lens.Lens' WorkflowDetails [WorkflowDetail]
workflowDetails_onUpload :: ([WorkflowDetail] -> f [WorkflowDetail])
-> WorkflowDetails -> f WorkflowDetails
workflowDetails_onUpload = (WorkflowDetails -> [WorkflowDetail])
-> (WorkflowDetails -> [WorkflowDetail] -> WorkflowDetails)
-> Lens
WorkflowDetails WorkflowDetails [WorkflowDetail] [WorkflowDetail]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowDetails' {[WorkflowDetail]
onUpload :: [WorkflowDetail]
$sel:onUpload:WorkflowDetails' :: WorkflowDetails -> [WorkflowDetail]
onUpload} -> [WorkflowDetail]
onUpload) (\s :: WorkflowDetails
s@WorkflowDetails' {} [WorkflowDetail]
a -> WorkflowDetails
s {$sel:onUpload:WorkflowDetails' :: [WorkflowDetail]
onUpload = [WorkflowDetail]
a} :: WorkflowDetails) (([WorkflowDetail] -> f [WorkflowDetail])
-> WorkflowDetails -> f WorkflowDetails)
-> (([WorkflowDetail] -> f [WorkflowDetail])
-> [WorkflowDetail] -> f [WorkflowDetail])
-> ([WorkflowDetail] -> f [WorkflowDetail])
-> WorkflowDetails
-> f WorkflowDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([WorkflowDetail] -> f [WorkflowDetail])
-> [WorkflowDetail] -> f [WorkflowDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON WorkflowDetails where
parseJSON :: Value -> Parser WorkflowDetails
parseJSON =
String
-> (Object -> Parser WorkflowDetails)
-> Value
-> Parser WorkflowDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WorkflowDetails"
( \Object
x ->
[WorkflowDetail] -> WorkflowDetails
WorkflowDetails'
([WorkflowDetail] -> WorkflowDetails)
-> Parser [WorkflowDetail] -> Parser WorkflowDetails
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe [WorkflowDetail])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OnUpload" Parser (Maybe [WorkflowDetail])
-> [WorkflowDetail] -> Parser [WorkflowDetail]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [WorkflowDetail]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable WorkflowDetails
instance Prelude.NFData WorkflowDetails
instance Core.ToJSON WorkflowDetails where
toJSON :: WorkflowDetails -> Value
toJSON WorkflowDetails' {[WorkflowDetail]
onUpload :: [WorkflowDetail]
$sel:onUpload:WorkflowDetails' :: WorkflowDetails -> [WorkflowDetail]
..} =
[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
"OnUpload" Text -> [WorkflowDetail] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [WorkflowDetail]
onUpload)]
)