{-# 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.InstanceFleetModifyConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceFleetModifyConfig = InstanceFleetModifyConfig'
{
InstanceFleetModifyConfig -> Maybe Natural
targetOnDemandCapacity :: Prelude.Maybe Prelude.Natural,
InstanceFleetModifyConfig -> Maybe Natural
targetSpotCapacity :: Prelude.Maybe Prelude.Natural,
InstanceFleetModifyConfig -> Text
instanceFleetId :: Prelude.Text
}
deriving (InstanceFleetModifyConfig -> InstanceFleetModifyConfig -> Bool
(InstanceFleetModifyConfig -> InstanceFleetModifyConfig -> Bool)
-> (InstanceFleetModifyConfig -> InstanceFleetModifyConfig -> Bool)
-> Eq InstanceFleetModifyConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceFleetModifyConfig -> InstanceFleetModifyConfig -> Bool
$c/= :: InstanceFleetModifyConfig -> InstanceFleetModifyConfig -> Bool
== :: InstanceFleetModifyConfig -> InstanceFleetModifyConfig -> Bool
$c== :: InstanceFleetModifyConfig -> InstanceFleetModifyConfig -> Bool
Prelude.Eq, ReadPrec [InstanceFleetModifyConfig]
ReadPrec InstanceFleetModifyConfig
Int -> ReadS InstanceFleetModifyConfig
ReadS [InstanceFleetModifyConfig]
(Int -> ReadS InstanceFleetModifyConfig)
-> ReadS [InstanceFleetModifyConfig]
-> ReadPrec InstanceFleetModifyConfig
-> ReadPrec [InstanceFleetModifyConfig]
-> Read InstanceFleetModifyConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceFleetModifyConfig]
$creadListPrec :: ReadPrec [InstanceFleetModifyConfig]
readPrec :: ReadPrec InstanceFleetModifyConfig
$creadPrec :: ReadPrec InstanceFleetModifyConfig
readList :: ReadS [InstanceFleetModifyConfig]
$creadList :: ReadS [InstanceFleetModifyConfig]
readsPrec :: Int -> ReadS InstanceFleetModifyConfig
$creadsPrec :: Int -> ReadS InstanceFleetModifyConfig
Prelude.Read, Int -> InstanceFleetModifyConfig -> ShowS
[InstanceFleetModifyConfig] -> ShowS
InstanceFleetModifyConfig -> String
(Int -> InstanceFleetModifyConfig -> ShowS)
-> (InstanceFleetModifyConfig -> String)
-> ([InstanceFleetModifyConfig] -> ShowS)
-> Show InstanceFleetModifyConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceFleetModifyConfig] -> ShowS
$cshowList :: [InstanceFleetModifyConfig] -> ShowS
show :: InstanceFleetModifyConfig -> String
$cshow :: InstanceFleetModifyConfig -> String
showsPrec :: Int -> InstanceFleetModifyConfig -> ShowS
$cshowsPrec :: Int -> InstanceFleetModifyConfig -> ShowS
Prelude.Show, (forall x.
InstanceFleetModifyConfig -> Rep InstanceFleetModifyConfig x)
-> (forall x.
Rep InstanceFleetModifyConfig x -> InstanceFleetModifyConfig)
-> Generic InstanceFleetModifyConfig
forall x.
Rep InstanceFleetModifyConfig x -> InstanceFleetModifyConfig
forall x.
InstanceFleetModifyConfig -> Rep InstanceFleetModifyConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstanceFleetModifyConfig x -> InstanceFleetModifyConfig
$cfrom :: forall x.
InstanceFleetModifyConfig -> Rep InstanceFleetModifyConfig x
Prelude.Generic)
newInstanceFleetModifyConfig ::
Prelude.Text ->
InstanceFleetModifyConfig
newInstanceFleetModifyConfig :: Text -> InstanceFleetModifyConfig
newInstanceFleetModifyConfig Text
pInstanceFleetId_ =
InstanceFleetModifyConfig' :: Maybe Natural -> Maybe Natural -> Text -> InstanceFleetModifyConfig
InstanceFleetModifyConfig'
{ $sel:targetOnDemandCapacity:InstanceFleetModifyConfig' :: Maybe Natural
targetOnDemandCapacity =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:targetSpotCapacity:InstanceFleetModifyConfig' :: Maybe Natural
targetSpotCapacity = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:instanceFleetId:InstanceFleetModifyConfig' :: Text
instanceFleetId = Text
pInstanceFleetId_
}
instanceFleetModifyConfig_targetOnDemandCapacity :: Lens.Lens' InstanceFleetModifyConfig (Prelude.Maybe Prelude.Natural)
instanceFleetModifyConfig_targetOnDemandCapacity :: (Maybe Natural -> f (Maybe Natural))
-> InstanceFleetModifyConfig -> f InstanceFleetModifyConfig
instanceFleetModifyConfig_targetOnDemandCapacity = (InstanceFleetModifyConfig -> Maybe Natural)
-> (InstanceFleetModifyConfig
-> Maybe Natural -> InstanceFleetModifyConfig)
-> Lens
InstanceFleetModifyConfig
InstanceFleetModifyConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceFleetModifyConfig' {Maybe Natural
targetOnDemandCapacity :: Maybe Natural
$sel:targetOnDemandCapacity:InstanceFleetModifyConfig' :: InstanceFleetModifyConfig -> Maybe Natural
targetOnDemandCapacity} -> Maybe Natural
targetOnDemandCapacity) (\s :: InstanceFleetModifyConfig
s@InstanceFleetModifyConfig' {} Maybe Natural
a -> InstanceFleetModifyConfig
s {$sel:targetOnDemandCapacity:InstanceFleetModifyConfig' :: Maybe Natural
targetOnDemandCapacity = Maybe Natural
a} :: InstanceFleetModifyConfig)
instanceFleetModifyConfig_targetSpotCapacity :: Lens.Lens' InstanceFleetModifyConfig (Prelude.Maybe Prelude.Natural)
instanceFleetModifyConfig_targetSpotCapacity :: (Maybe Natural -> f (Maybe Natural))
-> InstanceFleetModifyConfig -> f InstanceFleetModifyConfig
instanceFleetModifyConfig_targetSpotCapacity = (InstanceFleetModifyConfig -> Maybe Natural)
-> (InstanceFleetModifyConfig
-> Maybe Natural -> InstanceFleetModifyConfig)
-> Lens
InstanceFleetModifyConfig
InstanceFleetModifyConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceFleetModifyConfig' {Maybe Natural
targetSpotCapacity :: Maybe Natural
$sel:targetSpotCapacity:InstanceFleetModifyConfig' :: InstanceFleetModifyConfig -> Maybe Natural
targetSpotCapacity} -> Maybe Natural
targetSpotCapacity) (\s :: InstanceFleetModifyConfig
s@InstanceFleetModifyConfig' {} Maybe Natural
a -> InstanceFleetModifyConfig
s {$sel:targetSpotCapacity:InstanceFleetModifyConfig' :: Maybe Natural
targetSpotCapacity = Maybe Natural
a} :: InstanceFleetModifyConfig)
instanceFleetModifyConfig_instanceFleetId :: Lens.Lens' InstanceFleetModifyConfig Prelude.Text
instanceFleetModifyConfig_instanceFleetId :: (Text -> f Text)
-> InstanceFleetModifyConfig -> f InstanceFleetModifyConfig
instanceFleetModifyConfig_instanceFleetId = (InstanceFleetModifyConfig -> Text)
-> (InstanceFleetModifyConfig -> Text -> InstanceFleetModifyConfig)
-> Lens
InstanceFleetModifyConfig InstanceFleetModifyConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceFleetModifyConfig' {Text
instanceFleetId :: Text
$sel:instanceFleetId:InstanceFleetModifyConfig' :: InstanceFleetModifyConfig -> Text
instanceFleetId} -> Text
instanceFleetId) (\s :: InstanceFleetModifyConfig
s@InstanceFleetModifyConfig' {} Text
a -> InstanceFleetModifyConfig
s {$sel:instanceFleetId:InstanceFleetModifyConfig' :: Text
instanceFleetId = Text
a} :: InstanceFleetModifyConfig)
instance Prelude.Hashable InstanceFleetModifyConfig
instance Prelude.NFData InstanceFleetModifyConfig
instance Core.ToJSON InstanceFleetModifyConfig where
toJSON :: InstanceFleetModifyConfig -> Value
toJSON InstanceFleetModifyConfig' {Maybe Natural
Text
instanceFleetId :: Text
targetSpotCapacity :: Maybe Natural
targetOnDemandCapacity :: Maybe Natural
$sel:instanceFleetId:InstanceFleetModifyConfig' :: InstanceFleetModifyConfig -> Text
$sel:targetSpotCapacity:InstanceFleetModifyConfig' :: InstanceFleetModifyConfig -> Maybe Natural
$sel:targetOnDemandCapacity:InstanceFleetModifyConfig' :: InstanceFleetModifyConfig -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TargetOnDemandCapacity" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
targetOnDemandCapacity,
(Text
"TargetSpotCapacity" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
targetSpotCapacity,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"InstanceFleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceFleetId)
]
)