{-# 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.ElastiCache.Types.ReservedCacheNodesOffering
-- 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.ElastiCache.Types.ReservedCacheNodesOffering where

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

-- | Describes all of the attributes of a reserved cache node offering.
--
-- /See:/ 'newReservedCacheNodesOffering' smart constructor.
data ReservedCacheNodesOffering = ReservedCacheNodesOffering'
  { -- | The cache node type for the reserved cache node.
    --
    -- The following node types are supported by ElastiCache. Generally
    -- speaking, the current generation types provide more memory and
    -- computational power at lower cost when compared to their equivalent
    -- previous generation counterparts.
    --
    -- -   General purpose:
    --
    --     -   Current generation:
    --
    --         __M6g node types__ (available only for Redis engine version
    --         5.0.6 onward and for Memcached engine version 1.5.16 onward).
    --
    --         @cache.m6g.large@, @cache.m6g.xlarge@, @cache.m6g.2xlarge@,
    --         @cache.m6g.4xlarge@, @cache.m6g.8xlarge@, @cache.m6g.12xlarge@,
    --         @cache.m6g.16xlarge@
    --
    --         For region availability, see
    --         <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion Supported Node Types>
    --
    --         __M5 node types:__ @cache.m5.large@, @cache.m5.xlarge@,
    --         @cache.m5.2xlarge@, @cache.m5.4xlarge@, @cache.m5.12xlarge@,
    --         @cache.m5.24xlarge@
    --
    --         __M4 node types:__ @cache.m4.large@, @cache.m4.xlarge@,
    --         @cache.m4.2xlarge@, @cache.m4.4xlarge@, @cache.m4.10xlarge@
    --
    --         __T3 node types:__ @cache.t3.micro@, @cache.t3.small@,
    --         @cache.t3.medium@
    --
    --         __T2 node types:__ @cache.t2.micro@, @cache.t2.small@,
    --         @cache.t2.medium@
    --
    --     -   Previous generation: (not recommended)
    --
    --         __T1 node types:__ @cache.t1.micro@
    --
    --         __M1 node types:__ @cache.m1.small@, @cache.m1.medium@,
    --         @cache.m1.large@, @cache.m1.xlarge@
    --
    --         __M3 node types:__ @cache.m3.medium@, @cache.m3.large@,
    --         @cache.m3.xlarge@, @cache.m3.2xlarge@
    --
    -- -   Compute optimized:
    --
    --     -   Previous generation: (not recommended)
    --
    --         __C1 node types:__ @cache.c1.xlarge@
    --
    -- -   Memory optimized:
    --
    --     -   Current generation:
    --
    --         __R6g node types__ (available only for Redis engine version
    --         5.0.6 onward and for Memcached engine version 1.5.16 onward).
    --
    --         @cache.r6g.large@, @cache.r6g.xlarge@, @cache.r6g.2xlarge@,
    --         @cache.r6g.4xlarge@, @cache.r6g.8xlarge@, @cache.r6g.12xlarge@,
    --         @cache.r6g.16xlarge@
    --
    --         For region availability, see
    --         <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion Supported Node Types>
    --
    --         __R5 node types:__ @cache.r5.large@, @cache.r5.xlarge@,
    --         @cache.r5.2xlarge@, @cache.r5.4xlarge@, @cache.r5.12xlarge@,
    --         @cache.r5.24xlarge@
    --
    --         __R4 node types:__ @cache.r4.large@, @cache.r4.xlarge@,
    --         @cache.r4.2xlarge@, @cache.r4.4xlarge@, @cache.r4.8xlarge@,
    --         @cache.r4.16xlarge@
    --
    --     -   Previous generation: (not recommended)
    --
    --         __M2 node types:__ @cache.m2.xlarge@, @cache.m2.2xlarge@,
    --         @cache.m2.4xlarge@
    --
    --         __R3 node types:__ @cache.r3.large@, @cache.r3.xlarge@,
    --         @cache.r3.2xlarge@, @cache.r3.4xlarge@, @cache.r3.8xlarge@
    --
    -- __Additional node type info__
    --
    -- -   All current generation instance types are created in Amazon VPC by
    --     default.
    --
    -- -   Redis append-only files (AOF) are not supported for T1 or T2
    --     instances.
    --
    -- -   Redis Multi-AZ with automatic failover is not supported on T1
    --     instances.
    --
    -- -   Redis configuration variables @appendonly@ and @appendfsync@ are not
    --     supported on Redis version 2.8.22 and later.
    ReservedCacheNodesOffering -> Maybe Text
cacheNodeType :: Prelude.Maybe Prelude.Text,
    -- | The cache engine used by the offering.
    ReservedCacheNodesOffering -> Maybe Text
productDescription :: Prelude.Maybe Prelude.Text,
    -- | The recurring price charged to run this reserved cache node.
    ReservedCacheNodesOffering -> Maybe [RecurringCharge]
recurringCharges :: Prelude.Maybe [RecurringCharge],
    -- | The offering type.
    ReservedCacheNodesOffering -> Maybe Text
offeringType :: Prelude.Maybe Prelude.Text,
    -- | The hourly price charged for this offering.
    ReservedCacheNodesOffering -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double,
    -- | The fixed price charged for this offering.
    ReservedCacheNodesOffering -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | The duration of the offering. in seconds.
    ReservedCacheNodesOffering -> Maybe Int
duration :: Prelude.Maybe Prelude.Int,
    -- | A unique identifier for the reserved cache node offering.
    ReservedCacheNodesOffering -> Maybe Text
reservedCacheNodesOfferingId :: Prelude.Maybe Prelude.Text
  }
  deriving (ReservedCacheNodesOffering -> ReservedCacheNodesOffering -> Bool
(ReservedCacheNodesOffering -> ReservedCacheNodesOffering -> Bool)
-> (ReservedCacheNodesOffering
    -> ReservedCacheNodesOffering -> Bool)
-> Eq ReservedCacheNodesOffering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservedCacheNodesOffering -> ReservedCacheNodesOffering -> Bool
$c/= :: ReservedCacheNodesOffering -> ReservedCacheNodesOffering -> Bool
== :: ReservedCacheNodesOffering -> ReservedCacheNodesOffering -> Bool
$c== :: ReservedCacheNodesOffering -> ReservedCacheNodesOffering -> Bool
Prelude.Eq, ReadPrec [ReservedCacheNodesOffering]
ReadPrec ReservedCacheNodesOffering
Int -> ReadS ReservedCacheNodesOffering
ReadS [ReservedCacheNodesOffering]
(Int -> ReadS ReservedCacheNodesOffering)
-> ReadS [ReservedCacheNodesOffering]
-> ReadPrec ReservedCacheNodesOffering
-> ReadPrec [ReservedCacheNodesOffering]
-> Read ReservedCacheNodesOffering
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservedCacheNodesOffering]
$creadListPrec :: ReadPrec [ReservedCacheNodesOffering]
readPrec :: ReadPrec ReservedCacheNodesOffering
$creadPrec :: ReadPrec ReservedCacheNodesOffering
readList :: ReadS [ReservedCacheNodesOffering]
$creadList :: ReadS [ReservedCacheNodesOffering]
readsPrec :: Int -> ReadS ReservedCacheNodesOffering
$creadsPrec :: Int -> ReadS ReservedCacheNodesOffering
Prelude.Read, Int -> ReservedCacheNodesOffering -> ShowS
[ReservedCacheNodesOffering] -> ShowS
ReservedCacheNodesOffering -> String
(Int -> ReservedCacheNodesOffering -> ShowS)
-> (ReservedCacheNodesOffering -> String)
-> ([ReservedCacheNodesOffering] -> ShowS)
-> Show ReservedCacheNodesOffering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservedCacheNodesOffering] -> ShowS
$cshowList :: [ReservedCacheNodesOffering] -> ShowS
show :: ReservedCacheNodesOffering -> String
$cshow :: ReservedCacheNodesOffering -> String
showsPrec :: Int -> ReservedCacheNodesOffering -> ShowS
$cshowsPrec :: Int -> ReservedCacheNodesOffering -> ShowS
Prelude.Show, (forall x.
 ReservedCacheNodesOffering -> Rep ReservedCacheNodesOffering x)
-> (forall x.
    Rep ReservedCacheNodesOffering x -> ReservedCacheNodesOffering)
-> Generic ReservedCacheNodesOffering
forall x.
Rep ReservedCacheNodesOffering x -> ReservedCacheNodesOffering
forall x.
ReservedCacheNodesOffering -> Rep ReservedCacheNodesOffering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReservedCacheNodesOffering x -> ReservedCacheNodesOffering
$cfrom :: forall x.
ReservedCacheNodesOffering -> Rep ReservedCacheNodesOffering x
Prelude.Generic)

-- |
-- Create a value of 'ReservedCacheNodesOffering' 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:
--
-- 'cacheNodeType', 'reservedCacheNodesOffering_cacheNodeType' - The cache node type for the reserved cache node.
--
-- The following node types are supported by ElastiCache. Generally
-- speaking, the current generation types provide more memory and
-- computational power at lower cost when compared to their equivalent
-- previous generation counterparts.
--
-- -   General purpose:
--
--     -   Current generation:
--
--         __M6g node types__ (available only for Redis engine version
--         5.0.6 onward and for Memcached engine version 1.5.16 onward).
--
--         @cache.m6g.large@, @cache.m6g.xlarge@, @cache.m6g.2xlarge@,
--         @cache.m6g.4xlarge@, @cache.m6g.8xlarge@, @cache.m6g.12xlarge@,
--         @cache.m6g.16xlarge@
--
--         For region availability, see
--         <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion Supported Node Types>
--
--         __M5 node types:__ @cache.m5.large@, @cache.m5.xlarge@,
--         @cache.m5.2xlarge@, @cache.m5.4xlarge@, @cache.m5.12xlarge@,
--         @cache.m5.24xlarge@
--
--         __M4 node types:__ @cache.m4.large@, @cache.m4.xlarge@,
--         @cache.m4.2xlarge@, @cache.m4.4xlarge@, @cache.m4.10xlarge@
--
--         __T3 node types:__ @cache.t3.micro@, @cache.t3.small@,
--         @cache.t3.medium@
--
--         __T2 node types:__ @cache.t2.micro@, @cache.t2.small@,
--         @cache.t2.medium@
--
--     -   Previous generation: (not recommended)
--
--         __T1 node types:__ @cache.t1.micro@
--
--         __M1 node types:__ @cache.m1.small@, @cache.m1.medium@,
--         @cache.m1.large@, @cache.m1.xlarge@
--
--         __M3 node types:__ @cache.m3.medium@, @cache.m3.large@,
--         @cache.m3.xlarge@, @cache.m3.2xlarge@
--
-- -   Compute optimized:
--
--     -   Previous generation: (not recommended)
--
--         __C1 node types:__ @cache.c1.xlarge@
--
-- -   Memory optimized:
--
--     -   Current generation:
--
--         __R6g node types__ (available only for Redis engine version
--         5.0.6 onward and for Memcached engine version 1.5.16 onward).
--
--         @cache.r6g.large@, @cache.r6g.xlarge@, @cache.r6g.2xlarge@,
--         @cache.r6g.4xlarge@, @cache.r6g.8xlarge@, @cache.r6g.12xlarge@,
--         @cache.r6g.16xlarge@
--
--         For region availability, see
--         <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion Supported Node Types>
--
--         __R5 node types:__ @cache.r5.large@, @cache.r5.xlarge@,
--         @cache.r5.2xlarge@, @cache.r5.4xlarge@, @cache.r5.12xlarge@,
--         @cache.r5.24xlarge@
--
--         __R4 node types:__ @cache.r4.large@, @cache.r4.xlarge@,
--         @cache.r4.2xlarge@, @cache.r4.4xlarge@, @cache.r4.8xlarge@,
--         @cache.r4.16xlarge@
--
--     -   Previous generation: (not recommended)
--
--         __M2 node types:__ @cache.m2.xlarge@, @cache.m2.2xlarge@,
--         @cache.m2.4xlarge@
--
--         __R3 node types:__ @cache.r3.large@, @cache.r3.xlarge@,
--         @cache.r3.2xlarge@, @cache.r3.4xlarge@, @cache.r3.8xlarge@
--
-- __Additional node type info__
--
-- -   All current generation instance types are created in Amazon VPC by
--     default.
--
-- -   Redis append-only files (AOF) are not supported for T1 or T2
--     instances.
--
-- -   Redis Multi-AZ with automatic failover is not supported on T1
--     instances.
--
-- -   Redis configuration variables @appendonly@ and @appendfsync@ are not
--     supported on Redis version 2.8.22 and later.
--
-- 'productDescription', 'reservedCacheNodesOffering_productDescription' - The cache engine used by the offering.
--
-- 'recurringCharges', 'reservedCacheNodesOffering_recurringCharges' - The recurring price charged to run this reserved cache node.
--
-- 'offeringType', 'reservedCacheNodesOffering_offeringType' - The offering type.
--
-- 'usagePrice', 'reservedCacheNodesOffering_usagePrice' - The hourly price charged for this offering.
--
-- 'fixedPrice', 'reservedCacheNodesOffering_fixedPrice' - The fixed price charged for this offering.
--
-- 'duration', 'reservedCacheNodesOffering_duration' - The duration of the offering. in seconds.
--
-- 'reservedCacheNodesOfferingId', 'reservedCacheNodesOffering_reservedCacheNodesOfferingId' - A unique identifier for the reserved cache node offering.
newReservedCacheNodesOffering ::
  ReservedCacheNodesOffering
newReservedCacheNodesOffering :: ReservedCacheNodesOffering
newReservedCacheNodesOffering =
  ReservedCacheNodesOffering' :: Maybe Text
-> Maybe Text
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> ReservedCacheNodesOffering
ReservedCacheNodesOffering'
    { $sel:cacheNodeType:ReservedCacheNodesOffering' :: Maybe Text
cacheNodeType =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:productDescription:ReservedCacheNodesOffering' :: Maybe Text
productDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recurringCharges:ReservedCacheNodesOffering' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringType:ReservedCacheNodesOffering' :: Maybe Text
offeringType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usagePrice:ReservedCacheNodesOffering' :: Maybe Double
usagePrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:fixedPrice:ReservedCacheNodesOffering' :: Maybe Double
fixedPrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:ReservedCacheNodesOffering' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedCacheNodesOfferingId:ReservedCacheNodesOffering' :: Maybe Text
reservedCacheNodesOfferingId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The cache node type for the reserved cache node.
--
-- The following node types are supported by ElastiCache. Generally
-- speaking, the current generation types provide more memory and
-- computational power at lower cost when compared to their equivalent
-- previous generation counterparts.
--
-- -   General purpose:
--
--     -   Current generation:
--
--         __M6g node types__ (available only for Redis engine version
--         5.0.6 onward and for Memcached engine version 1.5.16 onward).
--
--         @cache.m6g.large@, @cache.m6g.xlarge@, @cache.m6g.2xlarge@,
--         @cache.m6g.4xlarge@, @cache.m6g.8xlarge@, @cache.m6g.12xlarge@,
--         @cache.m6g.16xlarge@
--
--         For region availability, see
--         <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion Supported Node Types>
--
--         __M5 node types:__ @cache.m5.large@, @cache.m5.xlarge@,
--         @cache.m5.2xlarge@, @cache.m5.4xlarge@, @cache.m5.12xlarge@,
--         @cache.m5.24xlarge@
--
--         __M4 node types:__ @cache.m4.large@, @cache.m4.xlarge@,
--         @cache.m4.2xlarge@, @cache.m4.4xlarge@, @cache.m4.10xlarge@
--
--         __T3 node types:__ @cache.t3.micro@, @cache.t3.small@,
--         @cache.t3.medium@
--
--         __T2 node types:__ @cache.t2.micro@, @cache.t2.small@,
--         @cache.t2.medium@
--
--     -   Previous generation: (not recommended)
--
--         __T1 node types:__ @cache.t1.micro@
--
--         __M1 node types:__ @cache.m1.small@, @cache.m1.medium@,
--         @cache.m1.large@, @cache.m1.xlarge@
--
--         __M3 node types:__ @cache.m3.medium@, @cache.m3.large@,
--         @cache.m3.xlarge@, @cache.m3.2xlarge@
--
-- -   Compute optimized:
--
--     -   Previous generation: (not recommended)
--
--         __C1 node types:__ @cache.c1.xlarge@
--
-- -   Memory optimized:
--
--     -   Current generation:
--
--         __R6g node types__ (available only for Redis engine version
--         5.0.6 onward and for Memcached engine version 1.5.16 onward).
--
--         @cache.r6g.large@, @cache.r6g.xlarge@, @cache.r6g.2xlarge@,
--         @cache.r6g.4xlarge@, @cache.r6g.8xlarge@, @cache.r6g.12xlarge@,
--         @cache.r6g.16xlarge@
--
--         For region availability, see
--         <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion Supported Node Types>
--
--         __R5 node types:__ @cache.r5.large@, @cache.r5.xlarge@,
--         @cache.r5.2xlarge@, @cache.r5.4xlarge@, @cache.r5.12xlarge@,
--         @cache.r5.24xlarge@
--
--         __R4 node types:__ @cache.r4.large@, @cache.r4.xlarge@,
--         @cache.r4.2xlarge@, @cache.r4.4xlarge@, @cache.r4.8xlarge@,
--         @cache.r4.16xlarge@
--
--     -   Previous generation: (not recommended)
--
--         __M2 node types:__ @cache.m2.xlarge@, @cache.m2.2xlarge@,
--         @cache.m2.4xlarge@
--
--         __R3 node types:__ @cache.r3.large@, @cache.r3.xlarge@,
--         @cache.r3.2xlarge@, @cache.r3.4xlarge@, @cache.r3.8xlarge@
--
-- __Additional node type info__
--
-- -   All current generation instance types are created in Amazon VPC by
--     default.
--
-- -   Redis append-only files (AOF) are not supported for T1 or T2
--     instances.
--
-- -   Redis Multi-AZ with automatic failover is not supported on T1
--     instances.
--
-- -   Redis configuration variables @appendonly@ and @appendfsync@ are not
--     supported on Redis version 2.8.22 and later.
reservedCacheNodesOffering_cacheNodeType :: Lens.Lens' ReservedCacheNodesOffering (Prelude.Maybe Prelude.Text)
reservedCacheNodesOffering_cacheNodeType :: (Maybe Text -> f (Maybe Text))
-> ReservedCacheNodesOffering -> f ReservedCacheNodesOffering
reservedCacheNodesOffering_cacheNodeType = (ReservedCacheNodesOffering -> Maybe Text)
-> (ReservedCacheNodesOffering
    -> Maybe Text -> ReservedCacheNodesOffering)
-> Lens
     ReservedCacheNodesOffering
     ReservedCacheNodesOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedCacheNodesOffering' {Maybe Text
cacheNodeType :: Maybe Text
$sel:cacheNodeType:ReservedCacheNodesOffering' :: ReservedCacheNodesOffering -> Maybe Text
cacheNodeType} -> Maybe Text
cacheNodeType) (\s :: ReservedCacheNodesOffering
s@ReservedCacheNodesOffering' {} Maybe Text
a -> ReservedCacheNodesOffering
s {$sel:cacheNodeType:ReservedCacheNodesOffering' :: Maybe Text
cacheNodeType = Maybe Text
a} :: ReservedCacheNodesOffering)

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

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

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

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

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

-- | A unique identifier for the reserved cache node offering.
reservedCacheNodesOffering_reservedCacheNodesOfferingId :: Lens.Lens' ReservedCacheNodesOffering (Prelude.Maybe Prelude.Text)
reservedCacheNodesOffering_reservedCacheNodesOfferingId :: (Maybe Text -> f (Maybe Text))
-> ReservedCacheNodesOffering -> f ReservedCacheNodesOffering
reservedCacheNodesOffering_reservedCacheNodesOfferingId = (ReservedCacheNodesOffering -> Maybe Text)
-> (ReservedCacheNodesOffering
    -> Maybe Text -> ReservedCacheNodesOffering)
-> Lens
     ReservedCacheNodesOffering
     ReservedCacheNodesOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedCacheNodesOffering' {Maybe Text
reservedCacheNodesOfferingId :: Maybe Text
$sel:reservedCacheNodesOfferingId:ReservedCacheNodesOffering' :: ReservedCacheNodesOffering -> Maybe Text
reservedCacheNodesOfferingId} -> Maybe Text
reservedCacheNodesOfferingId) (\s :: ReservedCacheNodesOffering
s@ReservedCacheNodesOffering' {} Maybe Text
a -> ReservedCacheNodesOffering
s {$sel:reservedCacheNodesOfferingId:ReservedCacheNodesOffering' :: Maybe Text
reservedCacheNodesOfferingId = Maybe Text
a} :: ReservedCacheNodesOffering)

instance Core.FromXML ReservedCacheNodesOffering where
  parseXML :: [Node] -> Either String ReservedCacheNodesOffering
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> ReservedCacheNodesOffering
ReservedCacheNodesOffering'
      (Maybe Text
 -> Maybe Text
 -> Maybe [RecurringCharge]
 -> Maybe Text
 -> Maybe Double
 -> Maybe Double
 -> Maybe Int
 -> Maybe Text
 -> ReservedCacheNodesOffering)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNodesOffering)
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
"CacheNodeType")
      Either
  String
  (Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe Text
   -> ReservedCacheNodesOffering)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNodesOffering)
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 [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe Text
   -> ReservedCacheNodesOffering)
-> Either String (Maybe [RecurringCharge])
-> Either
     String
     (Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNodesOffering)
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
   -> Maybe Text
   -> ReservedCacheNodesOffering)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNodesOffering)
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
   -> Maybe Text
   -> ReservedCacheNodesOffering)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Double
      -> Maybe Int -> Maybe Text -> ReservedCacheNodesOffering)
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 -> Maybe Text -> ReservedCacheNodesOffering)
-> Either String (Maybe Double)
-> Either
     String (Maybe Int -> Maybe Text -> ReservedCacheNodesOffering)
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 -> Maybe Text -> ReservedCacheNodesOffering)
-> Either String (Maybe Int)
-> Either String (Maybe Text -> ReservedCacheNodesOffering)
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")
      Either String (Maybe Text -> ReservedCacheNodesOffering)
-> Either String (Maybe Text)
-> Either String ReservedCacheNodesOffering
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
"ReservedCacheNodesOfferingId")

instance Prelude.Hashable ReservedCacheNodesOffering

instance Prelude.NFData ReservedCacheNodesOffering