{-# 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.SavingsPlans.Types.SavingsPlan
-- 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.SavingsPlans.Types.SavingsPlan where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SavingsPlans.Types.CurrencyCode
import Amazonka.SavingsPlans.Types.SavingsPlanPaymentOption
import Amazonka.SavingsPlans.Types.SavingsPlanProductType
import Amazonka.SavingsPlans.Types.SavingsPlanState
import Amazonka.SavingsPlans.Types.SavingsPlanType

-- | Information about a Savings Plan.
--
-- /See:/ 'newSavingsPlan' smart constructor.
data SavingsPlan = SavingsPlan'
  { -- | The duration of the term, in seconds.
    SavingsPlan -> Maybe Integer
termDurationInSeconds :: Prelude.Maybe Prelude.Integer,
    -- | The plan type.
    SavingsPlan -> Maybe SavingsPlanType
savingsPlanType :: Prelude.Maybe SavingsPlanType,
    -- | The state.
    SavingsPlan -> Maybe SavingsPlanState
state :: Prelude.Maybe SavingsPlanState,
    -- | The product types.
    SavingsPlan -> Maybe [SavingsPlanProductType]
productTypes :: Prelude.Maybe [SavingsPlanProductType],
    -- | The start time.
    SavingsPlan -> Maybe Text
start :: Prelude.Maybe Prelude.Text,
    -- | The EC2 instance family.
    SavingsPlan -> Maybe Text
ec2InstanceFamily :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Savings Plan.
    SavingsPlan -> Maybe Text
savingsPlanId :: Prelude.Maybe Prelude.Text,
    -- | The recurring payment amount.
    SavingsPlan -> Maybe Text
recurringPaymentAmount :: Prelude.Maybe Prelude.Text,
    -- | The currency.
    SavingsPlan -> Maybe CurrencyCode
currency :: Prelude.Maybe CurrencyCode,
    -- | The end time.
    SavingsPlan -> Maybe Text
end :: Prelude.Maybe Prelude.Text,
    -- | The up-front payment amount.
    SavingsPlan -> Maybe Text
upfrontPaymentAmount :: Prelude.Maybe Prelude.Text,
    -- | The ID of the offering.
    SavingsPlan -> Maybe Text
offeringId :: Prelude.Maybe Prelude.Text,
    -- | The AWS Region.
    SavingsPlan -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The hourly commitment, in USD.
    SavingsPlan -> Maybe Text
commitment :: Prelude.Maybe Prelude.Text,
    -- | The description.
    SavingsPlan -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The payment option.
    SavingsPlan -> Maybe SavingsPlanPaymentOption
paymentOption :: Prelude.Maybe SavingsPlanPaymentOption,
    -- | The Amazon Resource Name (ARN) of the Savings Plan.
    SavingsPlan -> Maybe Text
savingsPlanArn :: Prelude.Maybe Prelude.Text,
    -- | One or more tags.
    SavingsPlan -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (SavingsPlan -> SavingsPlan -> Bool
(SavingsPlan -> SavingsPlan -> Bool)
-> (SavingsPlan -> SavingsPlan -> Bool) -> Eq SavingsPlan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SavingsPlan -> SavingsPlan -> Bool
$c/= :: SavingsPlan -> SavingsPlan -> Bool
== :: SavingsPlan -> SavingsPlan -> Bool
$c== :: SavingsPlan -> SavingsPlan -> Bool
Prelude.Eq, ReadPrec [SavingsPlan]
ReadPrec SavingsPlan
Int -> ReadS SavingsPlan
ReadS [SavingsPlan]
(Int -> ReadS SavingsPlan)
-> ReadS [SavingsPlan]
-> ReadPrec SavingsPlan
-> ReadPrec [SavingsPlan]
-> Read SavingsPlan
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SavingsPlan]
$creadListPrec :: ReadPrec [SavingsPlan]
readPrec :: ReadPrec SavingsPlan
$creadPrec :: ReadPrec SavingsPlan
readList :: ReadS [SavingsPlan]
$creadList :: ReadS [SavingsPlan]
readsPrec :: Int -> ReadS SavingsPlan
$creadsPrec :: Int -> ReadS SavingsPlan
Prelude.Read, Int -> SavingsPlan -> ShowS
[SavingsPlan] -> ShowS
SavingsPlan -> String
(Int -> SavingsPlan -> ShowS)
-> (SavingsPlan -> String)
-> ([SavingsPlan] -> ShowS)
-> Show SavingsPlan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SavingsPlan] -> ShowS
$cshowList :: [SavingsPlan] -> ShowS
show :: SavingsPlan -> String
$cshow :: SavingsPlan -> String
showsPrec :: Int -> SavingsPlan -> ShowS
$cshowsPrec :: Int -> SavingsPlan -> ShowS
Prelude.Show, (forall x. SavingsPlan -> Rep SavingsPlan x)
-> (forall x. Rep SavingsPlan x -> SavingsPlan)
-> Generic SavingsPlan
forall x. Rep SavingsPlan x -> SavingsPlan
forall x. SavingsPlan -> Rep SavingsPlan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SavingsPlan x -> SavingsPlan
$cfrom :: forall x. SavingsPlan -> Rep SavingsPlan x
Prelude.Generic)

-- |
-- Create a value of 'SavingsPlan' 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:
--
-- 'termDurationInSeconds', 'savingsPlan_termDurationInSeconds' - The duration of the term, in seconds.
--
-- 'savingsPlanType', 'savingsPlan_savingsPlanType' - The plan type.
--
-- 'state', 'savingsPlan_state' - The state.
--
-- 'productTypes', 'savingsPlan_productTypes' - The product types.
--
-- 'start', 'savingsPlan_start' - The start time.
--
-- 'ec2InstanceFamily', 'savingsPlan_ec2InstanceFamily' - The EC2 instance family.
--
-- 'savingsPlanId', 'savingsPlan_savingsPlanId' - The ID of the Savings Plan.
--
-- 'recurringPaymentAmount', 'savingsPlan_recurringPaymentAmount' - The recurring payment amount.
--
-- 'currency', 'savingsPlan_currency' - The currency.
--
-- 'end', 'savingsPlan_end' - The end time.
--
-- 'upfrontPaymentAmount', 'savingsPlan_upfrontPaymentAmount' - The up-front payment amount.
--
-- 'offeringId', 'savingsPlan_offeringId' - The ID of the offering.
--
-- 'region', 'savingsPlan_region' - The AWS Region.
--
-- 'commitment', 'savingsPlan_commitment' - The hourly commitment, in USD.
--
-- 'description', 'savingsPlan_description' - The description.
--
-- 'paymentOption', 'savingsPlan_paymentOption' - The payment option.
--
-- 'savingsPlanArn', 'savingsPlan_savingsPlanArn' - The Amazon Resource Name (ARN) of the Savings Plan.
--
-- 'tags', 'savingsPlan_tags' - One or more tags.
newSavingsPlan ::
  SavingsPlan
newSavingsPlan :: SavingsPlan
newSavingsPlan =
  SavingsPlan' :: Maybe Integer
-> Maybe SavingsPlanType
-> Maybe SavingsPlanState
-> Maybe [SavingsPlanProductType]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CurrencyCode
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe Text
-> Maybe (HashMap Text Text)
-> SavingsPlan
SavingsPlan'
    { $sel:termDurationInSeconds:SavingsPlan' :: Maybe Integer
termDurationInSeconds =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:savingsPlanType:SavingsPlan' :: Maybe SavingsPlanType
savingsPlanType = Maybe SavingsPlanType
forall a. Maybe a
Prelude.Nothing,
      $sel:state:SavingsPlan' :: Maybe SavingsPlanState
state = Maybe SavingsPlanState
forall a. Maybe a
Prelude.Nothing,
      $sel:productTypes:SavingsPlan' :: Maybe [SavingsPlanProductType]
productTypes = Maybe [SavingsPlanProductType]
forall a. Maybe a
Prelude.Nothing,
      $sel:start:SavingsPlan' :: Maybe Text
start = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ec2InstanceFamily:SavingsPlan' :: Maybe Text
ec2InstanceFamily = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:savingsPlanId:SavingsPlan' :: Maybe Text
savingsPlanId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recurringPaymentAmount:SavingsPlan' :: Maybe Text
recurringPaymentAmount = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:currency:SavingsPlan' :: Maybe CurrencyCode
currency = Maybe CurrencyCode
forall a. Maybe a
Prelude.Nothing,
      $sel:end:SavingsPlan' :: Maybe Text
end = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:upfrontPaymentAmount:SavingsPlan' :: Maybe Text
upfrontPaymentAmount = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringId:SavingsPlan' :: Maybe Text
offeringId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:region:SavingsPlan' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:commitment:SavingsPlan' :: Maybe Text
commitment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:SavingsPlan' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:paymentOption:SavingsPlan' :: Maybe SavingsPlanPaymentOption
paymentOption = Maybe SavingsPlanPaymentOption
forall a. Maybe a
Prelude.Nothing,
      $sel:savingsPlanArn:SavingsPlan' :: Maybe Text
savingsPlanArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:SavingsPlan' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The duration of the term, in seconds.
savingsPlan_termDurationInSeconds :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Integer)
savingsPlan_termDurationInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> SavingsPlan -> f SavingsPlan
savingsPlan_termDurationInSeconds = (SavingsPlan -> Maybe Integer)
-> (SavingsPlan -> Maybe Integer -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Integer
termDurationInSeconds :: Maybe Integer
$sel:termDurationInSeconds:SavingsPlan' :: SavingsPlan -> Maybe Integer
termDurationInSeconds} -> Maybe Integer
termDurationInSeconds) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Integer
a -> SavingsPlan
s {$sel:termDurationInSeconds:SavingsPlan' :: Maybe Integer
termDurationInSeconds = Maybe Integer
a} :: SavingsPlan)

-- | The plan type.
savingsPlan_savingsPlanType :: Lens.Lens' SavingsPlan (Prelude.Maybe SavingsPlanType)
savingsPlan_savingsPlanType :: (Maybe SavingsPlanType -> f (Maybe SavingsPlanType))
-> SavingsPlan -> f SavingsPlan
savingsPlan_savingsPlanType = (SavingsPlan -> Maybe SavingsPlanType)
-> (SavingsPlan -> Maybe SavingsPlanType -> SavingsPlan)
-> Lens
     SavingsPlan
     SavingsPlan
     (Maybe SavingsPlanType)
     (Maybe SavingsPlanType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe SavingsPlanType
savingsPlanType :: Maybe SavingsPlanType
$sel:savingsPlanType:SavingsPlan' :: SavingsPlan -> Maybe SavingsPlanType
savingsPlanType} -> Maybe SavingsPlanType
savingsPlanType) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe SavingsPlanType
a -> SavingsPlan
s {$sel:savingsPlanType:SavingsPlan' :: Maybe SavingsPlanType
savingsPlanType = Maybe SavingsPlanType
a} :: SavingsPlan)

-- | The state.
savingsPlan_state :: Lens.Lens' SavingsPlan (Prelude.Maybe SavingsPlanState)
savingsPlan_state :: (Maybe SavingsPlanState -> f (Maybe SavingsPlanState))
-> SavingsPlan -> f SavingsPlan
savingsPlan_state = (SavingsPlan -> Maybe SavingsPlanState)
-> (SavingsPlan -> Maybe SavingsPlanState -> SavingsPlan)
-> Lens
     SavingsPlan
     SavingsPlan
     (Maybe SavingsPlanState)
     (Maybe SavingsPlanState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe SavingsPlanState
state :: Maybe SavingsPlanState
$sel:state:SavingsPlan' :: SavingsPlan -> Maybe SavingsPlanState
state} -> Maybe SavingsPlanState
state) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe SavingsPlanState
a -> SavingsPlan
s {$sel:state:SavingsPlan' :: Maybe SavingsPlanState
state = Maybe SavingsPlanState
a} :: SavingsPlan)

-- | The product types.
savingsPlan_productTypes :: Lens.Lens' SavingsPlan (Prelude.Maybe [SavingsPlanProductType])
savingsPlan_productTypes :: (Maybe [SavingsPlanProductType]
 -> f (Maybe [SavingsPlanProductType]))
-> SavingsPlan -> f SavingsPlan
savingsPlan_productTypes = (SavingsPlan -> Maybe [SavingsPlanProductType])
-> (SavingsPlan -> Maybe [SavingsPlanProductType] -> SavingsPlan)
-> Lens
     SavingsPlan
     SavingsPlan
     (Maybe [SavingsPlanProductType])
     (Maybe [SavingsPlanProductType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe [SavingsPlanProductType]
productTypes :: Maybe [SavingsPlanProductType]
$sel:productTypes:SavingsPlan' :: SavingsPlan -> Maybe [SavingsPlanProductType]
productTypes} -> Maybe [SavingsPlanProductType]
productTypes) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe [SavingsPlanProductType]
a -> SavingsPlan
s {$sel:productTypes:SavingsPlan' :: Maybe [SavingsPlanProductType]
productTypes = Maybe [SavingsPlanProductType]
a} :: SavingsPlan) ((Maybe [SavingsPlanProductType]
  -> f (Maybe [SavingsPlanProductType]))
 -> SavingsPlan -> f SavingsPlan)
-> ((Maybe [SavingsPlanProductType]
     -> f (Maybe [SavingsPlanProductType]))
    -> Maybe [SavingsPlanProductType]
    -> f (Maybe [SavingsPlanProductType]))
-> (Maybe [SavingsPlanProductType]
    -> f (Maybe [SavingsPlanProductType]))
-> SavingsPlan
-> f SavingsPlan
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SavingsPlanProductType]
  [SavingsPlanProductType]
  [SavingsPlanProductType]
  [SavingsPlanProductType]
-> Iso
     (Maybe [SavingsPlanProductType])
     (Maybe [SavingsPlanProductType])
     (Maybe [SavingsPlanProductType])
     (Maybe [SavingsPlanProductType])
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
  [SavingsPlanProductType]
  [SavingsPlanProductType]
  [SavingsPlanProductType]
  [SavingsPlanProductType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The start time.
savingsPlan_start :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_start :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_start = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
start :: Maybe Text
$sel:start:SavingsPlan' :: SavingsPlan -> Maybe Text
start} -> Maybe Text
start) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:start:SavingsPlan' :: Maybe Text
start = Maybe Text
a} :: SavingsPlan)

-- | The EC2 instance family.
savingsPlan_ec2InstanceFamily :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_ec2InstanceFamily :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_ec2InstanceFamily = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
ec2InstanceFamily :: Maybe Text
$sel:ec2InstanceFamily:SavingsPlan' :: SavingsPlan -> Maybe Text
ec2InstanceFamily} -> Maybe Text
ec2InstanceFamily) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:ec2InstanceFamily:SavingsPlan' :: Maybe Text
ec2InstanceFamily = Maybe Text
a} :: SavingsPlan)

-- | The ID of the Savings Plan.
savingsPlan_savingsPlanId :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_savingsPlanId :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_savingsPlanId = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
savingsPlanId :: Maybe Text
$sel:savingsPlanId:SavingsPlan' :: SavingsPlan -> Maybe Text
savingsPlanId} -> Maybe Text
savingsPlanId) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:savingsPlanId:SavingsPlan' :: Maybe Text
savingsPlanId = Maybe Text
a} :: SavingsPlan)

-- | The recurring payment amount.
savingsPlan_recurringPaymentAmount :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_recurringPaymentAmount :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_recurringPaymentAmount = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
recurringPaymentAmount :: Maybe Text
$sel:recurringPaymentAmount:SavingsPlan' :: SavingsPlan -> Maybe Text
recurringPaymentAmount} -> Maybe Text
recurringPaymentAmount) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:recurringPaymentAmount:SavingsPlan' :: Maybe Text
recurringPaymentAmount = Maybe Text
a} :: SavingsPlan)

-- | The currency.
savingsPlan_currency :: Lens.Lens' SavingsPlan (Prelude.Maybe CurrencyCode)
savingsPlan_currency :: (Maybe CurrencyCode -> f (Maybe CurrencyCode))
-> SavingsPlan -> f SavingsPlan
savingsPlan_currency = (SavingsPlan -> Maybe CurrencyCode)
-> (SavingsPlan -> Maybe CurrencyCode -> SavingsPlan)
-> Lens
     SavingsPlan SavingsPlan (Maybe CurrencyCode) (Maybe CurrencyCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe CurrencyCode
currency :: Maybe CurrencyCode
$sel:currency:SavingsPlan' :: SavingsPlan -> Maybe CurrencyCode
currency} -> Maybe CurrencyCode
currency) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe CurrencyCode
a -> SavingsPlan
s {$sel:currency:SavingsPlan' :: Maybe CurrencyCode
currency = Maybe CurrencyCode
a} :: SavingsPlan)

-- | The end time.
savingsPlan_end :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_end :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_end = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
end :: Maybe Text
$sel:end:SavingsPlan' :: SavingsPlan -> Maybe Text
end} -> Maybe Text
end) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:end:SavingsPlan' :: Maybe Text
end = Maybe Text
a} :: SavingsPlan)

-- | The up-front payment amount.
savingsPlan_upfrontPaymentAmount :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_upfrontPaymentAmount :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_upfrontPaymentAmount = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
upfrontPaymentAmount :: Maybe Text
$sel:upfrontPaymentAmount:SavingsPlan' :: SavingsPlan -> Maybe Text
upfrontPaymentAmount} -> Maybe Text
upfrontPaymentAmount) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:upfrontPaymentAmount:SavingsPlan' :: Maybe Text
upfrontPaymentAmount = Maybe Text
a} :: SavingsPlan)

-- | The ID of the offering.
savingsPlan_offeringId :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_offeringId :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_offeringId = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
offeringId :: Maybe Text
$sel:offeringId:SavingsPlan' :: SavingsPlan -> Maybe Text
offeringId} -> Maybe Text
offeringId) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:offeringId:SavingsPlan' :: Maybe Text
offeringId = Maybe Text
a} :: SavingsPlan)

-- | The AWS Region.
savingsPlan_region :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_region :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_region = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
region :: Maybe Text
$sel:region:SavingsPlan' :: SavingsPlan -> Maybe Text
region} -> Maybe Text
region) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:region:SavingsPlan' :: Maybe Text
region = Maybe Text
a} :: SavingsPlan)

-- | The hourly commitment, in USD.
savingsPlan_commitment :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_commitment :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_commitment = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
commitment :: Maybe Text
$sel:commitment:SavingsPlan' :: SavingsPlan -> Maybe Text
commitment} -> Maybe Text
commitment) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:commitment:SavingsPlan' :: Maybe Text
commitment = Maybe Text
a} :: SavingsPlan)

-- | The description.
savingsPlan_description :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_description :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_description = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
description :: Maybe Text
$sel:description:SavingsPlan' :: SavingsPlan -> Maybe Text
description} -> Maybe Text
description) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:description:SavingsPlan' :: Maybe Text
description = Maybe Text
a} :: SavingsPlan)

-- | The payment option.
savingsPlan_paymentOption :: Lens.Lens' SavingsPlan (Prelude.Maybe SavingsPlanPaymentOption)
savingsPlan_paymentOption :: (Maybe SavingsPlanPaymentOption
 -> f (Maybe SavingsPlanPaymentOption))
-> SavingsPlan -> f SavingsPlan
savingsPlan_paymentOption = (SavingsPlan -> Maybe SavingsPlanPaymentOption)
-> (SavingsPlan -> Maybe SavingsPlanPaymentOption -> SavingsPlan)
-> Lens
     SavingsPlan
     SavingsPlan
     (Maybe SavingsPlanPaymentOption)
     (Maybe SavingsPlanPaymentOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe SavingsPlanPaymentOption
paymentOption :: Maybe SavingsPlanPaymentOption
$sel:paymentOption:SavingsPlan' :: SavingsPlan -> Maybe SavingsPlanPaymentOption
paymentOption} -> Maybe SavingsPlanPaymentOption
paymentOption) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe SavingsPlanPaymentOption
a -> SavingsPlan
s {$sel:paymentOption:SavingsPlan' :: Maybe SavingsPlanPaymentOption
paymentOption = Maybe SavingsPlanPaymentOption
a} :: SavingsPlan)

-- | The Amazon Resource Name (ARN) of the Savings Plan.
savingsPlan_savingsPlanArn :: Lens.Lens' SavingsPlan (Prelude.Maybe Prelude.Text)
savingsPlan_savingsPlanArn :: (Maybe Text -> f (Maybe Text)) -> SavingsPlan -> f SavingsPlan
savingsPlan_savingsPlanArn = (SavingsPlan -> Maybe Text)
-> (SavingsPlan -> Maybe Text -> SavingsPlan)
-> Lens SavingsPlan SavingsPlan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe Text
savingsPlanArn :: Maybe Text
$sel:savingsPlanArn:SavingsPlan' :: SavingsPlan -> Maybe Text
savingsPlanArn} -> Maybe Text
savingsPlanArn) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe Text
a -> SavingsPlan
s {$sel:savingsPlanArn:SavingsPlan' :: Maybe Text
savingsPlanArn = Maybe Text
a} :: SavingsPlan)

-- | One or more tags.
savingsPlan_tags :: Lens.Lens' SavingsPlan (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
savingsPlan_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SavingsPlan -> f SavingsPlan
savingsPlan_tags = (SavingsPlan -> Maybe (HashMap Text Text))
-> (SavingsPlan -> Maybe (HashMap Text Text) -> SavingsPlan)
-> Lens
     SavingsPlan
     SavingsPlan
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlan' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:SavingsPlan' :: SavingsPlan -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: SavingsPlan
s@SavingsPlan' {} Maybe (HashMap Text Text)
a -> SavingsPlan
s {$sel:tags:SavingsPlan' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: SavingsPlan) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> SavingsPlan -> f SavingsPlan)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SavingsPlan
-> f SavingsPlan
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON SavingsPlan where
  parseJSON :: Value -> Parser SavingsPlan
parseJSON =
    String
-> (Object -> Parser SavingsPlan) -> Value -> Parser SavingsPlan
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SavingsPlan"
      ( \Object
x ->
          Maybe Integer
-> Maybe SavingsPlanType
-> Maybe SavingsPlanState
-> Maybe [SavingsPlanProductType]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CurrencyCode
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe Text
-> Maybe (HashMap Text Text)
-> SavingsPlan
SavingsPlan'
            (Maybe Integer
 -> Maybe SavingsPlanType
 -> Maybe SavingsPlanState
 -> Maybe [SavingsPlanProductType]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe CurrencyCode
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe SavingsPlanPaymentOption
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> SavingsPlan)
-> Parser (Maybe Integer)
-> Parser
     (Maybe SavingsPlanType
      -> Maybe SavingsPlanState
      -> Maybe [SavingsPlanProductType]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CurrencyCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"termDurationInSeconds")
            Parser
  (Maybe SavingsPlanType
   -> Maybe SavingsPlanState
   -> Maybe [SavingsPlanProductType]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CurrencyCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe SavingsPlanType)
-> Parser
     (Maybe SavingsPlanState
      -> Maybe [SavingsPlanProductType]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CurrencyCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SavingsPlanType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"savingsPlanType")
            Parser
  (Maybe SavingsPlanState
   -> Maybe [SavingsPlanProductType]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CurrencyCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe SavingsPlanState)
-> Parser
     (Maybe [SavingsPlanProductType]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CurrencyCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SavingsPlanState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
            Parser
  (Maybe [SavingsPlanProductType]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CurrencyCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe [SavingsPlanProductType])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CurrencyCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [SavingsPlanProductType]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"productTypes" Parser (Maybe (Maybe [SavingsPlanProductType]))
-> Maybe [SavingsPlanProductType]
-> Parser (Maybe [SavingsPlanProductType])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SavingsPlanProductType]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CurrencyCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CurrencyCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"start")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CurrencyCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe CurrencyCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ec2InstanceFamily")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe CurrencyCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe CurrencyCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"savingsPlanId")
            Parser
  (Maybe Text
   -> Maybe CurrencyCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe CurrencyCode
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"recurringPaymentAmount")
            Parser
  (Maybe CurrencyCode
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe CurrencyCode)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CurrencyCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"currency")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"end")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"upfrontPaymentAmount")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"offeringId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"region")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe SavingsPlanPaymentOption
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"commitment")
            Parser
  (Maybe Text
   -> Maybe SavingsPlanPaymentOption
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser
     (Maybe SavingsPlanPaymentOption
      -> Maybe Text -> Maybe (HashMap Text Text) -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
            Parser
  (Maybe SavingsPlanPaymentOption
   -> Maybe Text -> Maybe (HashMap Text Text) -> SavingsPlan)
-> Parser (Maybe SavingsPlanPaymentOption)
-> Parser (Maybe Text -> Maybe (HashMap Text Text) -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SavingsPlanPaymentOption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"paymentOption")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> SavingsPlan)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> SavingsPlan)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"savingsPlanArn")
            Parser (Maybe (HashMap Text Text) -> SavingsPlan)
-> Parser (Maybe (HashMap Text Text)) -> Parser SavingsPlan
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable SavingsPlan

instance Prelude.NFData SavingsPlan