{-# 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.Greengrass.Types.FunctionRunAsConfig 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 FunctionRunAsConfig = FunctionRunAsConfig'
{
FunctionRunAsConfig -> Maybe Int
gid :: Prelude.Maybe Prelude.Int,
FunctionRunAsConfig -> Maybe Int
uid :: Prelude.Maybe Prelude.Int
}
deriving (FunctionRunAsConfig -> FunctionRunAsConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FunctionRunAsConfig -> FunctionRunAsConfig -> Bool
$c/= :: FunctionRunAsConfig -> FunctionRunAsConfig -> Bool
== :: FunctionRunAsConfig -> FunctionRunAsConfig -> Bool
$c== :: FunctionRunAsConfig -> FunctionRunAsConfig -> Bool
Prelude.Eq, ReadPrec [FunctionRunAsConfig]
ReadPrec FunctionRunAsConfig
Int -> ReadS FunctionRunAsConfig
ReadS [FunctionRunAsConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FunctionRunAsConfig]
$creadListPrec :: ReadPrec [FunctionRunAsConfig]
readPrec :: ReadPrec FunctionRunAsConfig
$creadPrec :: ReadPrec FunctionRunAsConfig
readList :: ReadS [FunctionRunAsConfig]
$creadList :: ReadS [FunctionRunAsConfig]
readsPrec :: Int -> ReadS FunctionRunAsConfig
$creadsPrec :: Int -> ReadS FunctionRunAsConfig
Prelude.Read, Int -> FunctionRunAsConfig -> ShowS
[FunctionRunAsConfig] -> ShowS
FunctionRunAsConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FunctionRunAsConfig] -> ShowS
$cshowList :: [FunctionRunAsConfig] -> ShowS
show :: FunctionRunAsConfig -> String
$cshow :: FunctionRunAsConfig -> String
showsPrec :: Int -> FunctionRunAsConfig -> ShowS
$cshowsPrec :: Int -> FunctionRunAsConfig -> ShowS
Prelude.Show, forall x. Rep FunctionRunAsConfig x -> FunctionRunAsConfig
forall x. FunctionRunAsConfig -> Rep FunctionRunAsConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FunctionRunAsConfig x -> FunctionRunAsConfig
$cfrom :: forall x. FunctionRunAsConfig -> Rep FunctionRunAsConfig x
Prelude.Generic)
newFunctionRunAsConfig ::
FunctionRunAsConfig
newFunctionRunAsConfig :: FunctionRunAsConfig
newFunctionRunAsConfig =
FunctionRunAsConfig'
{ $sel:gid:FunctionRunAsConfig' :: Maybe Int
gid = forall a. Maybe a
Prelude.Nothing,
$sel:uid:FunctionRunAsConfig' :: Maybe Int
uid = forall a. Maybe a
Prelude.Nothing
}
functionRunAsConfig_gid :: Lens.Lens' FunctionRunAsConfig (Prelude.Maybe Prelude.Int)
functionRunAsConfig_gid :: Lens' FunctionRunAsConfig (Maybe Int)
functionRunAsConfig_gid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionRunAsConfig' {Maybe Int
gid :: Maybe Int
$sel:gid:FunctionRunAsConfig' :: FunctionRunAsConfig -> Maybe Int
gid} -> Maybe Int
gid) (\s :: FunctionRunAsConfig
s@FunctionRunAsConfig' {} Maybe Int
a -> FunctionRunAsConfig
s {$sel:gid:FunctionRunAsConfig' :: Maybe Int
gid = Maybe Int
a} :: FunctionRunAsConfig)
functionRunAsConfig_uid :: Lens.Lens' FunctionRunAsConfig (Prelude.Maybe Prelude.Int)
functionRunAsConfig_uid :: Lens' FunctionRunAsConfig (Maybe Int)
functionRunAsConfig_uid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionRunAsConfig' {Maybe Int
uid :: Maybe Int
$sel:uid:FunctionRunAsConfig' :: FunctionRunAsConfig -> Maybe Int
uid} -> Maybe Int
uid) (\s :: FunctionRunAsConfig
s@FunctionRunAsConfig' {} Maybe Int
a -> FunctionRunAsConfig
s {$sel:uid:FunctionRunAsConfig' :: Maybe Int
uid = Maybe Int
a} :: FunctionRunAsConfig)
instance Data.FromJSON FunctionRunAsConfig where
parseJSON :: Value -> Parser FunctionRunAsConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FunctionRunAsConfig"
( \Object
x ->
Maybe Int -> Maybe Int -> FunctionRunAsConfig
FunctionRunAsConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Gid")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Uid")
)
instance Prelude.Hashable FunctionRunAsConfig where
hashWithSalt :: Int -> FunctionRunAsConfig -> Int
hashWithSalt Int
_salt FunctionRunAsConfig' {Maybe Int
uid :: Maybe Int
gid :: Maybe Int
$sel:uid:FunctionRunAsConfig' :: FunctionRunAsConfig -> Maybe Int
$sel:gid:FunctionRunAsConfig' :: FunctionRunAsConfig -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
gid
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
uid
instance Prelude.NFData FunctionRunAsConfig where
rnf :: FunctionRunAsConfig -> ()
rnf FunctionRunAsConfig' {Maybe Int
uid :: Maybe Int
gid :: Maybe Int
$sel:uid:FunctionRunAsConfig' :: FunctionRunAsConfig -> Maybe Int
$sel:gid:FunctionRunAsConfig' :: FunctionRunAsConfig -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
gid seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
uid
instance Data.ToJSON FunctionRunAsConfig where
toJSON :: FunctionRunAsConfig -> Value
toJSON FunctionRunAsConfig' {Maybe Int
uid :: Maybe Int
gid :: Maybe Int
$sel:uid:FunctionRunAsConfig' :: FunctionRunAsConfig -> Maybe Int
$sel:gid:FunctionRunAsConfig' :: FunctionRunAsConfig -> Maybe Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Gid" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
gid,
(Key
"Uid" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
uid
]
)