{-# 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.SWF.Types.WorkflowType 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 WorkflowType = WorkflowType'
{
WorkflowType -> Text
name :: Prelude.Text,
WorkflowType -> Text
version :: Prelude.Text
}
deriving (WorkflowType -> WorkflowType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowType -> WorkflowType -> Bool
$c/= :: WorkflowType -> WorkflowType -> Bool
== :: WorkflowType -> WorkflowType -> Bool
$c== :: WorkflowType -> WorkflowType -> Bool
Prelude.Eq, ReadPrec [WorkflowType]
ReadPrec WorkflowType
Int -> ReadS WorkflowType
ReadS [WorkflowType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowType]
$creadListPrec :: ReadPrec [WorkflowType]
readPrec :: ReadPrec WorkflowType
$creadPrec :: ReadPrec WorkflowType
readList :: ReadS [WorkflowType]
$creadList :: ReadS [WorkflowType]
readsPrec :: Int -> ReadS WorkflowType
$creadsPrec :: Int -> ReadS WorkflowType
Prelude.Read, Int -> WorkflowType -> ShowS
[WorkflowType] -> ShowS
WorkflowType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowType] -> ShowS
$cshowList :: [WorkflowType] -> ShowS
show :: WorkflowType -> String
$cshow :: WorkflowType -> String
showsPrec :: Int -> WorkflowType -> ShowS
$cshowsPrec :: Int -> WorkflowType -> ShowS
Prelude.Show, forall x. Rep WorkflowType x -> WorkflowType
forall x. WorkflowType -> Rep WorkflowType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowType x -> WorkflowType
$cfrom :: forall x. WorkflowType -> Rep WorkflowType x
Prelude.Generic)
newWorkflowType ::
Prelude.Text ->
Prelude.Text ->
WorkflowType
newWorkflowType :: Text -> Text -> WorkflowType
newWorkflowType Text
pName_ Text
pVersion_ =
WorkflowType' {$sel:name:WorkflowType' :: Text
name = Text
pName_, $sel:version:WorkflowType' :: Text
version = Text
pVersion_}
workflowType_name :: Lens.Lens' WorkflowType Prelude.Text
workflowType_name :: Lens' WorkflowType Text
workflowType_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowType' {Text
name :: Text
$sel:name:WorkflowType' :: WorkflowType -> Text
name} -> Text
name) (\s :: WorkflowType
s@WorkflowType' {} Text
a -> WorkflowType
s {$sel:name:WorkflowType' :: Text
name = Text
a} :: WorkflowType)
workflowType_version :: Lens.Lens' WorkflowType Prelude.Text
workflowType_version :: Lens' WorkflowType Text
workflowType_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowType' {Text
version :: Text
$sel:version:WorkflowType' :: WorkflowType -> Text
version} -> Text
version) (\s :: WorkflowType
s@WorkflowType' {} Text
a -> WorkflowType
s {$sel:version:WorkflowType' :: Text
version = Text
a} :: WorkflowType)
instance Data.FromJSON WorkflowType where
parseJSON :: Value -> Parser WorkflowType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"WorkflowType"
( \Object
x ->
Text -> Text -> WorkflowType
WorkflowType'
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
"name")
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
"version")
)
instance Prelude.Hashable WorkflowType where
hashWithSalt :: Int -> WorkflowType -> Int
hashWithSalt Int
_salt WorkflowType' {Text
version :: Text
name :: Text
$sel:version:WorkflowType' :: WorkflowType -> Text
$sel:name:WorkflowType' :: WorkflowType -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
version
instance Prelude.NFData WorkflowType where
rnf :: WorkflowType -> ()
rnf WorkflowType' {Text
version :: Text
name :: Text
$sel:version:WorkflowType' :: WorkflowType -> Text
$sel:name:WorkflowType' :: WorkflowType -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
version
instance Data.ToJSON WorkflowType where
toJSON :: WorkflowType -> Value
toJSON WorkflowType' {Text
version :: Text
name :: Text
$sel:version:WorkflowType' :: WorkflowType -> Text
$sel:name:WorkflowType' :: WorkflowType -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
version)
]
)