{-# 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.EMR.Types.ClusterSummary where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.ClusterStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ClusterSummary = ClusterSummary'
{
ClusterSummary -> Maybe ClusterStatus
status :: Prelude.Maybe ClusterStatus,
ClusterSummary -> Maybe Text
clusterArn :: Prelude.Maybe Prelude.Text,
ClusterSummary -> Maybe Text
outpostArn :: Prelude.Maybe Prelude.Text,
ClusterSummary -> Maybe Int
normalizedInstanceHours :: Prelude.Maybe Prelude.Int,
ClusterSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ClusterSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (ClusterSummary -> ClusterSummary -> Bool
(ClusterSummary -> ClusterSummary -> Bool)
-> (ClusterSummary -> ClusterSummary -> Bool) -> Eq ClusterSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterSummary -> ClusterSummary -> Bool
$c/= :: ClusterSummary -> ClusterSummary -> Bool
== :: ClusterSummary -> ClusterSummary -> Bool
$c== :: ClusterSummary -> ClusterSummary -> Bool
Prelude.Eq, ReadPrec [ClusterSummary]
ReadPrec ClusterSummary
Int -> ReadS ClusterSummary
ReadS [ClusterSummary]
(Int -> ReadS ClusterSummary)
-> ReadS [ClusterSummary]
-> ReadPrec ClusterSummary
-> ReadPrec [ClusterSummary]
-> Read ClusterSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterSummary]
$creadListPrec :: ReadPrec [ClusterSummary]
readPrec :: ReadPrec ClusterSummary
$creadPrec :: ReadPrec ClusterSummary
readList :: ReadS [ClusterSummary]
$creadList :: ReadS [ClusterSummary]
readsPrec :: Int -> ReadS ClusterSummary
$creadsPrec :: Int -> ReadS ClusterSummary
Prelude.Read, Int -> ClusterSummary -> ShowS
[ClusterSummary] -> ShowS
ClusterSummary -> String
(Int -> ClusterSummary -> ShowS)
-> (ClusterSummary -> String)
-> ([ClusterSummary] -> ShowS)
-> Show ClusterSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterSummary] -> ShowS
$cshowList :: [ClusterSummary] -> ShowS
show :: ClusterSummary -> String
$cshow :: ClusterSummary -> String
showsPrec :: Int -> ClusterSummary -> ShowS
$cshowsPrec :: Int -> ClusterSummary -> ShowS
Prelude.Show, (forall x. ClusterSummary -> Rep ClusterSummary x)
-> (forall x. Rep ClusterSummary x -> ClusterSummary)
-> Generic ClusterSummary
forall x. Rep ClusterSummary x -> ClusterSummary
forall x. ClusterSummary -> Rep ClusterSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterSummary x -> ClusterSummary
$cfrom :: forall x. ClusterSummary -> Rep ClusterSummary x
Prelude.Generic)
newClusterSummary ::
ClusterSummary
newClusterSummary :: ClusterSummary
newClusterSummary =
ClusterSummary' :: Maybe ClusterStatus
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> ClusterSummary
ClusterSummary'
{ $sel:status:ClusterSummary' :: Maybe ClusterStatus
status = Maybe ClusterStatus
forall a. Maybe a
Prelude.Nothing,
$sel:clusterArn:ClusterSummary' :: Maybe Text
clusterArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:outpostArn:ClusterSummary' :: Maybe Text
outpostArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:normalizedInstanceHours:ClusterSummary' :: Maybe Int
normalizedInstanceHours = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:name:ClusterSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:ClusterSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
clusterSummary_status :: Lens.Lens' ClusterSummary (Prelude.Maybe ClusterStatus)
clusterSummary_status :: (Maybe ClusterStatus -> f (Maybe ClusterStatus))
-> ClusterSummary -> f ClusterSummary
clusterSummary_status = (ClusterSummary -> Maybe ClusterStatus)
-> (ClusterSummary -> Maybe ClusterStatus -> ClusterSummary)
-> Lens
ClusterSummary
ClusterSummary
(Maybe ClusterStatus)
(Maybe ClusterStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSummary' {Maybe ClusterStatus
status :: Maybe ClusterStatus
$sel:status:ClusterSummary' :: ClusterSummary -> Maybe ClusterStatus
status} -> Maybe ClusterStatus
status) (\s :: ClusterSummary
s@ClusterSummary' {} Maybe ClusterStatus
a -> ClusterSummary
s {$sel:status:ClusterSummary' :: Maybe ClusterStatus
status = Maybe ClusterStatus
a} :: ClusterSummary)
clusterSummary_clusterArn :: Lens.Lens' ClusterSummary (Prelude.Maybe Prelude.Text)
clusterSummary_clusterArn :: (Maybe Text -> f (Maybe Text))
-> ClusterSummary -> f ClusterSummary
clusterSummary_clusterArn = (ClusterSummary -> Maybe Text)
-> (ClusterSummary -> Maybe Text -> ClusterSummary)
-> Lens ClusterSummary ClusterSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSummary' {Maybe Text
clusterArn :: Maybe Text
$sel:clusterArn:ClusterSummary' :: ClusterSummary -> Maybe Text
clusterArn} -> Maybe Text
clusterArn) (\s :: ClusterSummary
s@ClusterSummary' {} Maybe Text
a -> ClusterSummary
s {$sel:clusterArn:ClusterSummary' :: Maybe Text
clusterArn = Maybe Text
a} :: ClusterSummary)
clusterSummary_outpostArn :: Lens.Lens' ClusterSummary (Prelude.Maybe Prelude.Text)
clusterSummary_outpostArn :: (Maybe Text -> f (Maybe Text))
-> ClusterSummary -> f ClusterSummary
clusterSummary_outpostArn = (ClusterSummary -> Maybe Text)
-> (ClusterSummary -> Maybe Text -> ClusterSummary)
-> Lens ClusterSummary ClusterSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSummary' {Maybe Text
outpostArn :: Maybe Text
$sel:outpostArn:ClusterSummary' :: ClusterSummary -> Maybe Text
outpostArn} -> Maybe Text
outpostArn) (\s :: ClusterSummary
s@ClusterSummary' {} Maybe Text
a -> ClusterSummary
s {$sel:outpostArn:ClusterSummary' :: Maybe Text
outpostArn = Maybe Text
a} :: ClusterSummary)
clusterSummary_normalizedInstanceHours :: Lens.Lens' ClusterSummary (Prelude.Maybe Prelude.Int)
clusterSummary_normalizedInstanceHours :: (Maybe Int -> f (Maybe Int)) -> ClusterSummary -> f ClusterSummary
clusterSummary_normalizedInstanceHours = (ClusterSummary -> Maybe Int)
-> (ClusterSummary -> Maybe Int -> ClusterSummary)
-> Lens ClusterSummary ClusterSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSummary' {Maybe Int
normalizedInstanceHours :: Maybe Int
$sel:normalizedInstanceHours:ClusterSummary' :: ClusterSummary -> Maybe Int
normalizedInstanceHours} -> Maybe Int
normalizedInstanceHours) (\s :: ClusterSummary
s@ClusterSummary' {} Maybe Int
a -> ClusterSummary
s {$sel:normalizedInstanceHours:ClusterSummary' :: Maybe Int
normalizedInstanceHours = Maybe Int
a} :: ClusterSummary)
clusterSummary_name :: Lens.Lens' ClusterSummary (Prelude.Maybe Prelude.Text)
clusterSummary_name :: (Maybe Text -> f (Maybe Text))
-> ClusterSummary -> f ClusterSummary
clusterSummary_name = (ClusterSummary -> Maybe Text)
-> (ClusterSummary -> Maybe Text -> ClusterSummary)
-> Lens ClusterSummary ClusterSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSummary' {Maybe Text
name :: Maybe Text
$sel:name:ClusterSummary' :: ClusterSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ClusterSummary
s@ClusterSummary' {} Maybe Text
a -> ClusterSummary
s {$sel:name:ClusterSummary' :: Maybe Text
name = Maybe Text
a} :: ClusterSummary)
clusterSummary_id :: Lens.Lens' ClusterSummary (Prelude.Maybe Prelude.Text)
clusterSummary_id :: (Maybe Text -> f (Maybe Text))
-> ClusterSummary -> f ClusterSummary
clusterSummary_id = (ClusterSummary -> Maybe Text)
-> (ClusterSummary -> Maybe Text -> ClusterSummary)
-> Lens ClusterSummary ClusterSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSummary' {Maybe Text
id :: Maybe Text
$sel:id:ClusterSummary' :: ClusterSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ClusterSummary
s@ClusterSummary' {} Maybe Text
a -> ClusterSummary
s {$sel:id:ClusterSummary' :: Maybe Text
id = Maybe Text
a} :: ClusterSummary)
instance Core.FromJSON ClusterSummary where
parseJSON :: Value -> Parser ClusterSummary
parseJSON =
String
-> (Object -> Parser ClusterSummary)
-> Value
-> Parser ClusterSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClusterSummary"
( \Object
x ->
Maybe ClusterStatus
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> ClusterSummary
ClusterSummary'
(Maybe ClusterStatus
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> ClusterSummary)
-> Parser (Maybe ClusterStatus)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> ClusterSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ClusterStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> ClusterSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Int -> Maybe Text -> Maybe Text -> ClusterSummary)
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
"ClusterArn")
Parser
(Maybe Text
-> Maybe Int -> Maybe Text -> Maybe Text -> ClusterSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> Maybe Text -> ClusterSummary)
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
"OutpostArn")
Parser (Maybe Int -> Maybe Text -> Maybe Text -> ClusterSummary)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Text -> ClusterSummary)
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
"NormalizedInstanceHours")
Parser (Maybe Text -> Maybe Text -> ClusterSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ClusterSummary)
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 Text -> ClusterSummary)
-> Parser (Maybe Text) -> Parser ClusterSummary
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
"Id")
)
instance Prelude.Hashable ClusterSummary
instance Prelude.NFData ClusterSummary