{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EC2InstanceCounts = EC2InstanceCounts'
{
EC2InstanceCounts -> Maybe Natural
idle :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
terminating :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
pending :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
maximum :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
desired :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
minimum :: Prelude.Maybe Prelude.Natural,
EC2InstanceCounts -> Maybe Natural
active :: Prelude.Maybe Prelude.Natural
}
deriving (EC2InstanceCounts -> EC2InstanceCounts -> Bool
(EC2InstanceCounts -> EC2InstanceCounts -> Bool)
-> (EC2InstanceCounts -> EC2InstanceCounts -> Bool)
-> Eq EC2InstanceCounts
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]
(Int -> ReadS EC2InstanceCounts)
-> ReadS [EC2InstanceCounts]
-> ReadPrec EC2InstanceCounts
-> ReadPrec [EC2InstanceCounts]
-> Read 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
(Int -> EC2InstanceCounts -> ShowS)
-> (EC2InstanceCounts -> String)
-> ([EC2InstanceCounts] -> ShowS)
-> Show EC2InstanceCounts
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. EC2InstanceCounts -> Rep EC2InstanceCounts x)
-> (forall x. Rep EC2InstanceCounts x -> EC2InstanceCounts)
-> Generic EC2InstanceCounts
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' :: Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts
EC2InstanceCounts'
{ $sel:idle:EC2InstanceCounts' :: Maybe Natural
idle = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:terminating:EC2InstanceCounts' :: Maybe Natural
terminating = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:pending:EC2InstanceCounts' :: Maybe Natural
pending = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maximum:EC2InstanceCounts' :: Maybe Natural
maximum = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:desired:EC2InstanceCounts' :: Maybe Natural
desired = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:minimum:EC2InstanceCounts' :: Maybe Natural
minimum = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:active:EC2InstanceCounts' :: Maybe Natural
active = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
eC2InstanceCounts_idle :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_idle :: (Maybe Natural -> f (Maybe Natural))
-> EC2InstanceCounts -> f EC2InstanceCounts
eC2InstanceCounts_idle = (EC2InstanceCounts -> Maybe Natural)
-> (EC2InstanceCounts -> Maybe Natural -> EC2InstanceCounts)
-> Lens
EC2InstanceCounts EC2InstanceCounts (Maybe Natural) (Maybe Natural)
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_terminating :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_terminating :: (Maybe Natural -> f (Maybe Natural))
-> EC2InstanceCounts -> f EC2InstanceCounts
eC2InstanceCounts_terminating = (EC2InstanceCounts -> Maybe Natural)
-> (EC2InstanceCounts -> Maybe Natural -> EC2InstanceCounts)
-> Lens
EC2InstanceCounts EC2InstanceCounts (Maybe Natural) (Maybe Natural)
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)
eC2InstanceCounts_pending :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_pending :: (Maybe Natural -> f (Maybe Natural))
-> EC2InstanceCounts -> f EC2InstanceCounts
eC2InstanceCounts_pending = (EC2InstanceCounts -> Maybe Natural)
-> (EC2InstanceCounts -> Maybe Natural -> EC2InstanceCounts)
-> Lens
EC2InstanceCounts EC2InstanceCounts (Maybe Natural) (Maybe Natural)
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_maximum :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_maximum :: (Maybe Natural -> f (Maybe Natural))
-> EC2InstanceCounts -> f EC2InstanceCounts
eC2InstanceCounts_maximum = (EC2InstanceCounts -> Maybe Natural)
-> (EC2InstanceCounts -> Maybe Natural -> EC2InstanceCounts)
-> Lens
EC2InstanceCounts EC2InstanceCounts (Maybe Natural) (Maybe Natural)
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_desired :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_desired :: (Maybe Natural -> f (Maybe Natural))
-> EC2InstanceCounts -> f EC2InstanceCounts
eC2InstanceCounts_desired = (EC2InstanceCounts -> Maybe Natural)
-> (EC2InstanceCounts -> Maybe Natural -> EC2InstanceCounts)
-> Lens
EC2InstanceCounts EC2InstanceCounts (Maybe Natural) (Maybe Natural)
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_minimum :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_minimum :: (Maybe Natural -> f (Maybe Natural))
-> EC2InstanceCounts -> f EC2InstanceCounts
eC2InstanceCounts_minimum = (EC2InstanceCounts -> Maybe Natural)
-> (EC2InstanceCounts -> Maybe Natural -> EC2InstanceCounts)
-> Lens
EC2InstanceCounts EC2InstanceCounts (Maybe Natural) (Maybe Natural)
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_active :: Lens.Lens' EC2InstanceCounts (Prelude.Maybe Prelude.Natural)
eC2InstanceCounts_active :: (Maybe Natural -> f (Maybe Natural))
-> EC2InstanceCounts -> f EC2InstanceCounts
eC2InstanceCounts_active = (EC2InstanceCounts -> Maybe Natural)
-> (EC2InstanceCounts -> Maybe Natural -> EC2InstanceCounts)
-> Lens
EC2InstanceCounts EC2InstanceCounts (Maybe Natural) (Maybe Natural)
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)
instance Core.FromJSON EC2InstanceCounts where
parseJSON :: Value -> Parser EC2InstanceCounts
parseJSON =
String
-> (Object -> Parser EC2InstanceCounts)
-> Value
-> Parser EC2InstanceCounts
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EC2InstanceCounts"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts
EC2InstanceCounts'
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IDLE")
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TERMINATING")
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PENDING")
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceCounts)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Natural -> Maybe Natural -> EC2InstanceCounts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MAXIMUM")
Parser
(Maybe Natural
-> Maybe Natural -> Maybe Natural -> EC2InstanceCounts)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> Maybe Natural -> EC2InstanceCounts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DESIRED")
Parser (Maybe Natural -> Maybe Natural -> EC2InstanceCounts)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> EC2InstanceCounts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MINIMUM")
Parser (Maybe Natural -> EC2InstanceCounts)
-> Parser (Maybe Natural) -> Parser EC2InstanceCounts
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ACTIVE")
)
instance Prelude.Hashable EC2InstanceCounts
instance Prelude.NFData EC2InstanceCounts