{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EMR.Types.InstanceFleetProvisioningSpecifications
import Amazonka.EMR.Types.InstanceFleetType
import Amazonka.EMR.Types.InstanceTypeConfig
import qualified Amazonka.Prelude as Prelude
data InstanceFleetConfig = InstanceFleetConfig'
{
InstanceFleetConfig -> Maybe [InstanceTypeConfig]
instanceTypeConfigs :: Prelude.Maybe [InstanceTypeConfig],
InstanceFleetConfig
-> Maybe InstanceFleetProvisioningSpecifications
launchSpecifications :: Prelude.Maybe InstanceFleetProvisioningSpecifications,
InstanceFleetConfig -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
InstanceFleetConfig -> Maybe Natural
targetOnDemandCapacity :: Prelude.Maybe Prelude.Natural,
InstanceFleetConfig -> Maybe Natural
targetSpotCapacity :: Prelude.Maybe Prelude.Natural,
InstanceFleetConfig -> InstanceFleetType
instanceFleetType :: InstanceFleetType
}
deriving (InstanceFleetConfig -> InstanceFleetConfig -> Bool
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]
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
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. 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'
{ $sel:instanceTypeConfigs:InstanceFleetConfig' :: Maybe [InstanceTypeConfig]
instanceTypeConfigs =
forall a. Maybe a
Prelude.Nothing,
$sel:launchSpecifications:InstanceFleetConfig' :: Maybe InstanceFleetProvisioningSpecifications
launchSpecifications = forall a. Maybe a
Prelude.Nothing,
$sel:name:InstanceFleetConfig' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:targetOnDemandCapacity:InstanceFleetConfig' :: Maybe Natural
targetOnDemandCapacity = forall a. Maybe a
Prelude.Nothing,
$sel:targetSpotCapacity:InstanceFleetConfig' :: Maybe Natural
targetSpotCapacity = forall a. Maybe a
Prelude.Nothing,
$sel:instanceFleetType:InstanceFleetConfig' :: InstanceFleetType
instanceFleetType = InstanceFleetType
pInstanceFleetType_
}
instanceFleetConfig_instanceTypeConfigs :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe [InstanceTypeConfig])
instanceFleetConfig_instanceTypeConfigs :: Lens' InstanceFleetConfig (Maybe [InstanceTypeConfig])
instanceFleetConfig_instanceTypeConfigs = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instanceFleetConfig_launchSpecifications :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe InstanceFleetProvisioningSpecifications)
instanceFleetConfig_launchSpecifications :: Lens'
InstanceFleetConfig (Maybe InstanceFleetProvisioningSpecifications)
instanceFleetConfig_launchSpecifications = 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_name :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe Prelude.Text)
instanceFleetConfig_name :: Lens' InstanceFleetConfig (Maybe Text)
instanceFleetConfig_name = 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_targetOnDemandCapacity :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe Prelude.Natural)
instanceFleetConfig_targetOnDemandCapacity :: Lens' InstanceFleetConfig (Maybe Natural)
instanceFleetConfig_targetOnDemandCapacity = 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_targetSpotCapacity :: Lens.Lens' InstanceFleetConfig (Prelude.Maybe Prelude.Natural)
instanceFleetConfig_targetSpotCapacity :: Lens' InstanceFleetConfig (Maybe Natural)
instanceFleetConfig_targetSpotCapacity = 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_instanceFleetType :: Lens.Lens' InstanceFleetConfig InstanceFleetType
instanceFleetConfig_instanceFleetType :: Lens' InstanceFleetConfig InstanceFleetType
instanceFleetConfig_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 where
hashWithSalt :: Int -> InstanceFleetConfig -> Int
hashWithSalt Int
_salt InstanceFleetConfig' {Maybe Natural
Maybe [InstanceTypeConfig]
Maybe Text
Maybe InstanceFleetProvisioningSpecifications
InstanceFleetType
instanceFleetType :: InstanceFleetType
targetSpotCapacity :: Maybe Natural
targetOnDemandCapacity :: Maybe Natural
name :: Maybe Text
launchSpecifications :: Maybe InstanceFleetProvisioningSpecifications
instanceTypeConfigs :: Maybe [InstanceTypeConfig]
$sel:instanceFleetType:InstanceFleetConfig' :: InstanceFleetConfig -> InstanceFleetType
$sel:targetSpotCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
$sel:targetOnDemandCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
$sel:name:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Text
$sel:launchSpecifications:InstanceFleetConfig' :: InstanceFleetConfig
-> Maybe InstanceFleetProvisioningSpecifications
$sel:instanceTypeConfigs:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe [InstanceTypeConfig]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstanceTypeConfig]
instanceTypeConfigs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceFleetProvisioningSpecifications
launchSpecifications
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
targetOnDemandCapacity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
targetSpotCapacity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InstanceFleetType
instanceFleetType
instance Prelude.NFData InstanceFleetConfig where
rnf :: InstanceFleetConfig -> ()
rnf InstanceFleetConfig' {Maybe Natural
Maybe [InstanceTypeConfig]
Maybe Text
Maybe InstanceFleetProvisioningSpecifications
InstanceFleetType
instanceFleetType :: InstanceFleetType
targetSpotCapacity :: Maybe Natural
targetOnDemandCapacity :: Maybe Natural
name :: Maybe Text
launchSpecifications :: Maybe InstanceFleetProvisioningSpecifications
instanceTypeConfigs :: Maybe [InstanceTypeConfig]
$sel:instanceFleetType:InstanceFleetConfig' :: InstanceFleetConfig -> InstanceFleetType
$sel:targetSpotCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
$sel:targetOnDemandCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
$sel:name:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Text
$sel:launchSpecifications:InstanceFleetConfig' :: InstanceFleetConfig
-> Maybe InstanceFleetProvisioningSpecifications
$sel:instanceTypeConfigs:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe [InstanceTypeConfig]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceTypeConfig]
instanceTypeConfigs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceFleetProvisioningSpecifications
launchSpecifications
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
targetOnDemandCapacity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
targetSpotCapacity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InstanceFleetType
instanceFleetType
instance Data.ToJSON InstanceFleetConfig where
toJSON :: InstanceFleetConfig -> Value
toJSON InstanceFleetConfig' {Maybe Natural
Maybe [InstanceTypeConfig]
Maybe Text
Maybe InstanceFleetProvisioningSpecifications
InstanceFleetType
instanceFleetType :: InstanceFleetType
targetSpotCapacity :: Maybe Natural
targetOnDemandCapacity :: Maybe Natural
name :: Maybe Text
launchSpecifications :: Maybe InstanceFleetProvisioningSpecifications
instanceTypeConfigs :: Maybe [InstanceTypeConfig]
$sel:instanceFleetType:InstanceFleetConfig' :: InstanceFleetConfig -> InstanceFleetType
$sel:targetSpotCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
$sel:targetOnDemandCapacity:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Natural
$sel:name:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe Text
$sel:launchSpecifications:InstanceFleetConfig' :: InstanceFleetConfig
-> Maybe InstanceFleetProvisioningSpecifications
$sel:instanceTypeConfigs:InstanceFleetConfig' :: InstanceFleetConfig -> Maybe [InstanceTypeConfig]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"InstanceTypeConfigs" 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 [InstanceTypeConfig]
instanceTypeConfigs,
(Key
"LaunchSpecifications" 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 InstanceFleetProvisioningSpecifications
launchSpecifications,
(Key
"Name" 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 Text
name,
(Key
"TargetOnDemandCapacity" 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 Natural
targetOnDemandCapacity,
(Key
"TargetSpotCapacity" 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 Natural
targetSpotCapacity,
forall a. a -> Maybe a
Prelude.Just
(Key
"InstanceFleetType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= InstanceFleetType
instanceFleetType)
]
)