{-# 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 Amazonka.GameLift.Types.EC2InstanceType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EC2InstanceLimit = EC2InstanceLimit'
{
EC2InstanceLimit -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
EC2InstanceLimit -> Maybe EC2InstanceType
eC2InstanceType :: Prelude.Maybe EC2InstanceType,
EC2InstanceLimit -> Maybe Natural
currentInstances :: Prelude.Maybe Prelude.Natural,
EC2InstanceLimit -> Maybe Natural
instanceLimit :: Prelude.Maybe Prelude.Natural
}
deriving (EC2InstanceLimit -> EC2InstanceLimit -> Bool
(EC2InstanceLimit -> EC2InstanceLimit -> Bool)
-> (EC2InstanceLimit -> EC2InstanceLimit -> Bool)
-> Eq EC2InstanceLimit
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]
(Int -> ReadS EC2InstanceLimit)
-> ReadS [EC2InstanceLimit]
-> ReadPrec EC2InstanceLimit
-> ReadPrec [EC2InstanceLimit]
-> Read 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
(Int -> EC2InstanceLimit -> ShowS)
-> (EC2InstanceLimit -> String)
-> ([EC2InstanceLimit] -> ShowS)
-> Show EC2InstanceLimit
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. EC2InstanceLimit -> Rep EC2InstanceLimit x)
-> (forall x. Rep EC2InstanceLimit x -> EC2InstanceLimit)
-> Generic EC2InstanceLimit
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' :: Maybe Text
-> Maybe EC2InstanceType
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceLimit
EC2InstanceLimit'
{ $sel:location:EC2InstanceLimit' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eC2InstanceType:EC2InstanceLimit' :: Maybe EC2InstanceType
eC2InstanceType = Maybe EC2InstanceType
forall a. Maybe a
Prelude.Nothing,
$sel:currentInstances:EC2InstanceLimit' :: Maybe Natural
currentInstances = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:instanceLimit:EC2InstanceLimit' :: Maybe Natural
instanceLimit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
eC2InstanceLimit_location :: Lens.Lens' EC2InstanceLimit (Prelude.Maybe Prelude.Text)
eC2InstanceLimit_location :: (Maybe Text -> f (Maybe Text))
-> EC2InstanceLimit -> f EC2InstanceLimit
eC2InstanceLimit_location = (EC2InstanceLimit -> Maybe Text)
-> (EC2InstanceLimit -> Maybe Text -> EC2InstanceLimit)
-> Lens EC2InstanceLimit EC2InstanceLimit (Maybe Text) (Maybe Text)
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)
eC2InstanceLimit_eC2InstanceType :: Lens.Lens' EC2InstanceLimit (Prelude.Maybe EC2InstanceType)
eC2InstanceLimit_eC2InstanceType :: (Maybe EC2InstanceType -> f (Maybe EC2InstanceType))
-> EC2InstanceLimit -> f EC2InstanceLimit
eC2InstanceLimit_eC2InstanceType = (EC2InstanceLimit -> Maybe EC2InstanceType)
-> (EC2InstanceLimit -> Maybe EC2InstanceType -> EC2InstanceLimit)
-> Lens
EC2InstanceLimit
EC2InstanceLimit
(Maybe EC2InstanceType)
(Maybe 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_currentInstances :: Lens.Lens' EC2InstanceLimit (Prelude.Maybe Prelude.Natural)
eC2InstanceLimit_currentInstances :: (Maybe Natural -> f (Maybe Natural))
-> EC2InstanceLimit -> f EC2InstanceLimit
eC2InstanceLimit_currentInstances = (EC2InstanceLimit -> Maybe Natural)
-> (EC2InstanceLimit -> Maybe Natural -> EC2InstanceLimit)
-> Lens
EC2InstanceLimit EC2InstanceLimit (Maybe Natural) (Maybe Natural)
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_instanceLimit :: Lens.Lens' EC2InstanceLimit (Prelude.Maybe Prelude.Natural)
eC2InstanceLimit_instanceLimit :: (Maybe Natural -> f (Maybe Natural))
-> EC2InstanceLimit -> f EC2InstanceLimit
eC2InstanceLimit_instanceLimit = (EC2InstanceLimit -> Maybe Natural)
-> (EC2InstanceLimit -> Maybe Natural -> EC2InstanceLimit)
-> Lens
EC2InstanceLimit EC2InstanceLimit (Maybe Natural) (Maybe Natural)
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)
instance Core.FromJSON EC2InstanceLimit where
parseJSON :: Value -> Parser EC2InstanceLimit
parseJSON =
String
-> (Object -> Parser EC2InstanceLimit)
-> Value
-> Parser EC2InstanceLimit
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EC2InstanceLimit"
( \Object
x ->
Maybe Text
-> Maybe EC2InstanceType
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceLimit
EC2InstanceLimit'
(Maybe Text
-> Maybe EC2InstanceType
-> Maybe Natural
-> Maybe Natural
-> EC2InstanceLimit)
-> Parser (Maybe Text)
-> Parser
(Maybe EC2InstanceType
-> Maybe Natural -> Maybe Natural -> EC2InstanceLimit)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Location")
Parser
(Maybe EC2InstanceType
-> Maybe Natural -> Maybe Natural -> EC2InstanceLimit)
-> Parser (Maybe EC2InstanceType)
-> Parser (Maybe Natural -> Maybe Natural -> EC2InstanceLimit)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EC2InstanceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EC2InstanceType")
Parser (Maybe Natural -> Maybe Natural -> EC2InstanceLimit)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> EC2InstanceLimit)
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
"CurrentInstances")
Parser (Maybe Natural -> EC2InstanceLimit)
-> Parser (Maybe Natural) -> Parser EC2InstanceLimit
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
"InstanceLimit")
)
instance Prelude.Hashable EC2InstanceLimit
instance Prelude.NFData EC2InstanceLimit