{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:parameters:ServerProcess' :: Maybe Text
parameters = 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 :: Lens' ServerProcess (Maybe Text)
serverProcess_parameters = 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 :: Lens' ServerProcess Text
serverProcess_launchPath = 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 :: Lens' ServerProcess Natural
serverProcess_concurrentExecutions = 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 Data.FromJSON ServerProcess where
parseJSON :: Value -> Parser ServerProcess
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ServerProcess"
( \Object
x ->
Maybe Text -> Text -> Natural -> ServerProcess
ServerProcess'
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
"Parameters")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LaunchPath")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ConcurrentExecutions")
)
instance Prelude.Hashable ServerProcess where
hashWithSalt :: Int -> ServerProcess -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
launchPath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
concurrentExecutions
instance Prelude.NFData ServerProcess where
rnf :: ServerProcess -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
launchPath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
concurrentExecutions
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Parameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameters,
forall a. a -> Maybe a
Prelude.Just (Key
"LaunchPath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
launchPath),
forall a. a -> Maybe a
Prelude.Just
( Key
"ConcurrentExecutions"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
concurrentExecutions
)
]
)