{-# 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.ServerProcess where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ServerProcess = ServerProcess'
{
ServerProcess -> Maybe Text
parameters :: Prelude.Maybe Prelude.Text,
ServerProcess -> Text
launchPath :: Prelude.Text,
ServerProcess -> Natural
concurrentExecutions :: Prelude.Natural
}
deriving (ServerProcess -> ServerProcess -> Bool
(ServerProcess -> ServerProcess -> Bool)
-> (ServerProcess -> ServerProcess -> Bool) -> Eq ServerProcess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServerProcess -> ServerProcess -> Bool
$c/= :: ServerProcess -> ServerProcess -> Bool
== :: ServerProcess -> ServerProcess -> Bool
$c== :: ServerProcess -> ServerProcess -> Bool
Prelude.Eq, ReadPrec [ServerProcess]
ReadPrec ServerProcess
Int -> ReadS ServerProcess
ReadS [ServerProcess]
(Int -> ReadS ServerProcess)
-> ReadS [ServerProcess]
-> ReadPrec ServerProcess
-> ReadPrec [ServerProcess]
-> Read ServerProcess
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServerProcess]
$creadListPrec :: ReadPrec [ServerProcess]
readPrec :: ReadPrec ServerProcess
$creadPrec :: ReadPrec ServerProcess
readList :: ReadS [ServerProcess]
$creadList :: ReadS [ServerProcess]
readsPrec :: Int -> ReadS ServerProcess
$creadsPrec :: Int -> ReadS ServerProcess
Prelude.Read, Int -> ServerProcess -> ShowS
[ServerProcess] -> ShowS
ServerProcess -> String
(Int -> ServerProcess -> ShowS)
-> (ServerProcess -> String)
-> ([ServerProcess] -> ShowS)
-> Show ServerProcess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServerProcess] -> ShowS
$cshowList :: [ServerProcess] -> ShowS
show :: ServerProcess -> String
$cshow :: ServerProcess -> String
showsPrec :: Int -> ServerProcess -> ShowS
$cshowsPrec :: Int -> ServerProcess -> ShowS
Prelude.Show, (forall x. ServerProcess -> Rep ServerProcess x)
-> (forall x. Rep ServerProcess x -> ServerProcess)
-> Generic ServerProcess
forall x. Rep ServerProcess x -> ServerProcess
forall x. ServerProcess -> Rep ServerProcess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServerProcess x -> ServerProcess
$cfrom :: forall x. ServerProcess -> Rep ServerProcess x
Prelude.Generic)
newServerProcess ::
Prelude.Text ->
Prelude.Natural ->
ServerProcess
newServerProcess :: Text -> Natural -> ServerProcess
newServerProcess Text
pLaunchPath_ Natural
pConcurrentExecutions_ =
ServerProcess' :: Maybe Text -> Text -> Natural -> ServerProcess
ServerProcess'
{ $sel:parameters:ServerProcess' :: Maybe Text
parameters = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:launchPath:ServerProcess' :: Text
launchPath = Text
pLaunchPath_,
$sel:concurrentExecutions:ServerProcess' :: Natural
concurrentExecutions = Natural
pConcurrentExecutions_
}
serverProcess_parameters :: Lens.Lens' ServerProcess (Prelude.Maybe Prelude.Text)
serverProcess_parameters :: (Maybe Text -> f (Maybe Text)) -> ServerProcess -> f ServerProcess
serverProcess_parameters = (ServerProcess -> Maybe Text)
-> (ServerProcess -> Maybe Text -> ServerProcess)
-> Lens ServerProcess ServerProcess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerProcess' {Maybe Text
parameters :: Maybe Text
$sel:parameters:ServerProcess' :: ServerProcess -> Maybe Text
parameters} -> Maybe Text
parameters) (\s :: ServerProcess
s@ServerProcess' {} Maybe Text
a -> ServerProcess
s {$sel:parameters:ServerProcess' :: Maybe Text
parameters = Maybe Text
a} :: ServerProcess)
serverProcess_launchPath :: Lens.Lens' ServerProcess Prelude.Text
serverProcess_launchPath :: (Text -> f Text) -> ServerProcess -> f ServerProcess
serverProcess_launchPath = (ServerProcess -> Text)
-> (ServerProcess -> Text -> ServerProcess)
-> Lens ServerProcess ServerProcess Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerProcess' {Text
launchPath :: Text
$sel:launchPath:ServerProcess' :: ServerProcess -> Text
launchPath} -> Text
launchPath) (\s :: ServerProcess
s@ServerProcess' {} Text
a -> ServerProcess
s {$sel:launchPath:ServerProcess' :: Text
launchPath = Text
a} :: ServerProcess)
serverProcess_concurrentExecutions :: Lens.Lens' ServerProcess Prelude.Natural
serverProcess_concurrentExecutions :: (Natural -> f Natural) -> ServerProcess -> f ServerProcess
serverProcess_concurrentExecutions = (ServerProcess -> Natural)
-> (ServerProcess -> Natural -> ServerProcess)
-> Lens ServerProcess ServerProcess Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerProcess' {Natural
concurrentExecutions :: Natural
$sel:concurrentExecutions:ServerProcess' :: ServerProcess -> Natural
concurrentExecutions} -> Natural
concurrentExecutions) (\s :: ServerProcess
s@ServerProcess' {} Natural
a -> ServerProcess
s {$sel:concurrentExecutions:ServerProcess' :: Natural
concurrentExecutions = Natural
a} :: ServerProcess)
instance Core.FromJSON ServerProcess where
parseJSON :: Value -> Parser ServerProcess
parseJSON =
String
-> (Object -> Parser ServerProcess)
-> Value
-> Parser ServerProcess
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ServerProcess"
( \Object
x ->
Maybe Text -> Text -> Natural -> ServerProcess
ServerProcess'
(Maybe Text -> Text -> Natural -> ServerProcess)
-> Parser (Maybe Text) -> Parser (Text -> Natural -> ServerProcess)
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
"Parameters")
Parser (Text -> Natural -> ServerProcess)
-> Parser Text -> Parser (Natural -> ServerProcess)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"LaunchPath")
Parser (Natural -> ServerProcess)
-> Parser Natural -> Parser ServerProcess
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ConcurrentExecutions")
)
instance Prelude.Hashable ServerProcess
instance Prelude.NFData ServerProcess
instance Core.ToJSON ServerProcess where
toJSON :: ServerProcess -> Value
toJSON ServerProcess' {Natural
Maybe Text
Text
concurrentExecutions :: Natural
launchPath :: Text
parameters :: Maybe Text
$sel:concurrentExecutions:ServerProcess' :: ServerProcess -> Natural
$sel:launchPath:ServerProcess' :: ServerProcess -> Text
$sel:parameters:ServerProcess' :: ServerProcess -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Parameters" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameters,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LaunchPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
launchPath),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ConcurrentExecutions"
Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
concurrentExecutions
)
]
)