{-# 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.RDS.Types.ReservedDBInstancesOffering
-- 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.RDS.Types.ReservedDBInstancesOffering where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types.RecurringCharge

-- | This data type is used as a response element in the
-- @DescribeReservedDBInstancesOfferings@ action.
--
-- /See:/ 'newReservedDBInstancesOffering' smart constructor.
data ReservedDBInstancesOffering = ReservedDBInstancesOffering'
  { -- | The currency code for the reserved DB instance offering.
    ReservedDBInstancesOffering -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | The database engine used by the offering.
    ReservedDBInstancesOffering -> Maybe Text
productDescription :: Prelude.Maybe Prelude.Text,
    -- | The DB instance class for the reserved DB instance.
    ReservedDBInstancesOffering -> Maybe Text
dbInstanceClass :: Prelude.Maybe Prelude.Text,
    -- | Indicates if the offering applies to Multi-AZ deployments.
    ReservedDBInstancesOffering -> Maybe Bool
multiAZ :: Prelude.Maybe Prelude.Bool,
    -- | The offering identifier.
    ReservedDBInstancesOffering -> Maybe Text
reservedDBInstancesOfferingId :: Prelude.Maybe Prelude.Text,
    -- | The recurring price charged to run this reserved DB instance.
    ReservedDBInstancesOffering -> Maybe [RecurringCharge]
recurringCharges :: Prelude.Maybe [RecurringCharge],
    -- | The offering type.
    ReservedDBInstancesOffering -> Maybe Text
offeringType :: Prelude.Maybe Prelude.Text,
    -- | The hourly price charged for this offering.
    ReservedDBInstancesOffering -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double,
    -- | The fixed price charged for this offering.
    ReservedDBInstancesOffering -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | The duration of the offering in seconds.
    ReservedDBInstancesOffering -> Maybe Int
duration :: Prelude.Maybe Prelude.Int
  }
  deriving (ReservedDBInstancesOffering -> ReservedDBInstancesOffering -> Bool
(ReservedDBInstancesOffering
 -> ReservedDBInstancesOffering -> Bool)
-> (ReservedDBInstancesOffering
    -> ReservedDBInstancesOffering -> Bool)
-> Eq ReservedDBInstancesOffering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservedDBInstancesOffering -> ReservedDBInstancesOffering -> Bool
$c/= :: ReservedDBInstancesOffering -> ReservedDBInstancesOffering -> Bool
== :: ReservedDBInstancesOffering -> ReservedDBInstancesOffering -> Bool
$c== :: ReservedDBInstancesOffering -> ReservedDBInstancesOffering -> Bool
Prelude.Eq, ReadPrec [ReservedDBInstancesOffering]
ReadPrec ReservedDBInstancesOffering
Int -> ReadS ReservedDBInstancesOffering
ReadS [ReservedDBInstancesOffering]
(Int -> ReadS ReservedDBInstancesOffering)
-> ReadS [ReservedDBInstancesOffering]
-> ReadPrec ReservedDBInstancesOffering
-> ReadPrec [ReservedDBInstancesOffering]
-> Read ReservedDBInstancesOffering
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservedDBInstancesOffering]
$creadListPrec :: ReadPrec [ReservedDBInstancesOffering]
readPrec :: ReadPrec ReservedDBInstancesOffering
$creadPrec :: ReadPrec ReservedDBInstancesOffering
readList :: ReadS [ReservedDBInstancesOffering]
$creadList :: ReadS [ReservedDBInstancesOffering]
readsPrec :: Int -> ReadS ReservedDBInstancesOffering
$creadsPrec :: Int -> ReadS ReservedDBInstancesOffering
Prelude.Read, Int -> ReservedDBInstancesOffering -> ShowS
[ReservedDBInstancesOffering] -> ShowS
ReservedDBInstancesOffering -> String
(Int -> ReservedDBInstancesOffering -> ShowS)
-> (ReservedDBInstancesOffering -> String)
-> ([ReservedDBInstancesOffering] -> ShowS)
-> Show ReservedDBInstancesOffering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservedDBInstancesOffering] -> ShowS
$cshowList :: [ReservedDBInstancesOffering] -> ShowS
show :: ReservedDBInstancesOffering -> String
$cshow :: ReservedDBInstancesOffering -> String
showsPrec :: Int -> ReservedDBInstancesOffering -> ShowS
$cshowsPrec :: Int -> ReservedDBInstancesOffering -> ShowS
Prelude.Show, (forall x.
 ReservedDBInstancesOffering -> Rep ReservedDBInstancesOffering x)
-> (forall x.
    Rep ReservedDBInstancesOffering x -> ReservedDBInstancesOffering)
-> Generic ReservedDBInstancesOffering
forall x.
Rep ReservedDBInstancesOffering x -> ReservedDBInstancesOffering
forall x.
ReservedDBInstancesOffering -> Rep ReservedDBInstancesOffering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReservedDBInstancesOffering x -> ReservedDBInstancesOffering
$cfrom :: forall x.
ReservedDBInstancesOffering -> Rep ReservedDBInstancesOffering x
Prelude.Generic)

-- |
-- Create a value of 'ReservedDBInstancesOffering' 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', 'reservedDBInstancesOffering_currencyCode' - The currency code for the reserved DB instance offering.
--
-- 'productDescription', 'reservedDBInstancesOffering_productDescription' - The database engine used by the offering.
--
-- 'dbInstanceClass', 'reservedDBInstancesOffering_dbInstanceClass' - The DB instance class for the reserved DB instance.
--
-- 'multiAZ', 'reservedDBInstancesOffering_multiAZ' - Indicates if the offering applies to Multi-AZ deployments.
--
-- 'reservedDBInstancesOfferingId', 'reservedDBInstancesOffering_reservedDBInstancesOfferingId' - The offering identifier.
--
-- 'recurringCharges', 'reservedDBInstancesOffering_recurringCharges' - The recurring price charged to run this reserved DB instance.
--
-- 'offeringType', 'reservedDBInstancesOffering_offeringType' - The offering type.
--
-- 'usagePrice', 'reservedDBInstancesOffering_usagePrice' - The hourly price charged for this offering.
--
-- 'fixedPrice', 'reservedDBInstancesOffering_fixedPrice' - The fixed price charged for this offering.
--
-- 'duration', 'reservedDBInstancesOffering_duration' - The duration of the offering in seconds.
newReservedDBInstancesOffering ::
  ReservedDBInstancesOffering
newReservedDBInstancesOffering :: ReservedDBInstancesOffering
newReservedDBInstancesOffering =
  ReservedDBInstancesOffering' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> ReservedDBInstancesOffering
ReservedDBInstancesOffering'
    { $sel:currencyCode:ReservedDBInstancesOffering' :: Maybe Text
currencyCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:productDescription:ReservedDBInstancesOffering' :: Maybe Text
productDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbInstanceClass:ReservedDBInstancesOffering' :: Maybe Text
dbInstanceClass = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:multiAZ:ReservedDBInstancesOffering' :: Maybe Bool
multiAZ = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedDBInstancesOfferingId:ReservedDBInstancesOffering' :: Maybe Text
reservedDBInstancesOfferingId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recurringCharges:ReservedDBInstancesOffering' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringType:ReservedDBInstancesOffering' :: Maybe Text
offeringType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usagePrice:ReservedDBInstancesOffering' :: Maybe Double
usagePrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:fixedPrice:ReservedDBInstancesOffering' :: Maybe Double
fixedPrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:ReservedDBInstancesOffering' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The database engine used by the offering.
reservedDBInstancesOffering_productDescription :: Lens.Lens' ReservedDBInstancesOffering (Prelude.Maybe Prelude.Text)
reservedDBInstancesOffering_productDescription :: (Maybe Text -> f (Maybe Text))
-> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering
reservedDBInstancesOffering_productDescription = (ReservedDBInstancesOffering -> Maybe Text)
-> (ReservedDBInstancesOffering
    -> Maybe Text -> ReservedDBInstancesOffering)
-> Lens
     ReservedDBInstancesOffering
     ReservedDBInstancesOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstancesOffering' {Maybe Text
productDescription :: Maybe Text
$sel:productDescription:ReservedDBInstancesOffering' :: ReservedDBInstancesOffering -> Maybe Text
productDescription} -> Maybe Text
productDescription) (\s :: ReservedDBInstancesOffering
s@ReservedDBInstancesOffering' {} Maybe Text
a -> ReservedDBInstancesOffering
s {$sel:productDescription:ReservedDBInstancesOffering' :: Maybe Text
productDescription = Maybe Text
a} :: ReservedDBInstancesOffering)

-- | The DB instance class for the reserved DB instance.
reservedDBInstancesOffering_dbInstanceClass :: Lens.Lens' ReservedDBInstancesOffering (Prelude.Maybe Prelude.Text)
reservedDBInstancesOffering_dbInstanceClass :: (Maybe Text -> f (Maybe Text))
-> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering
reservedDBInstancesOffering_dbInstanceClass = (ReservedDBInstancesOffering -> Maybe Text)
-> (ReservedDBInstancesOffering
    -> Maybe Text -> ReservedDBInstancesOffering)
-> Lens
     ReservedDBInstancesOffering
     ReservedDBInstancesOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstancesOffering' {Maybe Text
dbInstanceClass :: Maybe Text
$sel:dbInstanceClass:ReservedDBInstancesOffering' :: ReservedDBInstancesOffering -> Maybe Text
dbInstanceClass} -> Maybe Text
dbInstanceClass) (\s :: ReservedDBInstancesOffering
s@ReservedDBInstancesOffering' {} Maybe Text
a -> ReservedDBInstancesOffering
s {$sel:dbInstanceClass:ReservedDBInstancesOffering' :: Maybe Text
dbInstanceClass = Maybe Text
a} :: ReservedDBInstancesOffering)

-- | Indicates if the offering applies to Multi-AZ deployments.
reservedDBInstancesOffering_multiAZ :: Lens.Lens' ReservedDBInstancesOffering (Prelude.Maybe Prelude.Bool)
reservedDBInstancesOffering_multiAZ :: (Maybe Bool -> f (Maybe Bool))
-> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering
reservedDBInstancesOffering_multiAZ = (ReservedDBInstancesOffering -> Maybe Bool)
-> (ReservedDBInstancesOffering
    -> Maybe Bool -> ReservedDBInstancesOffering)
-> Lens
     ReservedDBInstancesOffering
     ReservedDBInstancesOffering
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstancesOffering' {Maybe Bool
multiAZ :: Maybe Bool
$sel:multiAZ:ReservedDBInstancesOffering' :: ReservedDBInstancesOffering -> Maybe Bool
multiAZ} -> Maybe Bool
multiAZ) (\s :: ReservedDBInstancesOffering
s@ReservedDBInstancesOffering' {} Maybe Bool
a -> ReservedDBInstancesOffering
s {$sel:multiAZ:ReservedDBInstancesOffering' :: Maybe Bool
multiAZ = Maybe Bool
a} :: ReservedDBInstancesOffering)

-- | The offering identifier.
reservedDBInstancesOffering_reservedDBInstancesOfferingId :: Lens.Lens' ReservedDBInstancesOffering (Prelude.Maybe Prelude.Text)
reservedDBInstancesOffering_reservedDBInstancesOfferingId :: (Maybe Text -> f (Maybe Text))
-> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering
reservedDBInstancesOffering_reservedDBInstancesOfferingId = (ReservedDBInstancesOffering -> Maybe Text)
-> (ReservedDBInstancesOffering
    -> Maybe Text -> ReservedDBInstancesOffering)
-> Lens
     ReservedDBInstancesOffering
     ReservedDBInstancesOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstancesOffering' {Maybe Text
reservedDBInstancesOfferingId :: Maybe Text
$sel:reservedDBInstancesOfferingId:ReservedDBInstancesOffering' :: ReservedDBInstancesOffering -> Maybe Text
reservedDBInstancesOfferingId} -> Maybe Text
reservedDBInstancesOfferingId) (\s :: ReservedDBInstancesOffering
s@ReservedDBInstancesOffering' {} Maybe Text
a -> ReservedDBInstancesOffering
s {$sel:reservedDBInstancesOfferingId:ReservedDBInstancesOffering' :: Maybe Text
reservedDBInstancesOfferingId = Maybe Text
a} :: ReservedDBInstancesOffering)

-- | The recurring price charged to run this reserved DB instance.
reservedDBInstancesOffering_recurringCharges :: Lens.Lens' ReservedDBInstancesOffering (Prelude.Maybe [RecurringCharge])
reservedDBInstancesOffering_recurringCharges :: (Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
-> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering
reservedDBInstancesOffering_recurringCharges = (ReservedDBInstancesOffering -> Maybe [RecurringCharge])
-> (ReservedDBInstancesOffering
    -> Maybe [RecurringCharge] -> ReservedDBInstancesOffering)
-> Lens
     ReservedDBInstancesOffering
     ReservedDBInstancesOffering
     (Maybe [RecurringCharge])
     (Maybe [RecurringCharge])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstancesOffering' {Maybe [RecurringCharge]
recurringCharges :: Maybe [RecurringCharge]
$sel:recurringCharges:ReservedDBInstancesOffering' :: ReservedDBInstancesOffering -> Maybe [RecurringCharge]
recurringCharges} -> Maybe [RecurringCharge]
recurringCharges) (\s :: ReservedDBInstancesOffering
s@ReservedDBInstancesOffering' {} Maybe [RecurringCharge]
a -> ReservedDBInstancesOffering
s {$sel:recurringCharges:ReservedDBInstancesOffering' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
a} :: ReservedDBInstancesOffering) ((Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
 -> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering)
-> ((Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
    -> Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
-> (Maybe [RecurringCharge] -> f (Maybe [RecurringCharge]))
-> ReservedDBInstancesOffering
-> f ReservedDBInstancesOffering
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 offering type.
reservedDBInstancesOffering_offeringType :: Lens.Lens' ReservedDBInstancesOffering (Prelude.Maybe Prelude.Text)
reservedDBInstancesOffering_offeringType :: (Maybe Text -> f (Maybe Text))
-> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering
reservedDBInstancesOffering_offeringType = (ReservedDBInstancesOffering -> Maybe Text)
-> (ReservedDBInstancesOffering
    -> Maybe Text -> ReservedDBInstancesOffering)
-> Lens
     ReservedDBInstancesOffering
     ReservedDBInstancesOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstancesOffering' {Maybe Text
offeringType :: Maybe Text
$sel:offeringType:ReservedDBInstancesOffering' :: ReservedDBInstancesOffering -> Maybe Text
offeringType} -> Maybe Text
offeringType) (\s :: ReservedDBInstancesOffering
s@ReservedDBInstancesOffering' {} Maybe Text
a -> ReservedDBInstancesOffering
s {$sel:offeringType:ReservedDBInstancesOffering' :: Maybe Text
offeringType = Maybe Text
a} :: ReservedDBInstancesOffering)

-- | The hourly price charged for this offering.
reservedDBInstancesOffering_usagePrice :: Lens.Lens' ReservedDBInstancesOffering (Prelude.Maybe Prelude.Double)
reservedDBInstancesOffering_usagePrice :: (Maybe Double -> f (Maybe Double))
-> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering
reservedDBInstancesOffering_usagePrice = (ReservedDBInstancesOffering -> Maybe Double)
-> (ReservedDBInstancesOffering
    -> Maybe Double -> ReservedDBInstancesOffering)
-> Lens
     ReservedDBInstancesOffering
     ReservedDBInstancesOffering
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstancesOffering' {Maybe Double
usagePrice :: Maybe Double
$sel:usagePrice:ReservedDBInstancesOffering' :: ReservedDBInstancesOffering -> Maybe Double
usagePrice} -> Maybe Double
usagePrice) (\s :: ReservedDBInstancesOffering
s@ReservedDBInstancesOffering' {} Maybe Double
a -> ReservedDBInstancesOffering
s {$sel:usagePrice:ReservedDBInstancesOffering' :: Maybe Double
usagePrice = Maybe Double
a} :: ReservedDBInstancesOffering)

-- | The fixed price charged for this offering.
reservedDBInstancesOffering_fixedPrice :: Lens.Lens' ReservedDBInstancesOffering (Prelude.Maybe Prelude.Double)
reservedDBInstancesOffering_fixedPrice :: (Maybe Double -> f (Maybe Double))
-> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering
reservedDBInstancesOffering_fixedPrice = (ReservedDBInstancesOffering -> Maybe Double)
-> (ReservedDBInstancesOffering
    -> Maybe Double -> ReservedDBInstancesOffering)
-> Lens
     ReservedDBInstancesOffering
     ReservedDBInstancesOffering
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstancesOffering' {Maybe Double
fixedPrice :: Maybe Double
$sel:fixedPrice:ReservedDBInstancesOffering' :: ReservedDBInstancesOffering -> Maybe Double
fixedPrice} -> Maybe Double
fixedPrice) (\s :: ReservedDBInstancesOffering
s@ReservedDBInstancesOffering' {} Maybe Double
a -> ReservedDBInstancesOffering
s {$sel:fixedPrice:ReservedDBInstancesOffering' :: Maybe Double
fixedPrice = Maybe Double
a} :: ReservedDBInstancesOffering)

-- | The duration of the offering in seconds.
reservedDBInstancesOffering_duration :: Lens.Lens' ReservedDBInstancesOffering (Prelude.Maybe Prelude.Int)
reservedDBInstancesOffering_duration :: (Maybe Int -> f (Maybe Int))
-> ReservedDBInstancesOffering -> f ReservedDBInstancesOffering
reservedDBInstancesOffering_duration = (ReservedDBInstancesOffering -> Maybe Int)
-> (ReservedDBInstancesOffering
    -> Maybe Int -> ReservedDBInstancesOffering)
-> Lens
     ReservedDBInstancesOffering
     ReservedDBInstancesOffering
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstancesOffering' {Maybe Int
duration :: Maybe Int
$sel:duration:ReservedDBInstancesOffering' :: ReservedDBInstancesOffering -> Maybe Int
duration} -> Maybe Int
duration) (\s :: ReservedDBInstancesOffering
s@ReservedDBInstancesOffering' {} Maybe Int
a -> ReservedDBInstancesOffering
s {$sel:duration:ReservedDBInstancesOffering' :: Maybe Int
duration = Maybe Int
a} :: ReservedDBInstancesOffering)

instance Core.FromXML ReservedDBInstancesOffering where
  parseXML :: [Node] -> Either String ReservedDBInstancesOffering
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> ReservedDBInstancesOffering
ReservedDBInstancesOffering'
      (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [RecurringCharge]
 -> Maybe Text
 -> Maybe Double
 -> Maybe Double
 -> Maybe Int
 -> ReservedDBInstancesOffering)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstancesOffering)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CurrencyCode")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstancesOffering)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstancesOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ProductDescription")
      Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstancesOffering)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstancesOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBInstanceClass")
      Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstancesOffering)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstancesOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MultiAZ")
      Either
  String
  (Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstancesOffering)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstancesOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ReservedDBInstancesOfferingId")
      Either
  String
  (Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstancesOffering)
-> Either String (Maybe [RecurringCharge])
-> Either
     String
     (Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstancesOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RecurringCharges"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [RecurringCharge]))
-> Either String (Maybe [RecurringCharge])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [RecurringCharge])
-> [Node] -> Either String (Maybe [RecurringCharge])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [RecurringCharge]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"RecurringCharge")
                  )
      Either
  String
  (Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstancesOffering)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Double
      -> Maybe Double -> Maybe Int -> ReservedDBInstancesOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"OfferingType")
      Either
  String
  (Maybe Double
   -> Maybe Double -> Maybe Int -> ReservedDBInstancesOffering)
-> Either String (Maybe Double)
-> Either
     String (Maybe Double -> Maybe Int -> ReservedDBInstancesOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UsagePrice")
      Either
  String (Maybe Double -> Maybe Int -> ReservedDBInstancesOffering)
-> Either String (Maybe Double)
-> Either String (Maybe Int -> ReservedDBInstancesOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FixedPrice")
      Either String (Maybe Int -> ReservedDBInstancesOffering)
-> Either String (Maybe Int)
-> Either String ReservedDBInstancesOffering
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Duration")

instance Prelude.Hashable ReservedDBInstancesOffering

instance Prelude.NFData ReservedDBInstancesOffering