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