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