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