{-# 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.ParentSavingsPlanOffering 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.SavingsPlanType
data ParentSavingsPlanOffering = ParentSavingsPlanOffering'
{
ParentSavingsPlanOffering -> Maybe CurrencyCode
currency :: Prelude.Maybe CurrencyCode,
ParentSavingsPlanOffering -> Maybe Natural
durationSeconds :: Prelude.Maybe Prelude.Natural,
ParentSavingsPlanOffering -> Maybe Text
offeringId :: Prelude.Maybe Prelude.Text,
ParentSavingsPlanOffering -> Maybe Text
planDescription :: Prelude.Maybe Prelude.Text,
ParentSavingsPlanOffering -> Maybe SavingsPlanType
planType :: Prelude.Maybe SavingsPlanType,
ParentSavingsPlanOffering -> Maybe SavingsPlanPaymentOption
paymentOption :: Prelude.Maybe SavingsPlanPaymentOption
}
deriving (ParentSavingsPlanOffering -> ParentSavingsPlanOffering -> Bool
(ParentSavingsPlanOffering -> ParentSavingsPlanOffering -> Bool)
-> (ParentSavingsPlanOffering -> ParentSavingsPlanOffering -> Bool)
-> Eq ParentSavingsPlanOffering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParentSavingsPlanOffering -> ParentSavingsPlanOffering -> Bool
$c/= :: ParentSavingsPlanOffering -> ParentSavingsPlanOffering -> Bool
== :: ParentSavingsPlanOffering -> ParentSavingsPlanOffering -> Bool
$c== :: ParentSavingsPlanOffering -> ParentSavingsPlanOffering -> Bool
Prelude.Eq, ReadPrec [ParentSavingsPlanOffering]
ReadPrec ParentSavingsPlanOffering
Int -> ReadS ParentSavingsPlanOffering
ReadS [ParentSavingsPlanOffering]
(Int -> ReadS ParentSavingsPlanOffering)
-> ReadS [ParentSavingsPlanOffering]
-> ReadPrec ParentSavingsPlanOffering
-> ReadPrec [ParentSavingsPlanOffering]
-> Read ParentSavingsPlanOffering
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParentSavingsPlanOffering]
$creadListPrec :: ReadPrec [ParentSavingsPlanOffering]
readPrec :: ReadPrec ParentSavingsPlanOffering
$creadPrec :: ReadPrec ParentSavingsPlanOffering
readList :: ReadS [ParentSavingsPlanOffering]
$creadList :: ReadS [ParentSavingsPlanOffering]
readsPrec :: Int -> ReadS ParentSavingsPlanOffering
$creadsPrec :: Int -> ReadS ParentSavingsPlanOffering
Prelude.Read, Int -> ParentSavingsPlanOffering -> ShowS
[ParentSavingsPlanOffering] -> ShowS
ParentSavingsPlanOffering -> String
(Int -> ParentSavingsPlanOffering -> ShowS)
-> (ParentSavingsPlanOffering -> String)
-> ([ParentSavingsPlanOffering] -> ShowS)
-> Show ParentSavingsPlanOffering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParentSavingsPlanOffering] -> ShowS
$cshowList :: [ParentSavingsPlanOffering] -> ShowS
show :: ParentSavingsPlanOffering -> String
$cshow :: ParentSavingsPlanOffering -> String
showsPrec :: Int -> ParentSavingsPlanOffering -> ShowS
$cshowsPrec :: Int -> ParentSavingsPlanOffering -> ShowS
Prelude.Show, (forall x.
ParentSavingsPlanOffering -> Rep ParentSavingsPlanOffering x)
-> (forall x.
Rep ParentSavingsPlanOffering x -> ParentSavingsPlanOffering)
-> Generic ParentSavingsPlanOffering
forall x.
Rep ParentSavingsPlanOffering x -> ParentSavingsPlanOffering
forall x.
ParentSavingsPlanOffering -> Rep ParentSavingsPlanOffering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ParentSavingsPlanOffering x -> ParentSavingsPlanOffering
$cfrom :: forall x.
ParentSavingsPlanOffering -> Rep ParentSavingsPlanOffering x
Prelude.Generic)
newParentSavingsPlanOffering ::
ParentSavingsPlanOffering
newParentSavingsPlanOffering :: ParentSavingsPlanOffering
newParentSavingsPlanOffering =
ParentSavingsPlanOffering' :: Maybe CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe SavingsPlanPaymentOption
-> ParentSavingsPlanOffering
ParentSavingsPlanOffering'
{ $sel:currency:ParentSavingsPlanOffering' :: Maybe CurrencyCode
currency =
Maybe CurrencyCode
forall a. Maybe a
Prelude.Nothing,
$sel:durationSeconds:ParentSavingsPlanOffering' :: Maybe Natural
durationSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:offeringId:ParentSavingsPlanOffering' :: Maybe Text
offeringId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:planDescription:ParentSavingsPlanOffering' :: Maybe Text
planDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:planType:ParentSavingsPlanOffering' :: Maybe SavingsPlanType
planType = Maybe SavingsPlanType
forall a. Maybe a
Prelude.Nothing,
$sel:paymentOption:ParentSavingsPlanOffering' :: Maybe SavingsPlanPaymentOption
paymentOption = Maybe SavingsPlanPaymentOption
forall a. Maybe a
Prelude.Nothing
}
parentSavingsPlanOffering_currency :: Lens.Lens' ParentSavingsPlanOffering (Prelude.Maybe CurrencyCode)
parentSavingsPlanOffering_currency :: (Maybe CurrencyCode -> f (Maybe CurrencyCode))
-> ParentSavingsPlanOffering -> f ParentSavingsPlanOffering
parentSavingsPlanOffering_currency = (ParentSavingsPlanOffering -> Maybe CurrencyCode)
-> (ParentSavingsPlanOffering
-> Maybe CurrencyCode -> ParentSavingsPlanOffering)
-> Lens
ParentSavingsPlanOffering
ParentSavingsPlanOffering
(Maybe CurrencyCode)
(Maybe CurrencyCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParentSavingsPlanOffering' {Maybe CurrencyCode
currency :: Maybe CurrencyCode
$sel:currency:ParentSavingsPlanOffering' :: ParentSavingsPlanOffering -> Maybe CurrencyCode
currency} -> Maybe CurrencyCode
currency) (\s :: ParentSavingsPlanOffering
s@ParentSavingsPlanOffering' {} Maybe CurrencyCode
a -> ParentSavingsPlanOffering
s {$sel:currency:ParentSavingsPlanOffering' :: Maybe CurrencyCode
currency = Maybe CurrencyCode
a} :: ParentSavingsPlanOffering)
parentSavingsPlanOffering_durationSeconds :: Lens.Lens' ParentSavingsPlanOffering (Prelude.Maybe Prelude.Natural)
parentSavingsPlanOffering_durationSeconds :: (Maybe Natural -> f (Maybe Natural))
-> ParentSavingsPlanOffering -> f ParentSavingsPlanOffering
parentSavingsPlanOffering_durationSeconds = (ParentSavingsPlanOffering -> Maybe Natural)
-> (ParentSavingsPlanOffering
-> Maybe Natural -> ParentSavingsPlanOffering)
-> Lens
ParentSavingsPlanOffering
ParentSavingsPlanOffering
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParentSavingsPlanOffering' {Maybe Natural
durationSeconds :: Maybe Natural
$sel:durationSeconds:ParentSavingsPlanOffering' :: ParentSavingsPlanOffering -> Maybe Natural
durationSeconds} -> Maybe Natural
durationSeconds) (\s :: ParentSavingsPlanOffering
s@ParentSavingsPlanOffering' {} Maybe Natural
a -> ParentSavingsPlanOffering
s {$sel:durationSeconds:ParentSavingsPlanOffering' :: Maybe Natural
durationSeconds = Maybe Natural
a} :: ParentSavingsPlanOffering)
parentSavingsPlanOffering_offeringId :: Lens.Lens' ParentSavingsPlanOffering (Prelude.Maybe Prelude.Text)
parentSavingsPlanOffering_offeringId :: (Maybe Text -> f (Maybe Text))
-> ParentSavingsPlanOffering -> f ParentSavingsPlanOffering
parentSavingsPlanOffering_offeringId = (ParentSavingsPlanOffering -> Maybe Text)
-> (ParentSavingsPlanOffering
-> Maybe Text -> ParentSavingsPlanOffering)
-> Lens
ParentSavingsPlanOffering
ParentSavingsPlanOffering
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParentSavingsPlanOffering' {Maybe Text
offeringId :: Maybe Text
$sel:offeringId:ParentSavingsPlanOffering' :: ParentSavingsPlanOffering -> Maybe Text
offeringId} -> Maybe Text
offeringId) (\s :: ParentSavingsPlanOffering
s@ParentSavingsPlanOffering' {} Maybe Text
a -> ParentSavingsPlanOffering
s {$sel:offeringId:ParentSavingsPlanOffering' :: Maybe Text
offeringId = Maybe Text
a} :: ParentSavingsPlanOffering)
parentSavingsPlanOffering_planDescription :: Lens.Lens' ParentSavingsPlanOffering (Prelude.Maybe Prelude.Text)
parentSavingsPlanOffering_planDescription :: (Maybe Text -> f (Maybe Text))
-> ParentSavingsPlanOffering -> f ParentSavingsPlanOffering
parentSavingsPlanOffering_planDescription = (ParentSavingsPlanOffering -> Maybe Text)
-> (ParentSavingsPlanOffering
-> Maybe Text -> ParentSavingsPlanOffering)
-> Lens
ParentSavingsPlanOffering
ParentSavingsPlanOffering
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParentSavingsPlanOffering' {Maybe Text
planDescription :: Maybe Text
$sel:planDescription:ParentSavingsPlanOffering' :: ParentSavingsPlanOffering -> Maybe Text
planDescription} -> Maybe Text
planDescription) (\s :: ParentSavingsPlanOffering
s@ParentSavingsPlanOffering' {} Maybe Text
a -> ParentSavingsPlanOffering
s {$sel:planDescription:ParentSavingsPlanOffering' :: Maybe Text
planDescription = Maybe Text
a} :: ParentSavingsPlanOffering)
parentSavingsPlanOffering_planType :: Lens.Lens' ParentSavingsPlanOffering (Prelude.Maybe SavingsPlanType)
parentSavingsPlanOffering_planType :: (Maybe SavingsPlanType -> f (Maybe SavingsPlanType))
-> ParentSavingsPlanOffering -> f ParentSavingsPlanOffering
parentSavingsPlanOffering_planType = (ParentSavingsPlanOffering -> Maybe SavingsPlanType)
-> (ParentSavingsPlanOffering
-> Maybe SavingsPlanType -> ParentSavingsPlanOffering)
-> Lens
ParentSavingsPlanOffering
ParentSavingsPlanOffering
(Maybe SavingsPlanType)
(Maybe SavingsPlanType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParentSavingsPlanOffering' {Maybe SavingsPlanType
planType :: Maybe SavingsPlanType
$sel:planType:ParentSavingsPlanOffering' :: ParentSavingsPlanOffering -> Maybe SavingsPlanType
planType} -> Maybe SavingsPlanType
planType) (\s :: ParentSavingsPlanOffering
s@ParentSavingsPlanOffering' {} Maybe SavingsPlanType
a -> ParentSavingsPlanOffering
s {$sel:planType:ParentSavingsPlanOffering' :: Maybe SavingsPlanType
planType = Maybe SavingsPlanType
a} :: ParentSavingsPlanOffering)
parentSavingsPlanOffering_paymentOption :: Lens.Lens' ParentSavingsPlanOffering (Prelude.Maybe SavingsPlanPaymentOption)
parentSavingsPlanOffering_paymentOption :: (Maybe SavingsPlanPaymentOption
-> f (Maybe SavingsPlanPaymentOption))
-> ParentSavingsPlanOffering -> f ParentSavingsPlanOffering
parentSavingsPlanOffering_paymentOption = (ParentSavingsPlanOffering -> Maybe SavingsPlanPaymentOption)
-> (ParentSavingsPlanOffering
-> Maybe SavingsPlanPaymentOption -> ParentSavingsPlanOffering)
-> Lens
ParentSavingsPlanOffering
ParentSavingsPlanOffering
(Maybe SavingsPlanPaymentOption)
(Maybe SavingsPlanPaymentOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParentSavingsPlanOffering' {Maybe SavingsPlanPaymentOption
paymentOption :: Maybe SavingsPlanPaymentOption
$sel:paymentOption:ParentSavingsPlanOffering' :: ParentSavingsPlanOffering -> Maybe SavingsPlanPaymentOption
paymentOption} -> Maybe SavingsPlanPaymentOption
paymentOption) (\s :: ParentSavingsPlanOffering
s@ParentSavingsPlanOffering' {} Maybe SavingsPlanPaymentOption
a -> ParentSavingsPlanOffering
s {$sel:paymentOption:ParentSavingsPlanOffering' :: Maybe SavingsPlanPaymentOption
paymentOption = Maybe SavingsPlanPaymentOption
a} :: ParentSavingsPlanOffering)
instance Core.FromJSON ParentSavingsPlanOffering where
parseJSON :: Value -> Parser ParentSavingsPlanOffering
parseJSON =
String
-> (Object -> Parser ParentSavingsPlanOffering)
-> Value
-> Parser ParentSavingsPlanOffering
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ParentSavingsPlanOffering"
( \Object
x ->
Maybe CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe SavingsPlanPaymentOption
-> ParentSavingsPlanOffering
ParentSavingsPlanOffering'
(Maybe CurrencyCode
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe SavingsPlanPaymentOption
-> ParentSavingsPlanOffering)
-> Parser (Maybe CurrencyCode)
-> Parser
(Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe SavingsPlanPaymentOption
-> ParentSavingsPlanOffering)
forall (f :: * -> *) a b. Functor 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 SavingsPlanPaymentOption
-> ParentSavingsPlanOffering)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe SavingsPlanType
-> Maybe SavingsPlanPaymentOption
-> ParentSavingsPlanOffering)
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 SavingsPlanPaymentOption
-> ParentSavingsPlanOffering)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe SavingsPlanType
-> Maybe SavingsPlanPaymentOption
-> ParentSavingsPlanOffering)
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 SavingsPlanPaymentOption
-> ParentSavingsPlanOffering)
-> Parser (Maybe Text)
-> Parser
(Maybe SavingsPlanType
-> Maybe SavingsPlanPaymentOption -> ParentSavingsPlanOffering)
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
"planDescription")
Parser
(Maybe SavingsPlanType
-> Maybe SavingsPlanPaymentOption -> ParentSavingsPlanOffering)
-> Parser (Maybe SavingsPlanType)
-> Parser
(Maybe SavingsPlanPaymentOption -> ParentSavingsPlanOffering)
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 SavingsPlanPaymentOption -> ParentSavingsPlanOffering)
-> Parser (Maybe SavingsPlanPaymentOption)
-> Parser ParentSavingsPlanOffering
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")
)
instance Prelude.Hashable ParentSavingsPlanOffering
instance Prelude.NFData ParentSavingsPlanOffering