{-# 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 #-}
module Amazonka.SavingsPlans.Types.SavingsPlanOffering 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.SavingsPlanOfferingProperty
import Amazonka.SavingsPlans.Types.SavingsPlanPaymentOption
import Amazonka.SavingsPlans.Types.SavingsPlanProductType
import Amazonka.SavingsPlans.Types.SavingsPlanType
data SavingsPlanOffering = SavingsPlanOffering'
{
SavingsPlanOffering -> Maybe Text
operation :: Prelude.Maybe Prelude.Text,
SavingsPlanOffering -> Maybe Text
usageType :: Prelude.Maybe Prelude.Text,
SavingsPlanOffering -> Maybe [SavingsPlanProductType]
productTypes :: Prelude.Maybe [SavingsPlanProductType],
SavingsPlanOffering -> Maybe CurrencyCode
currency :: Prelude.Maybe CurrencyCode,
SavingsPlanOffering -> Maybe Natural
durationSeconds :: Prelude.Maybe Prelude.Natural,
SavingsPlanOffering -> Maybe Text
offeringId :: Prelude.Maybe Prelude.Text,
SavingsPlanOffering -> Maybe Text
serviceCode :: Prelude.Maybe Prelude.Text,
SavingsPlanOffering -> Maybe SavingsPlanType
planType :: Prelude.Maybe SavingsPlanType,
SavingsPlanOffering -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
SavingsPlanOffering -> Maybe SavingsPlanPaymentOption
paymentOption :: Prelude.Maybe SavingsPlanPaymentOption,
SavingsPlanOffering -> Maybe [SavingsPlanOfferingProperty]
properties :: Prelude.Maybe [SavingsPlanOfferingProperty]
}
deriving (SavingsPlanOffering -> SavingsPlanOffering -> Bool
(SavingsPlanOffering -> SavingsPlanOffering -> Bool)
-> (SavingsPlanOffering -> SavingsPlanOffering -> Bool)
-> Eq SavingsPlanOffering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SavingsPlanOffering -> SavingsPlanOffering -> Bool
$c/= :: SavingsPlanOffering -> SavingsPlanOffering -> Bool
== :: SavingsPlanOffering -> SavingsPlanOffering -> Bool
$c== :: SavingsPlanOffering -> SavingsPlanOffering -> Bool
Prelude.Eq, ReadPrec [SavingsPlanOffering]
ReadPrec SavingsPlanOffering
Int -> ReadS SavingsPlanOffering
ReadS [SavingsPlanOffering]
(Int -> ReadS SavingsPlanOffering)
-> ReadS [SavingsPlanOffering]
-> ReadPrec SavingsPlanOffering
-> ReadPrec [SavingsPlanOffering]
-> Read SavingsPlanOffering
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SavingsPlanOffering]
$creadListPrec :: ReadPrec [SavingsPlanOffering]
readPrec :: ReadPrec SavingsPlanOffering
$creadPrec :: ReadPrec SavingsPlanOffering
readList :: ReadS [SavingsPlanOffering]
$creadList :: ReadS [SavingsPlanOffering]
readsPrec :: Int -> ReadS SavingsPlanOffering
$creadsPrec :: Int -> ReadS SavingsPlanOffering
Prelude.Read, Int -> SavingsPlanOffering -> ShowS
[SavingsPlanOffering] -> ShowS
SavingsPlanOffering -> String
(Int -> SavingsPlanOffering -> ShowS)
-> (SavingsPlanOffering -> String)
-> ([SavingsPlanOffering] -> ShowS)
-> Show SavingsPlanOffering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SavingsPlanOffering] -> ShowS
$cshowList :: [SavingsPlanOffering] -> ShowS
show :: SavingsPlanOffering -> String
$cshow :: SavingsPlanOffering -> String
showsPrec :: Int -> SavingsPlanOffering -> ShowS
$cshowsPrec :: Int -> SavingsPlanOffering -> ShowS
Prelude.Show, (forall x. SavingsPlanOffering -> Rep SavingsPlanOffering x)
-> (forall x. Rep SavingsPlanOffering x -> SavingsPlanOffering)
-> Generic SavingsPlanOffering
forall x. Rep SavingsPlanOffering x -> SavingsPlanOffering
forall x. SavingsPlanOffering -> Rep SavingsPlanOffering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SavingsPlanOffering x -> SavingsPlanOffering
$cfrom :: forall x. SavingsPlanOffering -> Rep SavingsPlanOffering x
Prelude.Generic)
newSavingsPlanOffering ::
SavingsPlanOffering
newSavingsPlanOffering :: SavingsPlanOffering
newSavingsPlanOffering =
SavingsPlanOffering' :: Maybe Text
-> Maybe Text
-> Maybe [SavingsPlanProductType]
-> Maybe CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering
SavingsPlanOffering'
{ $sel:operation:SavingsPlanOffering' :: Maybe Text
operation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:usageType:SavingsPlanOffering' :: Maybe Text
usageType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:productTypes:SavingsPlanOffering' :: Maybe [SavingsPlanProductType]
productTypes = Maybe [SavingsPlanProductType]
forall a. Maybe a
Prelude.Nothing,
$sel:currency:SavingsPlanOffering' :: Maybe CurrencyCode
currency = Maybe CurrencyCode
forall a. Maybe a
Prelude.Nothing,
$sel:durationSeconds:SavingsPlanOffering' :: Maybe Natural
durationSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:offeringId:SavingsPlanOffering' :: Maybe Text
offeringId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:serviceCode:SavingsPlanOffering' :: Maybe Text
serviceCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:planType:SavingsPlanOffering' :: Maybe SavingsPlanType
planType = Maybe SavingsPlanType
forall a. Maybe a
Prelude.Nothing,
$sel:description:SavingsPlanOffering' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:paymentOption:SavingsPlanOffering' :: Maybe SavingsPlanPaymentOption
paymentOption = Maybe SavingsPlanPaymentOption
forall a. Maybe a
Prelude.Nothing,
$sel:properties:SavingsPlanOffering' :: Maybe [SavingsPlanOfferingProperty]
properties = Maybe [SavingsPlanOfferingProperty]
forall a. Maybe a
Prelude.Nothing
}
savingsPlanOffering_operation :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe Prelude.Text)
savingsPlanOffering_operation :: (Maybe Text -> f (Maybe Text))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_operation = (SavingsPlanOffering -> Maybe Text)
-> (SavingsPlanOffering -> Maybe Text -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering SavingsPlanOffering (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe Text
operation :: Maybe Text
$sel:operation:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe Text
operation} -> Maybe Text
operation) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe Text
a -> SavingsPlanOffering
s {$sel:operation:SavingsPlanOffering' :: Maybe Text
operation = Maybe Text
a} :: SavingsPlanOffering)
savingsPlanOffering_usageType :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe Prelude.Text)
savingsPlanOffering_usageType :: (Maybe Text -> f (Maybe Text))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_usageType = (SavingsPlanOffering -> Maybe Text)
-> (SavingsPlanOffering -> Maybe Text -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering SavingsPlanOffering (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe Text
usageType :: Maybe Text
$sel:usageType:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe Text
usageType} -> Maybe Text
usageType) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe Text
a -> SavingsPlanOffering
s {$sel:usageType:SavingsPlanOffering' :: Maybe Text
usageType = Maybe Text
a} :: SavingsPlanOffering)
savingsPlanOffering_productTypes :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe [SavingsPlanProductType])
savingsPlanOffering_productTypes :: (Maybe [SavingsPlanProductType]
-> f (Maybe [SavingsPlanProductType]))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_productTypes = (SavingsPlanOffering -> Maybe [SavingsPlanProductType])
-> (SavingsPlanOffering
-> Maybe [SavingsPlanProductType] -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering
SavingsPlanOffering
(Maybe [SavingsPlanProductType])
(Maybe [SavingsPlanProductType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe [SavingsPlanProductType]
productTypes :: Maybe [SavingsPlanProductType]
$sel:productTypes:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe [SavingsPlanProductType]
productTypes} -> Maybe [SavingsPlanProductType]
productTypes) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe [SavingsPlanProductType]
a -> SavingsPlanOffering
s {$sel:productTypes:SavingsPlanOffering' :: Maybe [SavingsPlanProductType]
productTypes = Maybe [SavingsPlanProductType]
a} :: SavingsPlanOffering) ((Maybe [SavingsPlanProductType]
-> f (Maybe [SavingsPlanProductType]))
-> SavingsPlanOffering -> f SavingsPlanOffering)
-> ((Maybe [SavingsPlanProductType]
-> f (Maybe [SavingsPlanProductType]))
-> Maybe [SavingsPlanProductType]
-> f (Maybe [SavingsPlanProductType]))
-> (Maybe [SavingsPlanProductType]
-> f (Maybe [SavingsPlanProductType]))
-> SavingsPlanOffering
-> f SavingsPlanOffering
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
savingsPlanOffering_currency :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe CurrencyCode)
savingsPlanOffering_currency :: (Maybe CurrencyCode -> f (Maybe CurrencyCode))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_currency = (SavingsPlanOffering -> Maybe CurrencyCode)
-> (SavingsPlanOffering
-> Maybe CurrencyCode -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering
SavingsPlanOffering
(Maybe CurrencyCode)
(Maybe CurrencyCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe CurrencyCode
currency :: Maybe CurrencyCode
$sel:currency:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe CurrencyCode
currency} -> Maybe CurrencyCode
currency) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe CurrencyCode
a -> SavingsPlanOffering
s {$sel:currency:SavingsPlanOffering' :: Maybe CurrencyCode
currency = Maybe CurrencyCode
a} :: SavingsPlanOffering)
savingsPlanOffering_durationSeconds :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe Prelude.Natural)
savingsPlanOffering_durationSeconds :: (Maybe Natural -> f (Maybe Natural))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_durationSeconds = (SavingsPlanOffering -> Maybe Natural)
-> (SavingsPlanOffering -> Maybe Natural -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering
SavingsPlanOffering
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe Natural
durationSeconds :: Maybe Natural
$sel:durationSeconds:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe Natural
durationSeconds} -> Maybe Natural
durationSeconds) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe Natural
a -> SavingsPlanOffering
s {$sel:durationSeconds:SavingsPlanOffering' :: Maybe Natural
durationSeconds = Maybe Natural
a} :: SavingsPlanOffering)
savingsPlanOffering_offeringId :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe Prelude.Text)
savingsPlanOffering_offeringId :: (Maybe Text -> f (Maybe Text))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_offeringId = (SavingsPlanOffering -> Maybe Text)
-> (SavingsPlanOffering -> Maybe Text -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering SavingsPlanOffering (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe Text
offeringId :: Maybe Text
$sel:offeringId:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe Text
offeringId} -> Maybe Text
offeringId) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe Text
a -> SavingsPlanOffering
s {$sel:offeringId:SavingsPlanOffering' :: Maybe Text
offeringId = Maybe Text
a} :: SavingsPlanOffering)
savingsPlanOffering_serviceCode :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe Prelude.Text)
savingsPlanOffering_serviceCode :: (Maybe Text -> f (Maybe Text))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_serviceCode = (SavingsPlanOffering -> Maybe Text)
-> (SavingsPlanOffering -> Maybe Text -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering SavingsPlanOffering (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe Text
serviceCode :: Maybe Text
$sel:serviceCode:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe Text
serviceCode} -> Maybe Text
serviceCode) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe Text
a -> SavingsPlanOffering
s {$sel:serviceCode:SavingsPlanOffering' :: Maybe Text
serviceCode = Maybe Text
a} :: SavingsPlanOffering)
savingsPlanOffering_planType :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe SavingsPlanType)
savingsPlanOffering_planType :: (Maybe SavingsPlanType -> f (Maybe SavingsPlanType))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_planType = (SavingsPlanOffering -> Maybe SavingsPlanType)
-> (SavingsPlanOffering
-> Maybe SavingsPlanType -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering
SavingsPlanOffering
(Maybe SavingsPlanType)
(Maybe SavingsPlanType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe SavingsPlanType
planType :: Maybe SavingsPlanType
$sel:planType:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe SavingsPlanType
planType} -> Maybe SavingsPlanType
planType) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe SavingsPlanType
a -> SavingsPlanOffering
s {$sel:planType:SavingsPlanOffering' :: Maybe SavingsPlanType
planType = Maybe SavingsPlanType
a} :: SavingsPlanOffering)
savingsPlanOffering_description :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe Prelude.Text)
savingsPlanOffering_description :: (Maybe Text -> f (Maybe Text))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_description = (SavingsPlanOffering -> Maybe Text)
-> (SavingsPlanOffering -> Maybe Text -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering SavingsPlanOffering (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe Text
description :: Maybe Text
$sel:description:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe Text
description} -> Maybe Text
description) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe Text
a -> SavingsPlanOffering
s {$sel:description:SavingsPlanOffering' :: Maybe Text
description = Maybe Text
a} :: SavingsPlanOffering)
savingsPlanOffering_paymentOption :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe SavingsPlanPaymentOption)
savingsPlanOffering_paymentOption :: (Maybe SavingsPlanPaymentOption
-> f (Maybe SavingsPlanPaymentOption))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_paymentOption = (SavingsPlanOffering -> Maybe SavingsPlanPaymentOption)
-> (SavingsPlanOffering
-> Maybe SavingsPlanPaymentOption -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering
SavingsPlanOffering
(Maybe SavingsPlanPaymentOption)
(Maybe SavingsPlanPaymentOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe SavingsPlanPaymentOption
paymentOption :: Maybe SavingsPlanPaymentOption
$sel:paymentOption:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe SavingsPlanPaymentOption
paymentOption} -> Maybe SavingsPlanPaymentOption
paymentOption) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe SavingsPlanPaymentOption
a -> SavingsPlanOffering
s {$sel:paymentOption:SavingsPlanOffering' :: Maybe SavingsPlanPaymentOption
paymentOption = Maybe SavingsPlanPaymentOption
a} :: SavingsPlanOffering)
savingsPlanOffering_properties :: Lens.Lens' SavingsPlanOffering (Prelude.Maybe [SavingsPlanOfferingProperty])
savingsPlanOffering_properties :: (Maybe [SavingsPlanOfferingProperty]
-> f (Maybe [SavingsPlanOfferingProperty]))
-> SavingsPlanOffering -> f SavingsPlanOffering
savingsPlanOffering_properties = (SavingsPlanOffering -> Maybe [SavingsPlanOfferingProperty])
-> (SavingsPlanOffering
-> Maybe [SavingsPlanOfferingProperty] -> SavingsPlanOffering)
-> Lens
SavingsPlanOffering
SavingsPlanOffering
(Maybe [SavingsPlanOfferingProperty])
(Maybe [SavingsPlanOfferingProperty])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanOffering' {Maybe [SavingsPlanOfferingProperty]
properties :: Maybe [SavingsPlanOfferingProperty]
$sel:properties:SavingsPlanOffering' :: SavingsPlanOffering -> Maybe [SavingsPlanOfferingProperty]
properties} -> Maybe [SavingsPlanOfferingProperty]
properties) (\s :: SavingsPlanOffering
s@SavingsPlanOffering' {} Maybe [SavingsPlanOfferingProperty]
a -> SavingsPlanOffering
s {$sel:properties:SavingsPlanOffering' :: Maybe [SavingsPlanOfferingProperty]
properties = Maybe [SavingsPlanOfferingProperty]
a} :: SavingsPlanOffering) ((Maybe [SavingsPlanOfferingProperty]
-> f (Maybe [SavingsPlanOfferingProperty]))
-> SavingsPlanOffering -> f SavingsPlanOffering)
-> ((Maybe [SavingsPlanOfferingProperty]
-> f (Maybe [SavingsPlanOfferingProperty]))
-> Maybe [SavingsPlanOfferingProperty]
-> f (Maybe [SavingsPlanOfferingProperty]))
-> (Maybe [SavingsPlanOfferingProperty]
-> f (Maybe [SavingsPlanOfferingProperty]))
-> SavingsPlanOffering
-> f SavingsPlanOffering
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SavingsPlanOfferingProperty]
[SavingsPlanOfferingProperty]
[SavingsPlanOfferingProperty]
[SavingsPlanOfferingProperty]
-> Iso
(Maybe [SavingsPlanOfferingProperty])
(Maybe [SavingsPlanOfferingProperty])
(Maybe [SavingsPlanOfferingProperty])
(Maybe [SavingsPlanOfferingProperty])
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
[SavingsPlanOfferingProperty]
[SavingsPlanOfferingProperty]
[SavingsPlanOfferingProperty]
[SavingsPlanOfferingProperty]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON SavingsPlanOffering where
parseJSON :: Value -> Parser SavingsPlanOffering
parseJSON =
String
-> (Object -> Parser SavingsPlanOffering)
-> Value
-> Parser SavingsPlanOffering
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SavingsPlanOffering"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe [SavingsPlanProductType]
-> Maybe CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering
SavingsPlanOffering'
(Maybe Text
-> Maybe Text
-> Maybe [SavingsPlanProductType]
-> Maybe CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [SavingsPlanProductType]
-> Maybe CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
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 CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
-> Parser (Maybe Text)
-> Parser
(Maybe [SavingsPlanProductType]
-> Maybe CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
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 CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
-> Parser (Maybe [SavingsPlanProductType])
-> Parser
(Maybe CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
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 CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
-> Parser (Maybe CurrencyCode)
-> Parser
(Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
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 Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"durationSeconds")
Parser
(Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
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 SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
-> Parser (Maybe Text)
-> Parser
(Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
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
"serviceCode")
Parser
(Maybe SavingsPlanType
-> Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
-> Parser (Maybe SavingsPlanType)
-> Parser
(Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
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
"planType")
Parser
(Maybe Text
-> Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty]
-> SavingsPlanOffering)
-> Parser (Maybe Text)
-> Parser
(Maybe SavingsPlanPaymentOption
-> Maybe [SavingsPlanOfferingProperty] -> SavingsPlanOffering)
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 [SavingsPlanOfferingProperty] -> SavingsPlanOffering)
-> Parser (Maybe SavingsPlanPaymentOption)
-> Parser
(Maybe [SavingsPlanOfferingProperty] -> SavingsPlanOffering)
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 [SavingsPlanOfferingProperty] -> SavingsPlanOffering)
-> Parser (Maybe [SavingsPlanOfferingProperty])
-> Parser SavingsPlanOffering
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe [SavingsPlanOfferingProperty]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"properties" Parser (Maybe (Maybe [SavingsPlanOfferingProperty]))
-> Maybe [SavingsPlanOfferingProperty]
-> Parser (Maybe [SavingsPlanOfferingProperty])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SavingsPlanOfferingProperty]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable SavingsPlanOffering
instance Prelude.NFData SavingsPlanOffering