{-# 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.ECS.Types.ContainerOverride where
import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.EnvironmentFile
import Amazonka.ECS.Types.KeyValuePair
import Amazonka.ECS.Types.ResourceRequirement
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ContainerOverride = ContainerOverride'
{
ContainerOverride -> Maybe [Text]
command :: Prelude.Maybe [Prelude.Text],
ContainerOverride -> Maybe [KeyValuePair]
environment :: Prelude.Maybe [KeyValuePair],
ContainerOverride -> Maybe [EnvironmentFile]
environmentFiles :: Prelude.Maybe [EnvironmentFile],
ContainerOverride -> Maybe [ResourceRequirement]
resourceRequirements :: Prelude.Maybe [ResourceRequirement],
ContainerOverride -> Maybe Int
memory :: Prelude.Maybe Prelude.Int,
ContainerOverride -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ContainerOverride -> Maybe Int
cpu :: Prelude.Maybe Prelude.Int,
ContainerOverride -> Maybe Int
memoryReservation :: Prelude.Maybe Prelude.Int
}
deriving (ContainerOverride -> ContainerOverride -> Bool
(ContainerOverride -> ContainerOverride -> Bool)
-> (ContainerOverride -> ContainerOverride -> Bool)
-> Eq ContainerOverride
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerOverride -> ContainerOverride -> Bool
$c/= :: ContainerOverride -> ContainerOverride -> Bool
== :: ContainerOverride -> ContainerOverride -> Bool
$c== :: ContainerOverride -> ContainerOverride -> Bool
Prelude.Eq, ReadPrec [ContainerOverride]
ReadPrec ContainerOverride
Int -> ReadS ContainerOverride
ReadS [ContainerOverride]
(Int -> ReadS ContainerOverride)
-> ReadS [ContainerOverride]
-> ReadPrec ContainerOverride
-> ReadPrec [ContainerOverride]
-> Read ContainerOverride
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerOverride]
$creadListPrec :: ReadPrec [ContainerOverride]
readPrec :: ReadPrec ContainerOverride
$creadPrec :: ReadPrec ContainerOverride
readList :: ReadS [ContainerOverride]
$creadList :: ReadS [ContainerOverride]
readsPrec :: Int -> ReadS ContainerOverride
$creadsPrec :: Int -> ReadS ContainerOverride
Prelude.Read, Int -> ContainerOverride -> ShowS
[ContainerOverride] -> ShowS
ContainerOverride -> String
(Int -> ContainerOverride -> ShowS)
-> (ContainerOverride -> String)
-> ([ContainerOverride] -> ShowS)
-> Show ContainerOverride
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerOverride] -> ShowS
$cshowList :: [ContainerOverride] -> ShowS
show :: ContainerOverride -> String
$cshow :: ContainerOverride -> String
showsPrec :: Int -> ContainerOverride -> ShowS
$cshowsPrec :: Int -> ContainerOverride -> ShowS
Prelude.Show, (forall x. ContainerOverride -> Rep ContainerOverride x)
-> (forall x. Rep ContainerOverride x -> ContainerOverride)
-> Generic ContainerOverride
forall x. Rep ContainerOverride x -> ContainerOverride
forall x. ContainerOverride -> Rep ContainerOverride x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerOverride x -> ContainerOverride
$cfrom :: forall x. ContainerOverride -> Rep ContainerOverride x
Prelude.Generic)
newContainerOverride ::
ContainerOverride
newContainerOverride :: ContainerOverride
newContainerOverride =
ContainerOverride' :: Maybe [Text]
-> Maybe [KeyValuePair]
-> Maybe [EnvironmentFile]
-> Maybe [ResourceRequirement]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverride
ContainerOverride'
{ $sel:command:ContainerOverride' :: Maybe [Text]
command = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:environment:ContainerOverride' :: Maybe [KeyValuePair]
environment = Maybe [KeyValuePair]
forall a. Maybe a
Prelude.Nothing,
$sel:environmentFiles:ContainerOverride' :: Maybe [EnvironmentFile]
environmentFiles = Maybe [EnvironmentFile]
forall a. Maybe a
Prelude.Nothing,
$sel:resourceRequirements:ContainerOverride' :: Maybe [ResourceRequirement]
resourceRequirements = Maybe [ResourceRequirement]
forall a. Maybe a
Prelude.Nothing,
$sel:memory:ContainerOverride' :: Maybe Int
memory = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:name:ContainerOverride' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cpu:ContainerOverride' :: Maybe Int
cpu = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:memoryReservation:ContainerOverride' :: Maybe Int
memoryReservation = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
containerOverride_command :: Lens.Lens' ContainerOverride (Prelude.Maybe [Prelude.Text])
containerOverride_command :: (Maybe [Text] -> f (Maybe [Text]))
-> ContainerOverride -> f ContainerOverride
containerOverride_command = (ContainerOverride -> Maybe [Text])
-> (ContainerOverride -> Maybe [Text] -> ContainerOverride)
-> Lens
ContainerOverride ContainerOverride (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverride' {Maybe [Text]
command :: Maybe [Text]
$sel:command:ContainerOverride' :: ContainerOverride -> Maybe [Text]
command} -> Maybe [Text]
command) (\s :: ContainerOverride
s@ContainerOverride' {} Maybe [Text]
a -> ContainerOverride
s {$sel:command:ContainerOverride' :: Maybe [Text]
command = Maybe [Text]
a} :: ContainerOverride) ((Maybe [Text] -> f (Maybe [Text]))
-> ContainerOverride -> f ContainerOverride)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ContainerOverride
-> f ContainerOverride
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
containerOverride_environment :: Lens.Lens' ContainerOverride (Prelude.Maybe [KeyValuePair])
containerOverride_environment :: (Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> ContainerOverride -> f ContainerOverride
containerOverride_environment = (ContainerOverride -> Maybe [KeyValuePair])
-> (ContainerOverride -> Maybe [KeyValuePair] -> ContainerOverride)
-> Lens
ContainerOverride
ContainerOverride
(Maybe [KeyValuePair])
(Maybe [KeyValuePair])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverride' {Maybe [KeyValuePair]
environment :: Maybe [KeyValuePair]
$sel:environment:ContainerOverride' :: ContainerOverride -> Maybe [KeyValuePair]
environment} -> Maybe [KeyValuePair]
environment) (\s :: ContainerOverride
s@ContainerOverride' {} Maybe [KeyValuePair]
a -> ContainerOverride
s {$sel:environment:ContainerOverride' :: Maybe [KeyValuePair]
environment = Maybe [KeyValuePair]
a} :: ContainerOverride) ((Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> ContainerOverride -> f ContainerOverride)
-> ((Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> (Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> ContainerOverride
-> f ContainerOverride
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [KeyValuePair] [KeyValuePair] [KeyValuePair] [KeyValuePair]
-> Iso
(Maybe [KeyValuePair])
(Maybe [KeyValuePair])
(Maybe [KeyValuePair])
(Maybe [KeyValuePair])
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 [KeyValuePair] [KeyValuePair] [KeyValuePair] [KeyValuePair]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
containerOverride_environmentFiles :: Lens.Lens' ContainerOverride (Prelude.Maybe [EnvironmentFile])
containerOverride_environmentFiles :: (Maybe [EnvironmentFile] -> f (Maybe [EnvironmentFile]))
-> ContainerOverride -> f ContainerOverride
containerOverride_environmentFiles = (ContainerOverride -> Maybe [EnvironmentFile])
-> (ContainerOverride
-> Maybe [EnvironmentFile] -> ContainerOverride)
-> Lens
ContainerOverride
ContainerOverride
(Maybe [EnvironmentFile])
(Maybe [EnvironmentFile])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverride' {Maybe [EnvironmentFile]
environmentFiles :: Maybe [EnvironmentFile]
$sel:environmentFiles:ContainerOverride' :: ContainerOverride -> Maybe [EnvironmentFile]
environmentFiles} -> Maybe [EnvironmentFile]
environmentFiles) (\s :: ContainerOverride
s@ContainerOverride' {} Maybe [EnvironmentFile]
a -> ContainerOverride
s {$sel:environmentFiles:ContainerOverride' :: Maybe [EnvironmentFile]
environmentFiles = Maybe [EnvironmentFile]
a} :: ContainerOverride) ((Maybe [EnvironmentFile] -> f (Maybe [EnvironmentFile]))
-> ContainerOverride -> f ContainerOverride)
-> ((Maybe [EnvironmentFile] -> f (Maybe [EnvironmentFile]))
-> Maybe [EnvironmentFile] -> f (Maybe [EnvironmentFile]))
-> (Maybe [EnvironmentFile] -> f (Maybe [EnvironmentFile]))
-> ContainerOverride
-> f ContainerOverride
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EnvironmentFile]
[EnvironmentFile]
[EnvironmentFile]
[EnvironmentFile]
-> Iso
(Maybe [EnvironmentFile])
(Maybe [EnvironmentFile])
(Maybe [EnvironmentFile])
(Maybe [EnvironmentFile])
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
[EnvironmentFile]
[EnvironmentFile]
[EnvironmentFile]
[EnvironmentFile]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
containerOverride_resourceRequirements :: Lens.Lens' ContainerOverride (Prelude.Maybe [ResourceRequirement])
containerOverride_resourceRequirements :: (Maybe [ResourceRequirement] -> f (Maybe [ResourceRequirement]))
-> ContainerOverride -> f ContainerOverride
containerOverride_resourceRequirements = (ContainerOverride -> Maybe [ResourceRequirement])
-> (ContainerOverride
-> Maybe [ResourceRequirement] -> ContainerOverride)
-> Lens
ContainerOverride
ContainerOverride
(Maybe [ResourceRequirement])
(Maybe [ResourceRequirement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverride' {Maybe [ResourceRequirement]
resourceRequirements :: Maybe [ResourceRequirement]
$sel:resourceRequirements:ContainerOverride' :: ContainerOverride -> Maybe [ResourceRequirement]
resourceRequirements} -> Maybe [ResourceRequirement]
resourceRequirements) (\s :: ContainerOverride
s@ContainerOverride' {} Maybe [ResourceRequirement]
a -> ContainerOverride
s {$sel:resourceRequirements:ContainerOverride' :: Maybe [ResourceRequirement]
resourceRequirements = Maybe [ResourceRequirement]
a} :: ContainerOverride) ((Maybe [ResourceRequirement] -> f (Maybe [ResourceRequirement]))
-> ContainerOverride -> f ContainerOverride)
-> ((Maybe [ResourceRequirement]
-> f (Maybe [ResourceRequirement]))
-> Maybe [ResourceRequirement] -> f (Maybe [ResourceRequirement]))
-> (Maybe [ResourceRequirement] -> f (Maybe [ResourceRequirement]))
-> ContainerOverride
-> f ContainerOverride
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ResourceRequirement]
[ResourceRequirement]
[ResourceRequirement]
[ResourceRequirement]
-> Iso
(Maybe [ResourceRequirement])
(Maybe [ResourceRequirement])
(Maybe [ResourceRequirement])
(Maybe [ResourceRequirement])
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
[ResourceRequirement]
[ResourceRequirement]
[ResourceRequirement]
[ResourceRequirement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
containerOverride_memory :: Lens.Lens' ContainerOverride (Prelude.Maybe Prelude.Int)
containerOverride_memory :: (Maybe Int -> f (Maybe Int))
-> ContainerOverride -> f ContainerOverride
containerOverride_memory = (ContainerOverride -> Maybe Int)
-> (ContainerOverride -> Maybe Int -> ContainerOverride)
-> Lens ContainerOverride ContainerOverride (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverride' {Maybe Int
memory :: Maybe Int
$sel:memory:ContainerOverride' :: ContainerOverride -> Maybe Int
memory} -> Maybe Int
memory) (\s :: ContainerOverride
s@ContainerOverride' {} Maybe Int
a -> ContainerOverride
s {$sel:memory:ContainerOverride' :: Maybe Int
memory = Maybe Int
a} :: ContainerOverride)
containerOverride_name :: Lens.Lens' ContainerOverride (Prelude.Maybe Prelude.Text)
containerOverride_name :: (Maybe Text -> f (Maybe Text))
-> ContainerOverride -> f ContainerOverride
containerOverride_name = (ContainerOverride -> Maybe Text)
-> (ContainerOverride -> Maybe Text -> ContainerOverride)
-> Lens
ContainerOverride ContainerOverride (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverride' {Maybe Text
name :: Maybe Text
$sel:name:ContainerOverride' :: ContainerOverride -> Maybe Text
name} -> Maybe Text
name) (\s :: ContainerOverride
s@ContainerOverride' {} Maybe Text
a -> ContainerOverride
s {$sel:name:ContainerOverride' :: Maybe Text
name = Maybe Text
a} :: ContainerOverride)
containerOverride_cpu :: Lens.Lens' ContainerOverride (Prelude.Maybe Prelude.Int)
containerOverride_cpu :: (Maybe Int -> f (Maybe Int))
-> ContainerOverride -> f ContainerOverride
containerOverride_cpu = (ContainerOverride -> Maybe Int)
-> (ContainerOverride -> Maybe Int -> ContainerOverride)
-> Lens ContainerOverride ContainerOverride (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverride' {Maybe Int
cpu :: Maybe Int
$sel:cpu:ContainerOverride' :: ContainerOverride -> Maybe Int
cpu} -> Maybe Int
cpu) (\s :: ContainerOverride
s@ContainerOverride' {} Maybe Int
a -> ContainerOverride
s {$sel:cpu:ContainerOverride' :: Maybe Int
cpu = Maybe Int
a} :: ContainerOverride)
containerOverride_memoryReservation :: Lens.Lens' ContainerOverride (Prelude.Maybe Prelude.Int)
containerOverride_memoryReservation :: (Maybe Int -> f (Maybe Int))
-> ContainerOverride -> f ContainerOverride
containerOverride_memoryReservation = (ContainerOverride -> Maybe Int)
-> (ContainerOverride -> Maybe Int -> ContainerOverride)
-> Lens ContainerOverride ContainerOverride (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverride' {Maybe Int
memoryReservation :: Maybe Int
$sel:memoryReservation:ContainerOverride' :: ContainerOverride -> Maybe Int
memoryReservation} -> Maybe Int
memoryReservation) (\s :: ContainerOverride
s@ContainerOverride' {} Maybe Int
a -> ContainerOverride
s {$sel:memoryReservation:ContainerOverride' :: Maybe Int
memoryReservation = Maybe Int
a} :: ContainerOverride)
instance Core.FromJSON ContainerOverride where
parseJSON :: Value -> Parser ContainerOverride
parseJSON =
String
-> (Object -> Parser ContainerOverride)
-> Value
-> Parser ContainerOverride
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ContainerOverride"
( \Object
x ->
Maybe [Text]
-> Maybe [KeyValuePair]
-> Maybe [EnvironmentFile]
-> Maybe [ResourceRequirement]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverride
ContainerOverride'
(Maybe [Text]
-> Maybe [KeyValuePair]
-> Maybe [EnvironmentFile]
-> Maybe [ResourceRequirement]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverride)
-> Parser (Maybe [Text])
-> Parser
(Maybe [KeyValuePair]
-> Maybe [EnvironmentFile]
-> Maybe [ResourceRequirement]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverride)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"command" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe [KeyValuePair]
-> Maybe [EnvironmentFile]
-> Maybe [ResourceRequirement]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverride)
-> Parser (Maybe [KeyValuePair])
-> Parser
(Maybe [EnvironmentFile]
-> Maybe [ResourceRequirement]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverride)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [KeyValuePair]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"environment" Parser (Maybe (Maybe [KeyValuePair]))
-> Maybe [KeyValuePair] -> Parser (Maybe [KeyValuePair])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [KeyValuePair]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe [EnvironmentFile]
-> Maybe [ResourceRequirement]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverride)
-> Parser (Maybe [EnvironmentFile])
-> Parser
(Maybe [ResourceRequirement]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverride)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [EnvironmentFile]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"environmentFiles"
Parser (Maybe (Maybe [EnvironmentFile]))
-> Maybe [EnvironmentFile] -> Parser (Maybe [EnvironmentFile])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EnvironmentFile]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [ResourceRequirement]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverride)
-> Parser (Maybe [ResourceRequirement])
-> Parser
(Maybe Int
-> Maybe Text -> Maybe Int -> Maybe Int -> ContainerOverride)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ResourceRequirement]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceRequirements"
Parser (Maybe (Maybe [ResourceRequirement]))
-> Maybe [ResourceRequirement]
-> Parser (Maybe [ResourceRequirement])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ResourceRequirement]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe Int
-> Maybe Text -> Maybe Int -> Maybe Int -> ContainerOverride)
-> Parser (Maybe Int)
-> Parser
(Maybe Text -> Maybe Int -> Maybe Int -> ContainerOverride)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"memory")
Parser (Maybe Text -> Maybe Int -> Maybe Int -> ContainerOverride)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Int -> ContainerOverride)
forall (f :: * -> *) a b. Applicative f => 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
"name")
Parser (Maybe Int -> Maybe Int -> ContainerOverride)
-> Parser (Maybe Int) -> Parser (Maybe Int -> ContainerOverride)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cpu")
Parser (Maybe Int -> ContainerOverride)
-> Parser (Maybe Int) -> Parser ContainerOverride
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"memoryReservation")
)
instance Prelude.Hashable ContainerOverride
instance Prelude.NFData ContainerOverride
instance Core.ToJSON ContainerOverride where
toJSON :: ContainerOverride -> Value
toJSON ContainerOverride' {Maybe Int
Maybe [Text]
Maybe [EnvironmentFile]
Maybe [KeyValuePair]
Maybe [ResourceRequirement]
Maybe Text
memoryReservation :: Maybe Int
cpu :: Maybe Int
name :: Maybe Text
memory :: Maybe Int
resourceRequirements :: Maybe [ResourceRequirement]
environmentFiles :: Maybe [EnvironmentFile]
environment :: Maybe [KeyValuePair]
command :: Maybe [Text]
$sel:memoryReservation:ContainerOverride' :: ContainerOverride -> Maybe Int
$sel:cpu:ContainerOverride' :: ContainerOverride -> Maybe Int
$sel:name:ContainerOverride' :: ContainerOverride -> Maybe Text
$sel:memory:ContainerOverride' :: ContainerOverride -> Maybe Int
$sel:resourceRequirements:ContainerOverride' :: ContainerOverride -> Maybe [ResourceRequirement]
$sel:environmentFiles:ContainerOverride' :: ContainerOverride -> Maybe [EnvironmentFile]
$sel:environment:ContainerOverride' :: ContainerOverride -> Maybe [KeyValuePair]
$sel:command:ContainerOverride' :: ContainerOverride -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"command" 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]
command,
(Text
"environment" Text -> [KeyValuePair] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([KeyValuePair] -> Pair) -> Maybe [KeyValuePair] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [KeyValuePair]
environment,
(Text
"environmentFiles" Text -> [EnvironmentFile] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([EnvironmentFile] -> Pair)
-> Maybe [EnvironmentFile] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EnvironmentFile]
environmentFiles,
(Text
"resourceRequirements" Text -> [ResourceRequirement] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([ResourceRequirement] -> Pair)
-> Maybe [ResourceRequirement] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ResourceRequirement]
resourceRequirements,
(Text
"memory" 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
memory,
(Text
"name" 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
name,
(Text
"cpu" 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
cpu,
(Text
"memoryReservation" 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
memoryReservation
]
)