{-# 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.ReservedDBInstance
-- 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.ReservedDBInstance 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
-- @DescribeReservedDBInstances@ and @PurchaseReservedDBInstancesOffering@
-- actions.
--
-- /See:/ 'newReservedDBInstance' smart constructor.
data ReservedDBInstance = ReservedDBInstance'
  { -- | The number of reserved DB instances.
    ReservedDBInstance -> Maybe Int
dbInstanceCount :: Prelude.Maybe Prelude.Int,
    -- | The state of the reserved DB instance.
    ReservedDBInstance -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | The currency code for the reserved DB instance.
    ReservedDBInstance -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | The time the reservation started.
    ReservedDBInstance -> Maybe ISO8601
startTime :: Prelude.Maybe Core.ISO8601,
    -- | The description of the reserved DB instance.
    ReservedDBInstance -> Maybe Text
productDescription :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the lease associated with the reserved DB
    -- instance.
    --
    -- Amazon Web Services Support might request the lease ID for an issue
    -- related to a reserved DB instance.
    ReservedDBInstance -> Maybe Text
leaseId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the reservation.
    ReservedDBInstance -> Maybe Text
reservedDBInstanceId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the reserved DB instance.
    ReservedDBInstance -> Maybe Text
reservedDBInstanceArn :: Prelude.Maybe Prelude.Text,
    -- | The DB instance class for the reserved DB instance.
    ReservedDBInstance -> Maybe Text
dbInstanceClass :: Prelude.Maybe Prelude.Text,
    -- | Indicates if the reservation applies to Multi-AZ deployments.
    ReservedDBInstance -> Maybe Bool
multiAZ :: Prelude.Maybe Prelude.Bool,
    -- | The offering identifier.
    ReservedDBInstance -> Maybe Text
reservedDBInstancesOfferingId :: Prelude.Maybe Prelude.Text,
    -- | The recurring price charged to run this reserved DB instance.
    ReservedDBInstance -> Maybe [RecurringCharge]
recurringCharges :: Prelude.Maybe [RecurringCharge],
    -- | The offering type of this reserved DB instance.
    ReservedDBInstance -> Maybe Text
offeringType :: Prelude.Maybe Prelude.Text,
    -- | The hourly price charged for this reserved DB instance.
    ReservedDBInstance -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double,
    -- | The fixed price charged for this reserved DB instance.
    ReservedDBInstance -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | The duration of the reservation in seconds.
    ReservedDBInstance -> Maybe Int
duration :: Prelude.Maybe Prelude.Int
  }
  deriving (ReservedDBInstance -> ReservedDBInstance -> Bool
(ReservedDBInstance -> ReservedDBInstance -> Bool)
-> (ReservedDBInstance -> ReservedDBInstance -> Bool)
-> Eq ReservedDBInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservedDBInstance -> ReservedDBInstance -> Bool
$c/= :: ReservedDBInstance -> ReservedDBInstance -> Bool
== :: ReservedDBInstance -> ReservedDBInstance -> Bool
$c== :: ReservedDBInstance -> ReservedDBInstance -> Bool
Prelude.Eq, ReadPrec [ReservedDBInstance]
ReadPrec ReservedDBInstance
Int -> ReadS ReservedDBInstance
ReadS [ReservedDBInstance]
(Int -> ReadS ReservedDBInstance)
-> ReadS [ReservedDBInstance]
-> ReadPrec ReservedDBInstance
-> ReadPrec [ReservedDBInstance]
-> Read ReservedDBInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservedDBInstance]
$creadListPrec :: ReadPrec [ReservedDBInstance]
readPrec :: ReadPrec ReservedDBInstance
$creadPrec :: ReadPrec ReservedDBInstance
readList :: ReadS [ReservedDBInstance]
$creadList :: ReadS [ReservedDBInstance]
readsPrec :: Int -> ReadS ReservedDBInstance
$creadsPrec :: Int -> ReadS ReservedDBInstance
Prelude.Read, Int -> ReservedDBInstance -> ShowS
[ReservedDBInstance] -> ShowS
ReservedDBInstance -> String
(Int -> ReservedDBInstance -> ShowS)
-> (ReservedDBInstance -> String)
-> ([ReservedDBInstance] -> ShowS)
-> Show ReservedDBInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservedDBInstance] -> ShowS
$cshowList :: [ReservedDBInstance] -> ShowS
show :: ReservedDBInstance -> String
$cshow :: ReservedDBInstance -> String
showsPrec :: Int -> ReservedDBInstance -> ShowS
$cshowsPrec :: Int -> ReservedDBInstance -> ShowS
Prelude.Show, (forall x. ReservedDBInstance -> Rep ReservedDBInstance x)
-> (forall x. Rep ReservedDBInstance x -> ReservedDBInstance)
-> Generic ReservedDBInstance
forall x. Rep ReservedDBInstance x -> ReservedDBInstance
forall x. ReservedDBInstance -> Rep ReservedDBInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReservedDBInstance x -> ReservedDBInstance
$cfrom :: forall x. ReservedDBInstance -> Rep ReservedDBInstance x
Prelude.Generic)

-- |
-- Create a value of 'ReservedDBInstance' 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:
--
-- 'dbInstanceCount', 'reservedDBInstance_dbInstanceCount' - The number of reserved DB instances.
--
-- 'state', 'reservedDBInstance_state' - The state of the reserved DB instance.
--
-- 'currencyCode', 'reservedDBInstance_currencyCode' - The currency code for the reserved DB instance.
--
-- 'startTime', 'reservedDBInstance_startTime' - The time the reservation started.
--
-- 'productDescription', 'reservedDBInstance_productDescription' - The description of the reserved DB instance.
--
-- 'leaseId', 'reservedDBInstance_leaseId' - The unique identifier for the lease associated with the reserved DB
-- instance.
--
-- Amazon Web Services Support might request the lease ID for an issue
-- related to a reserved DB instance.
--
-- 'reservedDBInstanceId', 'reservedDBInstance_reservedDBInstanceId' - The unique identifier for the reservation.
--
-- 'reservedDBInstanceArn', 'reservedDBInstance_reservedDBInstanceArn' - The Amazon Resource Name (ARN) for the reserved DB instance.
--
-- 'dbInstanceClass', 'reservedDBInstance_dbInstanceClass' - The DB instance class for the reserved DB instance.
--
-- 'multiAZ', 'reservedDBInstance_multiAZ' - Indicates if the reservation applies to Multi-AZ deployments.
--
-- 'reservedDBInstancesOfferingId', 'reservedDBInstance_reservedDBInstancesOfferingId' - The offering identifier.
--
-- 'recurringCharges', 'reservedDBInstance_recurringCharges' - The recurring price charged to run this reserved DB instance.
--
-- 'offeringType', 'reservedDBInstance_offeringType' - The offering type of this reserved DB instance.
--
-- 'usagePrice', 'reservedDBInstance_usagePrice' - The hourly price charged for this reserved DB instance.
--
-- 'fixedPrice', 'reservedDBInstance_fixedPrice' - The fixed price charged for this reserved DB instance.
--
-- 'duration', 'reservedDBInstance_duration' - The duration of the reservation in seconds.
newReservedDBInstance ::
  ReservedDBInstance
newReservedDBInstance :: ReservedDBInstance
newReservedDBInstance =
  ReservedDBInstance' :: Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> ReservedDBInstance
ReservedDBInstance'
    { $sel:dbInstanceCount:ReservedDBInstance' :: Maybe Int
dbInstanceCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:state:ReservedDBInstance' :: Maybe Text
state = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:currencyCode:ReservedDBInstance' :: Maybe Text
currencyCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:ReservedDBInstance' :: Maybe ISO8601
startTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:productDescription:ReservedDBInstance' :: Maybe Text
productDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:leaseId:ReservedDBInstance' :: Maybe Text
leaseId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedDBInstanceId:ReservedDBInstance' :: Maybe Text
reservedDBInstanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedDBInstanceArn:ReservedDBInstance' :: Maybe Text
reservedDBInstanceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbInstanceClass:ReservedDBInstance' :: Maybe Text
dbInstanceClass = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:multiAZ:ReservedDBInstance' :: Maybe Bool
multiAZ = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedDBInstancesOfferingId:ReservedDBInstance' :: Maybe Text
reservedDBInstancesOfferingId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recurringCharges:ReservedDBInstance' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringType:ReservedDBInstance' :: Maybe Text
offeringType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usagePrice:ReservedDBInstance' :: Maybe Double
usagePrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:fixedPrice:ReservedDBInstance' :: Maybe Double
fixedPrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:ReservedDBInstance' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The number of reserved DB instances.
reservedDBInstance_dbInstanceCount :: Lens.Lens' ReservedDBInstance (Prelude.Maybe Prelude.Int)
reservedDBInstance_dbInstanceCount :: (Maybe Int -> f (Maybe Int))
-> ReservedDBInstance -> f ReservedDBInstance
reservedDBInstance_dbInstanceCount = (ReservedDBInstance -> Maybe Int)
-> (ReservedDBInstance -> Maybe Int -> ReservedDBInstance)
-> Lens
     ReservedDBInstance ReservedDBInstance (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstance' {Maybe Int
dbInstanceCount :: Maybe Int
$sel:dbInstanceCount:ReservedDBInstance' :: ReservedDBInstance -> Maybe Int
dbInstanceCount} -> Maybe Int
dbInstanceCount) (\s :: ReservedDBInstance
s@ReservedDBInstance' {} Maybe Int
a -> ReservedDBInstance
s {$sel:dbInstanceCount:ReservedDBInstance' :: Maybe Int
dbInstanceCount = Maybe Int
a} :: ReservedDBInstance)

-- | The state of the reserved DB instance.
reservedDBInstance_state :: Lens.Lens' ReservedDBInstance (Prelude.Maybe Prelude.Text)
reservedDBInstance_state :: (Maybe Text -> f (Maybe Text))
-> ReservedDBInstance -> f ReservedDBInstance
reservedDBInstance_state = (ReservedDBInstance -> Maybe Text)
-> (ReservedDBInstance -> Maybe Text -> ReservedDBInstance)
-> Lens
     ReservedDBInstance ReservedDBInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstance' {Maybe Text
state :: Maybe Text
$sel:state:ReservedDBInstance' :: ReservedDBInstance -> Maybe Text
state} -> Maybe Text
state) (\s :: ReservedDBInstance
s@ReservedDBInstance' {} Maybe Text
a -> ReservedDBInstance
s {$sel:state:ReservedDBInstance' :: Maybe Text
state = Maybe Text
a} :: ReservedDBInstance)

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

-- | The time the reservation started.
reservedDBInstance_startTime :: Lens.Lens' ReservedDBInstance (Prelude.Maybe Prelude.UTCTime)
reservedDBInstance_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReservedDBInstance -> f ReservedDBInstance
reservedDBInstance_startTime = (ReservedDBInstance -> Maybe ISO8601)
-> (ReservedDBInstance -> Maybe ISO8601 -> ReservedDBInstance)
-> Lens
     ReservedDBInstance
     ReservedDBInstance
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstance' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:ReservedDBInstance' :: ReservedDBInstance -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: ReservedDBInstance
s@ReservedDBInstance' {} Maybe ISO8601
a -> ReservedDBInstance
s {$sel:startTime:ReservedDBInstance' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: ReservedDBInstance) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> ReservedDBInstance -> f ReservedDBInstance)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReservedDBInstance
-> f ReservedDBInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The description of the reserved DB instance.
reservedDBInstance_productDescription :: Lens.Lens' ReservedDBInstance (Prelude.Maybe Prelude.Text)
reservedDBInstance_productDescription :: (Maybe Text -> f (Maybe Text))
-> ReservedDBInstance -> f ReservedDBInstance
reservedDBInstance_productDescription = (ReservedDBInstance -> Maybe Text)
-> (ReservedDBInstance -> Maybe Text -> ReservedDBInstance)
-> Lens
     ReservedDBInstance ReservedDBInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstance' {Maybe Text
productDescription :: Maybe Text
$sel:productDescription:ReservedDBInstance' :: ReservedDBInstance -> Maybe Text
productDescription} -> Maybe Text
productDescription) (\s :: ReservedDBInstance
s@ReservedDBInstance' {} Maybe Text
a -> ReservedDBInstance
s {$sel:productDescription:ReservedDBInstance' :: Maybe Text
productDescription = Maybe Text
a} :: ReservedDBInstance)

-- | The unique identifier for the lease associated with the reserved DB
-- instance.
--
-- Amazon Web Services Support might request the lease ID for an issue
-- related to a reserved DB instance.
reservedDBInstance_leaseId :: Lens.Lens' ReservedDBInstance (Prelude.Maybe Prelude.Text)
reservedDBInstance_leaseId :: (Maybe Text -> f (Maybe Text))
-> ReservedDBInstance -> f ReservedDBInstance
reservedDBInstance_leaseId = (ReservedDBInstance -> Maybe Text)
-> (ReservedDBInstance -> Maybe Text -> ReservedDBInstance)
-> Lens
     ReservedDBInstance ReservedDBInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstance' {Maybe Text
leaseId :: Maybe Text
$sel:leaseId:ReservedDBInstance' :: ReservedDBInstance -> Maybe Text
leaseId} -> Maybe Text
leaseId) (\s :: ReservedDBInstance
s@ReservedDBInstance' {} Maybe Text
a -> ReservedDBInstance
s {$sel:leaseId:ReservedDBInstance' :: Maybe Text
leaseId = Maybe Text
a} :: ReservedDBInstance)

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

-- | The Amazon Resource Name (ARN) for the reserved DB instance.
reservedDBInstance_reservedDBInstanceArn :: Lens.Lens' ReservedDBInstance (Prelude.Maybe Prelude.Text)
reservedDBInstance_reservedDBInstanceArn :: (Maybe Text -> f (Maybe Text))
-> ReservedDBInstance -> f ReservedDBInstance
reservedDBInstance_reservedDBInstanceArn = (ReservedDBInstance -> Maybe Text)
-> (ReservedDBInstance -> Maybe Text -> ReservedDBInstance)
-> Lens
     ReservedDBInstance ReservedDBInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedDBInstance' {Maybe Text
reservedDBInstanceArn :: Maybe Text
$sel:reservedDBInstanceArn:ReservedDBInstance' :: ReservedDBInstance -> Maybe Text
reservedDBInstanceArn} -> Maybe Text
reservedDBInstanceArn) (\s :: ReservedDBInstance
s@ReservedDBInstance' {} Maybe Text
a -> ReservedDBInstance
s {$sel:reservedDBInstanceArn:ReservedDBInstance' :: Maybe Text
reservedDBInstanceArn = Maybe Text
a} :: ReservedDBInstance)

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

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

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

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

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

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

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

instance Core.FromXML ReservedDBInstance where
  parseXML :: [Node] -> Either String ReservedDBInstance
parseXML [Node]
x =
    Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> ReservedDBInstance
ReservedDBInstance'
      (Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [RecurringCharge]
 -> Maybe Text
 -> Maybe Double
 -> Maybe Double
 -> Maybe Int
 -> ReservedDBInstance)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
forall (f :: * -> *) a b. Functor 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
"DBInstanceCount")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
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
"State")
      Either
  String
  (Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
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
"CurrencyCode")
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstance)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StartTime")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
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
"LeaseId")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
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
"ReservedDBInstanceId")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
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
"ReservedDBInstanceArn")
      Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> ReservedDBInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
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
   -> ReservedDBInstance)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
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
   -> ReservedDBInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> ReservedDBInstance)
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
   -> ReservedDBInstance)
-> Either String (Maybe [RecurringCharge])
-> Either
     String
     (Maybe Text
      -> Maybe Double -> Maybe Double -> Maybe Int -> ReservedDBInstance)
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 -> ReservedDBInstance)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Double -> Maybe Double -> Maybe Int -> ReservedDBInstance)
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 -> ReservedDBInstance)
-> Either String (Maybe Double)
-> Either String (Maybe Double -> Maybe Int -> ReservedDBInstance)
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 -> ReservedDBInstance)
-> Either String (Maybe Double)
-> Either String (Maybe Int -> ReservedDBInstance)
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 -> ReservedDBInstance)
-> Either String (Maybe Int) -> Either String ReservedDBInstance
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 ReservedDBInstance

instance Prelude.NFData ReservedDBInstance