{-# 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.FleetCapacity where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.EC2InstanceCounts
import Amazonka.GameLift.Types.EC2InstanceType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FleetCapacity = FleetCapacity'
{
FleetCapacity -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
FleetCapacity -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
FleetCapacity -> Maybe EC2InstanceType
instanceType :: Prelude.Maybe EC2InstanceType,
FleetCapacity -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
FleetCapacity -> Maybe EC2InstanceCounts
instanceCounts :: Prelude.Maybe EC2InstanceCounts
}
deriving (FleetCapacity -> FleetCapacity -> Bool
(FleetCapacity -> FleetCapacity -> Bool)
-> (FleetCapacity -> FleetCapacity -> Bool) -> Eq FleetCapacity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FleetCapacity -> FleetCapacity -> Bool
$c/= :: FleetCapacity -> FleetCapacity -> Bool
== :: FleetCapacity -> FleetCapacity -> Bool
$c== :: FleetCapacity -> FleetCapacity -> Bool
Prelude.Eq, ReadPrec [FleetCapacity]
ReadPrec FleetCapacity
Int -> ReadS FleetCapacity
ReadS [FleetCapacity]
(Int -> ReadS FleetCapacity)
-> ReadS [FleetCapacity]
-> ReadPrec FleetCapacity
-> ReadPrec [FleetCapacity]
-> Read FleetCapacity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FleetCapacity]
$creadListPrec :: ReadPrec [FleetCapacity]
readPrec :: ReadPrec FleetCapacity
$creadPrec :: ReadPrec FleetCapacity
readList :: ReadS [FleetCapacity]
$creadList :: ReadS [FleetCapacity]
readsPrec :: Int -> ReadS FleetCapacity
$creadsPrec :: Int -> ReadS FleetCapacity
Prelude.Read, Int -> FleetCapacity -> ShowS
[FleetCapacity] -> ShowS
FleetCapacity -> String
(Int -> FleetCapacity -> ShowS)
-> (FleetCapacity -> String)
-> ([FleetCapacity] -> ShowS)
-> Show FleetCapacity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FleetCapacity] -> ShowS
$cshowList :: [FleetCapacity] -> ShowS
show :: FleetCapacity -> String
$cshow :: FleetCapacity -> String
showsPrec :: Int -> FleetCapacity -> ShowS
$cshowsPrec :: Int -> FleetCapacity -> ShowS
Prelude.Show, (forall x. FleetCapacity -> Rep FleetCapacity x)
-> (forall x. Rep FleetCapacity x -> FleetCapacity)
-> Generic FleetCapacity
forall x. Rep FleetCapacity x -> FleetCapacity
forall x. FleetCapacity -> Rep FleetCapacity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FleetCapacity x -> FleetCapacity
$cfrom :: forall x. FleetCapacity -> Rep FleetCapacity x
Prelude.Generic)
newFleetCapacity ::
FleetCapacity
newFleetCapacity :: FleetCapacity
newFleetCapacity =
FleetCapacity' :: Maybe Text
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe EC2InstanceCounts
-> FleetCapacity
FleetCapacity'
{ $sel:location:FleetCapacity' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fleetArn:FleetCapacity' :: Maybe Text
fleetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:FleetCapacity' :: Maybe EC2InstanceType
instanceType = Maybe EC2InstanceType
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:FleetCapacity' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceCounts:FleetCapacity' :: Maybe EC2InstanceCounts
instanceCounts = Maybe EC2InstanceCounts
forall a. Maybe a
Prelude.Nothing
}
fleetCapacity_location :: Lens.Lens' FleetCapacity (Prelude.Maybe Prelude.Text)
fleetCapacity_location :: (Maybe Text -> f (Maybe Text)) -> FleetCapacity -> f FleetCapacity
fleetCapacity_location = (FleetCapacity -> Maybe Text)
-> (FleetCapacity -> Maybe Text -> FleetCapacity)
-> Lens FleetCapacity FleetCapacity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FleetCapacity' {Maybe Text
location :: Maybe Text
$sel:location:FleetCapacity' :: FleetCapacity -> Maybe Text
location} -> Maybe Text
location) (\s :: FleetCapacity
s@FleetCapacity' {} Maybe Text
a -> FleetCapacity
s {$sel:location:FleetCapacity' :: Maybe Text
location = Maybe Text
a} :: FleetCapacity)
fleetCapacity_fleetArn :: Lens.Lens' FleetCapacity (Prelude.Maybe Prelude.Text)
fleetCapacity_fleetArn :: (Maybe Text -> f (Maybe Text)) -> FleetCapacity -> f FleetCapacity
fleetCapacity_fleetArn = (FleetCapacity -> Maybe Text)
-> (FleetCapacity -> Maybe Text -> FleetCapacity)
-> Lens FleetCapacity FleetCapacity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FleetCapacity' {Maybe Text
fleetArn :: Maybe Text
$sel:fleetArn:FleetCapacity' :: FleetCapacity -> Maybe Text
fleetArn} -> Maybe Text
fleetArn) (\s :: FleetCapacity
s@FleetCapacity' {} Maybe Text
a -> FleetCapacity
s {$sel:fleetArn:FleetCapacity' :: Maybe Text
fleetArn = Maybe Text
a} :: FleetCapacity)
fleetCapacity_instanceType :: Lens.Lens' FleetCapacity (Prelude.Maybe EC2InstanceType)
fleetCapacity_instanceType :: (Maybe EC2InstanceType -> f (Maybe EC2InstanceType))
-> FleetCapacity -> f FleetCapacity
fleetCapacity_instanceType = (FleetCapacity -> Maybe EC2InstanceType)
-> (FleetCapacity -> Maybe EC2InstanceType -> FleetCapacity)
-> Lens
FleetCapacity
FleetCapacity
(Maybe EC2InstanceType)
(Maybe EC2InstanceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FleetCapacity' {Maybe EC2InstanceType
instanceType :: Maybe EC2InstanceType
$sel:instanceType:FleetCapacity' :: FleetCapacity -> Maybe EC2InstanceType
instanceType} -> Maybe EC2InstanceType
instanceType) (\s :: FleetCapacity
s@FleetCapacity' {} Maybe EC2InstanceType
a -> FleetCapacity
s {$sel:instanceType:FleetCapacity' :: Maybe EC2InstanceType
instanceType = Maybe EC2InstanceType
a} :: FleetCapacity)
fleetCapacity_fleetId :: Lens.Lens' FleetCapacity (Prelude.Maybe Prelude.Text)
fleetCapacity_fleetId :: (Maybe Text -> f (Maybe Text)) -> FleetCapacity -> f FleetCapacity
fleetCapacity_fleetId = (FleetCapacity -> Maybe Text)
-> (FleetCapacity -> Maybe Text -> FleetCapacity)
-> Lens FleetCapacity FleetCapacity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FleetCapacity' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:FleetCapacity' :: FleetCapacity -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: FleetCapacity
s@FleetCapacity' {} Maybe Text
a -> FleetCapacity
s {$sel:fleetId:FleetCapacity' :: Maybe Text
fleetId = Maybe Text
a} :: FleetCapacity)
fleetCapacity_instanceCounts :: Lens.Lens' FleetCapacity (Prelude.Maybe EC2InstanceCounts)
fleetCapacity_instanceCounts :: (Maybe EC2InstanceCounts -> f (Maybe EC2InstanceCounts))
-> FleetCapacity -> f FleetCapacity
fleetCapacity_instanceCounts = (FleetCapacity -> Maybe EC2InstanceCounts)
-> (FleetCapacity -> Maybe EC2InstanceCounts -> FleetCapacity)
-> Lens
FleetCapacity
FleetCapacity
(Maybe EC2InstanceCounts)
(Maybe EC2InstanceCounts)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FleetCapacity' {Maybe EC2InstanceCounts
instanceCounts :: Maybe EC2InstanceCounts
$sel:instanceCounts:FleetCapacity' :: FleetCapacity -> Maybe EC2InstanceCounts
instanceCounts} -> Maybe EC2InstanceCounts
instanceCounts) (\s :: FleetCapacity
s@FleetCapacity' {} Maybe EC2InstanceCounts
a -> FleetCapacity
s {$sel:instanceCounts:FleetCapacity' :: Maybe EC2InstanceCounts
instanceCounts = Maybe EC2InstanceCounts
a} :: FleetCapacity)
instance Core.FromJSON FleetCapacity where
parseJSON :: Value -> Parser FleetCapacity
parseJSON =
String
-> (Object -> Parser FleetCapacity)
-> Value
-> Parser FleetCapacity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FleetCapacity"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe EC2InstanceCounts
-> FleetCapacity
FleetCapacity'
(Maybe Text
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe EC2InstanceCounts
-> FleetCapacity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe EC2InstanceCounts
-> FleetCapacity)
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 Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe EC2InstanceCounts
-> FleetCapacity)
-> Parser (Maybe Text)
-> Parser
(Maybe EC2InstanceType
-> Maybe Text -> Maybe EC2InstanceCounts -> FleetCapacity)
forall (f :: * -> *) a b. Applicative f => 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
"FleetArn")
Parser
(Maybe EC2InstanceType
-> Maybe Text -> Maybe EC2InstanceCounts -> FleetCapacity)
-> Parser (Maybe EC2InstanceType)
-> Parser (Maybe Text -> Maybe EC2InstanceCounts -> FleetCapacity)
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
"InstanceType")
Parser (Maybe Text -> Maybe EC2InstanceCounts -> FleetCapacity)
-> Parser (Maybe Text)
-> Parser (Maybe EC2InstanceCounts -> FleetCapacity)
forall (f :: * -> *) a b. Applicative f => 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
"FleetId")
Parser (Maybe EC2InstanceCounts -> FleetCapacity)
-> Parser (Maybe EC2InstanceCounts) -> Parser FleetCapacity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EC2InstanceCounts)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceCounts")
)
instance Prelude.Hashable FleetCapacity
instance Prelude.NFData FleetCapacity