{-# 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.EC2InstanceLimit where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types.EC2InstanceType
import qualified Amazonka.Prelude as Prelude
data EC2InstanceLimit = EC2InstanceLimit'
{
EC2InstanceLimit -> Maybe Natural
currentInstances :: Prelude.Maybe Prelude.Natural,
EC2InstanceLimit -> Maybe EC2InstanceType
eC2InstanceType :: Prelude.Maybe EC2InstanceType,
EC2InstanceLimit -> Maybe Natural
instanceLimit :: Prelude.Maybe Prelude.Natural,
EC2InstanceLimit -> Maybe Text
location :: Prelude.Maybe Prelude.Text
}
deriving (EC2InstanceLimit -> EC2InstanceLimit -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EC2InstanceLimit -> EC2InstanceLimit -> Bool
$c/= :: EC2InstanceLimit -> EC2InstanceLimit -> Bool
== :: EC2InstanceLimit -> EC2InstanceLimit -> Bool
$c== :: EC2InstanceLimit -> EC2InstanceLimit -> Bool
Prelude.Eq, ReadPrec [EC2InstanceLimit]
ReadPrec EC2InstanceLimit
Int -> ReadS EC2InstanceLimit
ReadS [EC2InstanceLimit]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EC2InstanceLimit]
$creadListPrec :: ReadPrec [EC2InstanceLimit]
readPrec :: ReadPrec EC2InstanceLimit
$creadPrec :: ReadPrec EC2InstanceLimit
readList :: ReadS [EC2InstanceLimit]
$creadList :: ReadS [EC2InstanceLimit]
readsPrec :: Int -> ReadS EC2InstanceLimit
$creadsPrec :: Int -> ReadS EC2InstanceLimit
Prelude.Read, Int -> EC2InstanceLimit -> ShowS
[EC2InstanceLimit] -> ShowS
EC2InstanceLimit -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EC2InstanceLimit] -> ShowS
$cshowList :: [EC2InstanceLimit] -> ShowS
show :: EC2InstanceLimit -> String
$cshow :: EC2InstanceLimit -> String
showsPrec :: Int -> EC2InstanceLimit -> ShowS
$cshowsPrec :: Int -> EC2InstanceLimit -> ShowS
Prelude.Show, forall x. Rep EC2InstanceLimit x -> EC2InstanceLimit
forall x. EC2InstanceLimit -> Rep EC2InstanceLimit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EC2InstanceLimit x -> EC2InstanceLimit
$cfrom :: forall x. EC2InstanceLimit -> Rep EC2InstanceLimit x
Prelude.Generic)
newEC2InstanceLimit ::
EC2InstanceLimit
newEC2InstanceLimit :: EC2InstanceLimit
newEC2InstanceLimit =
EC2InstanceLimit'
{ $sel:currentInstances:EC2InstanceLimit' :: Maybe Natural
currentInstances =
forall a. Maybe a
Prelude.Nothing,
$sel:eC2InstanceType:EC2InstanceLimit' :: Maybe EC2InstanceType
eC2InstanceType = forall a. Maybe a
Prelude.Nothing,
$sel:instanceLimit:EC2InstanceLimit' :: Maybe Natural
instanceLimit = forall a. Maybe a
Prelude.Nothing,
$sel:location:EC2InstanceLimit' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing
}
eC2InstanceLimit_currentInstances :: Lens.Lens' EC2InstanceLimit (Prelude.Maybe Prelude.Natural)
eC2InstanceLimit_currentInstances :: Lens' EC2InstanceLimit (Maybe Natural)
eC2InstanceLimit_currentInstances = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceLimit' {Maybe Natural
currentInstances :: Maybe Natural
$sel:currentInstances:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe Natural
currentInstances} -> Maybe Natural
currentInstances) (\s :: EC2InstanceLimit
s@EC2InstanceLimit' {} Maybe Natural
a -> EC2InstanceLimit
s {$sel:currentInstances:EC2InstanceLimit' :: Maybe Natural
currentInstances = Maybe Natural
a} :: EC2InstanceLimit)
eC2InstanceLimit_eC2InstanceType :: Lens.Lens' EC2InstanceLimit (Prelude.Maybe EC2InstanceType)
eC2InstanceLimit_eC2InstanceType :: Lens' EC2InstanceLimit (Maybe EC2InstanceType)
eC2InstanceLimit_eC2InstanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceLimit' {Maybe EC2InstanceType
eC2InstanceType :: Maybe EC2InstanceType
$sel:eC2InstanceType:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe EC2InstanceType
eC2InstanceType} -> Maybe EC2InstanceType
eC2InstanceType) (\s :: EC2InstanceLimit
s@EC2InstanceLimit' {} Maybe EC2InstanceType
a -> EC2InstanceLimit
s {$sel:eC2InstanceType:EC2InstanceLimit' :: Maybe EC2InstanceType
eC2InstanceType = Maybe EC2InstanceType
a} :: EC2InstanceLimit)
eC2InstanceLimit_instanceLimit :: Lens.Lens' EC2InstanceLimit (Prelude.Maybe Prelude.Natural)
eC2InstanceLimit_instanceLimit :: Lens' EC2InstanceLimit (Maybe Natural)
eC2InstanceLimit_instanceLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceLimit' {Maybe Natural
instanceLimit :: Maybe Natural
$sel:instanceLimit:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe Natural
instanceLimit} -> Maybe Natural
instanceLimit) (\s :: EC2InstanceLimit
s@EC2InstanceLimit' {} Maybe Natural
a -> EC2InstanceLimit
s {$sel:instanceLimit:EC2InstanceLimit' :: Maybe Natural
instanceLimit = Maybe Natural
a} :: EC2InstanceLimit)
eC2InstanceLimit_location :: Lens.Lens' EC2InstanceLimit (Prelude.Maybe Prelude.Text)
eC2InstanceLimit_location :: Lens' EC2InstanceLimit (Maybe Text)
eC2InstanceLimit_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2InstanceLimit' {Maybe Text
location :: Maybe Text
$sel:location:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe Text
location} -> Maybe Text
location) (\s :: EC2InstanceLimit
s@EC2InstanceLimit' {} Maybe Text
a -> EC2InstanceLimit
s {$sel:location:EC2InstanceLimit' :: Maybe Text
location = Maybe Text
a} :: EC2InstanceLimit)
instance Data.FromJSON EC2InstanceLimit where
parseJSON :: Value -> Parser EC2InstanceLimit
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EC2InstanceLimit"
( \Object
x ->
Maybe Natural
-> Maybe EC2InstanceType
-> Maybe Natural
-> Maybe Text
-> EC2InstanceLimit
EC2InstanceLimit'
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
"CurrentInstances")
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
"EC2InstanceType")
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
"InstanceLimit")
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
"Location")
)
instance Prelude.Hashable EC2InstanceLimit where
hashWithSalt :: Int -> EC2InstanceLimit -> Int
hashWithSalt Int
_salt EC2InstanceLimit' {Maybe Natural
Maybe Text
Maybe EC2InstanceType
location :: Maybe Text
instanceLimit :: Maybe Natural
eC2InstanceType :: Maybe EC2InstanceType
currentInstances :: Maybe Natural
$sel:location:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe Text
$sel:instanceLimit:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe Natural
$sel:eC2InstanceType:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe EC2InstanceType
$sel:currentInstances:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
currentInstances
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EC2InstanceType
eC2InstanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
instanceLimit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
instance Prelude.NFData EC2InstanceLimit where
rnf :: EC2InstanceLimit -> ()
rnf EC2InstanceLimit' {Maybe Natural
Maybe Text
Maybe EC2InstanceType
location :: Maybe Text
instanceLimit :: Maybe Natural
eC2InstanceType :: Maybe EC2InstanceType
currentInstances :: Maybe Natural
$sel:location:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe Text
$sel:instanceLimit:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe Natural
$sel:eC2InstanceType:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe EC2InstanceType
$sel:currentInstances:EC2InstanceLimit' :: EC2InstanceLimit -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
currentInstances
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EC2InstanceType
eC2InstanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
instanceLimit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
location