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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.CurrencyCodeValues
import Amazonka.EC2.Types.InstanceType
import Amazonka.EC2.Types.OfferingClassType
import Amazonka.EC2.Types.OfferingTypeValues
import Amazonka.EC2.Types.RIProductDescription
import Amazonka.EC2.Types.RecurringCharge
import Amazonka.EC2.Types.ReservedInstanceState
import Amazonka.EC2.Types.Scope
import Amazonka.EC2.Types.Tag
import Amazonka.EC2.Types.Tenancy
import qualified Amazonka.Prelude as Prelude

-- | Describes a Reserved Instance.
--
-- /See:/ 'newReservedInstances' smart constructor.
data ReservedInstances = ReservedInstances'
  { -- | The Availability Zone in which the Reserved Instance can be used.
    ReservedInstances -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The currency of the Reserved Instance. It\'s specified using ISO 4217
    -- standard currency codes. At this time, the only supported currency is
    -- @USD@.
    ReservedInstances -> Maybe CurrencyCodeValues
currencyCode :: Prelude.Maybe CurrencyCodeValues,
    -- | The duration of the Reserved Instance, in seconds.
    ReservedInstances -> Maybe Integer
duration :: Prelude.Maybe Prelude.Integer,
    -- | The time when the Reserved Instance expires.
    ReservedInstances -> Maybe ISO8601
end :: Prelude.Maybe Data.ISO8601,
    -- | The purchase price of the Reserved Instance.
    ReservedInstances -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | The number of reservations purchased.
    ReservedInstances -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
    -- | The tenancy of the instance.
    ReservedInstances -> Maybe Tenancy
instanceTenancy :: Prelude.Maybe Tenancy,
    -- | The instance type on which the Reserved Instance can be used.
    ReservedInstances -> Maybe InstanceType
instanceType :: Prelude.Maybe InstanceType,
    -- | The offering class of the Reserved Instance.
    ReservedInstances -> Maybe OfferingClassType
offeringClass :: Prelude.Maybe OfferingClassType,
    -- | The Reserved Instance offering type.
    ReservedInstances -> Maybe OfferingTypeValues
offeringType :: Prelude.Maybe OfferingTypeValues,
    -- | The Reserved Instance product platform description.
    ReservedInstances -> Maybe RIProductDescription
productDescription :: Prelude.Maybe RIProductDescription,
    -- | The recurring charge tag assigned to the resource.
    ReservedInstances -> Maybe [RecurringCharge]
recurringCharges :: Prelude.Maybe [RecurringCharge],
    -- | The ID of the Reserved Instance.
    ReservedInstances -> Maybe Text
reservedInstancesId :: Prelude.Maybe Prelude.Text,
    -- | The scope of the Reserved Instance.
    ReservedInstances -> Maybe Scope
scope :: Prelude.Maybe Scope,
    -- | The date and time the Reserved Instance started.
    ReservedInstances -> Maybe ISO8601
start :: Prelude.Maybe Data.ISO8601,
    -- | The state of the Reserved Instance purchase.
    ReservedInstances -> Maybe ReservedInstanceState
state :: Prelude.Maybe ReservedInstanceState,
    -- | Any tags assigned to the resource.
    ReservedInstances -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The usage price of the Reserved Instance, per hour.
    ReservedInstances -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double
  }
  deriving (ReservedInstances -> ReservedInstances -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservedInstances -> ReservedInstances -> Bool
$c/= :: ReservedInstances -> ReservedInstances -> Bool
== :: ReservedInstances -> ReservedInstances -> Bool
$c== :: ReservedInstances -> ReservedInstances -> Bool
Prelude.Eq, ReadPrec [ReservedInstances]
ReadPrec ReservedInstances
Int -> ReadS ReservedInstances
ReadS [ReservedInstances]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservedInstances]
$creadListPrec :: ReadPrec [ReservedInstances]
readPrec :: ReadPrec ReservedInstances
$creadPrec :: ReadPrec ReservedInstances
readList :: ReadS [ReservedInstances]
$creadList :: ReadS [ReservedInstances]
readsPrec :: Int -> ReadS ReservedInstances
$creadsPrec :: Int -> ReadS ReservedInstances
Prelude.Read, Int -> ReservedInstances -> ShowS
[ReservedInstances] -> ShowS
ReservedInstances -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservedInstances] -> ShowS
$cshowList :: [ReservedInstances] -> ShowS
show :: ReservedInstances -> String
$cshow :: ReservedInstances -> String
showsPrec :: Int -> ReservedInstances -> ShowS
$cshowsPrec :: Int -> ReservedInstances -> ShowS
Prelude.Show, forall x. Rep ReservedInstances x -> ReservedInstances
forall x. ReservedInstances -> Rep ReservedInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReservedInstances x -> ReservedInstances
$cfrom :: forall x. ReservedInstances -> Rep ReservedInstances x
Prelude.Generic)

-- |
-- Create a value of 'ReservedInstances' 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:
--
-- 'availabilityZone', 'reservedInstances_availabilityZone' - The Availability Zone in which the Reserved Instance can be used.
--
-- 'currencyCode', 'reservedInstances_currencyCode' - The currency of the Reserved Instance. It\'s specified using ISO 4217
-- standard currency codes. At this time, the only supported currency is
-- @USD@.
--
-- 'duration', 'reservedInstances_duration' - The duration of the Reserved Instance, in seconds.
--
-- 'end', 'reservedInstances_end' - The time when the Reserved Instance expires.
--
-- 'fixedPrice', 'reservedInstances_fixedPrice' - The purchase price of the Reserved Instance.
--
-- 'instanceCount', 'reservedInstances_instanceCount' - The number of reservations purchased.
--
-- 'instanceTenancy', 'reservedInstances_instanceTenancy' - The tenancy of the instance.
--
-- 'instanceType', 'reservedInstances_instanceType' - The instance type on which the Reserved Instance can be used.
--
-- 'offeringClass', 'reservedInstances_offeringClass' - The offering class of the Reserved Instance.
--
-- 'offeringType', 'reservedInstances_offeringType' - The Reserved Instance offering type.
--
-- 'productDescription', 'reservedInstances_productDescription' - The Reserved Instance product platform description.
--
-- 'recurringCharges', 'reservedInstances_recurringCharges' - The recurring charge tag assigned to the resource.
--
-- 'reservedInstancesId', 'reservedInstances_reservedInstancesId' - The ID of the Reserved Instance.
--
-- 'scope', 'reservedInstances_scope' - The scope of the Reserved Instance.
--
-- 'start', 'reservedInstances_start' - The date and time the Reserved Instance started.
--
-- 'state', 'reservedInstances_state' - The state of the Reserved Instance purchase.
--
-- 'tags', 'reservedInstances_tags' - Any tags assigned to the resource.
--
-- 'usagePrice', 'reservedInstances_usagePrice' - The usage price of the Reserved Instance, per hour.
newReservedInstances ::
  ReservedInstances
newReservedInstances :: ReservedInstances
newReservedInstances =
  ReservedInstances'
    { $sel:availabilityZone:ReservedInstances' :: Maybe Text
availabilityZone =
        forall a. Maybe a
Prelude.Nothing,
      $sel:currencyCode:ReservedInstances' :: Maybe CurrencyCodeValues
currencyCode = forall a. Maybe a
Prelude.Nothing,
      $sel:duration:ReservedInstances' :: Maybe Integer
duration = forall a. Maybe a
Prelude.Nothing,
      $sel:end:ReservedInstances' :: Maybe ISO8601
end = forall a. Maybe a
Prelude.Nothing,
      $sel:fixedPrice:ReservedInstances' :: Maybe Double
fixedPrice = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceCount:ReservedInstances' :: Maybe Int
instanceCount = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceTenancy:ReservedInstances' :: Maybe Tenancy
instanceTenancy = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:ReservedInstances' :: Maybe InstanceType
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:offeringClass:ReservedInstances' :: Maybe OfferingClassType
offeringClass = forall a. Maybe a
Prelude.Nothing,
      $sel:offeringType:ReservedInstances' :: Maybe OfferingTypeValues
offeringType = forall a. Maybe a
Prelude.Nothing,
      $sel:productDescription:ReservedInstances' :: Maybe RIProductDescription
productDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:recurringCharges:ReservedInstances' :: Maybe [RecurringCharge]
recurringCharges = forall a. Maybe a
Prelude.Nothing,
      $sel:reservedInstancesId:ReservedInstances' :: Maybe Text
reservedInstancesId = forall a. Maybe a
Prelude.Nothing,
      $sel:scope:ReservedInstances' :: Maybe Scope
scope = forall a. Maybe a
Prelude.Nothing,
      $sel:start:ReservedInstances' :: Maybe ISO8601
start = forall a. Maybe a
Prelude.Nothing,
      $sel:state:ReservedInstances' :: Maybe ReservedInstanceState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ReservedInstances' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:usagePrice:ReservedInstances' :: Maybe Double
usagePrice = forall a. Maybe a
Prelude.Nothing
    }

-- | The Availability Zone in which the Reserved Instance can be used.
reservedInstances_availabilityZone :: Lens.Lens' ReservedInstances (Prelude.Maybe Prelude.Text)
reservedInstances_availabilityZone :: Lens' ReservedInstances (Maybe Text)
reservedInstances_availabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:ReservedInstances' :: ReservedInstances -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe Text
a -> ReservedInstances
s {$sel:availabilityZone:ReservedInstances' :: Maybe Text
availabilityZone = Maybe Text
a} :: ReservedInstances)

-- | The currency of the Reserved Instance. It\'s specified using ISO 4217
-- standard currency codes. At this time, the only supported currency is
-- @USD@.
reservedInstances_currencyCode :: Lens.Lens' ReservedInstances (Prelude.Maybe CurrencyCodeValues)
reservedInstances_currencyCode :: Lens' ReservedInstances (Maybe CurrencyCodeValues)
reservedInstances_currencyCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe CurrencyCodeValues
currencyCode :: Maybe CurrencyCodeValues
$sel:currencyCode:ReservedInstances' :: ReservedInstances -> Maybe CurrencyCodeValues
currencyCode} -> Maybe CurrencyCodeValues
currencyCode) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe CurrencyCodeValues
a -> ReservedInstances
s {$sel:currencyCode:ReservedInstances' :: Maybe CurrencyCodeValues
currencyCode = Maybe CurrencyCodeValues
a} :: ReservedInstances)

-- | The duration of the Reserved Instance, in seconds.
reservedInstances_duration :: Lens.Lens' ReservedInstances (Prelude.Maybe Prelude.Integer)
reservedInstances_duration :: Lens' ReservedInstances (Maybe Integer)
reservedInstances_duration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe Integer
duration :: Maybe Integer
$sel:duration:ReservedInstances' :: ReservedInstances -> Maybe Integer
duration} -> Maybe Integer
duration) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe Integer
a -> ReservedInstances
s {$sel:duration:ReservedInstances' :: Maybe Integer
duration = Maybe Integer
a} :: ReservedInstances)

-- | The time when the Reserved Instance expires.
reservedInstances_end :: Lens.Lens' ReservedInstances (Prelude.Maybe Prelude.UTCTime)
reservedInstances_end :: Lens' ReservedInstances (Maybe UTCTime)
reservedInstances_end = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe ISO8601
end :: Maybe ISO8601
$sel:end:ReservedInstances' :: ReservedInstances -> Maybe ISO8601
end} -> Maybe ISO8601
end) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe ISO8601
a -> ReservedInstances
s {$sel:end:ReservedInstances' :: Maybe ISO8601
end = Maybe ISO8601
a} :: ReservedInstances) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The purchase price of the Reserved Instance.
reservedInstances_fixedPrice :: Lens.Lens' ReservedInstances (Prelude.Maybe Prelude.Double)
reservedInstances_fixedPrice :: Lens' ReservedInstances (Maybe Double)
reservedInstances_fixedPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe Double
fixedPrice :: Maybe Double
$sel:fixedPrice:ReservedInstances' :: ReservedInstances -> Maybe Double
fixedPrice} -> Maybe Double
fixedPrice) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe Double
a -> ReservedInstances
s {$sel:fixedPrice:ReservedInstances' :: Maybe Double
fixedPrice = Maybe Double
a} :: ReservedInstances)

-- | The number of reservations purchased.
reservedInstances_instanceCount :: Lens.Lens' ReservedInstances (Prelude.Maybe Prelude.Int)
reservedInstances_instanceCount :: Lens' ReservedInstances (Maybe Int)
reservedInstances_instanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:ReservedInstances' :: ReservedInstances -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe Int
a -> ReservedInstances
s {$sel:instanceCount:ReservedInstances' :: Maybe Int
instanceCount = Maybe Int
a} :: ReservedInstances)

-- | The tenancy of the instance.
reservedInstances_instanceTenancy :: Lens.Lens' ReservedInstances (Prelude.Maybe Tenancy)
reservedInstances_instanceTenancy :: Lens' ReservedInstances (Maybe Tenancy)
reservedInstances_instanceTenancy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe Tenancy
instanceTenancy :: Maybe Tenancy
$sel:instanceTenancy:ReservedInstances' :: ReservedInstances -> Maybe Tenancy
instanceTenancy} -> Maybe Tenancy
instanceTenancy) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe Tenancy
a -> ReservedInstances
s {$sel:instanceTenancy:ReservedInstances' :: Maybe Tenancy
instanceTenancy = Maybe Tenancy
a} :: ReservedInstances)

-- | The instance type on which the Reserved Instance can be used.
reservedInstances_instanceType :: Lens.Lens' ReservedInstances (Prelude.Maybe InstanceType)
reservedInstances_instanceType :: Lens' ReservedInstances (Maybe InstanceType)
reservedInstances_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe InstanceType
instanceType :: Maybe InstanceType
$sel:instanceType:ReservedInstances' :: ReservedInstances -> Maybe InstanceType
instanceType} -> Maybe InstanceType
instanceType) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe InstanceType
a -> ReservedInstances
s {$sel:instanceType:ReservedInstances' :: Maybe InstanceType
instanceType = Maybe InstanceType
a} :: ReservedInstances)

-- | The offering class of the Reserved Instance.
reservedInstances_offeringClass :: Lens.Lens' ReservedInstances (Prelude.Maybe OfferingClassType)
reservedInstances_offeringClass :: Lens' ReservedInstances (Maybe OfferingClassType)
reservedInstances_offeringClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe OfferingClassType
offeringClass :: Maybe OfferingClassType
$sel:offeringClass:ReservedInstances' :: ReservedInstances -> Maybe OfferingClassType
offeringClass} -> Maybe OfferingClassType
offeringClass) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe OfferingClassType
a -> ReservedInstances
s {$sel:offeringClass:ReservedInstances' :: Maybe OfferingClassType
offeringClass = Maybe OfferingClassType
a} :: ReservedInstances)

-- | The Reserved Instance offering type.
reservedInstances_offeringType :: Lens.Lens' ReservedInstances (Prelude.Maybe OfferingTypeValues)
reservedInstances_offeringType :: Lens' ReservedInstances (Maybe OfferingTypeValues)
reservedInstances_offeringType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe OfferingTypeValues
offeringType :: Maybe OfferingTypeValues
$sel:offeringType:ReservedInstances' :: ReservedInstances -> Maybe OfferingTypeValues
offeringType} -> Maybe OfferingTypeValues
offeringType) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe OfferingTypeValues
a -> ReservedInstances
s {$sel:offeringType:ReservedInstances' :: Maybe OfferingTypeValues
offeringType = Maybe OfferingTypeValues
a} :: ReservedInstances)

-- | The Reserved Instance product platform description.
reservedInstances_productDescription :: Lens.Lens' ReservedInstances (Prelude.Maybe RIProductDescription)
reservedInstances_productDescription :: Lens' ReservedInstances (Maybe RIProductDescription)
reservedInstances_productDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe RIProductDescription
productDescription :: Maybe RIProductDescription
$sel:productDescription:ReservedInstances' :: ReservedInstances -> Maybe RIProductDescription
productDescription} -> Maybe RIProductDescription
productDescription) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe RIProductDescription
a -> ReservedInstances
s {$sel:productDescription:ReservedInstances' :: Maybe RIProductDescription
productDescription = Maybe RIProductDescription
a} :: ReservedInstances)

-- | The recurring charge tag assigned to the resource.
reservedInstances_recurringCharges :: Lens.Lens' ReservedInstances (Prelude.Maybe [RecurringCharge])
reservedInstances_recurringCharges :: Lens' ReservedInstances (Maybe [RecurringCharge])
reservedInstances_recurringCharges = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe [RecurringCharge]
recurringCharges :: Maybe [RecurringCharge]
$sel:recurringCharges:ReservedInstances' :: ReservedInstances -> Maybe [RecurringCharge]
recurringCharges} -> Maybe [RecurringCharge]
recurringCharges) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe [RecurringCharge]
a -> ReservedInstances
s {$sel:recurringCharges:ReservedInstances' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
a} :: ReservedInstances) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The scope of the Reserved Instance.
reservedInstances_scope :: Lens.Lens' ReservedInstances (Prelude.Maybe Scope)
reservedInstances_scope :: Lens' ReservedInstances (Maybe Scope)
reservedInstances_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe Scope
scope :: Maybe Scope
$sel:scope:ReservedInstances' :: ReservedInstances -> Maybe Scope
scope} -> Maybe Scope
scope) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe Scope
a -> ReservedInstances
s {$sel:scope:ReservedInstances' :: Maybe Scope
scope = Maybe Scope
a} :: ReservedInstances)

-- | The date and time the Reserved Instance started.
reservedInstances_start :: Lens.Lens' ReservedInstances (Prelude.Maybe Prelude.UTCTime)
reservedInstances_start :: Lens' ReservedInstances (Maybe UTCTime)
reservedInstances_start = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe ISO8601
start :: Maybe ISO8601
$sel:start:ReservedInstances' :: ReservedInstances -> Maybe ISO8601
start} -> Maybe ISO8601
start) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe ISO8601
a -> ReservedInstances
s {$sel:start:ReservedInstances' :: Maybe ISO8601
start = Maybe ISO8601
a} :: ReservedInstances) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

-- | Any tags assigned to the resource.
reservedInstances_tags :: Lens.Lens' ReservedInstances (Prelude.Maybe [Tag])
reservedInstances_tags :: Lens' ReservedInstances (Maybe [Tag])
reservedInstances_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ReservedInstances' :: ReservedInstances -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe [Tag]
a -> ReservedInstances
s {$sel:tags:ReservedInstances' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ReservedInstances) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The usage price of the Reserved Instance, per hour.
reservedInstances_usagePrice :: Lens.Lens' ReservedInstances (Prelude.Maybe Prelude.Double)
reservedInstances_usagePrice :: Lens' ReservedInstances (Maybe Double)
reservedInstances_usagePrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedInstances' {Maybe Double
usagePrice :: Maybe Double
$sel:usagePrice:ReservedInstances' :: ReservedInstances -> Maybe Double
usagePrice} -> Maybe Double
usagePrice) (\s :: ReservedInstances
s@ReservedInstances' {} Maybe Double
a -> ReservedInstances
s {$sel:usagePrice:ReservedInstances' :: Maybe Double
usagePrice = Maybe Double
a} :: ReservedInstances)

instance Data.FromXML ReservedInstances where
  parseXML :: [Node] -> Either String ReservedInstances
parseXML [Node]
x =
    Maybe Text
-> Maybe CurrencyCodeValues
-> Maybe Integer
-> Maybe ISO8601
-> Maybe Double
-> Maybe Int
-> Maybe Tenancy
-> Maybe InstanceType
-> Maybe OfferingClassType
-> Maybe OfferingTypeValues
-> Maybe RIProductDescription
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Scope
-> Maybe ISO8601
-> Maybe ReservedInstanceState
-> Maybe [Tag]
-> Maybe Double
-> ReservedInstances
ReservedInstances'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"availabilityZone")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"currencyCode")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"duration")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"end")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"fixedPrice")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceCount")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceTenancy")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceType")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"offeringClass")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"offeringType")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"productDescription")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"recurringCharges"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"reservedInstancesId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"scope")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"start")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"state")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"tagSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"usagePrice")

instance Prelude.Hashable ReservedInstances where
  hashWithSalt :: Int -> ReservedInstances -> Int
hashWithSalt Int
_salt ReservedInstances' {Maybe Double
Maybe Int
Maybe Integer
Maybe [RecurringCharge]
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe CurrencyCodeValues
Maybe InstanceType
Maybe OfferingClassType
Maybe OfferingTypeValues
Maybe RIProductDescription
Maybe ReservedInstanceState
Maybe Scope
Maybe Tenancy
usagePrice :: Maybe Double
tags :: Maybe [Tag]
state :: Maybe ReservedInstanceState
start :: Maybe ISO8601
scope :: Maybe Scope
reservedInstancesId :: Maybe Text
recurringCharges :: Maybe [RecurringCharge]
productDescription :: Maybe RIProductDescription
offeringType :: Maybe OfferingTypeValues
offeringClass :: Maybe OfferingClassType
instanceType :: Maybe InstanceType
instanceTenancy :: Maybe Tenancy
instanceCount :: Maybe Int
fixedPrice :: Maybe Double
end :: Maybe ISO8601
duration :: Maybe Integer
currencyCode :: Maybe CurrencyCodeValues
availabilityZone :: Maybe Text
$sel:usagePrice:ReservedInstances' :: ReservedInstances -> Maybe Double
$sel:tags:ReservedInstances' :: ReservedInstances -> Maybe [Tag]
$sel:state:ReservedInstances' :: ReservedInstances -> Maybe ReservedInstanceState
$sel:start:ReservedInstances' :: ReservedInstances -> Maybe ISO8601
$sel:scope:ReservedInstances' :: ReservedInstances -> Maybe Scope
$sel:reservedInstancesId:ReservedInstances' :: ReservedInstances -> Maybe Text
$sel:recurringCharges:ReservedInstances' :: ReservedInstances -> Maybe [RecurringCharge]
$sel:productDescription:ReservedInstances' :: ReservedInstances -> Maybe RIProductDescription
$sel:offeringType:ReservedInstances' :: ReservedInstances -> Maybe OfferingTypeValues
$sel:offeringClass:ReservedInstances' :: ReservedInstances -> Maybe OfferingClassType
$sel:instanceType:ReservedInstances' :: ReservedInstances -> Maybe InstanceType
$sel:instanceTenancy:ReservedInstances' :: ReservedInstances -> Maybe Tenancy
$sel:instanceCount:ReservedInstances' :: ReservedInstances -> Maybe Int
$sel:fixedPrice:ReservedInstances' :: ReservedInstances -> Maybe Double
$sel:end:ReservedInstances' :: ReservedInstances -> Maybe ISO8601
$sel:duration:ReservedInstances' :: ReservedInstances -> Maybe Integer
$sel:currencyCode:ReservedInstances' :: ReservedInstances -> Maybe CurrencyCodeValues
$sel:availabilityZone:ReservedInstances' :: ReservedInstances -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availabilityZone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CurrencyCodeValues
currencyCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
duration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
end
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
fixedPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
instanceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Tenancy
instanceTenancy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceType
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OfferingClassType
offeringClass
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OfferingTypeValues
offeringType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RIProductDescription
productDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RecurringCharge]
recurringCharges
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reservedInstancesId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Scope
scope
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
start
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReservedInstanceState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
usagePrice

instance Prelude.NFData ReservedInstances where
  rnf :: ReservedInstances -> ()
rnf ReservedInstances' {Maybe Double
Maybe Int
Maybe Integer
Maybe [RecurringCharge]
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe CurrencyCodeValues
Maybe InstanceType
Maybe OfferingClassType
Maybe OfferingTypeValues
Maybe RIProductDescription
Maybe ReservedInstanceState
Maybe Scope
Maybe Tenancy
usagePrice :: Maybe Double
tags :: Maybe [Tag]
state :: Maybe ReservedInstanceState
start :: Maybe ISO8601
scope :: Maybe Scope
reservedInstancesId :: Maybe Text
recurringCharges :: Maybe [RecurringCharge]
productDescription :: Maybe RIProductDescription
offeringType :: Maybe OfferingTypeValues
offeringClass :: Maybe OfferingClassType
instanceType :: Maybe InstanceType
instanceTenancy :: Maybe Tenancy
instanceCount :: Maybe Int
fixedPrice :: Maybe Double
end :: Maybe ISO8601
duration :: Maybe Integer
currencyCode :: Maybe CurrencyCodeValues
availabilityZone :: Maybe Text
$sel:usagePrice:ReservedInstances' :: ReservedInstances -> Maybe Double
$sel:tags:ReservedInstances' :: ReservedInstances -> Maybe [Tag]
$sel:state:ReservedInstances' :: ReservedInstances -> Maybe ReservedInstanceState
$sel:start:ReservedInstances' :: ReservedInstances -> Maybe ISO8601
$sel:scope:ReservedInstances' :: ReservedInstances -> Maybe Scope
$sel:reservedInstancesId:ReservedInstances' :: ReservedInstances -> Maybe Text
$sel:recurringCharges:ReservedInstances' :: ReservedInstances -> Maybe [RecurringCharge]
$sel:productDescription:ReservedInstances' :: ReservedInstances -> Maybe RIProductDescription
$sel:offeringType:ReservedInstances' :: ReservedInstances -> Maybe OfferingTypeValues
$sel:offeringClass:ReservedInstances' :: ReservedInstances -> Maybe OfferingClassType
$sel:instanceType:ReservedInstances' :: ReservedInstances -> Maybe InstanceType
$sel:instanceTenancy:ReservedInstances' :: ReservedInstances -> Maybe Tenancy
$sel:instanceCount:ReservedInstances' :: ReservedInstances -> Maybe Int
$sel:fixedPrice:ReservedInstances' :: ReservedInstances -> Maybe Double
$sel:end:ReservedInstances' :: ReservedInstances -> Maybe ISO8601
$sel:duration:ReservedInstances' :: ReservedInstances -> Maybe Integer
$sel:currencyCode:ReservedInstances' :: ReservedInstances -> Maybe CurrencyCodeValues
$sel:availabilityZone:ReservedInstances' :: ReservedInstances -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availabilityZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CurrencyCodeValues
currencyCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
duration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
end
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
fixedPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
instanceCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Tenancy
instanceTenancy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceType
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OfferingClassType
offeringClass
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OfferingTypeValues
offeringType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RIProductDescription
productDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RecurringCharge]
recurringCharges
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reservedInstancesId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Scope
scope
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
start
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReservedInstanceState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
usagePrice