{-# 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.MatchmakingRuleSet 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 MatchmakingRuleSet = MatchmakingRuleSet'
{
MatchmakingRuleSet -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
MatchmakingRuleSet -> Maybe Text
ruleSetArn :: Prelude.Maybe Prelude.Text,
MatchmakingRuleSet -> Maybe Text
ruleSetName :: Prelude.Maybe Prelude.Text,
MatchmakingRuleSet -> Text
ruleSetBody :: Prelude.Text
}
deriving (MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
$c/= :: MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
== :: MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
$c== :: MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
Prelude.Eq, ReadPrec [MatchmakingRuleSet]
ReadPrec MatchmakingRuleSet
Int -> ReadS MatchmakingRuleSet
ReadS [MatchmakingRuleSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MatchmakingRuleSet]
$creadListPrec :: ReadPrec [MatchmakingRuleSet]
readPrec :: ReadPrec MatchmakingRuleSet
$creadPrec :: ReadPrec MatchmakingRuleSet
readList :: ReadS [MatchmakingRuleSet]
$creadList :: ReadS [MatchmakingRuleSet]
readsPrec :: Int -> ReadS MatchmakingRuleSet
$creadsPrec :: Int -> ReadS MatchmakingRuleSet
Prelude.Read, Int -> MatchmakingRuleSet -> ShowS
[MatchmakingRuleSet] -> ShowS
MatchmakingRuleSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MatchmakingRuleSet] -> ShowS
$cshowList :: [MatchmakingRuleSet] -> ShowS
show :: MatchmakingRuleSet -> String
$cshow :: MatchmakingRuleSet -> String
showsPrec :: Int -> MatchmakingRuleSet -> ShowS
$cshowsPrec :: Int -> MatchmakingRuleSet -> ShowS
Prelude.Show, forall x. Rep MatchmakingRuleSet x -> MatchmakingRuleSet
forall x. MatchmakingRuleSet -> Rep MatchmakingRuleSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MatchmakingRuleSet x -> MatchmakingRuleSet
$cfrom :: forall x. MatchmakingRuleSet -> Rep MatchmakingRuleSet x
Prelude.Generic)
newMatchmakingRuleSet ::
Prelude.Text ->
MatchmakingRuleSet
newMatchmakingRuleSet :: Text -> MatchmakingRuleSet
newMatchmakingRuleSet Text
pRuleSetBody_ =
MatchmakingRuleSet'
{ $sel:creationTime:MatchmakingRuleSet' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:ruleSetArn:MatchmakingRuleSet' :: Maybe Text
ruleSetArn = forall a. Maybe a
Prelude.Nothing,
$sel:ruleSetName:MatchmakingRuleSet' :: Maybe Text
ruleSetName = forall a. Maybe a
Prelude.Nothing,
$sel:ruleSetBody:MatchmakingRuleSet' :: Text
ruleSetBody = Text
pRuleSetBody_
}
matchmakingRuleSet_creationTime :: Lens.Lens' MatchmakingRuleSet (Prelude.Maybe Prelude.UTCTime)
matchmakingRuleSet_creationTime :: Lens' MatchmakingRuleSet (Maybe UTCTime)
matchmakingRuleSet_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingRuleSet' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:MatchmakingRuleSet' :: MatchmakingRuleSet -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: MatchmakingRuleSet
s@MatchmakingRuleSet' {} Maybe POSIX
a -> MatchmakingRuleSet
s {$sel:creationTime:MatchmakingRuleSet' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: MatchmakingRuleSet) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
matchmakingRuleSet_ruleSetArn :: Lens.Lens' MatchmakingRuleSet (Prelude.Maybe Prelude.Text)
matchmakingRuleSet_ruleSetArn :: Lens' MatchmakingRuleSet (Maybe Text)
matchmakingRuleSet_ruleSetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingRuleSet' {Maybe Text
ruleSetArn :: Maybe Text
$sel:ruleSetArn:MatchmakingRuleSet' :: MatchmakingRuleSet -> Maybe Text
ruleSetArn} -> Maybe Text
ruleSetArn) (\s :: MatchmakingRuleSet
s@MatchmakingRuleSet' {} Maybe Text
a -> MatchmakingRuleSet
s {$sel:ruleSetArn:MatchmakingRuleSet' :: Maybe Text
ruleSetArn = Maybe Text
a} :: MatchmakingRuleSet)
matchmakingRuleSet_ruleSetName :: Lens.Lens' MatchmakingRuleSet (Prelude.Maybe Prelude.Text)
matchmakingRuleSet_ruleSetName :: Lens' MatchmakingRuleSet (Maybe Text)
matchmakingRuleSet_ruleSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingRuleSet' {Maybe Text
ruleSetName :: Maybe Text
$sel:ruleSetName:MatchmakingRuleSet' :: MatchmakingRuleSet -> Maybe Text
ruleSetName} -> Maybe Text
ruleSetName) (\s :: MatchmakingRuleSet
s@MatchmakingRuleSet' {} Maybe Text
a -> MatchmakingRuleSet
s {$sel:ruleSetName:MatchmakingRuleSet' :: Maybe Text
ruleSetName = Maybe Text
a} :: MatchmakingRuleSet)
matchmakingRuleSet_ruleSetBody :: Lens.Lens' MatchmakingRuleSet Prelude.Text
matchmakingRuleSet_ruleSetBody :: Lens' MatchmakingRuleSet Text
matchmakingRuleSet_ruleSetBody = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingRuleSet' {Text
ruleSetBody :: Text
$sel:ruleSetBody:MatchmakingRuleSet' :: MatchmakingRuleSet -> Text
ruleSetBody} -> Text
ruleSetBody) (\s :: MatchmakingRuleSet
s@MatchmakingRuleSet' {} Text
a -> MatchmakingRuleSet
s {$sel:ruleSetBody:MatchmakingRuleSet' :: Text
ruleSetBody = Text
a} :: MatchmakingRuleSet)
instance Data.FromJSON MatchmakingRuleSet where
parseJSON :: Value -> Parser MatchmakingRuleSet
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MatchmakingRuleSet"
( \Object
x ->
Maybe POSIX
-> Maybe Text -> Maybe Text -> Text -> MatchmakingRuleSet
MatchmakingRuleSet'
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
"CreationTime")
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
"RuleSetArn")
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
"RuleSetName")
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
"RuleSetBody")
)
instance Prelude.Hashable MatchmakingRuleSet where
hashWithSalt :: Int -> MatchmakingRuleSet -> Int
hashWithSalt Int
_salt MatchmakingRuleSet' {Maybe Text
Maybe POSIX
Text
ruleSetBody :: Text
ruleSetName :: Maybe Text
ruleSetArn :: Maybe Text
creationTime :: Maybe POSIX
$sel:ruleSetBody:MatchmakingRuleSet' :: MatchmakingRuleSet -> Text
$sel:ruleSetName:MatchmakingRuleSet' :: MatchmakingRuleSet -> Maybe Text
$sel:ruleSetArn:MatchmakingRuleSet' :: MatchmakingRuleSet -> Maybe Text
$sel:creationTime:MatchmakingRuleSet' :: MatchmakingRuleSet -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleSetArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleSetName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleSetBody
instance Prelude.NFData MatchmakingRuleSet where
rnf :: MatchmakingRuleSet -> ()
rnf MatchmakingRuleSet' {Maybe Text
Maybe POSIX
Text
ruleSetBody :: Text
ruleSetName :: Maybe Text
ruleSetArn :: Maybe Text
creationTime :: Maybe POSIX
$sel:ruleSetBody:MatchmakingRuleSet' :: MatchmakingRuleSet -> Text
$sel:ruleSetName:MatchmakingRuleSet' :: MatchmakingRuleSet -> Maybe Text
$sel:ruleSetArn:MatchmakingRuleSet' :: MatchmakingRuleSet -> Maybe Text
$sel:creationTime:MatchmakingRuleSet' :: MatchmakingRuleSet -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleSetArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleSetName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleSetBody