module Stratosphere.Greengrass.FunctionDefinition.ExecutionProperty (
        module Exports, ExecutionProperty(..), mkExecutionProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Greengrass.FunctionDefinition.RunAsProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ExecutionProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-execution.html>
    ExecutionProperty {ExecutionProperty -> ()
haddock_workaround_ :: (),
                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-execution.html#cfn-greengrass-functiondefinition-execution-isolationmode>
                       ExecutionProperty -> Maybe (Value Text)
isolationMode :: (Prelude.Maybe (Value Prelude.Text)),
                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-execution.html#cfn-greengrass-functiondefinition-execution-runas>
                       ExecutionProperty -> Maybe RunAsProperty
runAs :: (Prelude.Maybe RunAsProperty)}
  deriving stock (ExecutionProperty -> ExecutionProperty -> Bool
(ExecutionProperty -> ExecutionProperty -> Bool)
-> (ExecutionProperty -> ExecutionProperty -> Bool)
-> Eq ExecutionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ExecutionProperty -> ExecutionProperty -> Bool
== :: ExecutionProperty -> ExecutionProperty -> Bool
$c/= :: ExecutionProperty -> ExecutionProperty -> Bool
/= :: ExecutionProperty -> ExecutionProperty -> Bool
Prelude.Eq, Int -> ExecutionProperty -> ShowS
[ExecutionProperty] -> ShowS
ExecutionProperty -> String
(Int -> ExecutionProperty -> ShowS)
-> (ExecutionProperty -> String)
-> ([ExecutionProperty] -> ShowS)
-> Show ExecutionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ExecutionProperty -> ShowS
showsPrec :: Int -> ExecutionProperty -> ShowS
$cshow :: ExecutionProperty -> String
show :: ExecutionProperty -> String
$cshowList :: [ExecutionProperty] -> ShowS
showList :: [ExecutionProperty] -> ShowS
Prelude.Show)
mkExecutionProperty :: ExecutionProperty
mkExecutionProperty :: ExecutionProperty
mkExecutionProperty
  = ExecutionProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), isolationMode :: Maybe (Value Text)
isolationMode = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       runAs :: Maybe RunAsProperty
runAs = Maybe RunAsProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ExecutionProperty where
  toResourceProperties :: ExecutionProperty -> ResourceProperties
toResourceProperties ExecutionProperty {Maybe (Value Text)
Maybe RunAsProperty
()
haddock_workaround_ :: ExecutionProperty -> ()
isolationMode :: ExecutionProperty -> Maybe (Value Text)
runAs :: ExecutionProperty -> Maybe RunAsProperty
haddock_workaround_ :: ()
isolationMode :: Maybe (Value Text)
runAs :: Maybe RunAsProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Greengrass::FunctionDefinition.Execution",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"IsolationMode" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
isolationMode,
                            Key -> RunAsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RunAs" (RunAsProperty -> (Key, Value))
-> Maybe RunAsProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RunAsProperty
runAs])}
instance JSON.ToJSON ExecutionProperty where
  toJSON :: ExecutionProperty -> Value
toJSON ExecutionProperty {Maybe (Value Text)
Maybe RunAsProperty
()
haddock_workaround_ :: ExecutionProperty -> ()
isolationMode :: ExecutionProperty -> Maybe (Value Text)
runAs :: ExecutionProperty -> Maybe RunAsProperty
haddock_workaround_ :: ()
isolationMode :: Maybe (Value Text)
runAs :: Maybe RunAsProperty
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"IsolationMode" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
isolationMode,
               Key -> RunAsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RunAs" (RunAsProperty -> (Key, Value))
-> Maybe RunAsProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RunAsProperty
runAs]))
instance Property "IsolationMode" ExecutionProperty where
  type PropertyType "IsolationMode" ExecutionProperty = Value Prelude.Text
  set :: PropertyType "IsolationMode" ExecutionProperty
-> ExecutionProperty -> ExecutionProperty
set PropertyType "IsolationMode" ExecutionProperty
newValue ExecutionProperty {Maybe (Value Text)
Maybe RunAsProperty
()
haddock_workaround_ :: ExecutionProperty -> ()
isolationMode :: ExecutionProperty -> Maybe (Value Text)
runAs :: ExecutionProperty -> Maybe RunAsProperty
haddock_workaround_ :: ()
isolationMode :: Maybe (Value Text)
runAs :: Maybe RunAsProperty
..}
    = ExecutionProperty {isolationMode :: Maybe (Value Text)
isolationMode = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "IsolationMode" ExecutionProperty
Value Text
newValue, Maybe RunAsProperty
()
haddock_workaround_ :: ()
runAs :: Maybe RunAsProperty
haddock_workaround_ :: ()
runAs :: Maybe RunAsProperty
..}
instance Property "RunAs" ExecutionProperty where
  type PropertyType "RunAs" ExecutionProperty = RunAsProperty
  set :: PropertyType "RunAs" ExecutionProperty
-> ExecutionProperty -> ExecutionProperty
set PropertyType "RunAs" ExecutionProperty
newValue ExecutionProperty {Maybe (Value Text)
Maybe RunAsProperty
()
haddock_workaround_ :: ExecutionProperty -> ()
isolationMode :: ExecutionProperty -> Maybe (Value Text)
runAs :: ExecutionProperty -> Maybe RunAsProperty
haddock_workaround_ :: ()
isolationMode :: Maybe (Value Text)
runAs :: Maybe RunAsProperty
..}
    = ExecutionProperty {runAs :: Maybe RunAsProperty
runAs = RunAsProperty -> Maybe RunAsProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "RunAs" ExecutionProperty
RunAsProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
isolationMode :: Maybe (Value Text)
haddock_workaround_ :: ()
isolationMode :: Maybe (Value Text)
..}