{-# 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.PlayerLatencyPolicy 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 PlayerLatencyPolicy = PlayerLatencyPolicy'
{
PlayerLatencyPolicy -> Maybe Natural
maximumIndividualPlayerLatencyMilliseconds :: Prelude.Maybe Prelude.Natural,
PlayerLatencyPolicy -> Maybe Natural
policyDurationSeconds :: Prelude.Maybe Prelude.Natural
}
deriving (PlayerLatencyPolicy -> PlayerLatencyPolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlayerLatencyPolicy -> PlayerLatencyPolicy -> Bool
$c/= :: PlayerLatencyPolicy -> PlayerLatencyPolicy -> Bool
== :: PlayerLatencyPolicy -> PlayerLatencyPolicy -> Bool
$c== :: PlayerLatencyPolicy -> PlayerLatencyPolicy -> Bool
Prelude.Eq, ReadPrec [PlayerLatencyPolicy]
ReadPrec PlayerLatencyPolicy
Int -> ReadS PlayerLatencyPolicy
ReadS [PlayerLatencyPolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlayerLatencyPolicy]
$creadListPrec :: ReadPrec [PlayerLatencyPolicy]
readPrec :: ReadPrec PlayerLatencyPolicy
$creadPrec :: ReadPrec PlayerLatencyPolicy
readList :: ReadS [PlayerLatencyPolicy]
$creadList :: ReadS [PlayerLatencyPolicy]
readsPrec :: Int -> ReadS PlayerLatencyPolicy
$creadsPrec :: Int -> ReadS PlayerLatencyPolicy
Prelude.Read, Int -> PlayerLatencyPolicy -> ShowS
[PlayerLatencyPolicy] -> ShowS
PlayerLatencyPolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlayerLatencyPolicy] -> ShowS
$cshowList :: [PlayerLatencyPolicy] -> ShowS
show :: PlayerLatencyPolicy -> String
$cshow :: PlayerLatencyPolicy -> String
showsPrec :: Int -> PlayerLatencyPolicy -> ShowS
$cshowsPrec :: Int -> PlayerLatencyPolicy -> ShowS
Prelude.Show, forall x. Rep PlayerLatencyPolicy x -> PlayerLatencyPolicy
forall x. PlayerLatencyPolicy -> Rep PlayerLatencyPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlayerLatencyPolicy x -> PlayerLatencyPolicy
$cfrom :: forall x. PlayerLatencyPolicy -> Rep PlayerLatencyPolicy x
Prelude.Generic)
newPlayerLatencyPolicy ::
PlayerLatencyPolicy
newPlayerLatencyPolicy :: PlayerLatencyPolicy
newPlayerLatencyPolicy =
PlayerLatencyPolicy'
{ $sel:maximumIndividualPlayerLatencyMilliseconds:PlayerLatencyPolicy' :: Maybe Natural
maximumIndividualPlayerLatencyMilliseconds =
forall a. Maybe a
Prelude.Nothing,
$sel:policyDurationSeconds:PlayerLatencyPolicy' :: Maybe Natural
policyDurationSeconds = forall a. Maybe a
Prelude.Nothing
}
playerLatencyPolicy_maximumIndividualPlayerLatencyMilliseconds :: Lens.Lens' PlayerLatencyPolicy (Prelude.Maybe Prelude.Natural)
playerLatencyPolicy_maximumIndividualPlayerLatencyMilliseconds :: Lens' PlayerLatencyPolicy (Maybe Natural)
playerLatencyPolicy_maximumIndividualPlayerLatencyMilliseconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlayerLatencyPolicy' {Maybe Natural
maximumIndividualPlayerLatencyMilliseconds :: Maybe Natural
$sel:maximumIndividualPlayerLatencyMilliseconds:PlayerLatencyPolicy' :: PlayerLatencyPolicy -> Maybe Natural
maximumIndividualPlayerLatencyMilliseconds} -> Maybe Natural
maximumIndividualPlayerLatencyMilliseconds) (\s :: PlayerLatencyPolicy
s@PlayerLatencyPolicy' {} Maybe Natural
a -> PlayerLatencyPolicy
s {$sel:maximumIndividualPlayerLatencyMilliseconds:PlayerLatencyPolicy' :: Maybe Natural
maximumIndividualPlayerLatencyMilliseconds = Maybe Natural
a} :: PlayerLatencyPolicy)
playerLatencyPolicy_policyDurationSeconds :: Lens.Lens' PlayerLatencyPolicy (Prelude.Maybe Prelude.Natural)
playerLatencyPolicy_policyDurationSeconds :: Lens' PlayerLatencyPolicy (Maybe Natural)
playerLatencyPolicy_policyDurationSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlayerLatencyPolicy' {Maybe Natural
policyDurationSeconds :: Maybe Natural
$sel:policyDurationSeconds:PlayerLatencyPolicy' :: PlayerLatencyPolicy -> Maybe Natural
policyDurationSeconds} -> Maybe Natural
policyDurationSeconds) (\s :: PlayerLatencyPolicy
s@PlayerLatencyPolicy' {} Maybe Natural
a -> PlayerLatencyPolicy
s {$sel:policyDurationSeconds:PlayerLatencyPolicy' :: Maybe Natural
policyDurationSeconds = Maybe Natural
a} :: PlayerLatencyPolicy)
instance Data.FromJSON PlayerLatencyPolicy where
parseJSON :: Value -> Parser PlayerLatencyPolicy
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PlayerLatencyPolicy"
( \Object
x ->
Maybe Natural -> Maybe Natural -> PlayerLatencyPolicy
PlayerLatencyPolicy'
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
"MaximumIndividualPlayerLatencyMilliseconds"
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PolicyDurationSeconds")
)
instance Prelude.Hashable PlayerLatencyPolicy where
hashWithSalt :: Int -> PlayerLatencyPolicy -> Int
hashWithSalt Int
_salt PlayerLatencyPolicy' {Maybe Natural
policyDurationSeconds :: Maybe Natural
maximumIndividualPlayerLatencyMilliseconds :: Maybe Natural
$sel:policyDurationSeconds:PlayerLatencyPolicy' :: PlayerLatencyPolicy -> Maybe Natural
$sel:maximumIndividualPlayerLatencyMilliseconds:PlayerLatencyPolicy' :: PlayerLatencyPolicy -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maximumIndividualPlayerLatencyMilliseconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
policyDurationSeconds
instance Prelude.NFData PlayerLatencyPolicy where
rnf :: PlayerLatencyPolicy -> ()
rnf PlayerLatencyPolicy' {Maybe Natural
policyDurationSeconds :: Maybe Natural
maximumIndividualPlayerLatencyMilliseconds :: Maybe Natural
$sel:policyDurationSeconds:PlayerLatencyPolicy' :: PlayerLatencyPolicy -> Maybe Natural
$sel:maximumIndividualPlayerLatencyMilliseconds:PlayerLatencyPolicy' :: PlayerLatencyPolicy -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf
Maybe Natural
maximumIndividualPlayerLatencyMilliseconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
policyDurationSeconds
instance Data.ToJSON PlayerLatencyPolicy where
toJSON :: PlayerLatencyPolicy -> Value
toJSON PlayerLatencyPolicy' {Maybe Natural
policyDurationSeconds :: Maybe Natural
maximumIndividualPlayerLatencyMilliseconds :: Maybe Natural
$sel:policyDurationSeconds:PlayerLatencyPolicy' :: PlayerLatencyPolicy -> Maybe Natural
$sel:maximumIndividualPlayerLatencyMilliseconds:PlayerLatencyPolicy' :: PlayerLatencyPolicy -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ ( Key
"MaximumIndividualPlayerLatencyMilliseconds"
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 Natural
maximumIndividualPlayerLatencyMilliseconds,
(Key
"PolicyDurationSeconds" 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 Natural
policyDurationSeconds
]
)