{-# 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.LambdaContainerParams where
import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.Types.LambdaDeviceMount
import Amazonka.GreengrassV2.Types.LambdaVolumeMount
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LambdaContainerParams = LambdaContainerParams'
{
LambdaContainerParams -> Maybe Bool
mountROSysfs :: Prelude.Maybe Prelude.Bool,
LambdaContainerParams -> Maybe Int
memorySizeInKB :: Prelude.Maybe Prelude.Int,
LambdaContainerParams -> Maybe [LambdaDeviceMount]
devices :: Prelude.Maybe [LambdaDeviceMount],
LambdaContainerParams -> Maybe [LambdaVolumeMount]
volumes :: Prelude.Maybe [LambdaVolumeMount]
}
deriving (LambdaContainerParams -> LambdaContainerParams -> Bool
(LambdaContainerParams -> LambdaContainerParams -> Bool)
-> (LambdaContainerParams -> LambdaContainerParams -> Bool)
-> Eq LambdaContainerParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaContainerParams -> LambdaContainerParams -> Bool
$c/= :: LambdaContainerParams -> LambdaContainerParams -> Bool
== :: LambdaContainerParams -> LambdaContainerParams -> Bool
$c== :: LambdaContainerParams -> LambdaContainerParams -> Bool
Prelude.Eq, ReadPrec [LambdaContainerParams]
ReadPrec LambdaContainerParams
Int -> ReadS LambdaContainerParams
ReadS [LambdaContainerParams]
(Int -> ReadS LambdaContainerParams)
-> ReadS [LambdaContainerParams]
-> ReadPrec LambdaContainerParams
-> ReadPrec [LambdaContainerParams]
-> Read LambdaContainerParams
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaContainerParams]
$creadListPrec :: ReadPrec [LambdaContainerParams]
readPrec :: ReadPrec LambdaContainerParams
$creadPrec :: ReadPrec LambdaContainerParams
readList :: ReadS [LambdaContainerParams]
$creadList :: ReadS [LambdaContainerParams]
readsPrec :: Int -> ReadS LambdaContainerParams
$creadsPrec :: Int -> ReadS LambdaContainerParams
Prelude.Read, Int -> LambdaContainerParams -> ShowS
[LambdaContainerParams] -> ShowS
LambdaContainerParams -> String
(Int -> LambdaContainerParams -> ShowS)
-> (LambdaContainerParams -> String)
-> ([LambdaContainerParams] -> ShowS)
-> Show LambdaContainerParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaContainerParams] -> ShowS
$cshowList :: [LambdaContainerParams] -> ShowS
show :: LambdaContainerParams -> String
$cshow :: LambdaContainerParams -> String
showsPrec :: Int -> LambdaContainerParams -> ShowS
$cshowsPrec :: Int -> LambdaContainerParams -> ShowS
Prelude.Show, (forall x. LambdaContainerParams -> Rep LambdaContainerParams x)
-> (forall x. Rep LambdaContainerParams x -> LambdaContainerParams)
-> Generic LambdaContainerParams
forall x. Rep LambdaContainerParams x -> LambdaContainerParams
forall x. LambdaContainerParams -> Rep LambdaContainerParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaContainerParams x -> LambdaContainerParams
$cfrom :: forall x. LambdaContainerParams -> Rep LambdaContainerParams x
Prelude.Generic)
newLambdaContainerParams ::
LambdaContainerParams
newLambdaContainerParams :: LambdaContainerParams
newLambdaContainerParams =
LambdaContainerParams' :: Maybe Bool
-> Maybe Int
-> Maybe [LambdaDeviceMount]
-> Maybe [LambdaVolumeMount]
-> LambdaContainerParams
LambdaContainerParams'
{ $sel:mountROSysfs:LambdaContainerParams' :: Maybe Bool
mountROSysfs =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:memorySizeInKB:LambdaContainerParams' :: Maybe Int
memorySizeInKB = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:devices:LambdaContainerParams' :: Maybe [LambdaDeviceMount]
devices = Maybe [LambdaDeviceMount]
forall a. Maybe a
Prelude.Nothing,
$sel:volumes:LambdaContainerParams' :: Maybe [LambdaVolumeMount]
volumes = Maybe [LambdaVolumeMount]
forall a. Maybe a
Prelude.Nothing
}
lambdaContainerParams_mountROSysfs :: Lens.Lens' LambdaContainerParams (Prelude.Maybe Prelude.Bool)
lambdaContainerParams_mountROSysfs :: (Maybe Bool -> f (Maybe Bool))
-> LambdaContainerParams -> f LambdaContainerParams
lambdaContainerParams_mountROSysfs = (LambdaContainerParams -> Maybe Bool)
-> (LambdaContainerParams -> Maybe Bool -> LambdaContainerParams)
-> Lens
LambdaContainerParams
LambdaContainerParams
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaContainerParams' {Maybe Bool
mountROSysfs :: Maybe Bool
$sel:mountROSysfs:LambdaContainerParams' :: LambdaContainerParams -> Maybe Bool
mountROSysfs} -> Maybe Bool
mountROSysfs) (\s :: LambdaContainerParams
s@LambdaContainerParams' {} Maybe Bool
a -> LambdaContainerParams
s {$sel:mountROSysfs:LambdaContainerParams' :: Maybe Bool
mountROSysfs = Maybe Bool
a} :: LambdaContainerParams)
lambdaContainerParams_memorySizeInKB :: Lens.Lens' LambdaContainerParams (Prelude.Maybe Prelude.Int)
lambdaContainerParams_memorySizeInKB :: (Maybe Int -> f (Maybe Int))
-> LambdaContainerParams -> f LambdaContainerParams
lambdaContainerParams_memorySizeInKB = (LambdaContainerParams -> Maybe Int)
-> (LambdaContainerParams -> Maybe Int -> LambdaContainerParams)
-> Lens
LambdaContainerParams LambdaContainerParams (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaContainerParams' {Maybe Int
memorySizeInKB :: Maybe Int
$sel:memorySizeInKB:LambdaContainerParams' :: LambdaContainerParams -> Maybe Int
memorySizeInKB} -> Maybe Int
memorySizeInKB) (\s :: LambdaContainerParams
s@LambdaContainerParams' {} Maybe Int
a -> LambdaContainerParams
s {$sel:memorySizeInKB:LambdaContainerParams' :: Maybe Int
memorySizeInKB = Maybe Int
a} :: LambdaContainerParams)
lambdaContainerParams_devices :: Lens.Lens' LambdaContainerParams (Prelude.Maybe [LambdaDeviceMount])
lambdaContainerParams_devices :: (Maybe [LambdaDeviceMount] -> f (Maybe [LambdaDeviceMount]))
-> LambdaContainerParams -> f LambdaContainerParams
lambdaContainerParams_devices = (LambdaContainerParams -> Maybe [LambdaDeviceMount])
-> (LambdaContainerParams
-> Maybe [LambdaDeviceMount] -> LambdaContainerParams)
-> Lens
LambdaContainerParams
LambdaContainerParams
(Maybe [LambdaDeviceMount])
(Maybe [LambdaDeviceMount])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaContainerParams' {Maybe [LambdaDeviceMount]
devices :: Maybe [LambdaDeviceMount]
$sel:devices:LambdaContainerParams' :: LambdaContainerParams -> Maybe [LambdaDeviceMount]
devices} -> Maybe [LambdaDeviceMount]
devices) (\s :: LambdaContainerParams
s@LambdaContainerParams' {} Maybe [LambdaDeviceMount]
a -> LambdaContainerParams
s {$sel:devices:LambdaContainerParams' :: Maybe [LambdaDeviceMount]
devices = Maybe [LambdaDeviceMount]
a} :: LambdaContainerParams) ((Maybe [LambdaDeviceMount] -> f (Maybe [LambdaDeviceMount]))
-> LambdaContainerParams -> f LambdaContainerParams)
-> ((Maybe [LambdaDeviceMount] -> f (Maybe [LambdaDeviceMount]))
-> Maybe [LambdaDeviceMount] -> f (Maybe [LambdaDeviceMount]))
-> (Maybe [LambdaDeviceMount] -> f (Maybe [LambdaDeviceMount]))
-> LambdaContainerParams
-> f LambdaContainerParams
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[LambdaDeviceMount]
[LambdaDeviceMount]
[LambdaDeviceMount]
[LambdaDeviceMount]
-> Iso
(Maybe [LambdaDeviceMount])
(Maybe [LambdaDeviceMount])
(Maybe [LambdaDeviceMount])
(Maybe [LambdaDeviceMount])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[LambdaDeviceMount]
[LambdaDeviceMount]
[LambdaDeviceMount]
[LambdaDeviceMount]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
lambdaContainerParams_volumes :: Lens.Lens' LambdaContainerParams (Prelude.Maybe [LambdaVolumeMount])
lambdaContainerParams_volumes :: (Maybe [LambdaVolumeMount] -> f (Maybe [LambdaVolumeMount]))
-> LambdaContainerParams -> f LambdaContainerParams
lambdaContainerParams_volumes = (LambdaContainerParams -> Maybe [LambdaVolumeMount])
-> (LambdaContainerParams
-> Maybe [LambdaVolumeMount] -> LambdaContainerParams)
-> Lens
LambdaContainerParams
LambdaContainerParams
(Maybe [LambdaVolumeMount])
(Maybe [LambdaVolumeMount])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaContainerParams' {Maybe [LambdaVolumeMount]
volumes :: Maybe [LambdaVolumeMount]
$sel:volumes:LambdaContainerParams' :: LambdaContainerParams -> Maybe [LambdaVolumeMount]
volumes} -> Maybe [LambdaVolumeMount]
volumes) (\s :: LambdaContainerParams
s@LambdaContainerParams' {} Maybe [LambdaVolumeMount]
a -> LambdaContainerParams
s {$sel:volumes:LambdaContainerParams' :: Maybe [LambdaVolumeMount]
volumes = Maybe [LambdaVolumeMount]
a} :: LambdaContainerParams) ((Maybe [LambdaVolumeMount] -> f (Maybe [LambdaVolumeMount]))
-> LambdaContainerParams -> f LambdaContainerParams)
-> ((Maybe [LambdaVolumeMount] -> f (Maybe [LambdaVolumeMount]))
-> Maybe [LambdaVolumeMount] -> f (Maybe [LambdaVolumeMount]))
-> (Maybe [LambdaVolumeMount] -> f (Maybe [LambdaVolumeMount]))
-> LambdaContainerParams
-> f LambdaContainerParams
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[LambdaVolumeMount]
[LambdaVolumeMount]
[LambdaVolumeMount]
[LambdaVolumeMount]
-> Iso
(Maybe [LambdaVolumeMount])
(Maybe [LambdaVolumeMount])
(Maybe [LambdaVolumeMount])
(Maybe [LambdaVolumeMount])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[LambdaVolumeMount]
[LambdaVolumeMount]
[LambdaVolumeMount]
[LambdaVolumeMount]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable LambdaContainerParams
instance Prelude.NFData LambdaContainerParams
instance Core.ToJSON LambdaContainerParams where
toJSON :: LambdaContainerParams -> Value
toJSON LambdaContainerParams' {Maybe Bool
Maybe Int
Maybe [LambdaDeviceMount]
Maybe [LambdaVolumeMount]
volumes :: Maybe [LambdaVolumeMount]
devices :: Maybe [LambdaDeviceMount]
memorySizeInKB :: Maybe Int
mountROSysfs :: Maybe Bool
$sel:volumes:LambdaContainerParams' :: LambdaContainerParams -> Maybe [LambdaVolumeMount]
$sel:devices:LambdaContainerParams' :: LambdaContainerParams -> Maybe [LambdaDeviceMount]
$sel:memorySizeInKB:LambdaContainerParams' :: LambdaContainerParams -> Maybe Int
$sel:mountROSysfs:LambdaContainerParams' :: LambdaContainerParams -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"mountROSysfs" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
mountROSysfs,
(Text
"memorySizeInKB" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
memorySizeInKB,
(Text
"devices" Text -> [LambdaDeviceMount] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([LambdaDeviceMount] -> Pair)
-> Maybe [LambdaDeviceMount] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [LambdaDeviceMount]
devices,
(Text
"volumes" Text -> [LambdaVolumeMount] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([LambdaVolumeMount] -> Pair)
-> Maybe [LambdaVolumeMount] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [LambdaVolumeMount]
volumes
]
)