{-# 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.ManagedScalingPolicy where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.ComputeLimits
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ManagedScalingPolicy = ManagedScalingPolicy'
{
ManagedScalingPolicy -> Maybe ComputeLimits
computeLimits :: Prelude.Maybe ComputeLimits
}
deriving (ManagedScalingPolicy -> ManagedScalingPolicy -> Bool
(ManagedScalingPolicy -> ManagedScalingPolicy -> Bool)
-> (ManagedScalingPolicy -> ManagedScalingPolicy -> Bool)
-> Eq ManagedScalingPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedScalingPolicy -> ManagedScalingPolicy -> Bool
$c/= :: ManagedScalingPolicy -> ManagedScalingPolicy -> Bool
== :: ManagedScalingPolicy -> ManagedScalingPolicy -> Bool
$c== :: ManagedScalingPolicy -> ManagedScalingPolicy -> Bool
Prelude.Eq, ReadPrec [ManagedScalingPolicy]
ReadPrec ManagedScalingPolicy
Int -> ReadS ManagedScalingPolicy
ReadS [ManagedScalingPolicy]
(Int -> ReadS ManagedScalingPolicy)
-> ReadS [ManagedScalingPolicy]
-> ReadPrec ManagedScalingPolicy
-> ReadPrec [ManagedScalingPolicy]
-> Read ManagedScalingPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedScalingPolicy]
$creadListPrec :: ReadPrec [ManagedScalingPolicy]
readPrec :: ReadPrec ManagedScalingPolicy
$creadPrec :: ReadPrec ManagedScalingPolicy
readList :: ReadS [ManagedScalingPolicy]
$creadList :: ReadS [ManagedScalingPolicy]
readsPrec :: Int -> ReadS ManagedScalingPolicy
$creadsPrec :: Int -> ReadS ManagedScalingPolicy
Prelude.Read, Int -> ManagedScalingPolicy -> ShowS
[ManagedScalingPolicy] -> ShowS
ManagedScalingPolicy -> String
(Int -> ManagedScalingPolicy -> ShowS)
-> (ManagedScalingPolicy -> String)
-> ([ManagedScalingPolicy] -> ShowS)
-> Show ManagedScalingPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedScalingPolicy] -> ShowS
$cshowList :: [ManagedScalingPolicy] -> ShowS
show :: ManagedScalingPolicy -> String
$cshow :: ManagedScalingPolicy -> String
showsPrec :: Int -> ManagedScalingPolicy -> ShowS
$cshowsPrec :: Int -> ManagedScalingPolicy -> ShowS
Prelude.Show, (forall x. ManagedScalingPolicy -> Rep ManagedScalingPolicy x)
-> (forall x. Rep ManagedScalingPolicy x -> ManagedScalingPolicy)
-> Generic ManagedScalingPolicy
forall x. Rep ManagedScalingPolicy x -> ManagedScalingPolicy
forall x. ManagedScalingPolicy -> Rep ManagedScalingPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManagedScalingPolicy x -> ManagedScalingPolicy
$cfrom :: forall x. ManagedScalingPolicy -> Rep ManagedScalingPolicy x
Prelude.Generic)
newManagedScalingPolicy ::
ManagedScalingPolicy
newManagedScalingPolicy :: ManagedScalingPolicy
newManagedScalingPolicy =
ManagedScalingPolicy' :: Maybe ComputeLimits -> ManagedScalingPolicy
ManagedScalingPolicy'
{ $sel:computeLimits:ManagedScalingPolicy' :: Maybe ComputeLimits
computeLimits =
Maybe ComputeLimits
forall a. Maybe a
Prelude.Nothing
}
managedScalingPolicy_computeLimits :: Lens.Lens' ManagedScalingPolicy (Prelude.Maybe ComputeLimits)
managedScalingPolicy_computeLimits :: (Maybe ComputeLimits -> f (Maybe ComputeLimits))
-> ManagedScalingPolicy -> f ManagedScalingPolicy
managedScalingPolicy_computeLimits = (ManagedScalingPolicy -> Maybe ComputeLimits)
-> (ManagedScalingPolicy
-> Maybe ComputeLimits -> ManagedScalingPolicy)
-> Lens
ManagedScalingPolicy
ManagedScalingPolicy
(Maybe ComputeLimits)
(Maybe ComputeLimits)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedScalingPolicy' {Maybe ComputeLimits
computeLimits :: Maybe ComputeLimits
$sel:computeLimits:ManagedScalingPolicy' :: ManagedScalingPolicy -> Maybe ComputeLimits
computeLimits} -> Maybe ComputeLimits
computeLimits) (\s :: ManagedScalingPolicy
s@ManagedScalingPolicy' {} Maybe ComputeLimits
a -> ManagedScalingPolicy
s {$sel:computeLimits:ManagedScalingPolicy' :: Maybe ComputeLimits
computeLimits = Maybe ComputeLimits
a} :: ManagedScalingPolicy)
instance Core.FromJSON ManagedScalingPolicy where
parseJSON :: Value -> Parser ManagedScalingPolicy
parseJSON =
String
-> (Object -> Parser ManagedScalingPolicy)
-> Value
-> Parser ManagedScalingPolicy
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ManagedScalingPolicy"
( \Object
x ->
Maybe ComputeLimits -> ManagedScalingPolicy
ManagedScalingPolicy'
(Maybe ComputeLimits -> ManagedScalingPolicy)
-> Parser (Maybe ComputeLimits) -> Parser ManagedScalingPolicy
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ComputeLimits)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ComputeLimits")
)
instance Prelude.Hashable ManagedScalingPolicy
instance Prelude.NFData ManagedScalingPolicy
instance Core.ToJSON ManagedScalingPolicy where
toJSON :: ManagedScalingPolicy -> Value
toJSON ManagedScalingPolicy' {Maybe ComputeLimits
computeLimits :: Maybe ComputeLimits
$sel:computeLimits:ManagedScalingPolicy' :: ManagedScalingPolicy -> Maybe ComputeLimits
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ComputeLimits" Text -> ComputeLimits -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ComputeLimits -> Pair) -> Maybe ComputeLimits -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComputeLimits
computeLimits
]
)