{-# 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.ReservationValue 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 qualified Amazonka.Prelude as Prelude
data ReservationValue = ReservationValue'
{
ReservationValue -> Maybe Text
hourlyPrice :: Prelude.Maybe Prelude.Text,
ReservationValue -> Maybe Text
remainingTotalValue :: Prelude.Maybe Prelude.Text,
ReservationValue -> Maybe Text
remainingUpfrontValue :: Prelude.Maybe Prelude.Text
}
deriving (ReservationValue -> ReservationValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservationValue -> ReservationValue -> Bool
$c/= :: ReservationValue -> ReservationValue -> Bool
== :: ReservationValue -> ReservationValue -> Bool
$c== :: ReservationValue -> ReservationValue -> Bool
Prelude.Eq, ReadPrec [ReservationValue]
ReadPrec ReservationValue
Int -> ReadS ReservationValue
ReadS [ReservationValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservationValue]
$creadListPrec :: ReadPrec [ReservationValue]
readPrec :: ReadPrec ReservationValue
$creadPrec :: ReadPrec ReservationValue
readList :: ReadS [ReservationValue]
$creadList :: ReadS [ReservationValue]
readsPrec :: Int -> ReadS ReservationValue
$creadsPrec :: Int -> ReadS ReservationValue
Prelude.Read, Int -> ReservationValue -> ShowS
[ReservationValue] -> ShowS
ReservationValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservationValue] -> ShowS
$cshowList :: [ReservationValue] -> ShowS
show :: ReservationValue -> String
$cshow :: ReservationValue -> String
showsPrec :: Int -> ReservationValue -> ShowS
$cshowsPrec :: Int -> ReservationValue -> ShowS
Prelude.Show, forall x. Rep ReservationValue x -> ReservationValue
forall x. ReservationValue -> Rep ReservationValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReservationValue x -> ReservationValue
$cfrom :: forall x. ReservationValue -> Rep ReservationValue x
Prelude.Generic)
newReservationValue ::
ReservationValue
newReservationValue :: ReservationValue
newReservationValue =
ReservationValue'
{ $sel:hourlyPrice:ReservationValue' :: Maybe Text
hourlyPrice = forall a. Maybe a
Prelude.Nothing,
$sel:remainingTotalValue:ReservationValue' :: Maybe Text
remainingTotalValue = forall a. Maybe a
Prelude.Nothing,
$sel:remainingUpfrontValue:ReservationValue' :: Maybe Text
remainingUpfrontValue = forall a. Maybe a
Prelude.Nothing
}
reservationValue_hourlyPrice :: Lens.Lens' ReservationValue (Prelude.Maybe Prelude.Text)
reservationValue_hourlyPrice :: Lens' ReservationValue (Maybe Text)
reservationValue_hourlyPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationValue' {Maybe Text
hourlyPrice :: Maybe Text
$sel:hourlyPrice:ReservationValue' :: ReservationValue -> Maybe Text
hourlyPrice} -> Maybe Text
hourlyPrice) (\s :: ReservationValue
s@ReservationValue' {} Maybe Text
a -> ReservationValue
s {$sel:hourlyPrice:ReservationValue' :: Maybe Text
hourlyPrice = Maybe Text
a} :: ReservationValue)
reservationValue_remainingTotalValue :: Lens.Lens' ReservationValue (Prelude.Maybe Prelude.Text)
reservationValue_remainingTotalValue :: Lens' ReservationValue (Maybe Text)
reservationValue_remainingTotalValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationValue' {Maybe Text
remainingTotalValue :: Maybe Text
$sel:remainingTotalValue:ReservationValue' :: ReservationValue -> Maybe Text
remainingTotalValue} -> Maybe Text
remainingTotalValue) (\s :: ReservationValue
s@ReservationValue' {} Maybe Text
a -> ReservationValue
s {$sel:remainingTotalValue:ReservationValue' :: Maybe Text
remainingTotalValue = Maybe Text
a} :: ReservationValue)
reservationValue_remainingUpfrontValue :: Lens.Lens' ReservationValue (Prelude.Maybe Prelude.Text)
reservationValue_remainingUpfrontValue :: Lens' ReservationValue (Maybe Text)
reservationValue_remainingUpfrontValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationValue' {Maybe Text
remainingUpfrontValue :: Maybe Text
$sel:remainingUpfrontValue:ReservationValue' :: ReservationValue -> Maybe Text
remainingUpfrontValue} -> Maybe Text
remainingUpfrontValue) (\s :: ReservationValue
s@ReservationValue' {} Maybe Text
a -> ReservationValue
s {$sel:remainingUpfrontValue:ReservationValue' :: Maybe Text
remainingUpfrontValue = Maybe Text
a} :: ReservationValue)
instance Data.FromXML ReservationValue where
parseXML :: [Node] -> Either String ReservationValue
parseXML [Node]
x =
Maybe Text -> Maybe Text -> Maybe Text -> ReservationValue
ReservationValue'
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
"hourlyPrice")
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
"remainingTotalValue")
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
"remainingUpfrontValue")
instance Prelude.Hashable ReservationValue where
hashWithSalt :: Int -> ReservationValue -> Int
hashWithSalt Int
_salt ReservationValue' {Maybe Text
remainingUpfrontValue :: Maybe Text
remainingTotalValue :: Maybe Text
hourlyPrice :: Maybe Text
$sel:remainingUpfrontValue:ReservationValue' :: ReservationValue -> Maybe Text
$sel:remainingTotalValue:ReservationValue' :: ReservationValue -> Maybe Text
$sel:hourlyPrice:ReservationValue' :: ReservationValue -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hourlyPrice
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
remainingTotalValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
remainingUpfrontValue
instance Prelude.NFData ReservationValue where
rnf :: ReservationValue -> ()
rnf ReservationValue' {Maybe Text
remainingUpfrontValue :: Maybe Text
remainingTotalValue :: Maybe Text
hourlyPrice :: Maybe Text
$sel:remainingUpfrontValue:ReservationValue' :: ReservationValue -> Maybe Text
$sel:remainingTotalValue:ReservationValue' :: ReservationValue -> Maybe Text
$sel:hourlyPrice:ReservationValue' :: ReservationValue -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hourlyPrice
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
remainingTotalValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
remainingUpfrontValue