{-# 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.InstanceTypeSpecification 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.Configuration
import Amazonka.EMR.Types.EbsBlockDevice
import qualified Amazonka.Prelude as Prelude
data InstanceTypeSpecification = InstanceTypeSpecification'
{
InstanceTypeSpecification -> Maybe Text
bidPrice :: Prelude.Maybe Prelude.Text,
InstanceTypeSpecification -> Maybe Double
bidPriceAsPercentageOfOnDemandPrice :: Prelude.Maybe Prelude.Double,
InstanceTypeSpecification -> Maybe [Configuration]
configurations :: Prelude.Maybe [Configuration],
InstanceTypeSpecification -> Maybe Text
customAmiId :: Prelude.Maybe Prelude.Text,
InstanceTypeSpecification -> Maybe [EbsBlockDevice]
ebsBlockDevices :: Prelude.Maybe [EbsBlockDevice],
InstanceTypeSpecification -> Maybe Bool
ebsOptimized :: Prelude.Maybe Prelude.Bool,
InstanceTypeSpecification -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
InstanceTypeSpecification -> Maybe Natural
weightedCapacity :: Prelude.Maybe Prelude.Natural
}
deriving (InstanceTypeSpecification -> InstanceTypeSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceTypeSpecification -> InstanceTypeSpecification -> Bool
$c/= :: InstanceTypeSpecification -> InstanceTypeSpecification -> Bool
== :: InstanceTypeSpecification -> InstanceTypeSpecification -> Bool
$c== :: InstanceTypeSpecification -> InstanceTypeSpecification -> Bool
Prelude.Eq, ReadPrec [InstanceTypeSpecification]
ReadPrec InstanceTypeSpecification
Int -> ReadS InstanceTypeSpecification
ReadS [InstanceTypeSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceTypeSpecification]
$creadListPrec :: ReadPrec [InstanceTypeSpecification]
readPrec :: ReadPrec InstanceTypeSpecification
$creadPrec :: ReadPrec InstanceTypeSpecification
readList :: ReadS [InstanceTypeSpecification]
$creadList :: ReadS [InstanceTypeSpecification]
readsPrec :: Int -> ReadS InstanceTypeSpecification
$creadsPrec :: Int -> ReadS InstanceTypeSpecification
Prelude.Read, Int -> InstanceTypeSpecification -> ShowS
[InstanceTypeSpecification] -> ShowS
InstanceTypeSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceTypeSpecification] -> ShowS
$cshowList :: [InstanceTypeSpecification] -> ShowS
show :: InstanceTypeSpecification -> String
$cshow :: InstanceTypeSpecification -> String
showsPrec :: Int -> InstanceTypeSpecification -> ShowS
$cshowsPrec :: Int -> InstanceTypeSpecification -> ShowS
Prelude.Show, forall x.
Rep InstanceTypeSpecification x -> InstanceTypeSpecification
forall x.
InstanceTypeSpecification -> Rep InstanceTypeSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstanceTypeSpecification x -> InstanceTypeSpecification
$cfrom :: forall x.
InstanceTypeSpecification -> Rep InstanceTypeSpecification x
Prelude.Generic)
newInstanceTypeSpecification ::
InstanceTypeSpecification
newInstanceTypeSpecification :: InstanceTypeSpecification
newInstanceTypeSpecification =
InstanceTypeSpecification'
{ $sel:bidPrice:InstanceTypeSpecification' :: Maybe Text
bidPrice =
forall a. Maybe a
Prelude.Nothing,
$sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeSpecification' :: Maybe Double
bidPriceAsPercentageOfOnDemandPrice =
forall a. Maybe a
Prelude.Nothing,
$sel:configurations:InstanceTypeSpecification' :: Maybe [Configuration]
configurations = forall a. Maybe a
Prelude.Nothing,
$sel:customAmiId:InstanceTypeSpecification' :: Maybe Text
customAmiId = forall a. Maybe a
Prelude.Nothing,
$sel:ebsBlockDevices:InstanceTypeSpecification' :: Maybe [EbsBlockDevice]
ebsBlockDevices = forall a. Maybe a
Prelude.Nothing,
$sel:ebsOptimized:InstanceTypeSpecification' :: Maybe Bool
ebsOptimized = forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:InstanceTypeSpecification' :: Maybe Text
instanceType = forall a. Maybe a
Prelude.Nothing,
$sel:weightedCapacity:InstanceTypeSpecification' :: Maybe Natural
weightedCapacity = forall a. Maybe a
Prelude.Nothing
}
instanceTypeSpecification_bidPrice :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Text)
instanceTypeSpecification_bidPrice :: Lens' InstanceTypeSpecification (Maybe Text)
instanceTypeSpecification_bidPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeSpecification' {Maybe Text
bidPrice :: Maybe Text
$sel:bidPrice:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Text
bidPrice} -> Maybe Text
bidPrice) (\s :: InstanceTypeSpecification
s@InstanceTypeSpecification' {} Maybe Text
a -> InstanceTypeSpecification
s {$sel:bidPrice:InstanceTypeSpecification' :: Maybe Text
bidPrice = Maybe Text
a} :: InstanceTypeSpecification)
instanceTypeSpecification_bidPriceAsPercentageOfOnDemandPrice :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Double)
instanceTypeSpecification_bidPriceAsPercentageOfOnDemandPrice :: Lens' InstanceTypeSpecification (Maybe Double)
instanceTypeSpecification_bidPriceAsPercentageOfOnDemandPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeSpecification' {Maybe Double
bidPriceAsPercentageOfOnDemandPrice :: Maybe Double
$sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Double
bidPriceAsPercentageOfOnDemandPrice} -> Maybe Double
bidPriceAsPercentageOfOnDemandPrice) (\s :: InstanceTypeSpecification
s@InstanceTypeSpecification' {} Maybe Double
a -> InstanceTypeSpecification
s {$sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeSpecification' :: Maybe Double
bidPriceAsPercentageOfOnDemandPrice = Maybe Double
a} :: InstanceTypeSpecification)
instanceTypeSpecification_configurations :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe [Configuration])
instanceTypeSpecification_configurations :: Lens' InstanceTypeSpecification (Maybe [Configuration])
instanceTypeSpecification_configurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeSpecification' {Maybe [Configuration]
configurations :: Maybe [Configuration]
$sel:configurations:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe [Configuration]
configurations} -> Maybe [Configuration]
configurations) (\s :: InstanceTypeSpecification
s@InstanceTypeSpecification' {} Maybe [Configuration]
a -> InstanceTypeSpecification
s {$sel:configurations:InstanceTypeSpecification' :: Maybe [Configuration]
configurations = Maybe [Configuration]
a} :: InstanceTypeSpecification) 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
instanceTypeSpecification_customAmiId :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Text)
instanceTypeSpecification_customAmiId :: Lens' InstanceTypeSpecification (Maybe Text)
instanceTypeSpecification_customAmiId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeSpecification' {Maybe Text
customAmiId :: Maybe Text
$sel:customAmiId:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Text
customAmiId} -> Maybe Text
customAmiId) (\s :: InstanceTypeSpecification
s@InstanceTypeSpecification' {} Maybe Text
a -> InstanceTypeSpecification
s {$sel:customAmiId:InstanceTypeSpecification' :: Maybe Text
customAmiId = Maybe Text
a} :: InstanceTypeSpecification)
instanceTypeSpecification_ebsBlockDevices :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe [EbsBlockDevice])
instanceTypeSpecification_ebsBlockDevices :: Lens' InstanceTypeSpecification (Maybe [EbsBlockDevice])
instanceTypeSpecification_ebsBlockDevices = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeSpecification' {Maybe [EbsBlockDevice]
ebsBlockDevices :: Maybe [EbsBlockDevice]
$sel:ebsBlockDevices:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe [EbsBlockDevice]
ebsBlockDevices} -> Maybe [EbsBlockDevice]
ebsBlockDevices) (\s :: InstanceTypeSpecification
s@InstanceTypeSpecification' {} Maybe [EbsBlockDevice]
a -> InstanceTypeSpecification
s {$sel:ebsBlockDevices:InstanceTypeSpecification' :: Maybe [EbsBlockDevice]
ebsBlockDevices = Maybe [EbsBlockDevice]
a} :: InstanceTypeSpecification) 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
instanceTypeSpecification_ebsOptimized :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Bool)
instanceTypeSpecification_ebsOptimized :: Lens' InstanceTypeSpecification (Maybe Bool)
instanceTypeSpecification_ebsOptimized = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeSpecification' {Maybe Bool
ebsOptimized :: Maybe Bool
$sel:ebsOptimized:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Bool
ebsOptimized} -> Maybe Bool
ebsOptimized) (\s :: InstanceTypeSpecification
s@InstanceTypeSpecification' {} Maybe Bool
a -> InstanceTypeSpecification
s {$sel:ebsOptimized:InstanceTypeSpecification' :: Maybe Bool
ebsOptimized = Maybe Bool
a} :: InstanceTypeSpecification)
instanceTypeSpecification_instanceType :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Text)
instanceTypeSpecification_instanceType :: Lens' InstanceTypeSpecification (Maybe Text)
instanceTypeSpecification_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeSpecification' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: InstanceTypeSpecification
s@InstanceTypeSpecification' {} Maybe Text
a -> InstanceTypeSpecification
s {$sel:instanceType:InstanceTypeSpecification' :: Maybe Text
instanceType = Maybe Text
a} :: InstanceTypeSpecification)
instanceTypeSpecification_weightedCapacity :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Natural)
instanceTypeSpecification_weightedCapacity :: Lens' InstanceTypeSpecification (Maybe Natural)
instanceTypeSpecification_weightedCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeSpecification' {Maybe Natural
weightedCapacity :: Maybe Natural
$sel:weightedCapacity:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Natural
weightedCapacity} -> Maybe Natural
weightedCapacity) (\s :: InstanceTypeSpecification
s@InstanceTypeSpecification' {} Maybe Natural
a -> InstanceTypeSpecification
s {$sel:weightedCapacity:InstanceTypeSpecification' :: Maybe Natural
weightedCapacity = Maybe Natural
a} :: InstanceTypeSpecification)
instance Data.FromJSON InstanceTypeSpecification where
parseJSON :: Value -> Parser InstanceTypeSpecification
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InstanceTypeSpecification"
( \Object
x ->
Maybe Text
-> Maybe Double
-> Maybe [Configuration]
-> Maybe Text
-> Maybe [EbsBlockDevice]
-> Maybe Bool
-> Maybe Text
-> Maybe Natural
-> InstanceTypeSpecification
InstanceTypeSpecification'
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
"BidPrice")
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
"BidPriceAsPercentageOfOnDemandPrice")
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
"Configurations" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"CustomAmiId")
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
"EbsBlockDevices"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"EbsOptimized")
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
"InstanceType")
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
"WeightedCapacity")
)
instance Prelude.Hashable InstanceTypeSpecification where
hashWithSalt :: Int -> InstanceTypeSpecification -> Int
hashWithSalt Int
_salt InstanceTypeSpecification' {Maybe Bool
Maybe Double
Maybe Natural
Maybe [Configuration]
Maybe [EbsBlockDevice]
Maybe Text
weightedCapacity :: Maybe Natural
instanceType :: Maybe Text
ebsOptimized :: Maybe Bool
ebsBlockDevices :: Maybe [EbsBlockDevice]
customAmiId :: Maybe Text
configurations :: Maybe [Configuration]
bidPriceAsPercentageOfOnDemandPrice :: Maybe Double
bidPrice :: Maybe Text
$sel:weightedCapacity:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Natural
$sel:instanceType:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Text
$sel:ebsOptimized:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Bool
$sel:ebsBlockDevices:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe [EbsBlockDevice]
$sel:customAmiId:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Text
$sel:configurations:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe [Configuration]
$sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Double
$sel:bidPrice:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bidPrice
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
bidPriceAsPercentageOfOnDemandPrice
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Configuration]
configurations
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customAmiId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [EbsBlockDevice]
ebsBlockDevices
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
ebsOptimized
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
weightedCapacity
instance Prelude.NFData InstanceTypeSpecification where
rnf :: InstanceTypeSpecification -> ()
rnf InstanceTypeSpecification' {Maybe Bool
Maybe Double
Maybe Natural
Maybe [Configuration]
Maybe [EbsBlockDevice]
Maybe Text
weightedCapacity :: Maybe Natural
instanceType :: Maybe Text
ebsOptimized :: Maybe Bool
ebsBlockDevices :: Maybe [EbsBlockDevice]
customAmiId :: Maybe Text
configurations :: Maybe [Configuration]
bidPriceAsPercentageOfOnDemandPrice :: Maybe Double
bidPrice :: Maybe Text
$sel:weightedCapacity:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Natural
$sel:instanceType:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Text
$sel:ebsOptimized:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Bool
$sel:ebsBlockDevices:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe [EbsBlockDevice]
$sel:customAmiId:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Text
$sel:configurations:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe [Configuration]
$sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Double
$sel:bidPrice:InstanceTypeSpecification' :: InstanceTypeSpecification -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bidPrice
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
bidPriceAsPercentageOfOnDemandPrice
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Configuration]
configurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customAmiId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [EbsBlockDevice]
ebsBlockDevices
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
ebsOptimized
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
weightedCapacity