{-# 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.Batch.Types.ContainerOverrides where
import Amazonka.Batch.Types.KeyValuePair
import Amazonka.Batch.Types.ResourceRequirement
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ContainerOverrides = ContainerOverrides'
{
ContainerOverrides -> Maybe [Text]
command :: Prelude.Maybe [Prelude.Text],
ContainerOverrides -> Maybe [KeyValuePair]
environment :: Prelude.Maybe [KeyValuePair],
ContainerOverrides -> Maybe [ResourceRequirement]
resourceRequirements :: Prelude.Maybe [ResourceRequirement],
ContainerOverrides -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
ContainerOverrides -> Maybe Int
memory :: Prelude.Maybe Prelude.Int,
ContainerOverrides -> Maybe Int
vcpus :: Prelude.Maybe Prelude.Int
}
deriving (ContainerOverrides -> ContainerOverrides -> Bool
(ContainerOverrides -> ContainerOverrides -> Bool)
-> (ContainerOverrides -> ContainerOverrides -> Bool)
-> Eq ContainerOverrides
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerOverrides -> ContainerOverrides -> Bool
$c/= :: ContainerOverrides -> ContainerOverrides -> Bool
== :: ContainerOverrides -> ContainerOverrides -> Bool
$c== :: ContainerOverrides -> ContainerOverrides -> Bool
Prelude.Eq, ReadPrec [ContainerOverrides]
ReadPrec ContainerOverrides
Int -> ReadS ContainerOverrides
ReadS [ContainerOverrides]
(Int -> ReadS ContainerOverrides)
-> ReadS [ContainerOverrides]
-> ReadPrec ContainerOverrides
-> ReadPrec [ContainerOverrides]
-> Read ContainerOverrides
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerOverrides]
$creadListPrec :: ReadPrec [ContainerOverrides]
readPrec :: ReadPrec ContainerOverrides
$creadPrec :: ReadPrec ContainerOverrides
readList :: ReadS [ContainerOverrides]
$creadList :: ReadS [ContainerOverrides]
readsPrec :: Int -> ReadS ContainerOverrides
$creadsPrec :: Int -> ReadS ContainerOverrides
Prelude.Read, Int -> ContainerOverrides -> ShowS
[ContainerOverrides] -> ShowS
ContainerOverrides -> String
(Int -> ContainerOverrides -> ShowS)
-> (ContainerOverrides -> String)
-> ([ContainerOverrides] -> ShowS)
-> Show ContainerOverrides
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerOverrides] -> ShowS
$cshowList :: [ContainerOverrides] -> ShowS
show :: ContainerOverrides -> String
$cshow :: ContainerOverrides -> String
showsPrec :: Int -> ContainerOverrides -> ShowS
$cshowsPrec :: Int -> ContainerOverrides -> ShowS
Prelude.Show, (forall x. ContainerOverrides -> Rep ContainerOverrides x)
-> (forall x. Rep ContainerOverrides x -> ContainerOverrides)
-> Generic ContainerOverrides
forall x. Rep ContainerOverrides x -> ContainerOverrides
forall x. ContainerOverrides -> Rep ContainerOverrides x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerOverrides x -> ContainerOverrides
$cfrom :: forall x. ContainerOverrides -> Rep ContainerOverrides x
Prelude.Generic)
newContainerOverrides ::
ContainerOverrides
newContainerOverrides :: ContainerOverrides
newContainerOverrides =
ContainerOverrides' :: Maybe [Text]
-> Maybe [KeyValuePair]
-> Maybe [ResourceRequirement]
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> ContainerOverrides
ContainerOverrides'
{ $sel:command:ContainerOverrides' :: Maybe [Text]
command = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:environment:ContainerOverrides' :: Maybe [KeyValuePair]
environment = Maybe [KeyValuePair]
forall a. Maybe a
Prelude.Nothing,
$sel:resourceRequirements:ContainerOverrides' :: Maybe [ResourceRequirement]
resourceRequirements = Maybe [ResourceRequirement]
forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:ContainerOverrides' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:memory:ContainerOverrides' :: Maybe Int
memory = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:vcpus:ContainerOverrides' :: Maybe Int
vcpus = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
containerOverrides_command :: Lens.Lens' ContainerOverrides (Prelude.Maybe [Prelude.Text])
containerOverrides_command :: (Maybe [Text] -> f (Maybe [Text]))
-> ContainerOverrides -> f ContainerOverrides
containerOverrides_command = (ContainerOverrides -> Maybe [Text])
-> (ContainerOverrides -> Maybe [Text] -> ContainerOverrides)
-> Lens
ContainerOverrides ContainerOverrides (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverrides' {Maybe [Text]
command :: Maybe [Text]
$sel:command:ContainerOverrides' :: ContainerOverrides -> Maybe [Text]
command} -> Maybe [Text]
command) (\s :: ContainerOverrides
s@ContainerOverrides' {} Maybe [Text]
a -> ContainerOverrides
s {$sel:command:ContainerOverrides' :: Maybe [Text]
command = Maybe [Text]
a} :: ContainerOverrides) ((Maybe [Text] -> f (Maybe [Text]))
-> ContainerOverrides -> f ContainerOverrides)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ContainerOverrides
-> f ContainerOverrides
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
containerOverrides_environment :: Lens.Lens' ContainerOverrides (Prelude.Maybe [KeyValuePair])
containerOverrides_environment :: (Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> ContainerOverrides -> f ContainerOverrides
containerOverrides_environment = (ContainerOverrides -> Maybe [KeyValuePair])
-> (ContainerOverrides
-> Maybe [KeyValuePair] -> ContainerOverrides)
-> Lens
ContainerOverrides
ContainerOverrides
(Maybe [KeyValuePair])
(Maybe [KeyValuePair])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverrides' {Maybe [KeyValuePair]
environment :: Maybe [KeyValuePair]
$sel:environment:ContainerOverrides' :: ContainerOverrides -> Maybe [KeyValuePair]
environment} -> Maybe [KeyValuePair]
environment) (\s :: ContainerOverrides
s@ContainerOverrides' {} Maybe [KeyValuePair]
a -> ContainerOverrides
s {$sel:environment:ContainerOverrides' :: Maybe [KeyValuePair]
environment = Maybe [KeyValuePair]
a} :: ContainerOverrides) ((Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> ContainerOverrides -> f ContainerOverrides)
-> ((Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> (Maybe [KeyValuePair] -> f (Maybe [KeyValuePair]))
-> ContainerOverrides
-> f ContainerOverrides
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
containerOverrides_resourceRequirements :: Lens.Lens' ContainerOverrides (Prelude.Maybe [ResourceRequirement])
containerOverrides_resourceRequirements :: (Maybe [ResourceRequirement] -> f (Maybe [ResourceRequirement]))
-> ContainerOverrides -> f ContainerOverrides
containerOverrides_resourceRequirements = (ContainerOverrides -> Maybe [ResourceRequirement])
-> (ContainerOverrides
-> Maybe [ResourceRequirement] -> ContainerOverrides)
-> Lens
ContainerOverrides
ContainerOverrides
(Maybe [ResourceRequirement])
(Maybe [ResourceRequirement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverrides' {Maybe [ResourceRequirement]
resourceRequirements :: Maybe [ResourceRequirement]
$sel:resourceRequirements:ContainerOverrides' :: ContainerOverrides -> Maybe [ResourceRequirement]
resourceRequirements} -> Maybe [ResourceRequirement]
resourceRequirements) (\s :: ContainerOverrides
s@ContainerOverrides' {} Maybe [ResourceRequirement]
a -> ContainerOverrides
s {$sel:resourceRequirements:ContainerOverrides' :: Maybe [ResourceRequirement]
resourceRequirements = Maybe [ResourceRequirement]
a} :: ContainerOverrides) ((Maybe [ResourceRequirement] -> f (Maybe [ResourceRequirement]))
-> ContainerOverrides -> f ContainerOverrides)
-> ((Maybe [ResourceRequirement]
-> f (Maybe [ResourceRequirement]))
-> Maybe [ResourceRequirement] -> f (Maybe [ResourceRequirement]))
-> (Maybe [ResourceRequirement] -> f (Maybe [ResourceRequirement]))
-> ContainerOverrides
-> f ContainerOverrides
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
containerOverrides_instanceType :: Lens.Lens' ContainerOverrides (Prelude.Maybe Prelude.Text)
containerOverrides_instanceType :: (Maybe Text -> f (Maybe Text))
-> ContainerOverrides -> f ContainerOverrides
containerOverrides_instanceType = (ContainerOverrides -> Maybe Text)
-> (ContainerOverrides -> Maybe Text -> ContainerOverrides)
-> Lens
ContainerOverrides ContainerOverrides (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverrides' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:ContainerOverrides' :: ContainerOverrides -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: ContainerOverrides
s@ContainerOverrides' {} Maybe Text
a -> ContainerOverrides
s {$sel:instanceType:ContainerOverrides' :: Maybe Text
instanceType = Maybe Text
a} :: ContainerOverrides)
containerOverrides_memory :: Lens.Lens' ContainerOverrides (Prelude.Maybe Prelude.Int)
containerOverrides_memory :: (Maybe Int -> f (Maybe Int))
-> ContainerOverrides -> f ContainerOverrides
containerOverrides_memory = (ContainerOverrides -> Maybe Int)
-> (ContainerOverrides -> Maybe Int -> ContainerOverrides)
-> Lens
ContainerOverrides ContainerOverrides (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverrides' {Maybe Int
memory :: Maybe Int
$sel:memory:ContainerOverrides' :: ContainerOverrides -> Maybe Int
memory} -> Maybe Int
memory) (\s :: ContainerOverrides
s@ContainerOverrides' {} Maybe Int
a -> ContainerOverrides
s {$sel:memory:ContainerOverrides' :: Maybe Int
memory = Maybe Int
a} :: ContainerOverrides)
containerOverrides_vcpus :: Lens.Lens' ContainerOverrides (Prelude.Maybe Prelude.Int)
containerOverrides_vcpus :: (Maybe Int -> f (Maybe Int))
-> ContainerOverrides -> f ContainerOverrides
containerOverrides_vcpus = (ContainerOverrides -> Maybe Int)
-> (ContainerOverrides -> Maybe Int -> ContainerOverrides)
-> Lens
ContainerOverrides ContainerOverrides (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerOverrides' {Maybe Int
vcpus :: Maybe Int
$sel:vcpus:ContainerOverrides' :: ContainerOverrides -> Maybe Int
vcpus} -> Maybe Int
vcpus) (\s :: ContainerOverrides
s@ContainerOverrides' {} Maybe Int
a -> ContainerOverrides
s {$sel:vcpus:ContainerOverrides' :: Maybe Int
vcpus = Maybe Int
a} :: ContainerOverrides)
instance Prelude.Hashable ContainerOverrides
instance Prelude.NFData ContainerOverrides
instance Core.ToJSON ContainerOverrides where
toJSON :: ContainerOverrides -> Value
toJSON ContainerOverrides' {Maybe Int
Maybe [Text]
Maybe [KeyValuePair]
Maybe [ResourceRequirement]
Maybe Text
vcpus :: Maybe Int
memory :: Maybe Int
instanceType :: Maybe Text
resourceRequirements :: Maybe [ResourceRequirement]
environment :: Maybe [KeyValuePair]
command :: Maybe [Text]
$sel:vcpus:ContainerOverrides' :: ContainerOverrides -> Maybe Int
$sel:memory:ContainerOverrides' :: ContainerOverrides -> Maybe Int
$sel:instanceType:ContainerOverrides' :: ContainerOverrides -> Maybe Text
$sel:resourceRequirements:ContainerOverrides' :: ContainerOverrides -> Maybe [ResourceRequirement]
$sel:environment:ContainerOverrides' :: ContainerOverrides -> Maybe [KeyValuePair]
$sel:command:ContainerOverrides' :: ContainerOverrides -> 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
"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
"instanceType" 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
instanceType,
(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
"vcpus" 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
vcpus
]
)