{-# 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.GameLift.Types.EC2InstanceCounts where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data EC2InstanceCounts = EC2InstanceCounts'
{
EC2InstanceCounts -> Maybe Natural
active :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
desired :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
idle :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
maximum :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
minimum :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
pending :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
terminating :: Prelude.Maybe Prelude.Natural
}
deriving (EC2InstanceCounts -> EC2InstanceCounts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EC2InstanceCounts -> EC2InstanceCounts -> Bool
$c/= :: EC2InstanceCounts -> EC2InstanceCounts -> Bool
== :: EC2InstanceCounts -> EC2InstanceCounts -> Bool
$c== :: EC2InstanceCounts -> EC2InstanceCounts -> Bool
Prelude.Eq, ReadPrec [EC2InstanceCounts]
ReadPrec EC2InstanceCounts
Int -> ReadS EC2InstanceCounts
ReadS [EC2InstanceCounts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EC2InstanceCounts]
$creadListPrec :: ReadPrec [EC2InstanceCounts]
readPrec :: ReadPrec EC2InstanceCounts
$creadPrec :: ReadPrec EC2InstanceCounts
readList :: ReadS [EC2InstanceCounts]
$creadList :: ReadS [EC2InstanceCounts]
readsPrec :: Int -> ReadS EC2InstanceCounts
$creadsPrec :: Int -> ReadS EC2InstanceCounts
Prelude.Read, Int -> EC2InstanceCounts -> ShowS
[EC2InstanceCounts] -> ShowS
EC2InstanceCounts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EC2InstanceCounts] -> ShowS
$cshowList :: [EC2InstanceCounts] -> ShowS
show :: EC2InstanceCounts -> String
$cshow :: EC2InstanceCounts -> String
showsPrec :: Int -> EC2InstanceCounts -> ShowS
$cshowsPrec :: Int -> EC2InstanceCounts -> ShowS
Prelude.Show, forall x. Rep EC2InstanceCounts x -> EC2InstanceCounts
forall x. EC2InstanceCounts -> Rep EC2InstanceCounts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EC2InstanceCounts x -> EC2InstanceCounts
$cfrom :: forall x. EC2InstanceCounts -> Rep EC2InstanceCounts x
Prelude.Generic)
newEC2InstanceCounts ::
EC2InstanceCounts
newEC2InstanceCounts :: EC2InstanceCounts
newEC2InstanceCounts =
EC2InstanceCounts'
{ $sel:active:EC2InstanceCounts' :: Maybe Natural
active = forall a. Maybe a
Prelude.Nothing,
$sel:desired:EC2InstanceCounts' :: Maybe Natural
desired = forall a. Maybe a
Prelude.Nothing,
$sel:idle:EC2InstanceCounts' :: Maybe Natural
idle = forall a. Maybe a
Prelude.Nothing,
$sel:maximum:EC2InstanceCounts' :: Maybe Natural
maximum = forall a. Maybe a
Prelude.Nothing,
$sel:minimum:EC2InstanceCounts' :: Maybe Natural
minimum = forall a. Maybe a
Prelude.Nothing,
$sel:pending:EC2InstanceCounts' :: Maybe Natural
pending = forall a. Maybe a
Prelude.Nothing,
$sel:terminating:EC2InstanceCounts' :: Maybe Natural
terminating = forall a. Maybe a
Prelude.Nothing
}
eC2InstanceCounts_active :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_active :: Lens' EC2InstanceCounts (Maybe Natural)
eC2InstanceCounts_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceCounts' {Maybe Natural
active :: Maybe Natural
$sel:active:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
active} -> Maybe Natural
active) (\s :: EC2InstanceCounts
s@EC2InstanceCounts' {} Maybe Natural
a -> EC2InstanceCounts
s {$sel:active:EC2InstanceCounts' :: Maybe Natural
active = Maybe Natural
a} :: EC2InstanceCounts)
eC2InstanceCounts_desired :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_desired :: Lens' EC2InstanceCounts (Maybe Natural)
eC2InstanceCounts_desired = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceCounts' {Maybe Natural
desired :: Maybe Natural
$sel:desired:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
desired} -> Maybe Natural
desired) (\s :: EC2InstanceCounts
s@EC2InstanceCounts' {} Maybe Natural
a -> EC2InstanceCounts
s {$sel:desired:EC2InstanceCounts' :: Maybe Natural
desired = Maybe Natural
a} :: EC2InstanceCounts)
eC2InstanceCounts_idle :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_idle :: Lens' EC2InstanceCounts (Maybe Natural)
eC2InstanceCounts_idle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceCounts' {Maybe Natural
idle :: Maybe Natural
$sel:idle:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
idle} -> Maybe Natural
idle) (\s :: EC2InstanceCounts
s@EC2InstanceCounts' {} Maybe Natural
a -> EC2InstanceCounts
s {$sel:idle:EC2InstanceCounts' :: Maybe Natural
idle = Maybe Natural
a} :: EC2InstanceCounts)
eC2InstanceCounts_maximum :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_maximum :: Lens' EC2InstanceCounts (Maybe Natural)
eC2InstanceCounts_maximum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceCounts' {Maybe Natural
maximum :: Maybe Natural
$sel:maximum:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
maximum} -> Maybe Natural
maximum) (\s :: EC2InstanceCounts
s@EC2InstanceCounts' {} Maybe Natural
a -> EC2InstanceCounts
s {$sel:maximum:EC2InstanceCounts' :: Maybe Natural
maximum = Maybe Natural
a} :: EC2InstanceCounts)
eC2InstanceCounts_minimum :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_minimum :: Lens' EC2InstanceCounts (Maybe Natural)
eC2InstanceCounts_minimum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceCounts' {Maybe Natural
minimum :: Maybe Natural
$sel:minimum:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
minimum} -> Maybe Natural
minimum) (\s :: EC2InstanceCounts
s@EC2InstanceCounts' {} Maybe Natural
a -> EC2InstanceCounts
s {$sel:minimum:EC2InstanceCounts' :: Maybe Natural
minimum = Maybe Natural
a} :: EC2InstanceCounts)
eC2InstanceCounts_pending :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_pending :: Lens' EC2InstanceCounts (Maybe Natural)
eC2InstanceCounts_pending = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceCounts' {Maybe Natural
pending :: Maybe Natural
$sel:pending:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
pending} -> Maybe Natural
pending) (\s :: EC2InstanceCounts
s@EC2InstanceCounts' {} Maybe Natural
a -> EC2InstanceCounts
s {$sel:pending:EC2InstanceCounts' :: Maybe Natural
pending = Maybe Natural
a} :: EC2InstanceCounts)
eC2InstanceCounts_terminating :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_terminating :: Lens' EC2InstanceCounts (Maybe Natural)
eC2InstanceCounts_terminating = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceCounts' {Maybe Natural
terminating :: Maybe Natural
$sel:terminating:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
terminating} -> Maybe Natural
terminating) (\s :: EC2InstanceCounts
s@EC2InstanceCounts' {} Maybe Natural
a -> EC2InstanceCounts
s {$sel:terminating:EC2InstanceCounts' :: Maybe Natural
terminating = Maybe Natural
a} :: EC2InstanceCounts)
instance Data.FromJSON EC2InstanceCounts where
parseJSON :: Value -> Parser EC2InstanceCounts
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EC2InstanceCounts"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts
EC2InstanceCounts'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ACTIVE")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DESIRED")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IDLE")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MAXIMUM")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MINIMUM")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PENDING")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TERMINATING")
)
instance Prelude.Hashable EC2InstanceCounts where
hashWithSalt :: Int -> EC2InstanceCounts -> Int
hashWithSalt Int
_salt EC2InstanceCounts' {Maybe Natural
terminating :: Maybe Natural
pending :: Maybe Natural
minimum :: Maybe Natural
maximum :: Maybe Natural
idle :: Maybe Natural
desired :: Maybe Natural
active :: Maybe Natural
$sel:terminating:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:pending:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:minimum:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:maximum:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:idle:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:desired:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:active:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
active
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
desired
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
idle
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maximum
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
minimum
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pending
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
terminating
instance Prelude.NFData EC2InstanceCounts where
rnf :: EC2InstanceCounts -> ()
rnf EC2InstanceCounts' {Maybe Natural
terminating :: Maybe Natural
pending :: Maybe Natural
minimum :: Maybe Natural
maximum :: Maybe Natural
idle :: Maybe Natural
desired :: Maybe Natural
active :: Maybe Natural
$sel:terminating:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:pending:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:minimum:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:maximum:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:idle:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:desired:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
$sel:active:EC2InstanceCounts' :: EC2InstanceCounts -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
active
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
desired
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
idle
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maximum
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
minimum
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
pending
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
terminating