{-# 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.NodePropertiesSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NodePropertiesSummary = NodePropertiesSummary'
{
NodePropertiesSummary -> Maybe Int
numNodes :: Prelude.Maybe Prelude.Int,
NodePropertiesSummary -> Maybe Int
nodeIndex :: Prelude.Maybe Prelude.Int,
NodePropertiesSummary -> Maybe Bool
isMainNode :: Prelude.Maybe Prelude.Bool
}
deriving (NodePropertiesSummary -> NodePropertiesSummary -> Bool
(NodePropertiesSummary -> NodePropertiesSummary -> Bool)
-> (NodePropertiesSummary -> NodePropertiesSummary -> Bool)
-> Eq NodePropertiesSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodePropertiesSummary -> NodePropertiesSummary -> Bool
$c/= :: NodePropertiesSummary -> NodePropertiesSummary -> Bool
== :: NodePropertiesSummary -> NodePropertiesSummary -> Bool
$c== :: NodePropertiesSummary -> NodePropertiesSummary -> Bool
Prelude.Eq, ReadPrec [NodePropertiesSummary]
ReadPrec NodePropertiesSummary
Int -> ReadS NodePropertiesSummary
ReadS [NodePropertiesSummary]
(Int -> ReadS NodePropertiesSummary)
-> ReadS [NodePropertiesSummary]
-> ReadPrec NodePropertiesSummary
-> ReadPrec [NodePropertiesSummary]
-> Read NodePropertiesSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodePropertiesSummary]
$creadListPrec :: ReadPrec [NodePropertiesSummary]
readPrec :: ReadPrec NodePropertiesSummary
$creadPrec :: ReadPrec NodePropertiesSummary
readList :: ReadS [NodePropertiesSummary]
$creadList :: ReadS [NodePropertiesSummary]
readsPrec :: Int -> ReadS NodePropertiesSummary
$creadsPrec :: Int -> ReadS NodePropertiesSummary
Prelude.Read, Int -> NodePropertiesSummary -> ShowS
[NodePropertiesSummary] -> ShowS
NodePropertiesSummary -> String
(Int -> NodePropertiesSummary -> ShowS)
-> (NodePropertiesSummary -> String)
-> ([NodePropertiesSummary] -> ShowS)
-> Show NodePropertiesSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodePropertiesSummary] -> ShowS
$cshowList :: [NodePropertiesSummary] -> ShowS
show :: NodePropertiesSummary -> String
$cshow :: NodePropertiesSummary -> String
showsPrec :: Int -> NodePropertiesSummary -> ShowS
$cshowsPrec :: Int -> NodePropertiesSummary -> ShowS
Prelude.Show, (forall x. NodePropertiesSummary -> Rep NodePropertiesSummary x)
-> (forall x. Rep NodePropertiesSummary x -> NodePropertiesSummary)
-> Generic NodePropertiesSummary
forall x. Rep NodePropertiesSummary x -> NodePropertiesSummary
forall x. NodePropertiesSummary -> Rep NodePropertiesSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NodePropertiesSummary x -> NodePropertiesSummary
$cfrom :: forall x. NodePropertiesSummary -> Rep NodePropertiesSummary x
Prelude.Generic)
newNodePropertiesSummary ::
NodePropertiesSummary
newNodePropertiesSummary :: NodePropertiesSummary
newNodePropertiesSummary =
NodePropertiesSummary' :: Maybe Int -> Maybe Int -> Maybe Bool -> NodePropertiesSummary
NodePropertiesSummary'
{ $sel:numNodes:NodePropertiesSummary' :: Maybe Int
numNodes = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:nodeIndex:NodePropertiesSummary' :: Maybe Int
nodeIndex = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:isMainNode:NodePropertiesSummary' :: Maybe Bool
isMainNode = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
nodePropertiesSummary_numNodes :: Lens.Lens' NodePropertiesSummary (Prelude.Maybe Prelude.Int)
nodePropertiesSummary_numNodes :: (Maybe Int -> f (Maybe Int))
-> NodePropertiesSummary -> f NodePropertiesSummary
nodePropertiesSummary_numNodes = (NodePropertiesSummary -> Maybe Int)
-> (NodePropertiesSummary -> Maybe Int -> NodePropertiesSummary)
-> Lens
NodePropertiesSummary NodePropertiesSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodePropertiesSummary' {Maybe Int
numNodes :: Maybe Int
$sel:numNodes:NodePropertiesSummary' :: NodePropertiesSummary -> Maybe Int
numNodes} -> Maybe Int
numNodes) (\s :: NodePropertiesSummary
s@NodePropertiesSummary' {} Maybe Int
a -> NodePropertiesSummary
s {$sel:numNodes:NodePropertiesSummary' :: Maybe Int
numNodes = Maybe Int
a} :: NodePropertiesSummary)
nodePropertiesSummary_nodeIndex :: Lens.Lens' NodePropertiesSummary (Prelude.Maybe Prelude.Int)
nodePropertiesSummary_nodeIndex :: (Maybe Int -> f (Maybe Int))
-> NodePropertiesSummary -> f NodePropertiesSummary
nodePropertiesSummary_nodeIndex = (NodePropertiesSummary -> Maybe Int)
-> (NodePropertiesSummary -> Maybe Int -> NodePropertiesSummary)
-> Lens
NodePropertiesSummary NodePropertiesSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodePropertiesSummary' {Maybe Int
nodeIndex :: Maybe Int
$sel:nodeIndex:NodePropertiesSummary' :: NodePropertiesSummary -> Maybe Int
nodeIndex} -> Maybe Int
nodeIndex) (\s :: NodePropertiesSummary
s@NodePropertiesSummary' {} Maybe Int
a -> NodePropertiesSummary
s {$sel:nodeIndex:NodePropertiesSummary' :: Maybe Int
nodeIndex = Maybe Int
a} :: NodePropertiesSummary)
nodePropertiesSummary_isMainNode :: Lens.Lens' NodePropertiesSummary (Prelude.Maybe Prelude.Bool)
nodePropertiesSummary_isMainNode :: (Maybe Bool -> f (Maybe Bool))
-> NodePropertiesSummary -> f NodePropertiesSummary
nodePropertiesSummary_isMainNode = (NodePropertiesSummary -> Maybe Bool)
-> (NodePropertiesSummary -> Maybe Bool -> NodePropertiesSummary)
-> Lens
NodePropertiesSummary
NodePropertiesSummary
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodePropertiesSummary' {Maybe Bool
isMainNode :: Maybe Bool
$sel:isMainNode:NodePropertiesSummary' :: NodePropertiesSummary -> Maybe Bool
isMainNode} -> Maybe Bool
isMainNode) (\s :: NodePropertiesSummary
s@NodePropertiesSummary' {} Maybe Bool
a -> NodePropertiesSummary
s {$sel:isMainNode:NodePropertiesSummary' :: Maybe Bool
isMainNode = Maybe Bool
a} :: NodePropertiesSummary)
instance Core.FromJSON NodePropertiesSummary where
parseJSON :: Value -> Parser NodePropertiesSummary
parseJSON =
String
-> (Object -> Parser NodePropertiesSummary)
-> Value
-> Parser NodePropertiesSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NodePropertiesSummary"
( \Object
x ->
Maybe Int -> Maybe Int -> Maybe Bool -> NodePropertiesSummary
NodePropertiesSummary'
(Maybe Int -> Maybe Int -> Maybe Bool -> NodePropertiesSummary)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Bool -> NodePropertiesSummary)
forall (f :: * -> *) a b. Functor 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
"numNodes")
Parser (Maybe Int -> Maybe Bool -> NodePropertiesSummary)
-> Parser (Maybe Int)
-> Parser (Maybe Bool -> NodePropertiesSummary)
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
"nodeIndex")
Parser (Maybe Bool -> NodePropertiesSummary)
-> Parser (Maybe Bool) -> Parser NodePropertiesSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"isMainNode")
)
instance Prelude.Hashable NodePropertiesSummary
instance Prelude.NFData NodePropertiesSummary