{-# 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.ReservedInstance
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.OpenSearch.Types.ReservedInstance where

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

-- | Details of an OpenSearch Reserved Instance.
--
-- /See:/ 'newReservedInstance' smart constructor.
data ReservedInstance = ReservedInstance'
  { -- | The unique identifier of the billing subscription.
    ReservedInstance -> Maybe Integer
billingSubscriptionId :: Prelude.Maybe Prelude.Integer,
    -- | The currency code for the offering.
    ReservedInstance -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | The duration, in seconds, for which the OpenSearch instance is reserved.
    ReservedInstance -> Maybe Int
duration :: Prelude.Maybe Prelude.Int,
    -- | The upfront fixed charge you will paid to purchase the specific Reserved
    -- Instance offering.
    ReservedInstance -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | The number of OpenSearch instances that have been reserved.
    ReservedInstance -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
    -- | The OpenSearch instance type offered by theReserved Instance offering.
    ReservedInstance -> Maybe OpenSearchPartitionInstanceType
instanceType :: Prelude.Maybe OpenSearchPartitionInstanceType,
    -- | The payment option as defined in the Reserved Instance offering.
    ReservedInstance -> Maybe ReservedInstancePaymentOption
paymentOption :: Prelude.Maybe ReservedInstancePaymentOption,
    -- | The recurring charge to your account, regardless of whether you create
    -- any domains using the Reserved Instance offering.
    ReservedInstance -> Maybe [RecurringCharge]
recurringCharges :: Prelude.Maybe [RecurringCharge],
    -- | The customer-specified identifier to track this reservation.
    ReservedInstance -> Maybe Text
reservationName :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the reservation.
    ReservedInstance -> Maybe Text
reservedInstanceId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the Reserved Instance offering.
    ReservedInstance -> Maybe Text
reservedInstanceOfferingId :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the reservation was purchased.
    ReservedInstance -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX,
    -- | The state of the Reserved Instance.
    ReservedInstance -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | The hourly rate at which you\'re charged for the domain using this
    -- Reserved Instance.
    ReservedInstance -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double
  }
  deriving (ReservedInstance -> ReservedInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservedInstance -> ReservedInstance -> Bool
$c/= :: ReservedInstance -> ReservedInstance -> Bool
== :: ReservedInstance -> ReservedInstance -> Bool
$c== :: ReservedInstance -> ReservedInstance -> Bool
Prelude.Eq, ReadPrec [ReservedInstance]
ReadPrec ReservedInstance
Int -> ReadS ReservedInstance
ReadS [ReservedInstance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservedInstance]
$creadListPrec :: ReadPrec [ReservedInstance]
readPrec :: ReadPrec ReservedInstance
$creadPrec :: ReadPrec ReservedInstance
readList :: ReadS [ReservedInstance]
$creadList :: ReadS [ReservedInstance]
readsPrec :: Int -> ReadS ReservedInstance
$creadsPrec :: Int -> ReadS ReservedInstance
Prelude.Read, Int -> ReservedInstance -> ShowS
[ReservedInstance] -> ShowS
ReservedInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservedInstance] -> ShowS
$cshowList :: [ReservedInstance] -> ShowS
show :: ReservedInstance -> String
$cshow :: ReservedInstance -> String
showsPrec :: Int -> ReservedInstance -> ShowS
$cshowsPrec :: Int -> ReservedInstance -> ShowS
Prelude.Show, forall x. Rep ReservedInstance x -> ReservedInstance
forall x. ReservedInstance -> Rep ReservedInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReservedInstance x -> ReservedInstance
$cfrom :: forall x. ReservedInstance -> Rep ReservedInstance x
Prelude.Generic)

-- |
-- Create a value of 'ReservedInstance' 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:
--
-- 'billingSubscriptionId', 'reservedInstance_billingSubscriptionId' - The unique identifier of the billing subscription.
--
-- 'currencyCode', 'reservedInstance_currencyCode' - The currency code for the offering.
--
-- 'duration', 'reservedInstance_duration' - The duration, in seconds, for which the OpenSearch instance is reserved.
--
-- 'fixedPrice', 'reservedInstance_fixedPrice' - The upfront fixed charge you will paid to purchase the specific Reserved
-- Instance offering.
--
-- 'instanceCount', 'reservedInstance_instanceCount' - The number of OpenSearch instances that have been reserved.
--
-- 'instanceType', 'reservedInstance_instanceType' - The OpenSearch instance type offered by theReserved Instance offering.
--
-- 'paymentOption', 'reservedInstance_paymentOption' - The payment option as defined in the Reserved Instance offering.
--
-- 'recurringCharges', 'reservedInstance_recurringCharges' - The recurring charge to your account, regardless of whether you create
-- any domains using the Reserved Instance offering.
--
-- 'reservationName', 'reservedInstance_reservationName' - The customer-specified identifier to track this reservation.
--
-- 'reservedInstanceId', 'reservedInstance_reservedInstanceId' - The unique identifier for the reservation.
--
-- 'reservedInstanceOfferingId', 'reservedInstance_reservedInstanceOfferingId' - The unique identifier of the Reserved Instance offering.
--
-- 'startTime', 'reservedInstance_startTime' - The date and time when the reservation was purchased.
--
-- 'state', 'reservedInstance_state' - The state of the Reserved Instance.
--
-- 'usagePrice', 'reservedInstance_usagePrice' - The hourly rate at which you\'re charged for the domain using this
-- Reserved Instance.
newReservedInstance ::
  ReservedInstance
newReservedInstance :: ReservedInstance
newReservedInstance =
  ReservedInstance'
    { $sel:billingSubscriptionId:ReservedInstance' :: Maybe Integer
billingSubscriptionId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:currencyCode:ReservedInstance' :: Maybe Text
currencyCode = forall a. Maybe a
Prelude.Nothing,
      $sel:duration:ReservedInstance' :: Maybe Int
duration = forall a. Maybe a
Prelude.Nothing,
      $sel:fixedPrice:ReservedInstance' :: Maybe Double
fixedPrice = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceCount:ReservedInstance' :: Maybe Int
instanceCount = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:ReservedInstance' :: Maybe OpenSearchPartitionInstanceType
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:paymentOption:ReservedInstance' :: Maybe ReservedInstancePaymentOption
paymentOption = forall a. Maybe a
Prelude.Nothing,
      $sel:recurringCharges:ReservedInstance' :: Maybe [RecurringCharge]
recurringCharges = forall a. Maybe a
Prelude.Nothing,
      $sel:reservationName:ReservedInstance' :: Maybe Text
reservationName = forall a. Maybe a
Prelude.Nothing,
      $sel:reservedInstanceId:ReservedInstance' :: Maybe Text
reservedInstanceId = forall a. Maybe a
Prelude.Nothing,
      $sel:reservedInstanceOfferingId:ReservedInstance' :: Maybe Text
reservedInstanceOfferingId = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:ReservedInstance' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:state:ReservedInstance' :: Maybe Text
state = forall a. Maybe a
Prelude.Nothing,
      $sel:usagePrice:ReservedInstance' :: Maybe Double
usagePrice = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier of the billing subscription.
reservedInstance_billingSubscriptionId :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.Integer)
reservedInstance_billingSubscriptionId :: Lens' ReservedInstance (Maybe Integer)
reservedInstance_billingSubscriptionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe Integer
billingSubscriptionId :: Maybe Integer
$sel:billingSubscriptionId:ReservedInstance' :: ReservedInstance -> Maybe Integer
billingSubscriptionId} -> Maybe Integer
billingSubscriptionId) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe Integer
a -> ReservedInstance
s {$sel:billingSubscriptionId:ReservedInstance' :: Maybe Integer
billingSubscriptionId = Maybe Integer
a} :: ReservedInstance)

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

-- | The duration, in seconds, for which the OpenSearch instance is reserved.
reservedInstance_duration :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.Int)
reservedInstance_duration :: Lens' ReservedInstance (Maybe Int)
reservedInstance_duration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe Int
duration :: Maybe Int
$sel:duration:ReservedInstance' :: ReservedInstance -> Maybe Int
duration} -> Maybe Int
duration) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe Int
a -> ReservedInstance
s {$sel:duration:ReservedInstance' :: Maybe Int
duration = Maybe Int
a} :: ReservedInstance)

-- | The upfront fixed charge you will paid to purchase the specific Reserved
-- Instance offering.
reservedInstance_fixedPrice :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.Double)
reservedInstance_fixedPrice :: Lens' ReservedInstance (Maybe Double)
reservedInstance_fixedPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe Double
fixedPrice :: Maybe Double
$sel:fixedPrice:ReservedInstance' :: ReservedInstance -> Maybe Double
fixedPrice} -> Maybe Double
fixedPrice) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe Double
a -> ReservedInstance
s {$sel:fixedPrice:ReservedInstance' :: Maybe Double
fixedPrice = Maybe Double
a} :: ReservedInstance)

-- | The number of OpenSearch instances that have been reserved.
reservedInstance_instanceCount :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.Int)
reservedInstance_instanceCount :: Lens' ReservedInstance (Maybe Int)
reservedInstance_instanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:ReservedInstance' :: ReservedInstance -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe Int
a -> ReservedInstance
s {$sel:instanceCount:ReservedInstance' :: Maybe Int
instanceCount = Maybe Int
a} :: ReservedInstance)

-- | The OpenSearch instance type offered by theReserved Instance offering.
reservedInstance_instanceType :: Lens.Lens' ReservedInstance (Prelude.Maybe OpenSearchPartitionInstanceType)
reservedInstance_instanceType :: Lens' ReservedInstance (Maybe OpenSearchPartitionInstanceType)
reservedInstance_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe OpenSearchPartitionInstanceType
instanceType :: Maybe OpenSearchPartitionInstanceType
$sel:instanceType:ReservedInstance' :: ReservedInstance -> Maybe OpenSearchPartitionInstanceType
instanceType} -> Maybe OpenSearchPartitionInstanceType
instanceType) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe OpenSearchPartitionInstanceType
a -> ReservedInstance
s {$sel:instanceType:ReservedInstance' :: Maybe OpenSearchPartitionInstanceType
instanceType = Maybe OpenSearchPartitionInstanceType
a} :: ReservedInstance)

-- | The payment option as defined in the Reserved Instance offering.
reservedInstance_paymentOption :: Lens.Lens' ReservedInstance (Prelude.Maybe ReservedInstancePaymentOption)
reservedInstance_paymentOption :: Lens' ReservedInstance (Maybe ReservedInstancePaymentOption)
reservedInstance_paymentOption = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe ReservedInstancePaymentOption
paymentOption :: Maybe ReservedInstancePaymentOption
$sel:paymentOption:ReservedInstance' :: ReservedInstance -> Maybe ReservedInstancePaymentOption
paymentOption} -> Maybe ReservedInstancePaymentOption
paymentOption) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe ReservedInstancePaymentOption
a -> ReservedInstance
s {$sel:paymentOption:ReservedInstance' :: Maybe ReservedInstancePaymentOption
paymentOption = Maybe ReservedInstancePaymentOption
a} :: ReservedInstance)

-- | The recurring charge to your account, regardless of whether you create
-- any domains using the Reserved Instance offering.
reservedInstance_recurringCharges :: Lens.Lens' ReservedInstance (Prelude.Maybe [RecurringCharge])
reservedInstance_recurringCharges :: Lens' ReservedInstance (Maybe [RecurringCharge])
reservedInstance_recurringCharges = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe [RecurringCharge]
recurringCharges :: Maybe [RecurringCharge]
$sel:recurringCharges:ReservedInstance' :: ReservedInstance -> Maybe [RecurringCharge]
recurringCharges} -> Maybe [RecurringCharge]
recurringCharges) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe [RecurringCharge]
a -> ReservedInstance
s {$sel:recurringCharges:ReservedInstance' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
a} :: ReservedInstance) 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

-- | The customer-specified identifier to track this reservation.
reservedInstance_reservationName :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.Text)
reservedInstance_reservationName :: Lens' ReservedInstance (Maybe Text)
reservedInstance_reservationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe Text
reservationName :: Maybe Text
$sel:reservationName:ReservedInstance' :: ReservedInstance -> Maybe Text
reservationName} -> Maybe Text
reservationName) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe Text
a -> ReservedInstance
s {$sel:reservationName:ReservedInstance' :: Maybe Text
reservationName = Maybe Text
a} :: ReservedInstance)

-- | The unique identifier for the reservation.
reservedInstance_reservedInstanceId :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.Text)
reservedInstance_reservedInstanceId :: Lens' ReservedInstance (Maybe Text)
reservedInstance_reservedInstanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe Text
reservedInstanceId :: Maybe Text
$sel:reservedInstanceId:ReservedInstance' :: ReservedInstance -> Maybe Text
reservedInstanceId} -> Maybe Text
reservedInstanceId) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe Text
a -> ReservedInstance
s {$sel:reservedInstanceId:ReservedInstance' :: Maybe Text
reservedInstanceId = Maybe Text
a} :: ReservedInstance)

-- | The unique identifier of the Reserved Instance offering.
reservedInstance_reservedInstanceOfferingId :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.Text)
reservedInstance_reservedInstanceOfferingId :: Lens' ReservedInstance (Maybe Text)
reservedInstance_reservedInstanceOfferingId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe Text
reservedInstanceOfferingId :: Maybe Text
$sel:reservedInstanceOfferingId:ReservedInstance' :: ReservedInstance -> Maybe Text
reservedInstanceOfferingId} -> Maybe Text
reservedInstanceOfferingId) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe Text
a -> ReservedInstance
s {$sel:reservedInstanceOfferingId:ReservedInstance' :: Maybe Text
reservedInstanceOfferingId = Maybe Text
a} :: ReservedInstance)

-- | The date and time when the reservation was purchased.
reservedInstance_startTime :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.UTCTime)
reservedInstance_startTime :: Lens' ReservedInstance (Maybe UTCTime)
reservedInstance_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:ReservedInstance' :: ReservedInstance -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe POSIX
a -> ReservedInstance
s {$sel:startTime:ReservedInstance' :: Maybe POSIX
startTime = Maybe POSIX
a} :: ReservedInstance) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The state of the Reserved Instance.
reservedInstance_state :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.Text)
reservedInstance_state :: Lens' ReservedInstance (Maybe Text)
reservedInstance_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe Text
state :: Maybe Text
$sel:state:ReservedInstance' :: ReservedInstance -> Maybe Text
state} -> Maybe Text
state) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe Text
a -> ReservedInstance
s {$sel:state:ReservedInstance' :: Maybe Text
state = Maybe Text
a} :: ReservedInstance)

-- | The hourly rate at which you\'re charged for the domain using this
-- Reserved Instance.
reservedInstance_usagePrice :: Lens.Lens' ReservedInstance (Prelude.Maybe Prelude.Double)
reservedInstance_usagePrice :: Lens' ReservedInstance (Maybe Double)
reservedInstance_usagePrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstance' {Maybe Double
usagePrice :: Maybe Double
$sel:usagePrice:ReservedInstance' :: ReservedInstance -> Maybe Double
usagePrice} -> Maybe Double
usagePrice) (\s :: ReservedInstance
s@ReservedInstance' {} Maybe Double
a -> ReservedInstance
s {$sel:usagePrice:ReservedInstance' :: Maybe Double
usagePrice = Maybe Double
a} :: ReservedInstance)

instance Data.FromJSON ReservedInstance where
  parseJSON :: Value -> Parser ReservedInstance
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ReservedInstance"
      ( \Object
x ->
          Maybe Integer
-> Maybe Text
-> Maybe Int
-> Maybe Double
-> Maybe Int
-> Maybe OpenSearchPartitionInstanceType
-> Maybe ReservedInstancePaymentOption
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Double
-> ReservedInstance
ReservedInstance'
            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
"BillingSubscriptionId")
            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
"CurrencyCode")
            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
"Duration")
            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
"FixedPrice")
            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
"InstanceCount")
            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
"PaymentOption")
            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
"RecurringCharges"
                            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
"ReservationName")
            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
"ReservedInstanceId")
            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
"ReservedInstanceOfferingId")
            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
"StartTime")
            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
"State")
            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
"UsagePrice")
      )

instance Prelude.Hashable ReservedInstance where
  hashWithSalt :: Int -> ReservedInstance -> Int
hashWithSalt Int
_salt ReservedInstance' {Maybe Double
Maybe Int
Maybe Integer
Maybe [RecurringCharge]
Maybe Text
Maybe POSIX
Maybe OpenSearchPartitionInstanceType
Maybe ReservedInstancePaymentOption
usagePrice :: Maybe Double
state :: Maybe Text
startTime :: Maybe POSIX
reservedInstanceOfferingId :: Maybe Text
reservedInstanceId :: Maybe Text
reservationName :: Maybe Text
recurringCharges :: Maybe [RecurringCharge]
paymentOption :: Maybe ReservedInstancePaymentOption
instanceType :: Maybe OpenSearchPartitionInstanceType
instanceCount :: Maybe Int
fixedPrice :: Maybe Double
duration :: Maybe Int
currencyCode :: Maybe Text
billingSubscriptionId :: Maybe Integer
$sel:usagePrice:ReservedInstance' :: ReservedInstance -> Maybe Double
$sel:state:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:startTime:ReservedInstance' :: ReservedInstance -> Maybe POSIX
$sel:reservedInstanceOfferingId:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:reservedInstanceId:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:reservationName:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:recurringCharges:ReservedInstance' :: ReservedInstance -> Maybe [RecurringCharge]
$sel:paymentOption:ReservedInstance' :: ReservedInstance -> Maybe ReservedInstancePaymentOption
$sel:instanceType:ReservedInstance' :: ReservedInstance -> Maybe OpenSearchPartitionInstanceType
$sel:instanceCount:ReservedInstance' :: ReservedInstance -> Maybe Int
$sel:fixedPrice:ReservedInstance' :: ReservedInstance -> Maybe Double
$sel:duration:ReservedInstance' :: ReservedInstance -> Maybe Int
$sel:currencyCode:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:billingSubscriptionId:ReservedInstance' :: ReservedInstance -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
billingSubscriptionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
currencyCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
duration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
fixedPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
instanceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OpenSearchPartitionInstanceType
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReservedInstancePaymentOption
paymentOption
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RecurringCharge]
recurringCharges
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reservationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reservedInstanceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reservedInstanceOfferingId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
usagePrice

instance Prelude.NFData ReservedInstance where
  rnf :: ReservedInstance -> ()
rnf ReservedInstance' {Maybe Double
Maybe Int
Maybe Integer
Maybe [RecurringCharge]
Maybe Text
Maybe POSIX
Maybe OpenSearchPartitionInstanceType
Maybe ReservedInstancePaymentOption
usagePrice :: Maybe Double
state :: Maybe Text
startTime :: Maybe POSIX
reservedInstanceOfferingId :: Maybe Text
reservedInstanceId :: Maybe Text
reservationName :: Maybe Text
recurringCharges :: Maybe [RecurringCharge]
paymentOption :: Maybe ReservedInstancePaymentOption
instanceType :: Maybe OpenSearchPartitionInstanceType
instanceCount :: Maybe Int
fixedPrice :: Maybe Double
duration :: Maybe Int
currencyCode :: Maybe Text
billingSubscriptionId :: Maybe Integer
$sel:usagePrice:ReservedInstance' :: ReservedInstance -> Maybe Double
$sel:state:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:startTime:ReservedInstance' :: ReservedInstance -> Maybe POSIX
$sel:reservedInstanceOfferingId:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:reservedInstanceId:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:reservationName:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:recurringCharges:ReservedInstance' :: ReservedInstance -> Maybe [RecurringCharge]
$sel:paymentOption:ReservedInstance' :: ReservedInstance -> Maybe ReservedInstancePaymentOption
$sel:instanceType:ReservedInstance' :: ReservedInstance -> Maybe OpenSearchPartitionInstanceType
$sel:instanceCount:ReservedInstance' :: ReservedInstance -> Maybe Int
$sel:fixedPrice:ReservedInstance' :: ReservedInstance -> Maybe Double
$sel:duration:ReservedInstance' :: ReservedInstance -> Maybe Int
$sel:currencyCode:ReservedInstance' :: ReservedInstance -> Maybe Text
$sel:billingSubscriptionId:ReservedInstance' :: ReservedInstance -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
billingSubscriptionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
currencyCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
duration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
fixedPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
instanceCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OpenSearchPartitionInstanceType
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReservedInstancePaymentOption
paymentOption
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RecurringCharge]
recurringCharges
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reservationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reservedInstanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reservedInstanceOfferingId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
usagePrice