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