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