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