{-# 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.EC2.Types.PriceSchedule where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.CurrencyCodeValues
import qualified Amazonka.Prelude as Prelude
data PriceSchedule = PriceSchedule'
{
PriceSchedule -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
PriceSchedule -> Maybe CurrencyCodeValues
currencyCode :: Prelude.Maybe CurrencyCodeValues,
PriceSchedule -> Maybe Double
price :: Prelude.Maybe Prelude.Double,
PriceSchedule -> Maybe Integer
term :: Prelude.Maybe Prelude.Integer
}
deriving (PriceSchedule -> PriceSchedule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceSchedule -> PriceSchedule -> Bool
$c/= :: PriceSchedule -> PriceSchedule -> Bool
== :: PriceSchedule -> PriceSchedule -> Bool
$c== :: PriceSchedule -> PriceSchedule -> Bool
Prelude.Eq, ReadPrec [PriceSchedule]
ReadPrec PriceSchedule
Int -> ReadS PriceSchedule
ReadS [PriceSchedule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PriceSchedule]
$creadListPrec :: ReadPrec [PriceSchedule]
readPrec :: ReadPrec PriceSchedule
$creadPrec :: ReadPrec PriceSchedule
readList :: ReadS [PriceSchedule]
$creadList :: ReadS [PriceSchedule]
readsPrec :: Int -> ReadS PriceSchedule
$creadsPrec :: Int -> ReadS PriceSchedule
Prelude.Read, Int -> PriceSchedule -> ShowS
[PriceSchedule] -> ShowS
PriceSchedule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceSchedule] -> ShowS
$cshowList :: [PriceSchedule] -> ShowS
show :: PriceSchedule -> String
$cshow :: PriceSchedule -> String
showsPrec :: Int -> PriceSchedule -> ShowS
$cshowsPrec :: Int -> PriceSchedule -> ShowS
Prelude.Show, forall x. Rep PriceSchedule x -> PriceSchedule
forall x. PriceSchedule -> Rep PriceSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PriceSchedule x -> PriceSchedule
$cfrom :: forall x. PriceSchedule -> Rep PriceSchedule x
Prelude.Generic)
newPriceSchedule ::
PriceSchedule
newPriceSchedule :: PriceSchedule
newPriceSchedule =
PriceSchedule'
{ $sel:active:PriceSchedule' :: Maybe Bool
active = forall a. Maybe a
Prelude.Nothing,
$sel:currencyCode:PriceSchedule' :: Maybe CurrencyCodeValues
currencyCode = forall a. Maybe a
Prelude.Nothing,
$sel:price:PriceSchedule' :: Maybe Double
price = forall a. Maybe a
Prelude.Nothing,
$sel:term:PriceSchedule' :: Maybe Integer
term = forall a. Maybe a
Prelude.Nothing
}
priceSchedule_active :: Lens.Lens' PriceSchedule (Prelude.Maybe Prelude.Bool)
priceSchedule_active :: Lens' PriceSchedule (Maybe Bool)
priceSchedule_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PriceSchedule' {Maybe Bool
active :: Maybe Bool
$sel:active:PriceSchedule' :: PriceSchedule -> Maybe Bool
active} -> Maybe Bool
active) (\s :: PriceSchedule
s@PriceSchedule' {} Maybe Bool
a -> PriceSchedule
s {$sel:active:PriceSchedule' :: Maybe Bool
active = Maybe Bool
a} :: PriceSchedule)
priceSchedule_currencyCode :: Lens.Lens' PriceSchedule (Prelude.Maybe CurrencyCodeValues)
priceSchedule_currencyCode :: Lens' PriceSchedule (Maybe CurrencyCodeValues)
priceSchedule_currencyCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PriceSchedule' {Maybe CurrencyCodeValues
currencyCode :: Maybe CurrencyCodeValues
$sel:currencyCode:PriceSchedule' :: PriceSchedule -> Maybe CurrencyCodeValues
currencyCode} -> Maybe CurrencyCodeValues
currencyCode) (\s :: PriceSchedule
s@PriceSchedule' {} Maybe CurrencyCodeValues
a -> PriceSchedule
s {$sel:currencyCode:PriceSchedule' :: Maybe CurrencyCodeValues
currencyCode = Maybe CurrencyCodeValues
a} :: PriceSchedule)
priceSchedule_price :: Lens.Lens' PriceSchedule (Prelude.Maybe Prelude.Double)
priceSchedule_price :: Lens' PriceSchedule (Maybe Double)
priceSchedule_price = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PriceSchedule' {Maybe Double
price :: Maybe Double
$sel:price:PriceSchedule' :: PriceSchedule -> Maybe Double
price} -> Maybe Double
price) (\s :: PriceSchedule
s@PriceSchedule' {} Maybe Double
a -> PriceSchedule
s {$sel:price:PriceSchedule' :: Maybe Double
price = Maybe Double
a} :: PriceSchedule)
priceSchedule_term :: Lens.Lens' PriceSchedule (Prelude.Maybe Prelude.Integer)
priceSchedule_term :: Lens' PriceSchedule (Maybe Integer)
priceSchedule_term = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PriceSchedule' {Maybe Integer
term :: Maybe Integer
$sel:term:PriceSchedule' :: PriceSchedule -> Maybe Integer
term} -> Maybe Integer
term) (\s :: PriceSchedule
s@PriceSchedule' {} Maybe Integer
a -> PriceSchedule
s {$sel:term:PriceSchedule' :: Maybe Integer
term = Maybe Integer
a} :: PriceSchedule)
instance Data.FromXML PriceSchedule where
parseXML :: [Node] -> Either String PriceSchedule
parseXML [Node]
x =
Maybe Bool
-> Maybe CurrencyCodeValues
-> Maybe Double
-> Maybe Integer
-> PriceSchedule
PriceSchedule'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"active")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"currencyCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"price")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"term")
instance Prelude.Hashable PriceSchedule where
hashWithSalt :: Int -> PriceSchedule -> Int
hashWithSalt Int
_salt PriceSchedule' {Maybe Bool
Maybe Double
Maybe Integer
Maybe CurrencyCodeValues
term :: Maybe Integer
price :: Maybe Double
currencyCode :: Maybe CurrencyCodeValues
active :: Maybe Bool
$sel:term:PriceSchedule' :: PriceSchedule -> Maybe Integer
$sel:price:PriceSchedule' :: PriceSchedule -> Maybe Double
$sel:currencyCode:PriceSchedule' :: PriceSchedule -> Maybe CurrencyCodeValues
$sel:active:PriceSchedule' :: PriceSchedule -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
active
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CurrencyCodeValues
currencyCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
price
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
term
instance Prelude.NFData PriceSchedule where
rnf :: PriceSchedule -> ()
rnf PriceSchedule' {Maybe Bool
Maybe Double
Maybe Integer
Maybe CurrencyCodeValues
term :: Maybe Integer
price :: Maybe Double
currencyCode :: Maybe CurrencyCodeValues
active :: Maybe Bool
$sel:term:PriceSchedule' :: PriceSchedule -> Maybe Integer
$sel:price:PriceSchedule' :: PriceSchedule -> Maybe Double
$sel:currencyCode:PriceSchedule' :: PriceSchedule -> Maybe CurrencyCodeValues
$sel:active:PriceSchedule' :: PriceSchedule -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
active
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CurrencyCodeValues
currencyCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
price
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
term