module Stratosphere.Greengrass.FunctionDefinition.RunAsProperty (
        RunAsProperty(..), mkRunAsProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data RunAsProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-runas.html>
    RunAsProperty {RunAsProperty -> ()
haddock_workaround_ :: (),
                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-runas.html#cfn-greengrass-functiondefinition-runas-gid>
                   RunAsProperty -> Maybe (Value Integer)
gid :: (Prelude.Maybe (Value Prelude.Integer)),
                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-runas.html#cfn-greengrass-functiondefinition-runas-uid>
                   RunAsProperty -> Maybe (Value Integer)
uid :: (Prelude.Maybe (Value Prelude.Integer))}
  deriving stock (RunAsProperty -> RunAsProperty -> Bool
(RunAsProperty -> RunAsProperty -> Bool)
-> (RunAsProperty -> RunAsProperty -> Bool) -> Eq RunAsProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RunAsProperty -> RunAsProperty -> Bool
== :: RunAsProperty -> RunAsProperty -> Bool
$c/= :: RunAsProperty -> RunAsProperty -> Bool
/= :: RunAsProperty -> RunAsProperty -> Bool
Prelude.Eq, Int -> RunAsProperty -> ShowS
[RunAsProperty] -> ShowS
RunAsProperty -> String
(Int -> RunAsProperty -> ShowS)
-> (RunAsProperty -> String)
-> ([RunAsProperty] -> ShowS)
-> Show RunAsProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RunAsProperty -> ShowS
showsPrec :: Int -> RunAsProperty -> ShowS
$cshow :: RunAsProperty -> String
show :: RunAsProperty -> String
$cshowList :: [RunAsProperty] -> ShowS
showList :: [RunAsProperty] -> ShowS
Prelude.Show)
mkRunAsProperty :: RunAsProperty
mkRunAsProperty :: RunAsProperty
mkRunAsProperty
  = RunAsProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), gid :: Maybe (Value Integer)
gid = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing,
       uid :: Maybe (Value Integer)
uid = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties RunAsProperty where
  toResourceProperties :: RunAsProperty -> ResourceProperties
toResourceProperties RunAsProperty {Maybe (Value Integer)
()
haddock_workaround_ :: RunAsProperty -> ()
gid :: RunAsProperty -> Maybe (Value Integer)
uid :: RunAsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
gid :: Maybe (Value Integer)
uid :: Maybe (Value Integer)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Greengrass::FunctionDefinition.RunAs",
         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 Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Gid" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
gid,
                            Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Uid" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
uid])}
instance JSON.ToJSON RunAsProperty where
  toJSON :: RunAsProperty -> Value
toJSON RunAsProperty {Maybe (Value Integer)
()
haddock_workaround_ :: RunAsProperty -> ()
gid :: RunAsProperty -> Maybe (Value Integer)
uid :: RunAsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
gid :: Maybe (Value Integer)
uid :: Maybe (Value Integer)
..}
    = [(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 Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Gid" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
gid,
               Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Uid" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
uid]))
instance Property "Gid" RunAsProperty where
  type PropertyType "Gid" RunAsProperty = Value Prelude.Integer
  set :: PropertyType "Gid" RunAsProperty -> RunAsProperty -> RunAsProperty
set PropertyType "Gid" RunAsProperty
newValue RunAsProperty {Maybe (Value Integer)
()
haddock_workaround_ :: RunAsProperty -> ()
gid :: RunAsProperty -> Maybe (Value Integer)
uid :: RunAsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
gid :: Maybe (Value Integer)
uid :: Maybe (Value Integer)
..}
    = RunAsProperty {gid :: Maybe (Value Integer)
gid = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Gid" RunAsProperty
Value Integer
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
uid :: Maybe (Value Integer)
haddock_workaround_ :: ()
uid :: Maybe (Value Integer)
..}
instance Property "Uid" RunAsProperty where
  type PropertyType "Uid" RunAsProperty = Value Prelude.Integer
  set :: PropertyType "Uid" RunAsProperty -> RunAsProperty -> RunAsProperty
set PropertyType "Uid" RunAsProperty
newValue RunAsProperty {Maybe (Value Integer)
()
haddock_workaround_ :: RunAsProperty -> ()
gid :: RunAsProperty -> Maybe (Value Integer)
uid :: RunAsProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
gid :: Maybe (Value Integer)
uid :: Maybe (Value Integer)
..}
    = RunAsProperty {uid :: Maybe (Value Integer)
uid = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Uid" RunAsProperty
Value Integer
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
gid :: Maybe (Value Integer)
haddock_workaround_ :: ()
gid :: Maybe (Value Integer)
..}