{-# 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.ReservedCacheNode
-- 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.ReservedCacheNode where

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

-- | Represents the output of a @PurchaseReservedCacheNodesOffering@
-- operation.
--
-- /See:/ 'newReservedCacheNode' smart constructor.
data ReservedCacheNode = ReservedCacheNode'
  { -- | The cache node type for the reserved cache nodes.
    --
    -- 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.
    ReservedCacheNode -> Maybe Text
cacheNodeType :: Prelude.Maybe Prelude.Text,
    -- | The state of the reserved cache node.
    ReservedCacheNode -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | The time the reservation started.
    ReservedCacheNode -> Maybe ISO8601
startTime :: Prelude.Maybe Core.ISO8601,
    -- | The description of the reserved cache node.
    ReservedCacheNode -> Maybe Text
productDescription :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the reserved cache node.
    --
    -- Example:
    -- @arn:aws:elasticache:us-east-1:123456789012:reserved-instance:ri-2017-03-27-08-33-25-582@
    ReservedCacheNode -> Maybe Text
reservationARN :: Prelude.Maybe Prelude.Text,
    -- | The number of cache nodes that have been reserved.
    ReservedCacheNode -> Maybe Int
cacheNodeCount :: Prelude.Maybe Prelude.Int,
    -- | The unique identifier for the reservation.
    ReservedCacheNode -> Maybe Text
reservedCacheNodeId :: Prelude.Maybe Prelude.Text,
    -- | The recurring price charged to run this reserved cache node.
    ReservedCacheNode -> Maybe [RecurringCharge]
recurringCharges :: Prelude.Maybe [RecurringCharge],
    -- | The offering type of this reserved cache node.
    ReservedCacheNode -> Maybe Text
offeringType :: Prelude.Maybe Prelude.Text,
    -- | The hourly price charged for this reserved cache node.
    ReservedCacheNode -> Maybe Double
usagePrice :: Prelude.Maybe Prelude.Double,
    -- | The fixed price charged for this reserved cache node.
    ReservedCacheNode -> Maybe Double
fixedPrice :: Prelude.Maybe Prelude.Double,
    -- | The duration of the reservation in seconds.
    ReservedCacheNode -> Maybe Int
duration :: Prelude.Maybe Prelude.Int,
    -- | The offering identifier.
    ReservedCacheNode -> Maybe Text
reservedCacheNodesOfferingId :: Prelude.Maybe Prelude.Text
  }
  deriving (ReservedCacheNode -> ReservedCacheNode -> Bool
(ReservedCacheNode -> ReservedCacheNode -> Bool)
-> (ReservedCacheNode -> ReservedCacheNode -> Bool)
-> Eq ReservedCacheNode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservedCacheNode -> ReservedCacheNode -> Bool
$c/= :: ReservedCacheNode -> ReservedCacheNode -> Bool
== :: ReservedCacheNode -> ReservedCacheNode -> Bool
$c== :: ReservedCacheNode -> ReservedCacheNode -> Bool
Prelude.Eq, ReadPrec [ReservedCacheNode]
ReadPrec ReservedCacheNode
Int -> ReadS ReservedCacheNode
ReadS [ReservedCacheNode]
(Int -> ReadS ReservedCacheNode)
-> ReadS [ReservedCacheNode]
-> ReadPrec ReservedCacheNode
-> ReadPrec [ReservedCacheNode]
-> Read ReservedCacheNode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservedCacheNode]
$creadListPrec :: ReadPrec [ReservedCacheNode]
readPrec :: ReadPrec ReservedCacheNode
$creadPrec :: ReadPrec ReservedCacheNode
readList :: ReadS [ReservedCacheNode]
$creadList :: ReadS [ReservedCacheNode]
readsPrec :: Int -> ReadS ReservedCacheNode
$creadsPrec :: Int -> ReadS ReservedCacheNode
Prelude.Read, Int -> ReservedCacheNode -> ShowS
[ReservedCacheNode] -> ShowS
ReservedCacheNode -> String
(Int -> ReservedCacheNode -> ShowS)
-> (ReservedCacheNode -> String)
-> ([ReservedCacheNode] -> ShowS)
-> Show ReservedCacheNode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservedCacheNode] -> ShowS
$cshowList :: [ReservedCacheNode] -> ShowS
show :: ReservedCacheNode -> String
$cshow :: ReservedCacheNode -> String
showsPrec :: Int -> ReservedCacheNode -> ShowS
$cshowsPrec :: Int -> ReservedCacheNode -> ShowS
Prelude.Show, (forall x. ReservedCacheNode -> Rep ReservedCacheNode x)
-> (forall x. Rep ReservedCacheNode x -> ReservedCacheNode)
-> Generic ReservedCacheNode
forall x. Rep ReservedCacheNode x -> ReservedCacheNode
forall x. ReservedCacheNode -> Rep ReservedCacheNode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReservedCacheNode x -> ReservedCacheNode
$cfrom :: forall x. ReservedCacheNode -> Rep ReservedCacheNode x
Prelude.Generic)

-- |
-- Create a value of 'ReservedCacheNode' 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', 'reservedCacheNode_cacheNodeType' - The cache node type for the reserved cache nodes.
--
-- 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.
--
-- 'state', 'reservedCacheNode_state' - The state of the reserved cache node.
--
-- 'startTime', 'reservedCacheNode_startTime' - The time the reservation started.
--
-- 'productDescription', 'reservedCacheNode_productDescription' - The description of the reserved cache node.
--
-- 'reservationARN', 'reservedCacheNode_reservationARN' - The Amazon Resource Name (ARN) of the reserved cache node.
--
-- Example:
-- @arn:aws:elasticache:us-east-1:123456789012:reserved-instance:ri-2017-03-27-08-33-25-582@
--
-- 'cacheNodeCount', 'reservedCacheNode_cacheNodeCount' - The number of cache nodes that have been reserved.
--
-- 'reservedCacheNodeId', 'reservedCacheNode_reservedCacheNodeId' - The unique identifier for the reservation.
--
-- 'recurringCharges', 'reservedCacheNode_recurringCharges' - The recurring price charged to run this reserved cache node.
--
-- 'offeringType', 'reservedCacheNode_offeringType' - The offering type of this reserved cache node.
--
-- 'usagePrice', 'reservedCacheNode_usagePrice' - The hourly price charged for this reserved cache node.
--
-- 'fixedPrice', 'reservedCacheNode_fixedPrice' - The fixed price charged for this reserved cache node.
--
-- 'duration', 'reservedCacheNode_duration' - The duration of the reservation in seconds.
--
-- 'reservedCacheNodesOfferingId', 'reservedCacheNode_reservedCacheNodesOfferingId' - The offering identifier.
newReservedCacheNode ::
  ReservedCacheNode
newReservedCacheNode :: ReservedCacheNode
newReservedCacheNode =
  ReservedCacheNode' :: Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> ReservedCacheNode
ReservedCacheNode'
    { $sel:cacheNodeType:ReservedCacheNode' :: Maybe Text
cacheNodeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:state:ReservedCacheNode' :: Maybe Text
state = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:ReservedCacheNode' :: Maybe ISO8601
startTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:productDescription:ReservedCacheNode' :: Maybe Text
productDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reservationARN:ReservedCacheNode' :: Maybe Text
reservationARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheNodeCount:ReservedCacheNode' :: Maybe Int
cacheNodeCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedCacheNodeId:ReservedCacheNode' :: Maybe Text
reservedCacheNodeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recurringCharges:ReservedCacheNode' :: Maybe [RecurringCharge]
recurringCharges = Maybe [RecurringCharge]
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringType:ReservedCacheNode' :: Maybe Text
offeringType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usagePrice:ReservedCacheNode' :: Maybe Double
usagePrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:fixedPrice:ReservedCacheNode' :: Maybe Double
fixedPrice = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:ReservedCacheNode' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:reservedCacheNodesOfferingId:ReservedCacheNode' :: Maybe Text
reservedCacheNodesOfferingId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The cache node type for the reserved cache nodes.
--
-- 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.
reservedCacheNode_cacheNodeType :: Lens.Lens' ReservedCacheNode (Prelude.Maybe Prelude.Text)
reservedCacheNode_cacheNodeType :: (Maybe Text -> f (Maybe Text))
-> ReservedCacheNode -> f ReservedCacheNode
reservedCacheNode_cacheNodeType = (ReservedCacheNode -> Maybe Text)
-> (ReservedCacheNode -> Maybe Text -> ReservedCacheNode)
-> Lens
     ReservedCacheNode ReservedCacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedCacheNode' {Maybe Text
cacheNodeType :: Maybe Text
$sel:cacheNodeType:ReservedCacheNode' :: ReservedCacheNode -> Maybe Text
cacheNodeType} -> Maybe Text
cacheNodeType) (\s :: ReservedCacheNode
s@ReservedCacheNode' {} Maybe Text
a -> ReservedCacheNode
s {$sel:cacheNodeType:ReservedCacheNode' :: Maybe Text
cacheNodeType = Maybe Text
a} :: ReservedCacheNode)

-- | The state of the reserved cache node.
reservedCacheNode_state :: Lens.Lens' ReservedCacheNode (Prelude.Maybe Prelude.Text)
reservedCacheNode_state :: (Maybe Text -> f (Maybe Text))
-> ReservedCacheNode -> f ReservedCacheNode
reservedCacheNode_state = (ReservedCacheNode -> Maybe Text)
-> (ReservedCacheNode -> Maybe Text -> ReservedCacheNode)
-> Lens
     ReservedCacheNode ReservedCacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedCacheNode' {Maybe Text
state :: Maybe Text
$sel:state:ReservedCacheNode' :: ReservedCacheNode -> Maybe Text
state} -> Maybe Text
state) (\s :: ReservedCacheNode
s@ReservedCacheNode' {} Maybe Text
a -> ReservedCacheNode
s {$sel:state:ReservedCacheNode' :: Maybe Text
state = Maybe Text
a} :: ReservedCacheNode)

-- | The time the reservation started.
reservedCacheNode_startTime :: Lens.Lens' ReservedCacheNode (Prelude.Maybe Prelude.UTCTime)
reservedCacheNode_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReservedCacheNode -> f ReservedCacheNode
reservedCacheNode_startTime = (ReservedCacheNode -> Maybe ISO8601)
-> (ReservedCacheNode -> Maybe ISO8601 -> ReservedCacheNode)
-> Lens
     ReservedCacheNode ReservedCacheNode (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedCacheNode' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:ReservedCacheNode' :: ReservedCacheNode -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: ReservedCacheNode
s@ReservedCacheNode' {} Maybe ISO8601
a -> ReservedCacheNode
s {$sel:startTime:ReservedCacheNode' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: ReservedCacheNode) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> ReservedCacheNode -> f ReservedCacheNode)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReservedCacheNode
-> f ReservedCacheNode
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 cache node.
reservedCacheNode_productDescription :: Lens.Lens' ReservedCacheNode (Prelude.Maybe Prelude.Text)
reservedCacheNode_productDescription :: (Maybe Text -> f (Maybe Text))
-> ReservedCacheNode -> f ReservedCacheNode
reservedCacheNode_productDescription = (ReservedCacheNode -> Maybe Text)
-> (ReservedCacheNode -> Maybe Text -> ReservedCacheNode)
-> Lens
     ReservedCacheNode ReservedCacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedCacheNode' {Maybe Text
productDescription :: Maybe Text
$sel:productDescription:ReservedCacheNode' :: ReservedCacheNode -> Maybe Text
productDescription} -> Maybe Text
productDescription) (\s :: ReservedCacheNode
s@ReservedCacheNode' {} Maybe Text
a -> ReservedCacheNode
s {$sel:productDescription:ReservedCacheNode' :: Maybe Text
productDescription = Maybe Text
a} :: ReservedCacheNode)

-- | The Amazon Resource Name (ARN) of the reserved cache node.
--
-- Example:
-- @arn:aws:elasticache:us-east-1:123456789012:reserved-instance:ri-2017-03-27-08-33-25-582@
reservedCacheNode_reservationARN :: Lens.Lens' ReservedCacheNode (Prelude.Maybe Prelude.Text)
reservedCacheNode_reservationARN :: (Maybe Text -> f (Maybe Text))
-> ReservedCacheNode -> f ReservedCacheNode
reservedCacheNode_reservationARN = (ReservedCacheNode -> Maybe Text)
-> (ReservedCacheNode -> Maybe Text -> ReservedCacheNode)
-> Lens
     ReservedCacheNode ReservedCacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedCacheNode' {Maybe Text
reservationARN :: Maybe Text
$sel:reservationARN:ReservedCacheNode' :: ReservedCacheNode -> Maybe Text
reservationARN} -> Maybe Text
reservationARN) (\s :: ReservedCacheNode
s@ReservedCacheNode' {} Maybe Text
a -> ReservedCacheNode
s {$sel:reservationARN:ReservedCacheNode' :: Maybe Text
reservationARN = Maybe Text
a} :: ReservedCacheNode)

-- | The number of cache nodes that have been reserved.
reservedCacheNode_cacheNodeCount :: Lens.Lens' ReservedCacheNode (Prelude.Maybe Prelude.Int)
reservedCacheNode_cacheNodeCount :: (Maybe Int -> f (Maybe Int))
-> ReservedCacheNode -> f ReservedCacheNode
reservedCacheNode_cacheNodeCount = (ReservedCacheNode -> Maybe Int)
-> (ReservedCacheNode -> Maybe Int -> ReservedCacheNode)
-> Lens ReservedCacheNode ReservedCacheNode (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservedCacheNode' {Maybe Int
cacheNodeCount :: Maybe Int
$sel:cacheNodeCount:ReservedCacheNode' :: ReservedCacheNode -> Maybe Int
cacheNodeCount} -> Maybe Int
cacheNodeCount) (\s :: ReservedCacheNode
s@ReservedCacheNode' {} Maybe Int
a -> ReservedCacheNode
s {$sel:cacheNodeCount:ReservedCacheNode' :: Maybe Int
cacheNodeCount = Maybe Int
a} :: ReservedCacheNode)

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

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

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

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

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

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

instance Core.FromXML ReservedCacheNode where
  parseXML :: [Node] -> Either String ReservedCacheNode
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [RecurringCharge]
-> Maybe Text
-> Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> ReservedCacheNode
ReservedCacheNode'
      (Maybe Text
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe [RecurringCharge]
 -> Maybe Text
 -> Maybe Double
 -> Maybe Double
 -> Maybe Int
 -> Maybe Text
 -> ReservedCacheNode)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNode)
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 ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe Text
   -> ReservedCacheNode)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNode)
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 ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe Text
   -> ReservedCacheNode)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNode)
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 Int
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe Text
   -> ReservedCacheNode)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNode)
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 Int
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe Text
   -> ReservedCacheNode)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Int
      -> Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNode)
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
"ReservationARN")
      Either
  String
  (Maybe Int
   -> Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe Text
   -> ReservedCacheNode)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text
      -> Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNode)
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
"CacheNodeCount")
      Either
  String
  (Maybe Text
   -> Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe Text
   -> ReservedCacheNode)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [RecurringCharge]
      -> Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNode)
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
"ReservedCacheNodeId")
      Either
  String
  (Maybe [RecurringCharge]
   -> Maybe Text
   -> Maybe Double
   -> Maybe Double
   -> Maybe Int
   -> Maybe Text
   -> ReservedCacheNode)
-> Either String (Maybe [RecurringCharge])
-> Either
     String
     (Maybe Text
      -> Maybe Double
      -> Maybe Double
      -> Maybe Int
      -> Maybe Text
      -> ReservedCacheNode)
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
   -> ReservedCacheNode)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Double
      -> Maybe Double -> Maybe Int -> Maybe Text -> ReservedCacheNode)
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 -> ReservedCacheNode)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Double -> Maybe Int -> Maybe Text -> ReservedCacheNode)
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 -> ReservedCacheNode)
-> Either String (Maybe Double)
-> Either String (Maybe Int -> Maybe Text -> ReservedCacheNode)
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 -> ReservedCacheNode)
-> Either String (Maybe Int)
-> Either String (Maybe Text -> ReservedCacheNode)
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 -> ReservedCacheNode)
-> Either String (Maybe Text) -> Either String ReservedCacheNode
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 ReservedCacheNode

instance Prelude.NFData ReservedCacheNode