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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SavingsPlans.Types.ParentSavingsPlanOffering
import Amazonka.SavingsPlans.Types.SavingsPlanOfferingRateProperty
import Amazonka.SavingsPlans.Types.SavingsPlanProductType
import Amazonka.SavingsPlans.Types.SavingsPlanRateServiceCode
import Amazonka.SavingsPlans.Types.SavingsPlanRateUnit

-- | Information about a Savings Plan offering rate.
--
-- /See:/ 'newSavingsPlanOfferingRate' smart constructor.
data SavingsPlanOfferingRate = SavingsPlanOfferingRate'
  { -- | The specific AWS operation for the line item in the billing report.
    SavingsPlanOfferingRate -> Maybe Text
operation :: Prelude.Maybe Prelude.Text,
    -- | The usage details of the line item in the billing report.
    SavingsPlanOfferingRate -> Maybe Text
usageType :: Prelude.Maybe Prelude.Text,
    -- | The product type.
    SavingsPlanOfferingRate -> Maybe SavingsPlanProductType
productType :: Prelude.Maybe SavingsPlanProductType,
    -- | The Savings Plan offering.
    SavingsPlanOfferingRate -> Maybe ParentSavingsPlanOffering
savingsPlanOffering :: Prelude.Maybe ParentSavingsPlanOffering,
    -- | The Savings Plan rate.
    SavingsPlanOfferingRate -> Maybe Text
rate :: Prelude.Maybe Prelude.Text,
    -- | The service.
    SavingsPlanOfferingRate -> Maybe SavingsPlanRateServiceCode
serviceCode :: Prelude.Maybe SavingsPlanRateServiceCode,
    -- | The unit.
    SavingsPlanOfferingRate -> Maybe SavingsPlanRateUnit
unit :: Prelude.Maybe SavingsPlanRateUnit,
    -- | The properties.
    SavingsPlanOfferingRate -> Maybe [SavingsPlanOfferingRateProperty]
properties :: Prelude.Maybe [SavingsPlanOfferingRateProperty]
  }
  deriving (SavingsPlanOfferingRate -> SavingsPlanOfferingRate -> Bool
(SavingsPlanOfferingRate -> SavingsPlanOfferingRate -> Bool)
-> (SavingsPlanOfferingRate -> SavingsPlanOfferingRate -> Bool)
-> Eq SavingsPlanOfferingRate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SavingsPlanOfferingRate -> SavingsPlanOfferingRate -> Bool
$c/= :: SavingsPlanOfferingRate -> SavingsPlanOfferingRate -> Bool
== :: SavingsPlanOfferingRate -> SavingsPlanOfferingRate -> Bool
$c== :: SavingsPlanOfferingRate -> SavingsPlanOfferingRate -> Bool
Prelude.Eq, ReadPrec [SavingsPlanOfferingRate]
ReadPrec SavingsPlanOfferingRate
Int -> ReadS SavingsPlanOfferingRate
ReadS [SavingsPlanOfferingRate]
(Int -> ReadS SavingsPlanOfferingRate)
-> ReadS [SavingsPlanOfferingRate]
-> ReadPrec SavingsPlanOfferingRate
-> ReadPrec [SavingsPlanOfferingRate]
-> Read SavingsPlanOfferingRate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SavingsPlanOfferingRate]
$creadListPrec :: ReadPrec [SavingsPlanOfferingRate]
readPrec :: ReadPrec SavingsPlanOfferingRate
$creadPrec :: ReadPrec SavingsPlanOfferingRate
readList :: ReadS [SavingsPlanOfferingRate]
$creadList :: ReadS [SavingsPlanOfferingRate]
readsPrec :: Int -> ReadS SavingsPlanOfferingRate
$creadsPrec :: Int -> ReadS SavingsPlanOfferingRate
Prelude.Read, Int -> SavingsPlanOfferingRate -> ShowS
[SavingsPlanOfferingRate] -> ShowS
SavingsPlanOfferingRate -> String
(Int -> SavingsPlanOfferingRate -> ShowS)
-> (SavingsPlanOfferingRate -> String)
-> ([SavingsPlanOfferingRate] -> ShowS)
-> Show SavingsPlanOfferingRate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SavingsPlanOfferingRate] -> ShowS
$cshowList :: [SavingsPlanOfferingRate] -> ShowS
show :: SavingsPlanOfferingRate -> String
$cshow :: SavingsPlanOfferingRate -> String
showsPrec :: Int -> SavingsPlanOfferingRate -> ShowS
$cshowsPrec :: Int -> SavingsPlanOfferingRate -> ShowS
Prelude.Show, (forall x.
 SavingsPlanOfferingRate -> Rep SavingsPlanOfferingRate x)
-> (forall x.
    Rep SavingsPlanOfferingRate x -> SavingsPlanOfferingRate)
-> Generic SavingsPlanOfferingRate
forall x. Rep SavingsPlanOfferingRate x -> SavingsPlanOfferingRate
forall x. SavingsPlanOfferingRate -> Rep SavingsPlanOfferingRate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SavingsPlanOfferingRate x -> SavingsPlanOfferingRate
$cfrom :: forall x. SavingsPlanOfferingRate -> Rep SavingsPlanOfferingRate x
Prelude.Generic)

-- |
-- Create a value of 'SavingsPlanOfferingRate' 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:
--
-- 'operation', 'savingsPlanOfferingRate_operation' - The specific AWS operation for the line item in the billing report.
--
-- 'usageType', 'savingsPlanOfferingRate_usageType' - The usage details of the line item in the billing report.
--
-- 'productType', 'savingsPlanOfferingRate_productType' - The product type.
--
-- 'savingsPlanOffering', 'savingsPlanOfferingRate_savingsPlanOffering' - The Savings Plan offering.
--
-- 'rate', 'savingsPlanOfferingRate_rate' - The Savings Plan rate.
--
-- 'serviceCode', 'savingsPlanOfferingRate_serviceCode' - The service.
--
-- 'unit', 'savingsPlanOfferingRate_unit' - The unit.
--
-- 'properties', 'savingsPlanOfferingRate_properties' - The properties.
newSavingsPlanOfferingRate ::
  SavingsPlanOfferingRate
newSavingsPlanOfferingRate :: SavingsPlanOfferingRate
newSavingsPlanOfferingRate =
  SavingsPlanOfferingRate' :: Maybe Text
-> Maybe Text
-> Maybe SavingsPlanProductType
-> Maybe ParentSavingsPlanOffering
-> Maybe Text
-> Maybe SavingsPlanRateServiceCode
-> Maybe SavingsPlanRateUnit
-> Maybe [SavingsPlanOfferingRateProperty]
-> SavingsPlanOfferingRate
SavingsPlanOfferingRate'
    { $sel:operation:SavingsPlanOfferingRate' :: Maybe Text
operation =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usageType:SavingsPlanOfferingRate' :: Maybe Text
usageType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:productType:SavingsPlanOfferingRate' :: Maybe SavingsPlanProductType
productType = Maybe SavingsPlanProductType
forall a. Maybe a
Prelude.Nothing,
      $sel:savingsPlanOffering:SavingsPlanOfferingRate' :: Maybe ParentSavingsPlanOffering
savingsPlanOffering = Maybe ParentSavingsPlanOffering
forall a. Maybe a
Prelude.Nothing,
      $sel:rate:SavingsPlanOfferingRate' :: Maybe Text
rate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceCode:SavingsPlanOfferingRate' :: Maybe SavingsPlanRateServiceCode
serviceCode = Maybe SavingsPlanRateServiceCode
forall a. Maybe a
Prelude.Nothing,
      $sel:unit:SavingsPlanOfferingRate' :: Maybe SavingsPlanRateUnit
unit = Maybe SavingsPlanRateUnit
forall a. Maybe a
Prelude.Nothing,
      $sel:properties:SavingsPlanOfferingRate' :: Maybe [SavingsPlanOfferingRateProperty]
properties = Maybe [SavingsPlanOfferingRateProperty]
forall a. Maybe a
Prelude.Nothing
    }

-- | The specific AWS operation for the line item in the billing report.
savingsPlanOfferingRate_operation :: Lens.Lens' SavingsPlanOfferingRate (Prelude.Maybe Prelude.Text)
savingsPlanOfferingRate_operation :: (Maybe Text -> f (Maybe Text))
-> SavingsPlanOfferingRate -> f SavingsPlanOfferingRate
savingsPlanOfferingRate_operation = (SavingsPlanOfferingRate -> Maybe Text)
-> (SavingsPlanOfferingRate
    -> Maybe Text -> SavingsPlanOfferingRate)
-> Lens
     SavingsPlanOfferingRate
     SavingsPlanOfferingRate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOfferingRate' {Maybe Text
operation :: Maybe Text
$sel:operation:SavingsPlanOfferingRate' :: SavingsPlanOfferingRate -> Maybe Text
operation} -> Maybe Text
operation) (\s :: SavingsPlanOfferingRate
s@SavingsPlanOfferingRate' {} Maybe Text
a -> SavingsPlanOfferingRate
s {$sel:operation:SavingsPlanOfferingRate' :: Maybe Text
operation = Maybe Text
a} :: SavingsPlanOfferingRate)

-- | The usage details of the line item in the billing report.
savingsPlanOfferingRate_usageType :: Lens.Lens' SavingsPlanOfferingRate (Prelude.Maybe Prelude.Text)
savingsPlanOfferingRate_usageType :: (Maybe Text -> f (Maybe Text))
-> SavingsPlanOfferingRate -> f SavingsPlanOfferingRate
savingsPlanOfferingRate_usageType = (SavingsPlanOfferingRate -> Maybe Text)
-> (SavingsPlanOfferingRate
    -> Maybe Text -> SavingsPlanOfferingRate)
-> Lens
     SavingsPlanOfferingRate
     SavingsPlanOfferingRate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOfferingRate' {Maybe Text
usageType :: Maybe Text
$sel:usageType:SavingsPlanOfferingRate' :: SavingsPlanOfferingRate -> Maybe Text
usageType} -> Maybe Text
usageType) (\s :: SavingsPlanOfferingRate
s@SavingsPlanOfferingRate' {} Maybe Text
a -> SavingsPlanOfferingRate
s {$sel:usageType:SavingsPlanOfferingRate' :: Maybe Text
usageType = Maybe Text
a} :: SavingsPlanOfferingRate)

-- | The product type.
savingsPlanOfferingRate_productType :: Lens.Lens' SavingsPlanOfferingRate (Prelude.Maybe SavingsPlanProductType)
savingsPlanOfferingRate_productType :: (Maybe SavingsPlanProductType -> f (Maybe SavingsPlanProductType))
-> SavingsPlanOfferingRate -> f SavingsPlanOfferingRate
savingsPlanOfferingRate_productType = (SavingsPlanOfferingRate -> Maybe SavingsPlanProductType)
-> (SavingsPlanOfferingRate
    -> Maybe SavingsPlanProductType -> SavingsPlanOfferingRate)
-> Lens
     SavingsPlanOfferingRate
     SavingsPlanOfferingRate
     (Maybe SavingsPlanProductType)
     (Maybe SavingsPlanProductType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOfferingRate' {Maybe SavingsPlanProductType
productType :: Maybe SavingsPlanProductType
$sel:productType:SavingsPlanOfferingRate' :: SavingsPlanOfferingRate -> Maybe SavingsPlanProductType
productType} -> Maybe SavingsPlanProductType
productType) (\s :: SavingsPlanOfferingRate
s@SavingsPlanOfferingRate' {} Maybe SavingsPlanProductType
a -> SavingsPlanOfferingRate
s {$sel:productType:SavingsPlanOfferingRate' :: Maybe SavingsPlanProductType
productType = Maybe SavingsPlanProductType
a} :: SavingsPlanOfferingRate)

-- | The Savings Plan offering.
savingsPlanOfferingRate_savingsPlanOffering :: Lens.Lens' SavingsPlanOfferingRate (Prelude.Maybe ParentSavingsPlanOffering)
savingsPlanOfferingRate_savingsPlanOffering :: (Maybe ParentSavingsPlanOffering
 -> f (Maybe ParentSavingsPlanOffering))
-> SavingsPlanOfferingRate -> f SavingsPlanOfferingRate
savingsPlanOfferingRate_savingsPlanOffering = (SavingsPlanOfferingRate -> Maybe ParentSavingsPlanOffering)
-> (SavingsPlanOfferingRate
    -> Maybe ParentSavingsPlanOffering -> SavingsPlanOfferingRate)
-> Lens
     SavingsPlanOfferingRate
     SavingsPlanOfferingRate
     (Maybe ParentSavingsPlanOffering)
     (Maybe ParentSavingsPlanOffering)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOfferingRate' {Maybe ParentSavingsPlanOffering
savingsPlanOffering :: Maybe ParentSavingsPlanOffering
$sel:savingsPlanOffering:SavingsPlanOfferingRate' :: SavingsPlanOfferingRate -> Maybe ParentSavingsPlanOffering
savingsPlanOffering} -> Maybe ParentSavingsPlanOffering
savingsPlanOffering) (\s :: SavingsPlanOfferingRate
s@SavingsPlanOfferingRate' {} Maybe ParentSavingsPlanOffering
a -> SavingsPlanOfferingRate
s {$sel:savingsPlanOffering:SavingsPlanOfferingRate' :: Maybe ParentSavingsPlanOffering
savingsPlanOffering = Maybe ParentSavingsPlanOffering
a} :: SavingsPlanOfferingRate)

-- | The Savings Plan rate.
savingsPlanOfferingRate_rate :: Lens.Lens' SavingsPlanOfferingRate (Prelude.Maybe Prelude.Text)
savingsPlanOfferingRate_rate :: (Maybe Text -> f (Maybe Text))
-> SavingsPlanOfferingRate -> f SavingsPlanOfferingRate
savingsPlanOfferingRate_rate = (SavingsPlanOfferingRate -> Maybe Text)
-> (SavingsPlanOfferingRate
    -> Maybe Text -> SavingsPlanOfferingRate)
-> Lens
     SavingsPlanOfferingRate
     SavingsPlanOfferingRate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOfferingRate' {Maybe Text
rate :: Maybe Text
$sel:rate:SavingsPlanOfferingRate' :: SavingsPlanOfferingRate -> Maybe Text
rate} -> Maybe Text
rate) (\s :: SavingsPlanOfferingRate
s@SavingsPlanOfferingRate' {} Maybe Text
a -> SavingsPlanOfferingRate
s {$sel:rate:SavingsPlanOfferingRate' :: Maybe Text
rate = Maybe Text
a} :: SavingsPlanOfferingRate)

-- | The service.
savingsPlanOfferingRate_serviceCode :: Lens.Lens' SavingsPlanOfferingRate (Prelude.Maybe SavingsPlanRateServiceCode)
savingsPlanOfferingRate_serviceCode :: (Maybe SavingsPlanRateServiceCode
 -> f (Maybe SavingsPlanRateServiceCode))
-> SavingsPlanOfferingRate -> f SavingsPlanOfferingRate
savingsPlanOfferingRate_serviceCode = (SavingsPlanOfferingRate -> Maybe SavingsPlanRateServiceCode)
-> (SavingsPlanOfferingRate
    -> Maybe SavingsPlanRateServiceCode -> SavingsPlanOfferingRate)
-> Lens
     SavingsPlanOfferingRate
     SavingsPlanOfferingRate
     (Maybe SavingsPlanRateServiceCode)
     (Maybe SavingsPlanRateServiceCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOfferingRate' {Maybe SavingsPlanRateServiceCode
serviceCode :: Maybe SavingsPlanRateServiceCode
$sel:serviceCode:SavingsPlanOfferingRate' :: SavingsPlanOfferingRate -> Maybe SavingsPlanRateServiceCode
serviceCode} -> Maybe SavingsPlanRateServiceCode
serviceCode) (\s :: SavingsPlanOfferingRate
s@SavingsPlanOfferingRate' {} Maybe SavingsPlanRateServiceCode
a -> SavingsPlanOfferingRate
s {$sel:serviceCode:SavingsPlanOfferingRate' :: Maybe SavingsPlanRateServiceCode
serviceCode = Maybe SavingsPlanRateServiceCode
a} :: SavingsPlanOfferingRate)

-- | The unit.
savingsPlanOfferingRate_unit :: Lens.Lens' SavingsPlanOfferingRate (Prelude.Maybe SavingsPlanRateUnit)
savingsPlanOfferingRate_unit :: (Maybe SavingsPlanRateUnit -> f (Maybe SavingsPlanRateUnit))
-> SavingsPlanOfferingRate -> f SavingsPlanOfferingRate
savingsPlanOfferingRate_unit = (SavingsPlanOfferingRate -> Maybe SavingsPlanRateUnit)
-> (SavingsPlanOfferingRate
    -> Maybe SavingsPlanRateUnit -> SavingsPlanOfferingRate)
-> Lens
     SavingsPlanOfferingRate
     SavingsPlanOfferingRate
     (Maybe SavingsPlanRateUnit)
     (Maybe SavingsPlanRateUnit)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOfferingRate' {Maybe SavingsPlanRateUnit
unit :: Maybe SavingsPlanRateUnit
$sel:unit:SavingsPlanOfferingRate' :: SavingsPlanOfferingRate -> Maybe SavingsPlanRateUnit
unit} -> Maybe SavingsPlanRateUnit
unit) (\s :: SavingsPlanOfferingRate
s@SavingsPlanOfferingRate' {} Maybe SavingsPlanRateUnit
a -> SavingsPlanOfferingRate
s {$sel:unit:SavingsPlanOfferingRate' :: Maybe SavingsPlanRateUnit
unit = Maybe SavingsPlanRateUnit
a} :: SavingsPlanOfferingRate)

-- | The properties.
savingsPlanOfferingRate_properties :: Lens.Lens' SavingsPlanOfferingRate (Prelude.Maybe [SavingsPlanOfferingRateProperty])
savingsPlanOfferingRate_properties :: (Maybe [SavingsPlanOfferingRateProperty]
 -> f (Maybe [SavingsPlanOfferingRateProperty]))
-> SavingsPlanOfferingRate -> f SavingsPlanOfferingRate
savingsPlanOfferingRate_properties = (SavingsPlanOfferingRate
 -> Maybe [SavingsPlanOfferingRateProperty])
-> (SavingsPlanOfferingRate
    -> Maybe [SavingsPlanOfferingRateProperty]
    -> SavingsPlanOfferingRate)
-> Lens
     SavingsPlanOfferingRate
     SavingsPlanOfferingRate
     (Maybe [SavingsPlanOfferingRateProperty])
     (Maybe [SavingsPlanOfferingRateProperty])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOfferingRate' {Maybe [SavingsPlanOfferingRateProperty]
properties :: Maybe [SavingsPlanOfferingRateProperty]
$sel:properties:SavingsPlanOfferingRate' :: SavingsPlanOfferingRate -> Maybe [SavingsPlanOfferingRateProperty]
properties} -> Maybe [SavingsPlanOfferingRateProperty]
properties) (\s :: SavingsPlanOfferingRate
s@SavingsPlanOfferingRate' {} Maybe [SavingsPlanOfferingRateProperty]
a -> SavingsPlanOfferingRate
s {$sel:properties:SavingsPlanOfferingRate' :: Maybe [SavingsPlanOfferingRateProperty]
properties = Maybe [SavingsPlanOfferingRateProperty]
a} :: SavingsPlanOfferingRate) ((Maybe [SavingsPlanOfferingRateProperty]
  -> f (Maybe [SavingsPlanOfferingRateProperty]))
 -> SavingsPlanOfferingRate -> f SavingsPlanOfferingRate)
-> ((Maybe [SavingsPlanOfferingRateProperty]
     -> f (Maybe [SavingsPlanOfferingRateProperty]))
    -> Maybe [SavingsPlanOfferingRateProperty]
    -> f (Maybe [SavingsPlanOfferingRateProperty]))
-> (Maybe [SavingsPlanOfferingRateProperty]
    -> f (Maybe [SavingsPlanOfferingRateProperty]))
-> SavingsPlanOfferingRate
-> f SavingsPlanOfferingRate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SavingsPlanOfferingRateProperty]
  [SavingsPlanOfferingRateProperty]
  [SavingsPlanOfferingRateProperty]
  [SavingsPlanOfferingRateProperty]
-> Iso
     (Maybe [SavingsPlanOfferingRateProperty])
     (Maybe [SavingsPlanOfferingRateProperty])
     (Maybe [SavingsPlanOfferingRateProperty])
     (Maybe [SavingsPlanOfferingRateProperty])
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
  [SavingsPlanOfferingRateProperty]
  [SavingsPlanOfferingRateProperty]
  [SavingsPlanOfferingRateProperty]
  [SavingsPlanOfferingRateProperty]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON SavingsPlanOfferingRate where
  parseJSON :: Value -> Parser SavingsPlanOfferingRate
parseJSON =
    String
-> (Object -> Parser SavingsPlanOfferingRate)
-> Value
-> Parser SavingsPlanOfferingRate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SavingsPlanOfferingRate"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe SavingsPlanProductType
-> Maybe ParentSavingsPlanOffering
-> Maybe Text
-> Maybe SavingsPlanRateServiceCode
-> Maybe SavingsPlanRateUnit
-> Maybe [SavingsPlanOfferingRateProperty]
-> SavingsPlanOfferingRate
SavingsPlanOfferingRate'
            (Maybe Text
 -> Maybe Text
 -> Maybe SavingsPlanProductType
 -> Maybe ParentSavingsPlanOffering
 -> Maybe Text
 -> Maybe SavingsPlanRateServiceCode
 -> Maybe SavingsPlanRateUnit
 -> Maybe [SavingsPlanOfferingRateProperty]
 -> SavingsPlanOfferingRate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe SavingsPlanProductType
      -> Maybe ParentSavingsPlanOffering
      -> Maybe Text
      -> Maybe SavingsPlanRateServiceCode
      -> Maybe SavingsPlanRateUnit
      -> Maybe [SavingsPlanOfferingRateProperty]
      -> SavingsPlanOfferingRate)
forall (f :: * -> *) a b. Functor 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
"operation")
            Parser
  (Maybe Text
   -> Maybe SavingsPlanProductType
   -> Maybe ParentSavingsPlanOffering
   -> Maybe Text
   -> Maybe SavingsPlanRateServiceCode
   -> Maybe SavingsPlanRateUnit
   -> Maybe [SavingsPlanOfferingRateProperty]
   -> SavingsPlanOfferingRate)
-> Parser (Maybe Text)
-> Parser
     (Maybe SavingsPlanProductType
      -> Maybe ParentSavingsPlanOffering
      -> Maybe Text
      -> Maybe SavingsPlanRateServiceCode
      -> Maybe SavingsPlanRateUnit
      -> Maybe [SavingsPlanOfferingRateProperty]
      -> SavingsPlanOfferingRate)
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
"usageType")
            Parser
  (Maybe SavingsPlanProductType
   -> Maybe ParentSavingsPlanOffering
   -> Maybe Text
   -> Maybe SavingsPlanRateServiceCode
   -> Maybe SavingsPlanRateUnit
   -> Maybe [SavingsPlanOfferingRateProperty]
   -> SavingsPlanOfferingRate)
-> Parser (Maybe SavingsPlanProductType)
-> Parser
     (Maybe ParentSavingsPlanOffering
      -> Maybe Text
      -> Maybe SavingsPlanRateServiceCode
      -> Maybe SavingsPlanRateUnit
      -> Maybe [SavingsPlanOfferingRateProperty]
      -> SavingsPlanOfferingRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SavingsPlanProductType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"productType")
            Parser
  (Maybe ParentSavingsPlanOffering
   -> Maybe Text
   -> Maybe SavingsPlanRateServiceCode
   -> Maybe SavingsPlanRateUnit
   -> Maybe [SavingsPlanOfferingRateProperty]
   -> SavingsPlanOfferingRate)
-> Parser (Maybe ParentSavingsPlanOffering)
-> Parser
     (Maybe Text
      -> Maybe SavingsPlanRateServiceCode
      -> Maybe SavingsPlanRateUnit
      -> Maybe [SavingsPlanOfferingRateProperty]
      -> SavingsPlanOfferingRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ParentSavingsPlanOffering)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"savingsPlanOffering")
            Parser
  (Maybe Text
   -> Maybe SavingsPlanRateServiceCode
   -> Maybe SavingsPlanRateUnit
   -> Maybe [SavingsPlanOfferingRateProperty]
   -> SavingsPlanOfferingRate)
-> Parser (Maybe Text)
-> Parser
     (Maybe SavingsPlanRateServiceCode
      -> Maybe SavingsPlanRateUnit
      -> Maybe [SavingsPlanOfferingRateProperty]
      -> SavingsPlanOfferingRate)
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
"rate")
            Parser
  (Maybe SavingsPlanRateServiceCode
   -> Maybe SavingsPlanRateUnit
   -> Maybe [SavingsPlanOfferingRateProperty]
   -> SavingsPlanOfferingRate)
-> Parser (Maybe SavingsPlanRateServiceCode)
-> Parser
     (Maybe SavingsPlanRateUnit
      -> Maybe [SavingsPlanOfferingRateProperty]
      -> SavingsPlanOfferingRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SavingsPlanRateServiceCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serviceCode")
            Parser
  (Maybe SavingsPlanRateUnit
   -> Maybe [SavingsPlanOfferingRateProperty]
   -> SavingsPlanOfferingRate)
-> Parser (Maybe SavingsPlanRateUnit)
-> Parser
     (Maybe [SavingsPlanOfferingRateProperty]
      -> SavingsPlanOfferingRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SavingsPlanRateUnit)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"unit")
            Parser
  (Maybe [SavingsPlanOfferingRateProperty]
   -> SavingsPlanOfferingRate)
-> Parser (Maybe [SavingsPlanOfferingRateProperty])
-> Parser SavingsPlanOfferingRate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe [SavingsPlanOfferingRateProperty]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"properties" Parser (Maybe (Maybe [SavingsPlanOfferingRateProperty]))
-> Maybe [SavingsPlanOfferingRateProperty]
-> Parser (Maybe [SavingsPlanOfferingRateProperty])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SavingsPlanOfferingRateProperty]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable SavingsPlanOfferingRate

instance Prelude.NFData SavingsPlanOfferingRate