{-# 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.GreengrassV2.Types.ComponentRunWith where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GreengrassV2.Types.SystemResourceLimits
import qualified Amazonka.Prelude as Prelude
data ComponentRunWith = ComponentRunWith'
{
ComponentRunWith -> Maybe Text
posixUser :: Prelude.Maybe Prelude.Text,
ComponentRunWith -> Maybe SystemResourceLimits
systemResourceLimits :: Prelude.Maybe SystemResourceLimits,
ComponentRunWith -> Maybe Text
windowsUser :: Prelude.Maybe Prelude.Text
}
deriving (ComponentRunWith -> ComponentRunWith -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentRunWith -> ComponentRunWith -> Bool
$c/= :: ComponentRunWith -> ComponentRunWith -> Bool
== :: ComponentRunWith -> ComponentRunWith -> Bool
$c== :: ComponentRunWith -> ComponentRunWith -> Bool
Prelude.Eq, ReadPrec [ComponentRunWith]
ReadPrec ComponentRunWith
Int -> ReadS ComponentRunWith
ReadS [ComponentRunWith]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComponentRunWith]
$creadListPrec :: ReadPrec [ComponentRunWith]
readPrec :: ReadPrec ComponentRunWith
$creadPrec :: ReadPrec ComponentRunWith
readList :: ReadS [ComponentRunWith]
$creadList :: ReadS [ComponentRunWith]
readsPrec :: Int -> ReadS ComponentRunWith
$creadsPrec :: Int -> ReadS ComponentRunWith
Prelude.Read, Int -> ComponentRunWith -> ShowS
[ComponentRunWith] -> ShowS
ComponentRunWith -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentRunWith] -> ShowS
$cshowList :: [ComponentRunWith] -> ShowS
show :: ComponentRunWith -> String
$cshow :: ComponentRunWith -> String
showsPrec :: Int -> ComponentRunWith -> ShowS
$cshowsPrec :: Int -> ComponentRunWith -> ShowS
Prelude.Show, forall x. Rep ComponentRunWith x -> ComponentRunWith
forall x. ComponentRunWith -> Rep ComponentRunWith x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComponentRunWith x -> ComponentRunWith
$cfrom :: forall x. ComponentRunWith -> Rep ComponentRunWith x
Prelude.Generic)
newComponentRunWith ::
ComponentRunWith
newComponentRunWith :: ComponentRunWith
newComponentRunWith =
ComponentRunWith'
{ $sel:posixUser:ComponentRunWith' :: Maybe Text
posixUser = forall a. Maybe a
Prelude.Nothing,
$sel:systemResourceLimits:ComponentRunWith' :: Maybe SystemResourceLimits
systemResourceLimits = forall a. Maybe a
Prelude.Nothing,
$sel:windowsUser:ComponentRunWith' :: Maybe Text
windowsUser = forall a. Maybe a
Prelude.Nothing
}
componentRunWith_posixUser :: Lens.Lens' ComponentRunWith (Prelude.Maybe Prelude.Text)
componentRunWith_posixUser :: Lens' ComponentRunWith (Maybe Text)
componentRunWith_posixUser = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentRunWith' {Maybe Text
posixUser :: Maybe Text
$sel:posixUser:ComponentRunWith' :: ComponentRunWith -> Maybe Text
posixUser} -> Maybe Text
posixUser) (\s :: ComponentRunWith
s@ComponentRunWith' {} Maybe Text
a -> ComponentRunWith
s {$sel:posixUser:ComponentRunWith' :: Maybe Text
posixUser = Maybe Text
a} :: ComponentRunWith)
componentRunWith_systemResourceLimits :: Lens.Lens' ComponentRunWith (Prelude.Maybe SystemResourceLimits)
componentRunWith_systemResourceLimits :: Lens' ComponentRunWith (Maybe SystemResourceLimits)
componentRunWith_systemResourceLimits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentRunWith' {Maybe SystemResourceLimits
systemResourceLimits :: Maybe SystemResourceLimits
$sel:systemResourceLimits:ComponentRunWith' :: ComponentRunWith -> Maybe SystemResourceLimits
systemResourceLimits} -> Maybe SystemResourceLimits
systemResourceLimits) (\s :: ComponentRunWith
s@ComponentRunWith' {} Maybe SystemResourceLimits
a -> ComponentRunWith
s {$sel:systemResourceLimits:ComponentRunWith' :: Maybe SystemResourceLimits
systemResourceLimits = Maybe SystemResourceLimits
a} :: ComponentRunWith)
componentRunWith_windowsUser :: Lens.Lens' ComponentRunWith (Prelude.Maybe Prelude.Text)
componentRunWith_windowsUser :: Lens' ComponentRunWith (Maybe Text)
componentRunWith_windowsUser = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentRunWith' {Maybe Text
windowsUser :: Maybe Text
$sel:windowsUser:ComponentRunWith' :: ComponentRunWith -> Maybe Text
windowsUser} -> Maybe Text
windowsUser) (\s :: ComponentRunWith
s@ComponentRunWith' {} Maybe Text
a -> ComponentRunWith
s {$sel:windowsUser:ComponentRunWith' :: Maybe Text
windowsUser = Maybe Text
a} :: ComponentRunWith)
instance Data.FromJSON ComponentRunWith where
parseJSON :: Value -> Parser ComponentRunWith
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ComponentRunWith"
( \Object
x ->
Maybe Text
-> Maybe SystemResourceLimits -> Maybe Text -> ComponentRunWith
ComponentRunWith'
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
"posixUser")
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
"systemResourceLimits")
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
"windowsUser")
)
instance Prelude.Hashable ComponentRunWith where
hashWithSalt :: Int -> ComponentRunWith -> Int
hashWithSalt Int
_salt ComponentRunWith' {Maybe Text
Maybe SystemResourceLimits
windowsUser :: Maybe Text
systemResourceLimits :: Maybe SystemResourceLimits
posixUser :: Maybe Text
$sel:windowsUser:ComponentRunWith' :: ComponentRunWith -> Maybe Text
$sel:systemResourceLimits:ComponentRunWith' :: ComponentRunWith -> Maybe SystemResourceLimits
$sel:posixUser:ComponentRunWith' :: ComponentRunWith -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
posixUser
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SystemResourceLimits
systemResourceLimits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
windowsUser
instance Prelude.NFData ComponentRunWith where
rnf :: ComponentRunWith -> ()
rnf ComponentRunWith' {Maybe Text
Maybe SystemResourceLimits
windowsUser :: Maybe Text
systemResourceLimits :: Maybe SystemResourceLimits
posixUser :: Maybe Text
$sel:windowsUser:ComponentRunWith' :: ComponentRunWith -> Maybe Text
$sel:systemResourceLimits:ComponentRunWith' :: ComponentRunWith -> Maybe SystemResourceLimits
$sel:posixUser:ComponentRunWith' :: ComponentRunWith -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
posixUser
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SystemResourceLimits
systemResourceLimits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
windowsUser
instance Data.ToJSON ComponentRunWith where
toJSON :: ComponentRunWith -> Value
toJSON ComponentRunWith' {Maybe Text
Maybe SystemResourceLimits
windowsUser :: Maybe Text
systemResourceLimits :: Maybe SystemResourceLimits
posixUser :: Maybe Text
$sel:windowsUser:ComponentRunWith' :: ComponentRunWith -> Maybe Text
$sel:systemResourceLimits:ComponentRunWith' :: ComponentRunWith -> Maybe SystemResourceLimits
$sel:posixUser:ComponentRunWith' :: ComponentRunWith -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"posixUser" 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 Text
posixUser,
(Key
"systemResourceLimits" 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 SystemResourceLimits
systemResourceLimits,
(Key
"windowsUser" 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 Text
windowsUser
]
)