{-# 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.ComputeLimits where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMR.Types.ComputeLimitsUnitType
import qualified Amazonka.Prelude as Prelude
data ComputeLimits = ComputeLimits'
{
ComputeLimits -> Maybe Int
maximumCoreCapacityUnits :: Prelude.Maybe Prelude.Int,
ComputeLimits -> Maybe Int
maximumOnDemandCapacityUnits :: Prelude.Maybe Prelude.Int,
ComputeLimits -> ComputeLimitsUnitType
unitType :: ComputeLimitsUnitType,
ComputeLimits -> Int
minimumCapacityUnits :: Prelude.Int,
ComputeLimits -> Int
maximumCapacityUnits :: Prelude.Int
}
deriving (ComputeLimits -> ComputeLimits -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputeLimits -> ComputeLimits -> Bool
$c/= :: ComputeLimits -> ComputeLimits -> Bool
== :: ComputeLimits -> ComputeLimits -> Bool
$c== :: ComputeLimits -> ComputeLimits -> Bool
Prelude.Eq, ReadPrec [ComputeLimits]
ReadPrec ComputeLimits
Int -> ReadS ComputeLimits
ReadS [ComputeLimits]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputeLimits]
$creadListPrec :: ReadPrec [ComputeLimits]
readPrec :: ReadPrec ComputeLimits
$creadPrec :: ReadPrec ComputeLimits
readList :: ReadS [ComputeLimits]
$creadList :: ReadS [ComputeLimits]
readsPrec :: Int -> ReadS ComputeLimits
$creadsPrec :: Int -> ReadS ComputeLimits
Prelude.Read, Int -> ComputeLimits -> ShowS
[ComputeLimits] -> ShowS
ComputeLimits -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputeLimits] -> ShowS
$cshowList :: [ComputeLimits] -> ShowS
show :: ComputeLimits -> String
$cshow :: ComputeLimits -> String
showsPrec :: Int -> ComputeLimits -> ShowS
$cshowsPrec :: Int -> ComputeLimits -> ShowS
Prelude.Show, forall x. Rep ComputeLimits x -> ComputeLimits
forall x. ComputeLimits -> Rep ComputeLimits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComputeLimits x -> ComputeLimits
$cfrom :: forall x. ComputeLimits -> Rep ComputeLimits x
Prelude.Generic)
newComputeLimits ::
ComputeLimitsUnitType ->
Prelude.Int ->
Prelude.Int ->
ComputeLimits
newComputeLimits :: ComputeLimitsUnitType -> Int -> Int -> ComputeLimits
newComputeLimits
ComputeLimitsUnitType
pUnitType_
Int
pMinimumCapacityUnits_
Int
pMaximumCapacityUnits_ =
ComputeLimits'
{ $sel:maximumCoreCapacityUnits:ComputeLimits' :: Maybe Int
maximumCoreCapacityUnits =
forall a. Maybe a
Prelude.Nothing,
$sel:maximumOnDemandCapacityUnits:ComputeLimits' :: Maybe Int
maximumOnDemandCapacityUnits = forall a. Maybe a
Prelude.Nothing,
$sel:unitType:ComputeLimits' :: ComputeLimitsUnitType
unitType = ComputeLimitsUnitType
pUnitType_,
$sel:minimumCapacityUnits:ComputeLimits' :: Int
minimumCapacityUnits = Int
pMinimumCapacityUnits_,
$sel:maximumCapacityUnits:ComputeLimits' :: Int
maximumCapacityUnits = Int
pMaximumCapacityUnits_
}
computeLimits_maximumCoreCapacityUnits :: Lens.Lens' ComputeLimits (Prelude.Maybe Prelude.Int)
computeLimits_maximumCoreCapacityUnits :: Lens' ComputeLimits (Maybe Int)
computeLimits_maximumCoreCapacityUnits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeLimits' {Maybe Int
maximumCoreCapacityUnits :: Maybe Int
$sel:maximumCoreCapacityUnits:ComputeLimits' :: ComputeLimits -> Maybe Int
maximumCoreCapacityUnits} -> Maybe Int
maximumCoreCapacityUnits) (\s :: ComputeLimits
s@ComputeLimits' {} Maybe Int
a -> ComputeLimits
s {$sel:maximumCoreCapacityUnits:ComputeLimits' :: Maybe Int
maximumCoreCapacityUnits = Maybe Int
a} :: ComputeLimits)
computeLimits_maximumOnDemandCapacityUnits :: Lens.Lens' ComputeLimits (Prelude.Maybe Prelude.Int)
computeLimits_maximumOnDemandCapacityUnits :: Lens' ComputeLimits (Maybe Int)
computeLimits_maximumOnDemandCapacityUnits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeLimits' {Maybe Int
maximumOnDemandCapacityUnits :: Maybe Int
$sel:maximumOnDemandCapacityUnits:ComputeLimits' :: ComputeLimits -> Maybe Int
maximumOnDemandCapacityUnits} -> Maybe Int
maximumOnDemandCapacityUnits) (\s :: ComputeLimits
s@ComputeLimits' {} Maybe Int
a -> ComputeLimits
s {$sel:maximumOnDemandCapacityUnits:ComputeLimits' :: Maybe Int
maximumOnDemandCapacityUnits = Maybe Int
a} :: ComputeLimits)
computeLimits_unitType :: Lens.Lens' ComputeLimits ComputeLimitsUnitType
computeLimits_unitType :: Lens' ComputeLimits ComputeLimitsUnitType
computeLimits_unitType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeLimits' {ComputeLimitsUnitType
unitType :: ComputeLimitsUnitType
$sel:unitType:ComputeLimits' :: ComputeLimits -> ComputeLimitsUnitType
unitType} -> ComputeLimitsUnitType
unitType) (\s :: ComputeLimits
s@ComputeLimits' {} ComputeLimitsUnitType
a -> ComputeLimits
s {$sel:unitType:ComputeLimits' :: ComputeLimitsUnitType
unitType = ComputeLimitsUnitType
a} :: ComputeLimits)
computeLimits_minimumCapacityUnits :: Lens.Lens' ComputeLimits Prelude.Int
computeLimits_minimumCapacityUnits :: Lens' ComputeLimits Int
computeLimits_minimumCapacityUnits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeLimits' {Int
minimumCapacityUnits :: Int
$sel:minimumCapacityUnits:ComputeLimits' :: ComputeLimits -> Int
minimumCapacityUnits} -> Int
minimumCapacityUnits) (\s :: ComputeLimits
s@ComputeLimits' {} Int
a -> ComputeLimits
s {$sel:minimumCapacityUnits:ComputeLimits' :: Int
minimumCapacityUnits = Int
a} :: ComputeLimits)
computeLimits_maximumCapacityUnits :: Lens.Lens' ComputeLimits Prelude.Int
computeLimits_maximumCapacityUnits :: Lens' ComputeLimits Int
computeLimits_maximumCapacityUnits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeLimits' {Int
maximumCapacityUnits :: Int
$sel:maximumCapacityUnits:ComputeLimits' :: ComputeLimits -> Int
maximumCapacityUnits} -> Int
maximumCapacityUnits) (\s :: ComputeLimits
s@ComputeLimits' {} Int
a -> ComputeLimits
s {$sel:maximumCapacityUnits:ComputeLimits' :: Int
maximumCapacityUnits = Int
a} :: ComputeLimits)
instance Data.FromJSON ComputeLimits where
parseJSON :: Value -> Parser ComputeLimits
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ComputeLimits"
( \Object
x ->
Maybe Int
-> Maybe Int
-> ComputeLimitsUnitType
-> Int
-> Int
-> ComputeLimits
ComputeLimits'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MaximumCoreCapacityUnits")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MaximumOnDemandCapacityUnits")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"UnitType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MinimumCapacityUnits")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MaximumCapacityUnits")
)
instance Prelude.Hashable ComputeLimits where
hashWithSalt :: Int -> ComputeLimits -> Int
hashWithSalt Int
_salt ComputeLimits' {Int
Maybe Int
ComputeLimitsUnitType
maximumCapacityUnits :: Int
minimumCapacityUnits :: Int
unitType :: ComputeLimitsUnitType
maximumOnDemandCapacityUnits :: Maybe Int
maximumCoreCapacityUnits :: Maybe Int
$sel:maximumCapacityUnits:ComputeLimits' :: ComputeLimits -> Int
$sel:minimumCapacityUnits:ComputeLimits' :: ComputeLimits -> Int
$sel:unitType:ComputeLimits' :: ComputeLimits -> ComputeLimitsUnitType
$sel:maximumOnDemandCapacityUnits:ComputeLimits' :: ComputeLimits -> Maybe Int
$sel:maximumCoreCapacityUnits:ComputeLimits' :: ComputeLimits -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maximumCoreCapacityUnits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maximumOnDemandCapacityUnits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ComputeLimitsUnitType
unitType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
minimumCapacityUnits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
maximumCapacityUnits
instance Prelude.NFData ComputeLimits where
rnf :: ComputeLimits -> ()
rnf ComputeLimits' {Int
Maybe Int
ComputeLimitsUnitType
maximumCapacityUnits :: Int
minimumCapacityUnits :: Int
unitType :: ComputeLimitsUnitType
maximumOnDemandCapacityUnits :: Maybe Int
maximumCoreCapacityUnits :: Maybe Int
$sel:maximumCapacityUnits:ComputeLimits' :: ComputeLimits -> Int
$sel:minimumCapacityUnits:ComputeLimits' :: ComputeLimits -> Int
$sel:unitType:ComputeLimits' :: ComputeLimits -> ComputeLimitsUnitType
$sel:maximumOnDemandCapacityUnits:ComputeLimits' :: ComputeLimits -> Maybe Int
$sel:maximumCoreCapacityUnits:ComputeLimits' :: ComputeLimits -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maximumCoreCapacityUnits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maximumOnDemandCapacityUnits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ComputeLimitsUnitType
unitType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
minimumCapacityUnits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
maximumCapacityUnits
instance Data.ToJSON ComputeLimits where
toJSON :: ComputeLimits -> Value
toJSON ComputeLimits' {Int
Maybe Int
ComputeLimitsUnitType
maximumCapacityUnits :: Int
minimumCapacityUnits :: Int
unitType :: ComputeLimitsUnitType
maximumOnDemandCapacityUnits :: Maybe Int
maximumCoreCapacityUnits :: Maybe Int
$sel:maximumCapacityUnits:ComputeLimits' :: ComputeLimits -> Int
$sel:minimumCapacityUnits:ComputeLimits' :: ComputeLimits -> Int
$sel:unitType:ComputeLimits' :: ComputeLimits -> ComputeLimitsUnitType
$sel:maximumOnDemandCapacityUnits:ComputeLimits' :: ComputeLimits -> Maybe Int
$sel:maximumCoreCapacityUnits:ComputeLimits' :: ComputeLimits -> Maybe Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaximumCoreCapacityUnits" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maximumCoreCapacityUnits,
(Key
"MaximumOnDemandCapacityUnits" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maximumOnDemandCapacityUnits,
forall a. a -> Maybe a
Prelude.Just (Key
"UnitType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ComputeLimitsUnitType
unitType),
forall a. a -> Maybe a
Prelude.Just
( Key
"MinimumCapacityUnits"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
minimumCapacityUnits
),
forall a. a -> Maybe a
Prelude.Just
( Key
"MaximumCapacityUnits"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
maximumCapacityUnits
)
]
)