{-# 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.SavingsPlanRateProperty where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SavingsPlans.Types.SavingsPlanRatePropertyKey
data SavingsPlanRateProperty = SavingsPlanRateProperty'
{
SavingsPlanRateProperty -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
SavingsPlanRateProperty -> Maybe SavingsPlanRatePropertyKey
name :: Prelude.Maybe SavingsPlanRatePropertyKey
}
deriving (SavingsPlanRateProperty -> SavingsPlanRateProperty -> Bool
(SavingsPlanRateProperty -> SavingsPlanRateProperty -> Bool)
-> (SavingsPlanRateProperty -> SavingsPlanRateProperty -> Bool)
-> Eq SavingsPlanRateProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SavingsPlanRateProperty -> SavingsPlanRateProperty -> Bool
$c/= :: SavingsPlanRateProperty -> SavingsPlanRateProperty -> Bool
== :: SavingsPlanRateProperty -> SavingsPlanRateProperty -> Bool
$c== :: SavingsPlanRateProperty -> SavingsPlanRateProperty -> Bool
Prelude.Eq, ReadPrec [SavingsPlanRateProperty]
ReadPrec SavingsPlanRateProperty
Int -> ReadS SavingsPlanRateProperty
ReadS [SavingsPlanRateProperty]
(Int -> ReadS SavingsPlanRateProperty)
-> ReadS [SavingsPlanRateProperty]
-> ReadPrec SavingsPlanRateProperty
-> ReadPrec [SavingsPlanRateProperty]
-> Read SavingsPlanRateProperty
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SavingsPlanRateProperty]
$creadListPrec :: ReadPrec [SavingsPlanRateProperty]
readPrec :: ReadPrec SavingsPlanRateProperty
$creadPrec :: ReadPrec SavingsPlanRateProperty
readList :: ReadS [SavingsPlanRateProperty]
$creadList :: ReadS [SavingsPlanRateProperty]
readsPrec :: Int -> ReadS SavingsPlanRateProperty
$creadsPrec :: Int -> ReadS SavingsPlanRateProperty
Prelude.Read, Int -> SavingsPlanRateProperty -> ShowS
[SavingsPlanRateProperty] -> ShowS
SavingsPlanRateProperty -> String
(Int -> SavingsPlanRateProperty -> ShowS)
-> (SavingsPlanRateProperty -> String)
-> ([SavingsPlanRateProperty] -> ShowS)
-> Show SavingsPlanRateProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SavingsPlanRateProperty] -> ShowS
$cshowList :: [SavingsPlanRateProperty] -> ShowS
show :: SavingsPlanRateProperty -> String
$cshow :: SavingsPlanRateProperty -> String
showsPrec :: Int -> SavingsPlanRateProperty -> ShowS
$cshowsPrec :: Int -> SavingsPlanRateProperty -> ShowS
Prelude.Show, (forall x.
SavingsPlanRateProperty -> Rep SavingsPlanRateProperty x)
-> (forall x.
Rep SavingsPlanRateProperty x -> SavingsPlanRateProperty)
-> Generic SavingsPlanRateProperty
forall x. Rep SavingsPlanRateProperty x -> SavingsPlanRateProperty
forall x. SavingsPlanRateProperty -> Rep SavingsPlanRateProperty x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SavingsPlanRateProperty x -> SavingsPlanRateProperty
$cfrom :: forall x. SavingsPlanRateProperty -> Rep SavingsPlanRateProperty x
Prelude.Generic)
newSavingsPlanRateProperty ::
SavingsPlanRateProperty
newSavingsPlanRateProperty :: SavingsPlanRateProperty
newSavingsPlanRateProperty =
SavingsPlanRateProperty' :: Maybe Text
-> Maybe SavingsPlanRatePropertyKey -> SavingsPlanRateProperty
SavingsPlanRateProperty'
{ $sel:value:SavingsPlanRateProperty' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:SavingsPlanRateProperty' :: Maybe SavingsPlanRatePropertyKey
name = Maybe SavingsPlanRatePropertyKey
forall a. Maybe a
Prelude.Nothing
}
savingsPlanRateProperty_value :: Lens.Lens' SavingsPlanRateProperty (Prelude.Maybe Prelude.Text)
savingsPlanRateProperty_value :: (Maybe Text -> f (Maybe Text))
-> SavingsPlanRateProperty -> f SavingsPlanRateProperty
savingsPlanRateProperty_value = (SavingsPlanRateProperty -> Maybe Text)
-> (SavingsPlanRateProperty
-> Maybe Text -> SavingsPlanRateProperty)
-> Lens
SavingsPlanRateProperty
SavingsPlanRateProperty
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanRateProperty' {Maybe Text
value :: Maybe Text
$sel:value:SavingsPlanRateProperty' :: SavingsPlanRateProperty -> Maybe Text
value} -> Maybe Text
value) (\s :: SavingsPlanRateProperty
s@SavingsPlanRateProperty' {} Maybe Text
a -> SavingsPlanRateProperty
s {$sel:value:SavingsPlanRateProperty' :: Maybe Text
value = Maybe Text
a} :: SavingsPlanRateProperty)
savingsPlanRateProperty_name :: Lens.Lens' SavingsPlanRateProperty (Prelude.Maybe SavingsPlanRatePropertyKey)
savingsPlanRateProperty_name :: (Maybe SavingsPlanRatePropertyKey
-> f (Maybe SavingsPlanRatePropertyKey))
-> SavingsPlanRateProperty -> f SavingsPlanRateProperty
savingsPlanRateProperty_name = (SavingsPlanRateProperty -> Maybe SavingsPlanRatePropertyKey)
-> (SavingsPlanRateProperty
-> Maybe SavingsPlanRatePropertyKey -> SavingsPlanRateProperty)
-> Lens
SavingsPlanRateProperty
SavingsPlanRateProperty
(Maybe SavingsPlanRatePropertyKey)
(Maybe SavingsPlanRatePropertyKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlanRateProperty' {Maybe SavingsPlanRatePropertyKey
name :: Maybe SavingsPlanRatePropertyKey
$sel:name:SavingsPlanRateProperty' :: SavingsPlanRateProperty -> Maybe SavingsPlanRatePropertyKey
name} -> Maybe SavingsPlanRatePropertyKey
name) (\s :: SavingsPlanRateProperty
s@SavingsPlanRateProperty' {} Maybe SavingsPlanRatePropertyKey
a -> SavingsPlanRateProperty
s {$sel:name:SavingsPlanRateProperty' :: Maybe SavingsPlanRatePropertyKey
name = Maybe SavingsPlanRatePropertyKey
a} :: SavingsPlanRateProperty)
instance Core.FromJSON SavingsPlanRateProperty where
parseJSON :: Value -> Parser SavingsPlanRateProperty
parseJSON =
String
-> (Object -> Parser SavingsPlanRateProperty)
-> Value
-> Parser SavingsPlanRateProperty
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SavingsPlanRateProperty"
( \Object
x ->
Maybe Text
-> Maybe SavingsPlanRatePropertyKey -> SavingsPlanRateProperty
SavingsPlanRateProperty'
(Maybe Text
-> Maybe SavingsPlanRatePropertyKey -> SavingsPlanRateProperty)
-> Parser (Maybe Text)
-> Parser
(Maybe SavingsPlanRatePropertyKey -> SavingsPlanRateProperty)
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
"value") Parser
(Maybe SavingsPlanRatePropertyKey -> SavingsPlanRateProperty)
-> Parser (Maybe SavingsPlanRatePropertyKey)
-> Parser SavingsPlanRateProperty
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SavingsPlanRatePropertyKey)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
)
instance Prelude.Hashable SavingsPlanRateProperty
instance Prelude.NFData SavingsPlanRateProperty