{-# 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.OpenSearch.Types.ReservedInstanceOffering
-- 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.OpenSearch.Types.ReservedInstanceOffering where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types.OpenSearchPartitionInstanceType
import Amazonka.OpenSearch.Types.RecurringCharge
import Amazonka.OpenSearch.Types.ReservedInstancePaymentOption
import qualified Amazonka.Prelude as Prelude

-- | Details of a reserved OpenSearch instance offering.
--
-- /See:/ 'newReservedInstanceOffering' smart constructor.
data ReservedInstanceOffering = ReservedInstanceOffering'
  { -- | The currency code for the reserved OpenSearch instance offering.
    ReservedInstanceOffering -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | The OpenSearch instance type offered by the reserved instance offering.
    ReservedInstanceOffering -> Maybe OpenSearchPartitionInstanceType
instanceType :: Prelude.Maybe OpenSearchPartitionInstanceType,
    -- | The charge to your account regardless of whether you are creating any
    -- domains using the instance offering.
    ReservedInstanceOffering -> Maybe [RecurringCharge]
recurringCharges :: Prelude.Maybe [RecurringCharge],
    -- | The rate you are charged for each hour the domain that is using the
    -- offering is running.
    ReservedInstanceOffering -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double,
    -- | The OpenSearch reserved instance offering identifier.
    ReservedInstanceOffering -> Maybe Text
reservedInstanceOfferingId :: Prelude.Maybe Prelude.Text,
    -- | The upfront fixed charge you will pay to purchase the specific reserved
    -- OpenSearch instance offering.
    ReservedInstanceOffering -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | The duration, in seconds, for which the offering will reserve the
    -- OpenSearch instance.
    ReservedInstanceOffering -> Maybe Int
duration :: Prelude.Maybe Prelude.Int,
    -- | Payment option for the reserved OpenSearch instance offering
    ReservedInstanceOffering -> Maybe ReservedInstancePaymentOption
paymentOption :: Prelude.Maybe ReservedInstancePaymentOption
  }
  deriving (ReservedInstanceOffering -> ReservedInstanceOffering -> Bool
(ReservedInstanceOffering -> ReservedInstanceOffering -> Bool)
-> (ReservedInstanceOffering -> ReservedInstanceOffering -> Bool)
-> Eq ReservedInstanceOffering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservedInstanceOffering -> ReservedInstanceOffering -> Bool
$c/= :: ReservedInstanceOffering -> ReservedInstanceOffering -> Bool
== :: ReservedInstanceOffering -> ReservedInstanceOffering -> Bool
$c== :: ReservedInstanceOffering -> ReservedInstanceOffering -> Bool
Prelude.Eq, ReadPrec [ReservedInstanceOffering]
ReadPrec ReservedInstanceOffering
Int -> ReadS ReservedInstanceOffering
ReadS [ReservedInstanceOffering]
(Int -> ReadS ReservedInstanceOffering)
-> ReadS [ReservedInstanceOffering]
-> ReadPrec ReservedInstanceOffering
-> ReadPrec [ReservedInstanceOffering]
-> Read ReservedInstanceOffering
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservedInstanceOffering]
$creadListPrec :: ReadPrec [ReservedInstanceOffering]
readPrec :: ReadPrec ReservedInstanceOffering
$creadPrec :: ReadPrec ReservedInstanceOffering
readList :: ReadS [ReservedInstanceOffering]
$creadList :: ReadS [ReservedInstanceOffering]
readsPrec :: Int -> ReadS ReservedInstanceOffering
$creadsPrec :: Int -> ReadS ReservedInstanceOffering
Prelude.Read, Int -> ReservedInstanceOffering -> ShowS
[ReservedInstanceOffering] -> ShowS
ReservedInstanceOffering -> String
(Int -> ReservedInstanceOffering -> ShowS)
-> (ReservedInstanceOffering -> String)
-> ([ReservedInstanceOffering] -> ShowS)
-> Show ReservedInstanceOffering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservedInstanceOffering] -> ShowS
$cshowList :: [ReservedInstanceOffering] -> ShowS
show :: ReservedInstanceOffering -> String
$cshow :: ReservedInstanceOffering -> String
showsPrec :: Int -> ReservedInstanceOffering -> ShowS
$cshowsPrec :: Int -> ReservedInstanceOffering -> ShowS
Prelude.Show, (forall x.
 ReservedInstanceOffering -> Rep ReservedInstanceOffering x)
-> (forall x.
    Rep ReservedInstanceOffering x -> ReservedInstanceOffering)
-> Generic ReservedInstanceOffering
forall x.
Rep ReservedInstanceOffering x -> ReservedInstanceOffering
forall x.
ReservedInstanceOffering -> Rep ReservedInstanceOffering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReservedInstanceOffering x -> ReservedInstanceOffering
$cfrom :: forall x.
ReservedInstanceOffering -> Rep ReservedInstanceOffering x
Prelude.Generic)

-- |
-- Create a value of 'ReservedInstanceOffering' 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:
--
-- 'currencyCode', 'reservedInstanceOffering_currencyCode' - The currency code for the reserved OpenSearch instance offering.
--
-- 'instanceType', 'reservedInstanceOffering_instanceType' - The OpenSearch instance type offered by the reserved instance offering.
--
-- 'recurringCharges', 'reservedInstanceOffering_recurringCharges' - The charge to your account regardless of whether you are creating any
-- domains using the instance offering.
--
-- 'usagePrice', 'reservedInstanceOffering_usagePrice' - The rate you are charged for each hour the domain that is using the
-- offering is running.
--
-- 'reservedInstanceOfferingId', 'reservedInstanceOffering_reservedInstanceOfferingId' - The OpenSearch reserved instance offering identifier.
--
-- 'fixedPrice', 'reservedInstanceOffering_fixedPrice' - The upfront fixed charge you will pay to purchase the specific reserved
-- OpenSearch instance offering.
--
-- 'duration', 'reservedInstanceOffering_duration' - The duration, in seconds, for which the offering will reserve the
-- OpenSearch instance.
--
-- 'paymentOption', 'reservedInstanceOffering_paymentOption' - Payment option for the reserved OpenSearch instance offering
newReservedInstanceOffering ::
  ReservedInstanceOffering
newReservedInstanceOffering :: ReservedInstanceOffering
newReservedInstanceOffering =
  ReservedInstanceOffering' :: Maybe Text
-> Maybe OpenSearchPartitionInstanceType
-> Maybe [RecurringCharge]
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe ReservedInstancePaymentOption
-> ReservedInstanceOffering
ReservedInstanceOffering'
    { $sel:currencyCode:ReservedInstanceOffering' :: Maybe Text
currencyCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:ReservedInstanceOffering' :: Maybe OpenSearchPartitionInstanceType
instanceType = Maybe OpenSearchPartitionInstanceType
forall a. Maybe a
Prelude.Nothing,
      $sel:recurringCharges:ReservedInstanceOffering' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
forall a. Maybe a
Prelude.Nothing,
      $sel:usagePrice:ReservedInstanceOffering' :: Maybe Double
usagePrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedInstanceOfferingId:ReservedInstanceOffering' :: Maybe Text
reservedInstanceOfferingId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fixedPrice:ReservedInstanceOffering' :: Maybe Double
fixedPrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:ReservedInstanceOffering' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:paymentOption:ReservedInstanceOffering' :: Maybe ReservedInstancePaymentOption
paymentOption = Maybe ReservedInstancePaymentOption
forall a. Maybe a
Prelude.Nothing
    }

-- | The currency code for the reserved OpenSearch instance offering.
reservedInstanceOffering_currencyCode :: Lens.Lens' ReservedInstanceOffering (Prelude.Maybe Prelude.Text)
reservedInstanceOffering_currencyCode :: (Maybe Text -> f (Maybe Text))
-> ReservedInstanceOffering -> f ReservedInstanceOffering
reservedInstanceOffering_currencyCode = (ReservedInstanceOffering -> Maybe Text)
-> (ReservedInstanceOffering
    -> Maybe Text -> ReservedInstanceOffering)
-> Lens
     ReservedInstanceOffering
     ReservedInstanceOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstanceOffering' {Maybe Text
currencyCode :: Maybe Text
$sel:currencyCode:ReservedInstanceOffering' :: ReservedInstanceOffering -> Maybe Text
currencyCode} -> Maybe Text
currencyCode) (\s :: ReservedInstanceOffering
s@ReservedInstanceOffering' {} Maybe Text
a -> ReservedInstanceOffering
s {$sel:currencyCode:ReservedInstanceOffering' :: Maybe Text
currencyCode = Maybe Text
a} :: ReservedInstanceOffering)

-- | The OpenSearch instance type offered by the reserved instance offering.
reservedInstanceOffering_instanceType :: Lens.Lens' ReservedInstanceOffering (Prelude.Maybe OpenSearchPartitionInstanceType)
reservedInstanceOffering_instanceType :: (Maybe OpenSearchPartitionInstanceType
 -> f (Maybe OpenSearchPartitionInstanceType))
-> ReservedInstanceOffering -> f ReservedInstanceOffering
reservedInstanceOffering_instanceType = (ReservedInstanceOffering -> Maybe OpenSearchPartitionInstanceType)
-> (ReservedInstanceOffering
    -> Maybe OpenSearchPartitionInstanceType
    -> ReservedInstanceOffering)
-> Lens
     ReservedInstanceOffering
     ReservedInstanceOffering
     (Maybe OpenSearchPartitionInstanceType)
     (Maybe OpenSearchPartitionInstanceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstanceOffering' {Maybe OpenSearchPartitionInstanceType
instanceType :: Maybe OpenSearchPartitionInstanceType
$sel:instanceType:ReservedInstanceOffering' :: ReservedInstanceOffering -> Maybe OpenSearchPartitionInstanceType
instanceType} -> Maybe OpenSearchPartitionInstanceType
instanceType) (\s :: ReservedInstanceOffering
s@ReservedInstanceOffering' {} Maybe OpenSearchPartitionInstanceType
a -> ReservedInstanceOffering
s {$sel:instanceType:ReservedInstanceOffering' :: Maybe OpenSearchPartitionInstanceType
instanceType = Maybe OpenSearchPartitionInstanceType
a} :: ReservedInstanceOffering)

-- | The charge to your account regardless of whether you are creating any
-- domains using the instance offering.
reservedInstanceOffering_recurringCharges :: Lens.Lens' ReservedInstanceOffering (Prelude.Maybe [RecurringCharge])
reservedInstanceOffering_recurringCharges :: (Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
-> ReservedInstanceOffering -> f ReservedInstanceOffering
reservedInstanceOffering_recurringCharges = (ReservedInstanceOffering -> Maybe [RecurringCharge])
-> (ReservedInstanceOffering
    -> Maybe [RecurringCharge] -> ReservedInstanceOffering)
-> Lens
     ReservedInstanceOffering
     ReservedInstanceOffering
     (Maybe [RecurringCharge])
     (Maybe [RecurringCharge])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstanceOffering' {Maybe [RecurringCharge]
recurringCharges :: Maybe [RecurringCharge]
$sel:recurringCharges:ReservedInstanceOffering' :: ReservedInstanceOffering -> Maybe [RecurringCharge]
recurringCharges} -> Maybe [RecurringCharge]
recurringCharges) (\s :: ReservedInstanceOffering
s@ReservedInstanceOffering' {} Maybe [RecurringCharge]
a -> ReservedInstanceOffering
s {$sel:recurringCharges:ReservedInstanceOffering' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
a} :: ReservedInstanceOffering) ((Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
 -> ReservedInstanceOffering -> f ReservedInstanceOffering)
-> ((Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
    -> Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
-> (Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
-> ReservedInstanceOffering
-> f ReservedInstanceOffering
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RecurringCharge]
  [RecurringCharge]
  [RecurringCharge]
  [RecurringCharge]
-> Iso
     (Maybe [RecurringCharge])
     (Maybe [RecurringCharge])
     (Maybe [RecurringCharge])
     (Maybe [RecurringCharge])
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
  [RecurringCharge]
  [RecurringCharge]
  [RecurringCharge]
  [RecurringCharge]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The rate you are charged for each hour the domain that is using the
-- offering is running.
reservedInstanceOffering_usagePrice :: Lens.Lens' ReservedInstanceOffering (Prelude.Maybe Prelude.Double)
reservedInstanceOffering_usagePrice :: (Maybe Double -> f (Maybe Double))
-> ReservedInstanceOffering -> f ReservedInstanceOffering
reservedInstanceOffering_usagePrice = (ReservedInstanceOffering -> Maybe Double)
-> (ReservedInstanceOffering
    -> Maybe Double -> ReservedInstanceOffering)
-> Lens
     ReservedInstanceOffering
     ReservedInstanceOffering
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstanceOffering' {Maybe Double
usagePrice :: Maybe Double
$sel:usagePrice:ReservedInstanceOffering' :: ReservedInstanceOffering -> Maybe Double
usagePrice} -> Maybe Double
usagePrice) (\s :: ReservedInstanceOffering
s@ReservedInstanceOffering' {} Maybe Double
a -> ReservedInstanceOffering
s {$sel:usagePrice:ReservedInstanceOffering' :: Maybe Double
usagePrice = Maybe Double
a} :: ReservedInstanceOffering)

-- | The OpenSearch reserved instance offering identifier.
reservedInstanceOffering_reservedInstanceOfferingId :: Lens.Lens' ReservedInstanceOffering (Prelude.Maybe Prelude.Text)
reservedInstanceOffering_reservedInstanceOfferingId :: (Maybe Text -> f (Maybe Text))
-> ReservedInstanceOffering -> f ReservedInstanceOffering
reservedInstanceOffering_reservedInstanceOfferingId = (ReservedInstanceOffering -> Maybe Text)
-> (ReservedInstanceOffering
    -> Maybe Text -> ReservedInstanceOffering)
-> Lens
     ReservedInstanceOffering
     ReservedInstanceOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstanceOffering' {Maybe Text
reservedInstanceOfferingId :: Maybe Text
$sel:reservedInstanceOfferingId:ReservedInstanceOffering' :: ReservedInstanceOffering -> Maybe Text
reservedInstanceOfferingId} -> Maybe Text
reservedInstanceOfferingId) (\s :: ReservedInstanceOffering
s@ReservedInstanceOffering' {} Maybe Text
a -> ReservedInstanceOffering
s {$sel:reservedInstanceOfferingId:ReservedInstanceOffering' :: Maybe Text
reservedInstanceOfferingId = Maybe Text
a} :: ReservedInstanceOffering)

-- | The upfront fixed charge you will pay to purchase the specific reserved
-- OpenSearch instance offering.
reservedInstanceOffering_fixedPrice :: Lens.Lens' ReservedInstanceOffering (Prelude.Maybe Prelude.Double)
reservedInstanceOffering_fixedPrice :: (Maybe Double -> f (Maybe Double))
-> ReservedInstanceOffering -> f ReservedInstanceOffering
reservedInstanceOffering_fixedPrice = (ReservedInstanceOffering -> Maybe Double)
-> (ReservedInstanceOffering
    -> Maybe Double -> ReservedInstanceOffering)
-> Lens
     ReservedInstanceOffering
     ReservedInstanceOffering
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstanceOffering' {Maybe Double
fixedPrice :: Maybe Double
$sel:fixedPrice:ReservedInstanceOffering' :: ReservedInstanceOffering -> Maybe Double
fixedPrice} -> Maybe Double
fixedPrice) (\s :: ReservedInstanceOffering
s@ReservedInstanceOffering' {} Maybe Double
a -> ReservedInstanceOffering
s {$sel:fixedPrice:ReservedInstanceOffering' :: Maybe Double
fixedPrice = Maybe Double
a} :: ReservedInstanceOffering)

-- | The duration, in seconds, for which the offering will reserve the
-- OpenSearch instance.
reservedInstanceOffering_duration :: Lens.Lens' ReservedInstanceOffering (Prelude.Maybe Prelude.Int)
reservedInstanceOffering_duration :: (Maybe Int -> f (Maybe Int))
-> ReservedInstanceOffering -> f ReservedInstanceOffering
reservedInstanceOffering_duration = (ReservedInstanceOffering -> Maybe Int)
-> (ReservedInstanceOffering
    -> Maybe Int -> ReservedInstanceOffering)
-> Lens
     ReservedInstanceOffering
     ReservedInstanceOffering
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstanceOffering' {Maybe Int
duration :: Maybe Int
$sel:duration:ReservedInstanceOffering' :: ReservedInstanceOffering -> Maybe Int
duration} -> Maybe Int
duration) (\s :: ReservedInstanceOffering
s@ReservedInstanceOffering' {} Maybe Int
a -> ReservedInstanceOffering
s {$sel:duration:ReservedInstanceOffering' :: Maybe Int
duration = Maybe Int
a} :: ReservedInstanceOffering)

-- | Payment option for the reserved OpenSearch instance offering
reservedInstanceOffering_paymentOption :: Lens.Lens' ReservedInstanceOffering (Prelude.Maybe ReservedInstancePaymentOption)
reservedInstanceOffering_paymentOption :: (Maybe ReservedInstancePaymentOption
 -> f (Maybe ReservedInstancePaymentOption))
-> ReservedInstanceOffering -> f ReservedInstanceOffering
reservedInstanceOffering_paymentOption = (ReservedInstanceOffering -> Maybe ReservedInstancePaymentOption)
-> (ReservedInstanceOffering
    -> Maybe ReservedInstancePaymentOption -> ReservedInstanceOffering)
-> Lens
     ReservedInstanceOffering
     ReservedInstanceOffering
     (Maybe ReservedInstancePaymentOption)
     (Maybe ReservedInstancePaymentOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstanceOffering' {Maybe ReservedInstancePaymentOption
paymentOption :: Maybe ReservedInstancePaymentOption
$sel:paymentOption:ReservedInstanceOffering' :: ReservedInstanceOffering -> Maybe ReservedInstancePaymentOption
paymentOption} -> Maybe ReservedInstancePaymentOption
paymentOption) (\s :: ReservedInstanceOffering
s@ReservedInstanceOffering' {} Maybe ReservedInstancePaymentOption
a -> ReservedInstanceOffering
s {$sel:paymentOption:ReservedInstanceOffering' :: Maybe ReservedInstancePaymentOption
paymentOption = Maybe ReservedInstancePaymentOption
a} :: ReservedInstanceOffering)

instance Core.FromJSON ReservedInstanceOffering where
  parseJSON :: Value -> Parser ReservedInstanceOffering
parseJSON =
    String
-> (Object -> Parser ReservedInstanceOffering)
-> Value
-> Parser ReservedInstanceOffering
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReservedInstanceOffering"
      ( \Object
x ->
          Maybe Text
-> Maybe OpenSearchPartitionInstanceType
-> Maybe [RecurringCharge]
-> Maybe Double
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe ReservedInstancePaymentOption
-> ReservedInstanceOffering
ReservedInstanceOffering'
            (Maybe Text
 -> Maybe OpenSearchPartitionInstanceType
 -> Maybe [RecurringCharge]
 -> Maybe Double
 -> Maybe Text
 -> Maybe Double
 -> Maybe Int
 -> Maybe ReservedInstancePaymentOption
 -> ReservedInstanceOffering)
-> Parser (Maybe Text)
-> Parser
     (Maybe OpenSearchPartitionInstanceType
      -> Maybe [RecurringCharge]
      -> Maybe Double
      -> Maybe Text
      -> Maybe Double
      -> Maybe Int
      -> Maybe ReservedInstancePaymentOption
      -> ReservedInstanceOffering)
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
"CurrencyCode")
            Parser
  (Maybe OpenSearchPartitionInstanceType
   -> Maybe [RecurringCharge]
   -> Maybe Double
   -> Maybe Text
   -> Maybe Double
   -> Maybe Int
   -> Maybe ReservedInstancePaymentOption
   -> ReservedInstanceOffering)
-> Parser (Maybe OpenSearchPartitionInstanceType)
-> Parser
     (Maybe [RecurringCharge]
      -> Maybe Double
      -> Maybe Text
      -> Maybe Double
      -> Maybe Int
      -> Maybe ReservedInstancePaymentOption
      -> ReservedInstanceOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OpenSearchPartitionInstanceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceType")
            Parser
  (Maybe [RecurringCharge]
   -> Maybe Double
   -> Maybe Text
   -> Maybe Double
   -> Maybe Int
   -> Maybe ReservedInstancePaymentOption
   -> ReservedInstanceOffering)
-> Parser (Maybe [RecurringCharge])
-> Parser
     (Maybe Double
      -> Maybe Text
      -> Maybe Double
      -> Maybe Int
      -> Maybe ReservedInstancePaymentOption
      -> ReservedInstanceOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [RecurringCharge]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RecurringCharges"
                            Parser (Maybe (Maybe [RecurringCharge]))
-> Maybe [RecurringCharge] -> Parser (Maybe [RecurringCharge])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RecurringCharge]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Double
   -> Maybe Text
   -> Maybe Double
   -> Maybe Int
   -> Maybe ReservedInstancePaymentOption
   -> ReservedInstanceOffering)
-> Parser (Maybe Double)
-> Parser
     (Maybe Text
      -> Maybe Double
      -> Maybe Int
      -> Maybe ReservedInstancePaymentOption
      -> ReservedInstanceOffering)
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
"UsagePrice")
            Parser
  (Maybe Text
   -> Maybe Double
   -> Maybe Int
   -> Maybe ReservedInstancePaymentOption
   -> ReservedInstanceOffering)
-> Parser (Maybe Text)
-> Parser
     (Maybe Double
      -> Maybe Int
      -> Maybe ReservedInstancePaymentOption
      -> ReservedInstanceOffering)
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
"ReservedInstanceOfferingId")
            Parser
  (Maybe Double
   -> Maybe Int
   -> Maybe ReservedInstancePaymentOption
   -> ReservedInstanceOffering)
-> Parser (Maybe Double)
-> Parser
     (Maybe Int
      -> Maybe ReservedInstancePaymentOption -> ReservedInstanceOffering)
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
"FixedPrice")
            Parser
  (Maybe Int
   -> Maybe ReservedInstancePaymentOption -> ReservedInstanceOffering)
-> Parser (Maybe Int)
-> Parser
     (Maybe ReservedInstancePaymentOption -> ReservedInstanceOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Duration")
            Parser
  (Maybe ReservedInstancePaymentOption -> ReservedInstanceOffering)
-> Parser (Maybe ReservedInstancePaymentOption)
-> Parser ReservedInstanceOffering
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReservedInstancePaymentOption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PaymentOption")
      )

instance Prelude.Hashable ReservedInstanceOffering

instance Prelude.NFData ReservedInstanceOffering