{-# 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.ElasticSearch.Types.ReservedElasticsearchInstanceOffering
-- 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.ElasticSearch.Types.ReservedElasticsearchInstanceOffering where

import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.Types.ESPartitionInstanceType
import Amazonka.ElasticSearch.Types.RecurringCharge
import Amazonka.ElasticSearch.Types.ReservedElasticsearchInstancePaymentOption
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'ReservedElasticsearchInstanceOffering' 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', 'reservedElasticsearchInstanceOffering_currencyCode' - The currency code for the reserved Elasticsearch instance offering.
--
-- 'reservedElasticsearchInstanceOfferingId', 'reservedElasticsearchInstanceOffering_reservedElasticsearchInstanceOfferingId' - The Elasticsearch reserved instance offering identifier.
--
-- 'elasticsearchInstanceType', 'reservedElasticsearchInstanceOffering_elasticsearchInstanceType' - The Elasticsearch instance type offered by the reserved instance
-- offering.
--
-- 'recurringCharges', 'reservedElasticsearchInstanceOffering_recurringCharges' - The charge to your account regardless of whether you are creating any
-- domains using the instance offering.
--
-- 'usagePrice', 'reservedElasticsearchInstanceOffering_usagePrice' - The rate you are charged for each hour the domain that is using the
-- offering is running.
--
-- 'fixedPrice', 'reservedElasticsearchInstanceOffering_fixedPrice' - The upfront fixed charge you will pay to purchase the specific reserved
-- Elasticsearch instance offering.
--
-- 'duration', 'reservedElasticsearchInstanceOffering_duration' - The duration, in seconds, for which the offering will reserve the
-- Elasticsearch instance.
--
-- 'paymentOption', 'reservedElasticsearchInstanceOffering_paymentOption' - Payment option for the reserved Elasticsearch instance offering
newReservedElasticsearchInstanceOffering ::
  ReservedElasticsearchInstanceOffering
newReservedElasticsearchInstanceOffering :: ReservedElasticsearchInstanceOffering
newReservedElasticsearchInstanceOffering =
  ReservedElasticsearchInstanceOffering' :: Maybe Text
-> Maybe Text
-> Maybe ESPartitionInstanceType
-> Maybe [RecurringCharge]
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe ReservedElasticsearchInstancePaymentOption
-> ReservedElasticsearchInstanceOffering
ReservedElasticsearchInstanceOffering'
    { $sel:currencyCode:ReservedElasticsearchInstanceOffering' :: Maybe Text
currencyCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedElasticsearchInstanceOfferingId:ReservedElasticsearchInstanceOffering' :: Maybe Text
reservedElasticsearchInstanceOfferingId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:elasticsearchInstanceType:ReservedElasticsearchInstanceOffering' :: Maybe ESPartitionInstanceType
elasticsearchInstanceType =
        Maybe ESPartitionInstanceType
forall a. Maybe a
Prelude.Nothing,
      $sel:recurringCharges:ReservedElasticsearchInstanceOffering' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
forall a. Maybe a
Prelude.Nothing,
      $sel:usagePrice:ReservedElasticsearchInstanceOffering' :: Maybe Double
usagePrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:fixedPrice:ReservedElasticsearchInstanceOffering' :: Maybe Double
fixedPrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:ReservedElasticsearchInstanceOffering' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:paymentOption:ReservedElasticsearchInstanceOffering' :: Maybe ReservedElasticsearchInstancePaymentOption
paymentOption = Maybe ReservedElasticsearchInstancePaymentOption
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The Elasticsearch reserved instance offering identifier.
reservedElasticsearchInstanceOffering_reservedElasticsearchInstanceOfferingId :: Lens.Lens' ReservedElasticsearchInstanceOffering (Prelude.Maybe Prelude.Text)
reservedElasticsearchInstanceOffering_reservedElasticsearchInstanceOfferingId :: (Maybe Text -> f (Maybe Text))
-> ReservedElasticsearchInstanceOffering
-> f ReservedElasticsearchInstanceOffering
reservedElasticsearchInstanceOffering_reservedElasticsearchInstanceOfferingId = (ReservedElasticsearchInstanceOffering -> Maybe Text)
-> (ReservedElasticsearchInstanceOffering
    -> Maybe Text -> ReservedElasticsearchInstanceOffering)
-> Lens
     ReservedElasticsearchInstanceOffering
     ReservedElasticsearchInstanceOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedElasticsearchInstanceOffering' {Maybe Text
reservedElasticsearchInstanceOfferingId :: Maybe Text
$sel:reservedElasticsearchInstanceOfferingId:ReservedElasticsearchInstanceOffering' :: ReservedElasticsearchInstanceOffering -> Maybe Text
reservedElasticsearchInstanceOfferingId} -> Maybe Text
reservedElasticsearchInstanceOfferingId) (\s :: ReservedElasticsearchInstanceOffering
s@ReservedElasticsearchInstanceOffering' {} Maybe Text
a -> ReservedElasticsearchInstanceOffering
s {$sel:reservedElasticsearchInstanceOfferingId:ReservedElasticsearchInstanceOffering' :: Maybe Text
reservedElasticsearchInstanceOfferingId = Maybe Text
a} :: ReservedElasticsearchInstanceOffering)

-- | The Elasticsearch instance type offered by the reserved instance
-- offering.
reservedElasticsearchInstanceOffering_elasticsearchInstanceType :: Lens.Lens' ReservedElasticsearchInstanceOffering (Prelude.Maybe ESPartitionInstanceType)
reservedElasticsearchInstanceOffering_elasticsearchInstanceType :: (Maybe ESPartitionInstanceType
 -> f (Maybe ESPartitionInstanceType))
-> ReservedElasticsearchInstanceOffering
-> f ReservedElasticsearchInstanceOffering
reservedElasticsearchInstanceOffering_elasticsearchInstanceType = (ReservedElasticsearchInstanceOffering
 -> Maybe ESPartitionInstanceType)
-> (ReservedElasticsearchInstanceOffering
    -> Maybe ESPartitionInstanceType
    -> ReservedElasticsearchInstanceOffering)
-> Lens
     ReservedElasticsearchInstanceOffering
     ReservedElasticsearchInstanceOffering
     (Maybe ESPartitionInstanceType)
     (Maybe ESPartitionInstanceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedElasticsearchInstanceOffering' {Maybe ESPartitionInstanceType
elasticsearchInstanceType :: Maybe ESPartitionInstanceType
$sel:elasticsearchInstanceType:ReservedElasticsearchInstanceOffering' :: ReservedElasticsearchInstanceOffering
-> Maybe ESPartitionInstanceType
elasticsearchInstanceType} -> Maybe ESPartitionInstanceType
elasticsearchInstanceType) (\s :: ReservedElasticsearchInstanceOffering
s@ReservedElasticsearchInstanceOffering' {} Maybe ESPartitionInstanceType
a -> ReservedElasticsearchInstanceOffering
s {$sel:elasticsearchInstanceType:ReservedElasticsearchInstanceOffering' :: Maybe ESPartitionInstanceType
elasticsearchInstanceType = Maybe ESPartitionInstanceType
a} :: ReservedElasticsearchInstanceOffering)

-- | The charge to your account regardless of whether you are creating any
-- domains using the instance offering.
reservedElasticsearchInstanceOffering_recurringCharges :: Lens.Lens' ReservedElasticsearchInstanceOffering (Prelude.Maybe [RecurringCharge])
reservedElasticsearchInstanceOffering_recurringCharges :: (Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
-> ReservedElasticsearchInstanceOffering
-> f ReservedElasticsearchInstanceOffering
reservedElasticsearchInstanceOffering_recurringCharges = (ReservedElasticsearchInstanceOffering -> Maybe [RecurringCharge])
-> (ReservedElasticsearchInstanceOffering
    -> Maybe [RecurringCharge]
    -> ReservedElasticsearchInstanceOffering)
-> Lens
     ReservedElasticsearchInstanceOffering
     ReservedElasticsearchInstanceOffering
     (Maybe [RecurringCharge])
     (Maybe [RecurringCharge])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedElasticsearchInstanceOffering' {Maybe [RecurringCharge]
recurringCharges :: Maybe [RecurringCharge]
$sel:recurringCharges:ReservedElasticsearchInstanceOffering' :: ReservedElasticsearchInstanceOffering -> Maybe [RecurringCharge]
recurringCharges} -> Maybe [RecurringCharge]
recurringCharges) (\s :: ReservedElasticsearchInstanceOffering
s@ReservedElasticsearchInstanceOffering' {} Maybe [RecurringCharge]
a -> ReservedElasticsearchInstanceOffering
s {$sel:recurringCharges:ReservedElasticsearchInstanceOffering' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
a} :: ReservedElasticsearchInstanceOffering) ((Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
 -> ReservedElasticsearchInstanceOffering
 -> f ReservedElasticsearchInstanceOffering)
-> ((Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
    -> Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
-> (Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
-> ReservedElasticsearchInstanceOffering
-> f ReservedElasticsearchInstanceOffering
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.
reservedElasticsearchInstanceOffering_usagePrice :: Lens.Lens' ReservedElasticsearchInstanceOffering (Prelude.Maybe Prelude.Double)
reservedElasticsearchInstanceOffering_usagePrice :: (Maybe Double -> f (Maybe Double))
-> ReservedElasticsearchInstanceOffering
-> f ReservedElasticsearchInstanceOffering
reservedElasticsearchInstanceOffering_usagePrice = (ReservedElasticsearchInstanceOffering -> Maybe Double)
-> (ReservedElasticsearchInstanceOffering
    -> Maybe Double -> ReservedElasticsearchInstanceOffering)
-> Lens
     ReservedElasticsearchInstanceOffering
     ReservedElasticsearchInstanceOffering
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedElasticsearchInstanceOffering' {Maybe Double
usagePrice :: Maybe Double
$sel:usagePrice:ReservedElasticsearchInstanceOffering' :: ReservedElasticsearchInstanceOffering -> Maybe Double
usagePrice} -> Maybe Double
usagePrice) (\s :: ReservedElasticsearchInstanceOffering
s@ReservedElasticsearchInstanceOffering' {} Maybe Double
a -> ReservedElasticsearchInstanceOffering
s {$sel:usagePrice:ReservedElasticsearchInstanceOffering' :: Maybe Double
usagePrice = Maybe Double
a} :: ReservedElasticsearchInstanceOffering)

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

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

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

instance
  Core.FromJSON
    ReservedElasticsearchInstanceOffering
  where
  parseJSON :: Value -> Parser ReservedElasticsearchInstanceOffering
parseJSON =
    String
-> (Object -> Parser ReservedElasticsearchInstanceOffering)
-> Value
-> Parser ReservedElasticsearchInstanceOffering
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReservedElasticsearchInstanceOffering"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ESPartitionInstanceType
-> Maybe [RecurringCharge]
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe ReservedElasticsearchInstancePaymentOption
-> ReservedElasticsearchInstanceOffering
ReservedElasticsearchInstanceOffering'
            (Maybe Text
 -> Maybe Text
 -> Maybe ESPartitionInstanceType
 -> Maybe [RecurringCharge]
 -> Maybe Double
 -> Maybe Double
 -> Maybe Int
 -> Maybe ReservedElasticsearchInstancePaymentOption
 -> ReservedElasticsearchInstanceOffering)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ESPartitionInstanceType
      -> Maybe [RecurringCharge]
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe ReservedElasticsearchInstancePaymentOption
      -> ReservedElasticsearchInstanceOffering)
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 Text
   -> Maybe ESPartitionInstanceType
   -> Maybe [RecurringCharge]
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe ReservedElasticsearchInstancePaymentOption
   -> ReservedElasticsearchInstanceOffering)
-> Parser (Maybe Text)
-> Parser
     (Maybe ESPartitionInstanceType
      -> Maybe [RecurringCharge]
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe ReservedElasticsearchInstancePaymentOption
      -> ReservedElasticsearchInstanceOffering)
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
"ReservedElasticsearchInstanceOfferingId"
                        )
            Parser
  (Maybe ESPartitionInstanceType
   -> Maybe [RecurringCharge]
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe ReservedElasticsearchInstancePaymentOption
   -> ReservedElasticsearchInstanceOffering)
-> Parser (Maybe ESPartitionInstanceType)
-> Parser
     (Maybe [RecurringCharge]
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe ReservedElasticsearchInstancePaymentOption
      -> ReservedElasticsearchInstanceOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ESPartitionInstanceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ElasticsearchInstanceType")
            Parser
  (Maybe [RecurringCharge]
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe ReservedElasticsearchInstancePaymentOption
   -> ReservedElasticsearchInstanceOffering)
-> Parser (Maybe [RecurringCharge])
-> Parser
     (Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe ReservedElasticsearchInstancePaymentOption
      -> ReservedElasticsearchInstanceOffering)
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 Double
   -> Maybe Int
   -> Maybe ReservedElasticsearchInstancePaymentOption
   -> ReservedElasticsearchInstanceOffering)
-> Parser (Maybe Double)
-> Parser
     (Maybe Double
      -> Maybe Int
      -> Maybe ReservedElasticsearchInstancePaymentOption
      -> ReservedElasticsearchInstanceOffering)
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 Double
   -> Maybe Int
   -> Maybe ReservedElasticsearchInstancePaymentOption
   -> ReservedElasticsearchInstanceOffering)
-> Parser (Maybe Double)
-> Parser
     (Maybe Int
      -> Maybe ReservedElasticsearchInstancePaymentOption
      -> ReservedElasticsearchInstanceOffering)
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 ReservedElasticsearchInstancePaymentOption
   -> ReservedElasticsearchInstanceOffering)
-> Parser (Maybe Int)
-> Parser
     (Maybe ReservedElasticsearchInstancePaymentOption
      -> ReservedElasticsearchInstanceOffering)
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 ReservedElasticsearchInstancePaymentOption
   -> ReservedElasticsearchInstanceOffering)
-> Parser (Maybe ReservedElasticsearchInstancePaymentOption)
-> Parser ReservedElasticsearchInstanceOffering
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe ReservedElasticsearchInstancePaymentOption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PaymentOption")
      )

instance
  Prelude.Hashable
    ReservedElasticsearchInstanceOffering

instance
  Prelude.NFData
    ReservedElasticsearchInstanceOffering