{-# 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 Amazonka.GreengrassV2.Types.SystemResourceLimits
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComponentRunWith = ComponentRunWith'
{
ComponentRunWith -> Maybe Text
posixUser :: Prelude.Maybe Prelude.Text,
ComponentRunWith -> Maybe SystemResourceLimits
systemResourceLimits :: Prelude.Maybe SystemResourceLimits
}
deriving (ComponentRunWith -> ComponentRunWith -> Bool
(ComponentRunWith -> ComponentRunWith -> Bool)
-> (ComponentRunWith -> ComponentRunWith -> Bool)
-> Eq ComponentRunWith
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]
(Int -> ReadS ComponentRunWith)
-> ReadS [ComponentRunWith]
-> ReadPrec ComponentRunWith
-> ReadPrec [ComponentRunWith]
-> Read 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
(Int -> ComponentRunWith -> ShowS)
-> (ComponentRunWith -> String)
-> ([ComponentRunWith] -> ShowS)
-> Show ComponentRunWith
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. ComponentRunWith -> Rep ComponentRunWith x)
-> (forall x. Rep ComponentRunWith x -> ComponentRunWith)
-> Generic ComponentRunWith
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' :: Maybe Text -> Maybe SystemResourceLimits -> ComponentRunWith
ComponentRunWith'
{ $sel:posixUser:ComponentRunWith' :: Maybe Text
posixUser = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:systemResourceLimits:ComponentRunWith' :: Maybe SystemResourceLimits
systemResourceLimits = Maybe SystemResourceLimits
forall a. Maybe a
Prelude.Nothing
}
componentRunWith_posixUser :: Lens.Lens' ComponentRunWith (Prelude.Maybe Prelude.Text)
componentRunWith_posixUser :: (Maybe Text -> f (Maybe Text))
-> ComponentRunWith -> f ComponentRunWith
componentRunWith_posixUser = (ComponentRunWith -> Maybe Text)
-> (ComponentRunWith -> Maybe Text -> ComponentRunWith)
-> Lens ComponentRunWith ComponentRunWith (Maybe Text) (Maybe Text)
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 :: (Maybe SystemResourceLimits -> f (Maybe SystemResourceLimits))
-> ComponentRunWith -> f ComponentRunWith
componentRunWith_systemResourceLimits = (ComponentRunWith -> Maybe SystemResourceLimits)
-> (ComponentRunWith
-> Maybe SystemResourceLimits -> ComponentRunWith)
-> Lens
ComponentRunWith
ComponentRunWith
(Maybe SystemResourceLimits)
(Maybe 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)
instance Core.FromJSON ComponentRunWith where
parseJSON :: Value -> Parser ComponentRunWith
parseJSON =
String
-> (Object -> Parser ComponentRunWith)
-> Value
-> Parser ComponentRunWith
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComponentRunWith"
( \Object
x ->
Maybe Text -> Maybe SystemResourceLimits -> ComponentRunWith
ComponentRunWith'
(Maybe Text -> Maybe SystemResourceLimits -> ComponentRunWith)
-> Parser (Maybe Text)
-> Parser (Maybe SystemResourceLimits -> ComponentRunWith)
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
"posixUser")
Parser (Maybe SystemResourceLimits -> ComponentRunWith)
-> Parser (Maybe SystemResourceLimits) -> Parser ComponentRunWith
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SystemResourceLimits)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"systemResourceLimits")
)
instance Prelude.Hashable ComponentRunWith
instance Prelude.NFData ComponentRunWith
instance Core.ToJSON ComponentRunWith where
toJSON :: ComponentRunWith -> Value
toJSON ComponentRunWith' {Maybe Text
Maybe SystemResourceLimits
systemResourceLimits :: Maybe SystemResourceLimits
posixUser :: Maybe Text
$sel:systemResourceLimits:ComponentRunWith' :: ComponentRunWith -> Maybe SystemResourceLimits
$sel:posixUser:ComponentRunWith' :: ComponentRunWith -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"posixUser" 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
posixUser,
(Text
"systemResourceLimits" Text -> SystemResourceLimits -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SystemResourceLimits -> Pair)
-> Maybe SystemResourceLimits -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SystemResourceLimits
systemResourceLimits
]
)