{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EMR.Types.InstanceTypeSpecification
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EMR.Types.InstanceTypeSpecification where

import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.Configuration
import Amazonka.EMR.Types.EbsBlockDevice
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The configuration specification for each instance type in an instance
-- fleet.
--
-- The instance fleet configuration is available only in Amazon EMR
-- versions 4.8.0 and later, excluding 5.0.x versions.
--
-- /See:/ 'newInstanceTypeSpecification' smart constructor.
data InstanceTypeSpecification = InstanceTypeSpecification'
  { -- | The bid price for each EC2 Spot Instance type as defined by
    -- @InstanceType@. Expressed in USD.
    InstanceTypeSpecification -> Maybe Text
bidPrice :: Prelude.Maybe Prelude.Text,
    -- | The number of units that a provisioned instance of this type provides
    -- toward fulfilling the target capacities defined in InstanceFleetConfig.
    -- Capacity values represent performance characteristics such as vCPUs,
    -- memory, or I\/O. If not specified, the default value is 1.
    InstanceTypeSpecification -> Maybe Natural
weightedCapacity :: Prelude.Maybe Prelude.Natural,
    -- | A configuration classification that applies when provisioning cluster
    -- instances, which can include configurations for applications and
    -- software bundled with Amazon EMR.
    InstanceTypeSpecification -> Maybe [Configuration]
configurations :: Prelude.Maybe [Configuration],
    -- | The custom AMI ID to use for the instance type.
    InstanceTypeSpecification -> Maybe Text
customAmiId :: Prelude.Maybe Prelude.Text,
    -- | The configuration of Amazon Elastic Block Store (Amazon EBS) attached to
    -- each instance as defined by @InstanceType@.
    InstanceTypeSpecification -> Maybe [EbsBlockDevice]
ebsBlockDevices :: Prelude.Maybe [EbsBlockDevice],
    -- | The EC2 instance type, for example @m3.xlarge@.
    InstanceTypeSpecification -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | Evaluates to @TRUE@ when the specified @InstanceType@ is EBS-optimized.
    InstanceTypeSpecification -> Maybe Bool
ebsOptimized :: Prelude.Maybe Prelude.Bool,
    -- | The bid price, as a percentage of On-Demand price, for each EC2 Spot
    -- Instance as defined by @InstanceType@. Expressed as a number (for
    -- example, 20 specifies 20%).
    InstanceTypeSpecification -> Maybe Double
bidPriceAsPercentageOfOnDemandPrice :: Prelude.Maybe Prelude.Double
  }
  deriving (InstanceTypeSpecification -> InstanceTypeSpecification -> Bool
(InstanceTypeSpecification -> InstanceTypeSpecification -> Bool)
-> (InstanceTypeSpecification -> InstanceTypeSpecification -> Bool)
-> Eq InstanceTypeSpecification
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]
(Int -> ReadS InstanceTypeSpecification)
-> ReadS [InstanceTypeSpecification]
-> ReadPrec InstanceTypeSpecification
-> ReadPrec [InstanceTypeSpecification]
-> Read 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
(Int -> InstanceTypeSpecification -> ShowS)
-> (InstanceTypeSpecification -> String)
-> ([InstanceTypeSpecification] -> ShowS)
-> Show InstanceTypeSpecification
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.
 InstanceTypeSpecification -> Rep InstanceTypeSpecification x)
-> (forall x.
    Rep InstanceTypeSpecification x -> InstanceTypeSpecification)
-> Generic InstanceTypeSpecification
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)

-- |
-- Create a value of 'InstanceTypeSpecification' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'bidPrice', 'instanceTypeSpecification_bidPrice' - The bid price for each EC2 Spot Instance type as defined by
-- @InstanceType@. Expressed in USD.
--
-- 'weightedCapacity', 'instanceTypeSpecification_weightedCapacity' - The number of units that a provisioned instance of this type provides
-- toward fulfilling the target capacities defined in InstanceFleetConfig.
-- Capacity values represent performance characteristics such as vCPUs,
-- memory, or I\/O. If not specified, the default value is 1.
--
-- 'configurations', 'instanceTypeSpecification_configurations' - A configuration classification that applies when provisioning cluster
-- instances, which can include configurations for applications and
-- software bundled with Amazon EMR.
--
-- 'customAmiId', 'instanceTypeSpecification_customAmiId' - The custom AMI ID to use for the instance type.
--
-- 'ebsBlockDevices', 'instanceTypeSpecification_ebsBlockDevices' - The configuration of Amazon Elastic Block Store (Amazon EBS) attached to
-- each instance as defined by @InstanceType@.
--
-- 'instanceType', 'instanceTypeSpecification_instanceType' - The EC2 instance type, for example @m3.xlarge@.
--
-- 'ebsOptimized', 'instanceTypeSpecification_ebsOptimized' - Evaluates to @TRUE@ when the specified @InstanceType@ is EBS-optimized.
--
-- 'bidPriceAsPercentageOfOnDemandPrice', 'instanceTypeSpecification_bidPriceAsPercentageOfOnDemandPrice' - The bid price, as a percentage of On-Demand price, for each EC2 Spot
-- Instance as defined by @InstanceType@. Expressed as a number (for
-- example, 20 specifies 20%).
newInstanceTypeSpecification ::
  InstanceTypeSpecification
newInstanceTypeSpecification :: InstanceTypeSpecification
newInstanceTypeSpecification =
  InstanceTypeSpecification' :: Maybe Text
-> Maybe Natural
-> Maybe [Configuration]
-> Maybe Text
-> Maybe [EbsBlockDevice]
-> Maybe Text
-> Maybe Bool
-> Maybe Double
-> InstanceTypeSpecification
InstanceTypeSpecification'
    { $sel:bidPrice:InstanceTypeSpecification' :: Maybe Text
bidPrice =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:weightedCapacity:InstanceTypeSpecification' :: Maybe Natural
weightedCapacity = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:configurations:InstanceTypeSpecification' :: Maybe [Configuration]
configurations = Maybe [Configuration]
forall a. Maybe a
Prelude.Nothing,
      $sel:customAmiId:InstanceTypeSpecification' :: Maybe Text
customAmiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ebsBlockDevices:InstanceTypeSpecification' :: Maybe [EbsBlockDevice]
ebsBlockDevices = Maybe [EbsBlockDevice]
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:InstanceTypeSpecification' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ebsOptimized:InstanceTypeSpecification' :: Maybe Bool
ebsOptimized = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:bidPriceAsPercentageOfOnDemandPrice:InstanceTypeSpecification' :: Maybe Double
bidPriceAsPercentageOfOnDemandPrice =
        Maybe Double
forall a. Maybe a
Prelude.Nothing
    }

-- | The bid price for each EC2 Spot Instance type as defined by
-- @InstanceType@. Expressed in USD.
instanceTypeSpecification_bidPrice :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Text)
instanceTypeSpecification_bidPrice :: (Maybe Text -> f (Maybe Text))
-> InstanceTypeSpecification -> f InstanceTypeSpecification
instanceTypeSpecification_bidPrice = (InstanceTypeSpecification -> Maybe Text)
-> (InstanceTypeSpecification
    -> Maybe Text -> InstanceTypeSpecification)
-> Lens
     InstanceTypeSpecification
     InstanceTypeSpecification
     (Maybe Text)
     (Maybe Text)
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)

-- | The number of units that a provisioned instance of this type provides
-- toward fulfilling the target capacities defined in InstanceFleetConfig.
-- Capacity values represent performance characteristics such as vCPUs,
-- memory, or I\/O. If not specified, the default value is 1.
instanceTypeSpecification_weightedCapacity :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Natural)
instanceTypeSpecification_weightedCapacity :: (Maybe Natural -> f (Maybe Natural))
-> InstanceTypeSpecification -> f InstanceTypeSpecification
instanceTypeSpecification_weightedCapacity = (InstanceTypeSpecification -> Maybe Natural)
-> (InstanceTypeSpecification
    -> Maybe Natural -> InstanceTypeSpecification)
-> Lens
     InstanceTypeSpecification
     InstanceTypeSpecification
     (Maybe Natural)
     (Maybe Natural)
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)

-- | A configuration classification that applies when provisioning cluster
-- instances, which can include configurations for applications and
-- software bundled with Amazon EMR.
instanceTypeSpecification_configurations :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe [Configuration])
instanceTypeSpecification_configurations :: (Maybe [Configuration] -> f (Maybe [Configuration]))
-> InstanceTypeSpecification -> f InstanceTypeSpecification
instanceTypeSpecification_configurations = (InstanceTypeSpecification -> Maybe [Configuration])
-> (InstanceTypeSpecification
    -> Maybe [Configuration] -> InstanceTypeSpecification)
-> Lens
     InstanceTypeSpecification
     InstanceTypeSpecification
     (Maybe [Configuration])
     (Maybe [Configuration])
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) ((Maybe [Configuration] -> f (Maybe [Configuration]))
 -> InstanceTypeSpecification -> f InstanceTypeSpecification)
-> ((Maybe [Configuration] -> f (Maybe [Configuration]))
    -> Maybe [Configuration] -> f (Maybe [Configuration]))
-> (Maybe [Configuration] -> f (Maybe [Configuration]))
-> InstanceTypeSpecification
-> f InstanceTypeSpecification
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [Configuration] [Configuration] [Configuration] [Configuration]
-> Iso
     (Maybe [Configuration])
     (Maybe [Configuration])
     (Maybe [Configuration])
     (Maybe [Configuration])
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
  [Configuration] [Configuration] [Configuration] [Configuration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The custom AMI ID to use for the instance type.
instanceTypeSpecification_customAmiId :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Text)
instanceTypeSpecification_customAmiId :: (Maybe Text -> f (Maybe Text))
-> InstanceTypeSpecification -> f InstanceTypeSpecification
instanceTypeSpecification_customAmiId = (InstanceTypeSpecification -> Maybe Text)
-> (InstanceTypeSpecification
    -> Maybe Text -> InstanceTypeSpecification)
-> Lens
     InstanceTypeSpecification
     InstanceTypeSpecification
     (Maybe Text)
     (Maybe Text)
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)

-- | The configuration of Amazon Elastic Block Store (Amazon EBS) attached to
-- each instance as defined by @InstanceType@.
instanceTypeSpecification_ebsBlockDevices :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe [EbsBlockDevice])
instanceTypeSpecification_ebsBlockDevices :: (Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
-> InstanceTypeSpecification -> f InstanceTypeSpecification
instanceTypeSpecification_ebsBlockDevices = (InstanceTypeSpecification -> Maybe [EbsBlockDevice])
-> (InstanceTypeSpecification
    -> Maybe [EbsBlockDevice] -> InstanceTypeSpecification)
-> Lens
     InstanceTypeSpecification
     InstanceTypeSpecification
     (Maybe [EbsBlockDevice])
     (Maybe [EbsBlockDevice])
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) ((Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
 -> InstanceTypeSpecification -> f InstanceTypeSpecification)
-> ((Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
    -> Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
-> (Maybe [EbsBlockDevice] -> f (Maybe [EbsBlockDevice]))
-> InstanceTypeSpecification
-> f InstanceTypeSpecification
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EbsBlockDevice] [EbsBlockDevice] [EbsBlockDevice] [EbsBlockDevice]
-> Iso
     (Maybe [EbsBlockDevice])
     (Maybe [EbsBlockDevice])
     (Maybe [EbsBlockDevice])
     (Maybe [EbsBlockDevice])
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
  [EbsBlockDevice] [EbsBlockDevice] [EbsBlockDevice] [EbsBlockDevice]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The EC2 instance type, for example @m3.xlarge@.
instanceTypeSpecification_instanceType :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Text)
instanceTypeSpecification_instanceType :: (Maybe Text -> f (Maybe Text))
-> InstanceTypeSpecification -> f InstanceTypeSpecification
instanceTypeSpecification_instanceType = (InstanceTypeSpecification -> Maybe Text)
-> (InstanceTypeSpecification
    -> Maybe Text -> InstanceTypeSpecification)
-> Lens
     InstanceTypeSpecification
     InstanceTypeSpecification
     (Maybe Text)
     (Maybe Text)
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)

-- | Evaluates to @TRUE@ when the specified @InstanceType@ is EBS-optimized.
instanceTypeSpecification_ebsOptimized :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Bool)
instanceTypeSpecification_ebsOptimized :: (Maybe Bool -> f (Maybe Bool))
-> InstanceTypeSpecification -> f InstanceTypeSpecification
instanceTypeSpecification_ebsOptimized = (InstanceTypeSpecification -> Maybe Bool)
-> (InstanceTypeSpecification
    -> Maybe Bool -> InstanceTypeSpecification)
-> Lens
     InstanceTypeSpecification
     InstanceTypeSpecification
     (Maybe Bool)
     (Maybe Bool)
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)

-- | The bid price, as a percentage of On-Demand price, for each EC2 Spot
-- Instance as defined by @InstanceType@. Expressed as a number (for
-- example, 20 specifies 20%).
instanceTypeSpecification_bidPriceAsPercentageOfOnDemandPrice :: Lens.Lens' InstanceTypeSpecification (Prelude.Maybe Prelude.Double)
instanceTypeSpecification_bidPriceAsPercentageOfOnDemandPrice :: (Maybe Double -> f (Maybe Double))
-> InstanceTypeSpecification -> f InstanceTypeSpecification
instanceTypeSpecification_bidPriceAsPercentageOfOnDemandPrice = (InstanceTypeSpecification -> Maybe Double)
-> (InstanceTypeSpecification
    -> Maybe Double -> InstanceTypeSpecification)
-> Lens
     InstanceTypeSpecification
     InstanceTypeSpecification
     (Maybe Double)
     (Maybe Double)
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)

instance Core.FromJSON InstanceTypeSpecification where
  parseJSON :: Value -> Parser InstanceTypeSpecification
parseJSON =
    String
-> (Object -> Parser InstanceTypeSpecification)
-> Value
-> Parser InstanceTypeSpecification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InstanceTypeSpecification"
      ( \Object
x ->
          Maybe Text
-> Maybe Natural
-> Maybe [Configuration]
-> Maybe Text
-> Maybe [EbsBlockDevice]
-> Maybe Text
-> Maybe Bool
-> Maybe Double
-> InstanceTypeSpecification
InstanceTypeSpecification'
            (Maybe Text
 -> Maybe Natural
 -> Maybe [Configuration]
 -> Maybe Text
 -> Maybe [EbsBlockDevice]
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Double
 -> InstanceTypeSpecification)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe [Configuration]
      -> Maybe Text
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Double
      -> InstanceTypeSpecification)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BidPrice")
            Parser
  (Maybe Natural
   -> Maybe [Configuration]
   -> Maybe Text
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Double
   -> InstanceTypeSpecification)
-> Parser (Maybe Natural)
-> Parser
     (Maybe [Configuration]
      -> Maybe Text
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Double
      -> InstanceTypeSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WeightedCapacity")
            Parser
  (Maybe [Configuration]
   -> Maybe Text
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Double
   -> InstanceTypeSpecification)
-> Parser (Maybe [Configuration])
-> Parser
     (Maybe Text
      -> Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Double
      -> InstanceTypeSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Configuration]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Configurations" Parser (Maybe (Maybe [Configuration]))
-> Maybe [Configuration] -> Parser (Maybe [Configuration])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Configuration]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Double
   -> InstanceTypeSpecification)
-> Parser (Maybe Text)
-> Parser
     (Maybe [EbsBlockDevice]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Double
      -> InstanceTypeSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomAmiId")
            Parser
  (Maybe [EbsBlockDevice]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Double
   -> InstanceTypeSpecification)
-> Parser (Maybe [EbsBlockDevice])
-> Parser
     (Maybe Text
      -> Maybe Bool -> Maybe Double -> InstanceTypeSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [EbsBlockDevice]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EbsBlockDevices"
                            Parser (Maybe (Maybe [EbsBlockDevice]))
-> Maybe [EbsBlockDevice] -> Parser (Maybe [EbsBlockDevice])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EbsBlockDevice]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Bool -> Maybe Double -> InstanceTypeSpecification)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe Double -> InstanceTypeSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceType")
            Parser (Maybe Bool -> Maybe Double -> InstanceTypeSpecification)
-> Parser (Maybe Bool)
-> Parser (Maybe Double -> InstanceTypeSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EbsOptimized")
            Parser (Maybe Double -> InstanceTypeSpecification)
-> Parser (Maybe Double) -> Parser InstanceTypeSpecification
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BidPriceAsPercentageOfOnDemandPrice")
      )

instance Prelude.Hashable InstanceTypeSpecification

instance Prelude.NFData InstanceTypeSpecification