{-# 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.SpotPrice 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.InstanceType
import Amazonka.EC2.Types.RIProductDescription
import qualified Amazonka.Prelude as Prelude
data SpotPrice = SpotPrice'
{
SpotPrice -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
SpotPrice -> Maybe InstanceType
instanceType :: Prelude.Maybe InstanceType,
SpotPrice -> Maybe RIProductDescription
productDescription :: Prelude.Maybe RIProductDescription,
SpotPrice -> Maybe Text
spotPrice :: Prelude.Maybe Prelude.Text,
SpotPrice -> Maybe ISO8601
timestamp :: Prelude.Maybe Data.ISO8601
}
deriving (SpotPrice -> SpotPrice -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SpotPrice -> SpotPrice -> Bool
$c/= :: SpotPrice -> SpotPrice -> Bool
== :: SpotPrice -> SpotPrice -> Bool
$c== :: SpotPrice -> SpotPrice -> Bool
Prelude.Eq, ReadPrec [SpotPrice]
ReadPrec SpotPrice
Int -> ReadS SpotPrice
ReadS [SpotPrice]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SpotPrice]
$creadListPrec :: ReadPrec [SpotPrice]
readPrec :: ReadPrec SpotPrice
$creadPrec :: ReadPrec SpotPrice
readList :: ReadS [SpotPrice]
$creadList :: ReadS [SpotPrice]
readsPrec :: Int -> ReadS SpotPrice
$creadsPrec :: Int -> ReadS SpotPrice
Prelude.Read, Int -> SpotPrice -> ShowS
[SpotPrice] -> ShowS
SpotPrice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SpotPrice] -> ShowS
$cshowList :: [SpotPrice] -> ShowS
show :: SpotPrice -> String
$cshow :: SpotPrice -> String
showsPrec :: Int -> SpotPrice -> ShowS
$cshowsPrec :: Int -> SpotPrice -> ShowS
Prelude.Show, forall x. Rep SpotPrice x -> SpotPrice
forall x. SpotPrice -> Rep SpotPrice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SpotPrice x -> SpotPrice
$cfrom :: forall x. SpotPrice -> Rep SpotPrice x
Prelude.Generic)
newSpotPrice ::
SpotPrice
newSpotPrice :: SpotPrice
newSpotPrice =
SpotPrice'
{ $sel:availabilityZone:SpotPrice' :: Maybe Text
availabilityZone = forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:SpotPrice' :: Maybe InstanceType
instanceType = forall a. Maybe a
Prelude.Nothing,
$sel:productDescription:SpotPrice' :: Maybe RIProductDescription
productDescription = forall a. Maybe a
Prelude.Nothing,
$sel:spotPrice:SpotPrice' :: Maybe Text
spotPrice = forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:SpotPrice' :: Maybe ISO8601
timestamp = forall a. Maybe a
Prelude.Nothing
}
spotPrice_availabilityZone :: Lens.Lens' SpotPrice (Prelude.Maybe Prelude.Text)
spotPrice_availabilityZone :: Lens' SpotPrice (Maybe Text)
spotPrice_availabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotPrice' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:SpotPrice' :: SpotPrice -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: SpotPrice
s@SpotPrice' {} Maybe Text
a -> SpotPrice
s {$sel:availabilityZone:SpotPrice' :: Maybe Text
availabilityZone = Maybe Text
a} :: SpotPrice)
spotPrice_instanceType :: Lens.Lens' SpotPrice (Prelude.Maybe InstanceType)
spotPrice_instanceType :: Lens' SpotPrice (Maybe InstanceType)
spotPrice_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotPrice' {Maybe InstanceType
instanceType :: Maybe InstanceType
$sel:instanceType:SpotPrice' :: SpotPrice -> Maybe InstanceType
instanceType} -> Maybe InstanceType
instanceType) (\s :: SpotPrice
s@SpotPrice' {} Maybe InstanceType
a -> SpotPrice
s {$sel:instanceType:SpotPrice' :: Maybe InstanceType
instanceType = Maybe InstanceType
a} :: SpotPrice)
spotPrice_productDescription :: Lens.Lens' SpotPrice (Prelude.Maybe RIProductDescription)
spotPrice_productDescription :: Lens' SpotPrice (Maybe RIProductDescription)
spotPrice_productDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotPrice' {Maybe RIProductDescription
productDescription :: Maybe RIProductDescription
$sel:productDescription:SpotPrice' :: SpotPrice -> Maybe RIProductDescription
productDescription} -> Maybe RIProductDescription
productDescription) (\s :: SpotPrice
s@SpotPrice' {} Maybe RIProductDescription
a -> SpotPrice
s {$sel:productDescription:SpotPrice' :: Maybe RIProductDescription
productDescription = Maybe RIProductDescription
a} :: SpotPrice)
spotPrice_spotPrice :: Lens.Lens' SpotPrice (Prelude.Maybe Prelude.Text)
spotPrice_spotPrice :: Lens' SpotPrice (Maybe Text)
spotPrice_spotPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotPrice' {Maybe Text
spotPrice :: Maybe Text
$sel:spotPrice:SpotPrice' :: SpotPrice -> Maybe Text
spotPrice} -> Maybe Text
spotPrice) (\s :: SpotPrice
s@SpotPrice' {} Maybe Text
a -> SpotPrice
s {$sel:spotPrice:SpotPrice' :: Maybe Text
spotPrice = Maybe Text
a} :: SpotPrice)
spotPrice_timestamp :: Lens.Lens' SpotPrice (Prelude.Maybe Prelude.UTCTime)
spotPrice_timestamp :: Lens' SpotPrice (Maybe UTCTime)
spotPrice_timestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotPrice' {Maybe ISO8601
timestamp :: Maybe ISO8601
$sel:timestamp:SpotPrice' :: SpotPrice -> Maybe ISO8601
timestamp} -> Maybe ISO8601
timestamp) (\s :: SpotPrice
s@SpotPrice' {} Maybe ISO8601
a -> SpotPrice
s {$sel:timestamp:SpotPrice' :: Maybe ISO8601
timestamp = Maybe ISO8601
a} :: SpotPrice) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromXML SpotPrice where
parseXML :: [Node] -> Either String SpotPrice
parseXML [Node]
x =
Maybe Text
-> Maybe InstanceType
-> Maybe RIProductDescription
-> Maybe Text
-> Maybe ISO8601
-> SpotPrice
SpotPrice'
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
"availabilityZone")
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
"instanceType")
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
"productDescription")
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
"spotPrice")
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
"timestamp")
instance Prelude.Hashable SpotPrice where
hashWithSalt :: Int -> SpotPrice -> Int
hashWithSalt Int
_salt SpotPrice' {Maybe Text
Maybe ISO8601
Maybe InstanceType
Maybe RIProductDescription
timestamp :: Maybe ISO8601
spotPrice :: Maybe Text
productDescription :: Maybe RIProductDescription
instanceType :: Maybe InstanceType
availabilityZone :: Maybe Text
$sel:timestamp:SpotPrice' :: SpotPrice -> Maybe ISO8601
$sel:spotPrice:SpotPrice' :: SpotPrice -> Maybe Text
$sel:productDescription:SpotPrice' :: SpotPrice -> Maybe RIProductDescription
$sel:instanceType:SpotPrice' :: SpotPrice -> Maybe InstanceType
$sel:availabilityZone:SpotPrice' :: SpotPrice -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availabilityZone
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceType
instanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RIProductDescription
productDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
spotPrice
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
timestamp
instance Prelude.NFData SpotPrice where
rnf :: SpotPrice -> ()
rnf SpotPrice' {Maybe Text
Maybe ISO8601
Maybe InstanceType
Maybe RIProductDescription
timestamp :: Maybe ISO8601
spotPrice :: Maybe Text
productDescription :: Maybe RIProductDescription
instanceType :: Maybe InstanceType
availabilityZone :: Maybe Text
$sel:timestamp:SpotPrice' :: SpotPrice -> Maybe ISO8601
$sel:spotPrice:SpotPrice' :: SpotPrice -> Maybe Text
$sel:productDescription:SpotPrice' :: SpotPrice -> Maybe RIProductDescription
$sel:instanceType:SpotPrice' :: SpotPrice -> Maybe InstanceType
$sel:availabilityZone:SpotPrice' :: SpotPrice -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availabilityZone
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceType
instanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RIProductDescription
productDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
spotPrice
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
timestamp