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