{-# 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.RuntimeConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.ServerProcess
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RuntimeConfiguration = RuntimeConfiguration'
{
RuntimeConfiguration -> Maybe Natural
gameSessionActivationTimeoutSeconds :: Prelude.Maybe Prelude.Natural,
RuntimeConfiguration -> Maybe (NonEmpty ServerProcess)
serverProcesses :: Prelude.Maybe (Prelude.NonEmpty ServerProcess),
RuntimeConfiguration -> Maybe Natural
maxConcurrentGameSessionActivations :: Prelude.Maybe Prelude.Natural
}
deriving (RuntimeConfiguration -> RuntimeConfiguration -> Bool
(RuntimeConfiguration -> RuntimeConfiguration -> Bool)
-> (RuntimeConfiguration -> RuntimeConfiguration -> Bool)
-> Eq RuntimeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuntimeConfiguration -> RuntimeConfiguration -> Bool
$c/= :: RuntimeConfiguration -> RuntimeConfiguration -> Bool
== :: RuntimeConfiguration -> RuntimeConfiguration -> Bool
$c== :: RuntimeConfiguration -> RuntimeConfiguration -> Bool
Prelude.Eq, ReadPrec [RuntimeConfiguration]
ReadPrec RuntimeConfiguration
Int -> ReadS RuntimeConfiguration
ReadS [RuntimeConfiguration]
(Int -> ReadS RuntimeConfiguration)
-> ReadS [RuntimeConfiguration]
-> ReadPrec RuntimeConfiguration
-> ReadPrec [RuntimeConfiguration]
-> Read RuntimeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuntimeConfiguration]
$creadListPrec :: ReadPrec [RuntimeConfiguration]
readPrec :: ReadPrec RuntimeConfiguration
$creadPrec :: ReadPrec RuntimeConfiguration
readList :: ReadS [RuntimeConfiguration]
$creadList :: ReadS [RuntimeConfiguration]
readsPrec :: Int -> ReadS RuntimeConfiguration
$creadsPrec :: Int -> ReadS RuntimeConfiguration
Prelude.Read, Int -> RuntimeConfiguration -> ShowS
[RuntimeConfiguration] -> ShowS
RuntimeConfiguration -> String
(Int -> RuntimeConfiguration -> ShowS)
-> (RuntimeConfiguration -> String)
-> ([RuntimeConfiguration] -> ShowS)
-> Show RuntimeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuntimeConfiguration] -> ShowS
$cshowList :: [RuntimeConfiguration] -> ShowS
show :: RuntimeConfiguration -> String
$cshow :: RuntimeConfiguration -> String
showsPrec :: Int -> RuntimeConfiguration -> ShowS
$cshowsPrec :: Int -> RuntimeConfiguration -> ShowS
Prelude.Show, (forall x. RuntimeConfiguration -> Rep RuntimeConfiguration x)
-> (forall x. Rep RuntimeConfiguration x -> RuntimeConfiguration)
-> Generic RuntimeConfiguration
forall x. Rep RuntimeConfiguration x -> RuntimeConfiguration
forall x. RuntimeConfiguration -> Rep RuntimeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuntimeConfiguration x -> RuntimeConfiguration
$cfrom :: forall x. RuntimeConfiguration -> Rep RuntimeConfiguration x
Prelude.Generic)
newRuntimeConfiguration ::
RuntimeConfiguration
newRuntimeConfiguration :: RuntimeConfiguration
newRuntimeConfiguration =
RuntimeConfiguration' :: Maybe Natural
-> Maybe (NonEmpty ServerProcess)
-> Maybe Natural
-> RuntimeConfiguration
RuntimeConfiguration'
{ $sel:gameSessionActivationTimeoutSeconds:RuntimeConfiguration' :: Maybe Natural
gameSessionActivationTimeoutSeconds =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:serverProcesses:RuntimeConfiguration' :: Maybe (NonEmpty ServerProcess)
serverProcesses = Maybe (NonEmpty ServerProcess)
forall a. Maybe a
Prelude.Nothing,
$sel:maxConcurrentGameSessionActivations:RuntimeConfiguration' :: Maybe Natural
maxConcurrentGameSessionActivations =
Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
runtimeConfiguration_gameSessionActivationTimeoutSeconds :: Lens.Lens' RuntimeConfiguration (Prelude.Maybe Prelude.Natural)
runtimeConfiguration_gameSessionActivationTimeoutSeconds :: (Maybe Natural -> f (Maybe Natural))
-> RuntimeConfiguration -> f RuntimeConfiguration
runtimeConfiguration_gameSessionActivationTimeoutSeconds = (RuntimeConfiguration -> Maybe Natural)
-> (RuntimeConfiguration -> Maybe Natural -> RuntimeConfiguration)
-> Lens
RuntimeConfiguration
RuntimeConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuntimeConfiguration' {Maybe Natural
gameSessionActivationTimeoutSeconds :: Maybe Natural
$sel:gameSessionActivationTimeoutSeconds:RuntimeConfiguration' :: RuntimeConfiguration -> Maybe Natural
gameSessionActivationTimeoutSeconds} -> Maybe Natural
gameSessionActivationTimeoutSeconds) (\s :: RuntimeConfiguration
s@RuntimeConfiguration' {} Maybe Natural
a -> RuntimeConfiguration
s {$sel:gameSessionActivationTimeoutSeconds:RuntimeConfiguration' :: Maybe Natural
gameSessionActivationTimeoutSeconds = Maybe Natural
a} :: RuntimeConfiguration)
runtimeConfiguration_serverProcesses :: Lens.Lens' RuntimeConfiguration (Prelude.Maybe (Prelude.NonEmpty ServerProcess))
runtimeConfiguration_serverProcesses :: (Maybe (NonEmpty ServerProcess)
-> f (Maybe (NonEmpty ServerProcess)))
-> RuntimeConfiguration -> f RuntimeConfiguration
runtimeConfiguration_serverProcesses = (RuntimeConfiguration -> Maybe (NonEmpty ServerProcess))
-> (RuntimeConfiguration
-> Maybe (NonEmpty ServerProcess) -> RuntimeConfiguration)
-> Lens
RuntimeConfiguration
RuntimeConfiguration
(Maybe (NonEmpty ServerProcess))
(Maybe (NonEmpty ServerProcess))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuntimeConfiguration' {Maybe (NonEmpty ServerProcess)
serverProcesses :: Maybe (NonEmpty ServerProcess)
$sel:serverProcesses:RuntimeConfiguration' :: RuntimeConfiguration -> Maybe (NonEmpty ServerProcess)
serverProcesses} -> Maybe (NonEmpty ServerProcess)
serverProcesses) (\s :: RuntimeConfiguration
s@RuntimeConfiguration' {} Maybe (NonEmpty ServerProcess)
a -> RuntimeConfiguration
s {$sel:serverProcesses:RuntimeConfiguration' :: Maybe (NonEmpty ServerProcess)
serverProcesses = Maybe (NonEmpty ServerProcess)
a} :: RuntimeConfiguration) ((Maybe (NonEmpty ServerProcess)
-> f (Maybe (NonEmpty ServerProcess)))
-> RuntimeConfiguration -> f RuntimeConfiguration)
-> ((Maybe (NonEmpty ServerProcess)
-> f (Maybe (NonEmpty ServerProcess)))
-> Maybe (NonEmpty ServerProcess)
-> f (Maybe (NonEmpty ServerProcess)))
-> (Maybe (NonEmpty ServerProcess)
-> f (Maybe (NonEmpty ServerProcess)))
-> RuntimeConfiguration
-> f RuntimeConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty ServerProcess)
(NonEmpty ServerProcess)
(NonEmpty ServerProcess)
(NonEmpty ServerProcess)
-> Iso
(Maybe (NonEmpty ServerProcess))
(Maybe (NonEmpty ServerProcess))
(Maybe (NonEmpty ServerProcess))
(Maybe (NonEmpty ServerProcess))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty ServerProcess)
(NonEmpty ServerProcess)
(NonEmpty ServerProcess)
(NonEmpty ServerProcess)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
runtimeConfiguration_maxConcurrentGameSessionActivations :: Lens.Lens' RuntimeConfiguration (Prelude.Maybe Prelude.Natural)
runtimeConfiguration_maxConcurrentGameSessionActivations :: (Maybe Natural -> f (Maybe Natural))
-> RuntimeConfiguration -> f RuntimeConfiguration
runtimeConfiguration_maxConcurrentGameSessionActivations = (RuntimeConfiguration -> Maybe Natural)
-> (RuntimeConfiguration -> Maybe Natural -> RuntimeConfiguration)
-> Lens
RuntimeConfiguration
RuntimeConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuntimeConfiguration' {Maybe Natural
maxConcurrentGameSessionActivations :: Maybe Natural
$sel:maxConcurrentGameSessionActivations:RuntimeConfiguration' :: RuntimeConfiguration -> Maybe Natural
maxConcurrentGameSessionActivations} -> Maybe Natural
maxConcurrentGameSessionActivations) (\s :: RuntimeConfiguration
s@RuntimeConfiguration' {} Maybe Natural
a -> RuntimeConfiguration
s {$sel:maxConcurrentGameSessionActivations:RuntimeConfiguration' :: Maybe Natural
maxConcurrentGameSessionActivations = Maybe Natural
a} :: RuntimeConfiguration)
instance Core.FromJSON RuntimeConfiguration where
parseJSON :: Value -> Parser RuntimeConfiguration
parseJSON =
String
-> (Object -> Parser RuntimeConfiguration)
-> Value
-> Parser RuntimeConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RuntimeConfiguration"
( \Object
x ->
Maybe Natural
-> Maybe (NonEmpty ServerProcess)
-> Maybe Natural
-> RuntimeConfiguration
RuntimeConfiguration'
(Maybe Natural
-> Maybe (NonEmpty ServerProcess)
-> Maybe Natural
-> RuntimeConfiguration)
-> Parser (Maybe Natural)
-> Parser
(Maybe (NonEmpty ServerProcess)
-> Maybe Natural -> RuntimeConfiguration)
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
"GameSessionActivationTimeoutSeconds")
Parser
(Maybe (NonEmpty ServerProcess)
-> Maybe Natural -> RuntimeConfiguration)
-> Parser (Maybe (NonEmpty ServerProcess))
-> Parser (Maybe Natural -> RuntimeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty ServerProcess))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServerProcesses")
Parser (Maybe Natural -> RuntimeConfiguration)
-> Parser (Maybe Natural) -> Parser RuntimeConfiguration
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
"MaxConcurrentGameSessionActivations")
)
instance Prelude.Hashable RuntimeConfiguration
instance Prelude.NFData RuntimeConfiguration
instance Core.ToJSON RuntimeConfiguration where
toJSON :: RuntimeConfiguration -> Value
toJSON RuntimeConfiguration' {Maybe Natural
Maybe (NonEmpty ServerProcess)
maxConcurrentGameSessionActivations :: Maybe Natural
serverProcesses :: Maybe (NonEmpty ServerProcess)
gameSessionActivationTimeoutSeconds :: Maybe Natural
$sel:maxConcurrentGameSessionActivations:RuntimeConfiguration' :: RuntimeConfiguration -> Maybe Natural
$sel:serverProcesses:RuntimeConfiguration' :: RuntimeConfiguration -> Maybe (NonEmpty ServerProcess)
$sel:gameSessionActivationTimeoutSeconds:RuntimeConfiguration' :: RuntimeConfiguration -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"GameSessionActivationTimeoutSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
gameSessionActivationTimeoutSeconds,
(Text
"ServerProcesses" Text -> NonEmpty ServerProcess -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty ServerProcess -> Pair)
-> Maybe (NonEmpty ServerProcess) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ServerProcess)
serverProcesses,
(Text
"MaxConcurrentGameSessionActivations" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxConcurrentGameSessionActivations
]
)