{-# 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.PriceScheduleSpecification 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 PriceScheduleSpecification = PriceScheduleSpecification'
{
PriceScheduleSpecification -> Maybe CurrencyCodeValues
currencyCode :: Prelude.Maybe CurrencyCodeValues,
PriceScheduleSpecification -> Maybe Double
price :: Prelude.Maybe Prelude.Double,
PriceScheduleSpecification -> Maybe Integer
term :: Prelude.Maybe Prelude.Integer
}
deriving (PriceScheduleSpecification -> PriceScheduleSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceScheduleSpecification -> PriceScheduleSpecification -> Bool
$c/= :: PriceScheduleSpecification -> PriceScheduleSpecification -> Bool
== :: PriceScheduleSpecification -> PriceScheduleSpecification -> Bool
$c== :: PriceScheduleSpecification -> PriceScheduleSpecification -> Bool
Prelude.Eq, ReadPrec [PriceScheduleSpecification]
ReadPrec PriceScheduleSpecification
Int -> ReadS PriceScheduleSpecification
ReadS [PriceScheduleSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PriceScheduleSpecification]
$creadListPrec :: ReadPrec [PriceScheduleSpecification]
readPrec :: ReadPrec PriceScheduleSpecification
$creadPrec :: ReadPrec PriceScheduleSpecification
readList :: ReadS [PriceScheduleSpecification]
$creadList :: ReadS [PriceScheduleSpecification]
readsPrec :: Int -> ReadS PriceScheduleSpecification
$creadsPrec :: Int -> ReadS PriceScheduleSpecification
Prelude.Read, Int -> PriceScheduleSpecification -> ShowS
[PriceScheduleSpecification] -> ShowS
PriceScheduleSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceScheduleSpecification] -> ShowS
$cshowList :: [PriceScheduleSpecification] -> ShowS
show :: PriceScheduleSpecification -> String
$cshow :: PriceScheduleSpecification -> String
showsPrec :: Int -> PriceScheduleSpecification -> ShowS
$cshowsPrec :: Int -> PriceScheduleSpecification -> ShowS
Prelude.Show, forall x.
Rep PriceScheduleSpecification x -> PriceScheduleSpecification
forall x.
PriceScheduleSpecification -> Rep PriceScheduleSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PriceScheduleSpecification x -> PriceScheduleSpecification
$cfrom :: forall x.
PriceScheduleSpecification -> Rep PriceScheduleSpecification x
Prelude.Generic)
newPriceScheduleSpecification ::
PriceScheduleSpecification
newPriceScheduleSpecification :: PriceScheduleSpecification
newPriceScheduleSpecification =
PriceScheduleSpecification'
{ $sel:currencyCode:PriceScheduleSpecification' :: Maybe CurrencyCodeValues
currencyCode =
forall a. Maybe a
Prelude.Nothing,
$sel:price:PriceScheduleSpecification' :: Maybe Double
price = forall a. Maybe a
Prelude.Nothing,
$sel:term:PriceScheduleSpecification' :: Maybe Integer
term = forall a. Maybe a
Prelude.Nothing
}
priceScheduleSpecification_currencyCode :: Lens.Lens' PriceScheduleSpecification (Prelude.Maybe CurrencyCodeValues)
priceScheduleSpecification_currencyCode :: Lens' PriceScheduleSpecification (Maybe CurrencyCodeValues)
priceScheduleSpecification_currencyCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PriceScheduleSpecification' {Maybe CurrencyCodeValues
currencyCode :: Maybe CurrencyCodeValues
$sel:currencyCode:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe CurrencyCodeValues
currencyCode} -> Maybe CurrencyCodeValues
currencyCode) (\s :: PriceScheduleSpecification
s@PriceScheduleSpecification' {} Maybe CurrencyCodeValues
a -> PriceScheduleSpecification
s {$sel:currencyCode:PriceScheduleSpecification' :: Maybe CurrencyCodeValues
currencyCode = Maybe CurrencyCodeValues
a} :: PriceScheduleSpecification)
priceScheduleSpecification_price :: Lens.Lens' PriceScheduleSpecification (Prelude.Maybe Prelude.Double)
priceScheduleSpecification_price :: Lens' PriceScheduleSpecification (Maybe Double)
priceScheduleSpecification_price = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PriceScheduleSpecification' {Maybe Double
price :: Maybe Double
$sel:price:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe Double
price} -> Maybe Double
price) (\s :: PriceScheduleSpecification
s@PriceScheduleSpecification' {} Maybe Double
a -> PriceScheduleSpecification
s {$sel:price:PriceScheduleSpecification' :: Maybe Double
price = Maybe Double
a} :: PriceScheduleSpecification)
priceScheduleSpecification_term :: Lens.Lens' PriceScheduleSpecification (Prelude.Maybe Prelude.Integer)
priceScheduleSpecification_term :: Lens' PriceScheduleSpecification (Maybe Integer)
priceScheduleSpecification_term = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PriceScheduleSpecification' {Maybe Integer
term :: Maybe Integer
$sel:term:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe Integer
term} -> Maybe Integer
term) (\s :: PriceScheduleSpecification
s@PriceScheduleSpecification' {} Maybe Integer
a -> PriceScheduleSpecification
s {$sel:term:PriceScheduleSpecification' :: Maybe Integer
term = Maybe Integer
a} :: PriceScheduleSpecification)
instance Prelude.Hashable PriceScheduleSpecification where
hashWithSalt :: Int -> PriceScheduleSpecification -> Int
hashWithSalt Int
_salt PriceScheduleSpecification' {Maybe Double
Maybe Integer
Maybe CurrencyCodeValues
term :: Maybe Integer
price :: Maybe Double
currencyCode :: Maybe CurrencyCodeValues
$sel:term:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe Integer
$sel:price:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe Double
$sel:currencyCode:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe CurrencyCodeValues
..} =
Int
_salt
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 PriceScheduleSpecification where
rnf :: PriceScheduleSpecification -> ()
rnf PriceScheduleSpecification' {Maybe Double
Maybe Integer
Maybe CurrencyCodeValues
term :: Maybe Integer
price :: Maybe Double
currencyCode :: Maybe CurrencyCodeValues
$sel:term:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe Integer
$sel:price:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe Double
$sel:currencyCode:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe CurrencyCodeValues
..} =
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
instance Data.ToQuery PriceScheduleSpecification where
toQuery :: PriceScheduleSpecification -> QueryString
toQuery PriceScheduleSpecification' {Maybe Double
Maybe Integer
Maybe CurrencyCodeValues
term :: Maybe Integer
price :: Maybe Double
currencyCode :: Maybe CurrencyCodeValues
$sel:term:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe Integer
$sel:price:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe Double
$sel:currencyCode:PriceScheduleSpecification' :: PriceScheduleSpecification -> Maybe CurrencyCodeValues
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"CurrencyCode" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe CurrencyCodeValues
currencyCode,
ByteString
"Price" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Double
price,
ByteString
"Term" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Integer
term
]