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