{-# 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.InstanceFleetConfig where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.InstanceFleetProvisioningSpecifications
import Amazonka.EMR.Types.InstanceFleetType
import Amazonka.EMR.Types.InstanceTypeConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceFleetConfig = InstanceFleetConfig'
{
InstanceFleetConfig -> Maybe [InstanceTypeConfig]
instanceTypeConfigs :: Prelude.Maybe [InstanceTypeConfig],
InstanceFleetConfig -> Maybe Natural
targetOnDemandCapacity :: Prelude.Maybe Prelude.Natural,
InstanceFleetConfig -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
InstanceFleetConfig -> Maybe Natural
targetSpotCapacity :: Prelude.Maybe Prelude.Natural,
InstanceFleetConfig
-> Maybe InstanceFleetProvisioningSpecifications
launchSpecifications :: Prelude.Maybe InstanceFleetProvisioningSpecifications,
InstanceFleetConfig -> InstanceFleetType
instanceFleetType :: InstanceFleetType
}
deriving (InstanceFleetConfig -> InstanceFleetConfig -> Bool
(InstanceFleetConfig -> InstanceFleetConfig -> Bool)
-> (InstanceFleetConfig -> InstanceFleetConfig -> Bool)
-> Eq InstanceFleetConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceFleetConfig -> InstanceFleetConfig -> Bool
$c/= :: InstanceFleetConfig -> InstanceFleetConfig -> Bool
== :: InstanceFleetConfig -> InstanceFleetConfig -> Bool
$c== :: InstanceFleetConfig -> InstanceFleetConfig -> Bool
Prelude.Eq, ReadPrec [InstanceFleetConfig]
ReadPrec InstanceFleetConfig
Int -> ReadS InstanceFleetConfig
ReadS [InstanceFleetConfig]
(Int -> ReadS InstanceFleetConfig)
-> ReadS [InstanceFleetConfig]
-> ReadPrec InstanceFleetConfig
-> ReadPrec [InstanceFleetConfig]
-> Read InstanceFleetConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceFleetConfig]
$creadListPrec :: ReadPrec [InstanceFleetConfig]
readPrec :: ReadPrec InstanceFleetConfig
$creadPrec :: ReadPrec InstanceFleetConfig
readList :: ReadS [InstanceFleetConfig]
$creadList :: ReadS [InstanceFleetConfig]
readsPrec :: Int -> ReadS InstanceFleetConfig
$creadsPrec :: Int -> ReadS InstanceFleetConfig
Prelude.Read, Int -> InstanceFleetConfig -> ShowS
[InstanceFleetConfig] -> ShowS
InstanceFleetConfig -> String
(Int -> InstanceFleetConfig -> ShowS)
-> (InstanceFleetConfig -> String)
-> ([InstanceFleetConfig] -> ShowS)
-> Show InstanceFleetConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceFleetConfig] -> ShowS
$cshowList :: [InstanceFleetConfig] -> ShowS
show :: InstanceFleetConfig -> String
$cshow :: InstanceFleetConfig -> String
showsPrec :: Int -> InstanceFleetConfig -> ShowS
$cshowsPrec :: Int -> InstanceFleetConfig -> ShowS
Prelude.Show, (forall x. InstanceFleetConfig -> Rep InstanceFleetConfig x)
-> (forall x. Rep InstanceFleetConfig x -> InstanceFleetConfig)
-> Generic InstanceFleetConfig
forall x. Rep InstanceFleetConfig x -> InstanceFleetConfig
forall x. InstanceFleetConfig -> Rep InstanceFleetConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceFleetConfig x -> InstanceFleetConfig
$cfrom :: forall x. InstanceFleetConfig -> Rep InstanceFleetConfig x
Prelude.Generic)
newInstanceFleetConfig ::
InstanceFleetType ->
InstanceFleetConfig
newInstanceFleetConfig :: InstanceFleetType -> InstanceFleetConfig
newInstanceFleetConfig InstanceFleetType
pInstanceFleetType_ =
InstanceFleetConfig' :: Maybe [InstanceTypeConfig]
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe InstanceFleetProvisioningSpecifications
-> InstanceFleetType
-> InstanceFleetConfig
InstanceFleetConfig'
{ $sel:instanceTypeConfigs:InstanceFleetConfig' :: Maybe [InstanceTypeConfig]
instanceTypeConfigs =
Maybe [InstanceTypeConfig]
forall a. Maybe a
Prelude.Nothing,
$sel:targetOnDemandCapacity:InstanceFleetConfig' :: Maybe Natural
targetOnDemandCapacity = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:name:InstanceFleetConfig' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:targetSpotCapacity:InstanceFleetConfig' :: Maybe Natural
targetSpotCapacity = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:launchSpecifications:InstanceFleetConfig' :: Maybe InstanceFleetProvisioningSpecifications
launchSpecifications = Maybe InstanceFleetProvisioningSpecifications
forall a. Maybe a
Prelude.Nothing,
$sel:instanceFleetType:InstanceFleetConfig' :: InstanceFleetType
instanceFleetType = InstanceFleetType
pInstanceFleetType_
}
instanceFleetConfig_instanceTypeConfigs :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe [InstanceTypeConfig])
instanceFleetConfig_instanceTypeConfigs :: (Maybe [InstanceTypeConfig] -> f (Maybe [InstanceTypeConfig]))
-> InstanceFleetConfig -> f InstanceFleetConfig
instanceFleetConfig_instanceTypeConfigs = (InstanceFleetConfig -> Maybe [InstanceTypeConfig])
-> (InstanceFleetConfig
-> Maybe [InstanceTypeConfig] -> InstanceFleetConfig)
-> Lens
InstanceFleetConfig
InstanceFleetConfig
(Maybe [InstanceTypeConfig])
(Maybe [InstanceTypeConfig])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceFleetConfig' {Maybe [InstanceTypeConfig]
instanceTypeConfigs :: Maybe [InstanceTypeConfig]
$sel:instanceTypeConfigs:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe [InstanceTypeConfig]
instanceTypeConfigs} -> Maybe [InstanceTypeConfig]
instanceTypeConfigs) (\s :: InstanceFleetConfig
s@InstanceFleetConfig' {} Maybe [InstanceTypeConfig]
a -> InstanceFleetConfig
s {$sel:instanceTypeConfigs:InstanceFleetConfig' :: Maybe [InstanceTypeConfig]
instanceTypeConfigs = Maybe [InstanceTypeConfig]
a} :: InstanceFleetConfig) ((Maybe [InstanceTypeConfig] -> f (Maybe [InstanceTypeConfig]))
-> InstanceFleetConfig -> f InstanceFleetConfig)
-> ((Maybe [InstanceTypeConfig] -> f (Maybe [InstanceTypeConfig]))
-> Maybe [InstanceTypeConfig] -> f (Maybe [InstanceTypeConfig]))
-> (Maybe [InstanceTypeConfig] -> f (Maybe [InstanceTypeConfig]))
-> InstanceFleetConfig
-> f InstanceFleetConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[InstanceTypeConfig]
[InstanceTypeConfig]
[InstanceTypeConfig]
[InstanceTypeConfig]
-> Iso
(Maybe [InstanceTypeConfig])
(Maybe [InstanceTypeConfig])
(Maybe [InstanceTypeConfig])
(Maybe [InstanceTypeConfig])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[InstanceTypeConfig]
[InstanceTypeConfig]
[InstanceTypeConfig]
[InstanceTypeConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instanceFleetConfig_targetOnDemandCapacity :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe Prelude.Natural)
instanceFleetConfig_targetOnDemandCapacity :: (Maybe Natural -> f (Maybe Natural))
-> InstanceFleetConfig -> f InstanceFleetConfig
instanceFleetConfig_targetOnDemandCapacity = (InstanceFleetConfig -> Maybe Natural)
-> (InstanceFleetConfig -> Maybe Natural -> InstanceFleetConfig)
-> Lens
InstanceFleetConfig
InstanceFleetConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceFleetConfig' {Maybe Natural
targetOnDemandCapacity :: Maybe Natural
$sel:targetOnDemandCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
targetOnDemandCapacity} -> Maybe Natural
targetOnDemandCapacity) (\s :: InstanceFleetConfig
s@InstanceFleetConfig' {} Maybe Natural
a -> InstanceFleetConfig
s {$sel:targetOnDemandCapacity:InstanceFleetConfig' :: Maybe Natural
targetOnDemandCapacity = Maybe Natural
a} :: InstanceFleetConfig)
instanceFleetConfig_name :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe Prelude.Text)
instanceFleetConfig_name :: (Maybe Text -> f (Maybe Text))
-> InstanceFleetConfig -> f InstanceFleetConfig
instanceFleetConfig_name = (InstanceFleetConfig -> Maybe Text)
-> (InstanceFleetConfig -> Maybe Text -> InstanceFleetConfig)
-> Lens
InstanceFleetConfig InstanceFleetConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceFleetConfig' {Maybe Text
name :: Maybe Text
$sel:name:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Text
name} -> Maybe Text
name) (\s :: InstanceFleetConfig
s@InstanceFleetConfig' {} Maybe Text
a -> InstanceFleetConfig
s {$sel:name:InstanceFleetConfig' :: Maybe Text
name = Maybe Text
a} :: InstanceFleetConfig)
instanceFleetConfig_targetSpotCapacity :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe Prelude.Natural)
instanceFleetConfig_targetSpotCapacity :: (Maybe Natural -> f (Maybe Natural))
-> InstanceFleetConfig -> f InstanceFleetConfig
instanceFleetConfig_targetSpotCapacity = (InstanceFleetConfig -> Maybe Natural)
-> (InstanceFleetConfig -> Maybe Natural -> InstanceFleetConfig)
-> Lens
InstanceFleetConfig
InstanceFleetConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceFleetConfig' {Maybe Natural
targetSpotCapacity :: Maybe Natural
$sel:targetSpotCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
targetSpotCapacity} -> Maybe Natural
targetSpotCapacity) (\s :: InstanceFleetConfig
s@InstanceFleetConfig' {} Maybe Natural
a -> InstanceFleetConfig
s {$sel:targetSpotCapacity:InstanceFleetConfig' :: Maybe Natural
targetSpotCapacity = Maybe Natural
a} :: InstanceFleetConfig)
instanceFleetConfig_launchSpecifications :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe InstanceFleetProvisioningSpecifications)
instanceFleetConfig_launchSpecifications :: (Maybe InstanceFleetProvisioningSpecifications
-> f (Maybe InstanceFleetProvisioningSpecifications))
-> InstanceFleetConfig -> f InstanceFleetConfig
instanceFleetConfig_launchSpecifications = (InstanceFleetConfig
-> Maybe InstanceFleetProvisioningSpecifications)
-> (InstanceFleetConfig
-> Maybe InstanceFleetProvisioningSpecifications
-> InstanceFleetConfig)
-> Lens
InstanceFleetConfig
InstanceFleetConfig
(Maybe InstanceFleetProvisioningSpecifications)
(Maybe InstanceFleetProvisioningSpecifications)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceFleetConfig' {Maybe InstanceFleetProvisioningSpecifications
launchSpecifications :: Maybe InstanceFleetProvisioningSpecifications
$sel:launchSpecifications:InstanceFleetConfig' :: InstanceFleetConfig
-> Maybe InstanceFleetProvisioningSpecifications
launchSpecifications} -> Maybe InstanceFleetProvisioningSpecifications
launchSpecifications) (\s :: InstanceFleetConfig
s@InstanceFleetConfig' {} Maybe InstanceFleetProvisioningSpecifications
a -> InstanceFleetConfig
s {$sel:launchSpecifications:InstanceFleetConfig' :: Maybe InstanceFleetProvisioningSpecifications
launchSpecifications = Maybe InstanceFleetProvisioningSpecifications
a} :: InstanceFleetConfig)
instanceFleetConfig_instanceFleetType :: Lens.Lens' InstanceFleetConfig InstanceFleetType
instanceFleetConfig_instanceFleetType :: (InstanceFleetType -> f InstanceFleetType)
-> InstanceFleetConfig -> f InstanceFleetConfig
instanceFleetConfig_instanceFleetType = (InstanceFleetConfig -> InstanceFleetType)
-> (InstanceFleetConfig
-> InstanceFleetType -> InstanceFleetConfig)
-> Lens
InstanceFleetConfig
InstanceFleetConfig
InstanceFleetType
InstanceFleetType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceFleetConfig' {InstanceFleetType
instanceFleetType :: InstanceFleetType
$sel:instanceFleetType:InstanceFleetConfig' :: InstanceFleetConfig -> InstanceFleetType
instanceFleetType} -> InstanceFleetType
instanceFleetType) (\s :: InstanceFleetConfig
s@InstanceFleetConfig' {} InstanceFleetType
a -> InstanceFleetConfig
s {$sel:instanceFleetType:InstanceFleetConfig' :: InstanceFleetType
instanceFleetType = InstanceFleetType
a} :: InstanceFleetConfig)
instance Prelude.Hashable InstanceFleetConfig
instance Prelude.NFData InstanceFleetConfig
instance Core.ToJSON InstanceFleetConfig where
toJSON :: InstanceFleetConfig -> Value
toJSON InstanceFleetConfig' {Maybe Natural
Maybe [InstanceTypeConfig]
Maybe Text
Maybe InstanceFleetProvisioningSpecifications
InstanceFleetType
instanceFleetType :: InstanceFleetType
launchSpecifications :: Maybe InstanceFleetProvisioningSpecifications
targetSpotCapacity :: Maybe Natural
name :: Maybe Text
targetOnDemandCapacity :: Maybe Natural
instanceTypeConfigs :: Maybe [InstanceTypeConfig]
$sel:instanceFleetType:InstanceFleetConfig' :: InstanceFleetConfig -> InstanceFleetType
$sel:launchSpecifications:InstanceFleetConfig' :: InstanceFleetConfig
-> Maybe InstanceFleetProvisioningSpecifications
$sel:targetSpotCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
$sel:name:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Text
$sel:targetOnDemandCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
$sel:instanceTypeConfigs:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe [InstanceTypeConfig]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InstanceTypeConfigs" Text -> [InstanceTypeConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([InstanceTypeConfig] -> Pair)
-> Maybe [InstanceTypeConfig] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstanceTypeConfig]
instanceTypeConfigs,
(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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(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,
(Text
"LaunchSpecifications" Text -> InstanceFleetProvisioningSpecifications -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InstanceFleetProvisioningSpecifications -> Pair)
-> Maybe InstanceFleetProvisioningSpecifications -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InstanceFleetProvisioningSpecifications
launchSpecifications,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"InstanceFleetType" Text -> InstanceFleetType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InstanceFleetType
instanceFleetType)
]
)