{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MatchmakingRuleSet = MatchmakingRuleSet'
{
MatchmakingRuleSet -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
MatchmakingRuleSet -> Maybe Text
ruleSetName :: Prelude.Maybe Prelude.Text,
MatchmakingRuleSet -> Maybe Text
ruleSetArn :: Prelude.Maybe Prelude.Text,
MatchmakingRuleSet -> Text
ruleSetBody :: Prelude.Text
}
deriving (MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
(MatchmakingRuleSet -> MatchmakingRuleSet -> Bool)
-> (MatchmakingRuleSet -> MatchmakingRuleSet -> Bool)
-> Eq MatchmakingRuleSet
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]
(Int -> ReadS MatchmakingRuleSet)
-> ReadS [MatchmakingRuleSet]
-> ReadPrec MatchmakingRuleSet
-> ReadPrec [MatchmakingRuleSet]
-> Read 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
(Int -> MatchmakingRuleSet -> ShowS)
-> (MatchmakingRuleSet -> String)
-> ([MatchmakingRuleSet] -> ShowS)
-> Show MatchmakingRuleSet
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. MatchmakingRuleSet -> Rep MatchmakingRuleSet x)
-> (forall x. Rep MatchmakingRuleSet x -> MatchmakingRuleSet)
-> Generic MatchmakingRuleSet
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' :: Maybe POSIX
-> Maybe Text -> Maybe Text -> Text -> MatchmakingRuleSet
MatchmakingRuleSet'
{ $sel:creationTime:MatchmakingRuleSet' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:ruleSetName:MatchmakingRuleSet' :: Maybe Text
ruleSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ruleSetArn:MatchmakingRuleSet' :: Maybe Text
ruleSetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ruleSetBody:MatchmakingRuleSet' :: Text
ruleSetBody = Text
pRuleSetBody_
}
matchmakingRuleSet_creationTime :: Lens.Lens' MatchmakingRuleSet (Prelude.Maybe Prelude.UTCTime)
matchmakingRuleSet_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MatchmakingRuleSet -> f MatchmakingRuleSet
matchmakingRuleSet_creationTime = (MatchmakingRuleSet -> Maybe POSIX)
-> (MatchmakingRuleSet -> Maybe POSIX -> MatchmakingRuleSet)
-> Lens
MatchmakingRuleSet MatchmakingRuleSet (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
-> MatchmakingRuleSet -> f MatchmakingRuleSet)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MatchmakingRuleSet
-> f MatchmakingRuleSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
matchmakingRuleSet_ruleSetName :: Lens.Lens' MatchmakingRuleSet (Prelude.Maybe Prelude.Text)
matchmakingRuleSet_ruleSetName :: (Maybe Text -> f (Maybe Text))
-> MatchmakingRuleSet -> f MatchmakingRuleSet
matchmakingRuleSet_ruleSetName = (MatchmakingRuleSet -> Maybe Text)
-> (MatchmakingRuleSet -> Maybe Text -> MatchmakingRuleSet)
-> Lens
MatchmakingRuleSet MatchmakingRuleSet (Maybe Text) (Maybe Text)
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_ruleSetArn :: Lens.Lens' MatchmakingRuleSet (Prelude.Maybe Prelude.Text)
matchmakingRuleSet_ruleSetArn :: (Maybe Text -> f (Maybe Text))
-> MatchmakingRuleSet -> f MatchmakingRuleSet
matchmakingRuleSet_ruleSetArn = (MatchmakingRuleSet -> Maybe Text)
-> (MatchmakingRuleSet -> Maybe Text -> MatchmakingRuleSet)
-> Lens
MatchmakingRuleSet MatchmakingRuleSet (Maybe Text) (Maybe Text)
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_ruleSetBody :: Lens.Lens' MatchmakingRuleSet Prelude.Text
matchmakingRuleSet_ruleSetBody :: (Text -> f Text) -> MatchmakingRuleSet -> f MatchmakingRuleSet
matchmakingRuleSet_ruleSetBody = (MatchmakingRuleSet -> Text)
-> (MatchmakingRuleSet -> Text -> MatchmakingRuleSet)
-> Lens MatchmakingRuleSet MatchmakingRuleSet Text Text
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 Core.FromJSON MatchmakingRuleSet where
parseJSON :: Value -> Parser MatchmakingRuleSet
parseJSON =
String
-> (Object -> Parser MatchmakingRuleSet)
-> Value
-> Parser MatchmakingRuleSet
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MatchmakingRuleSet"
( \Object
x ->
Maybe POSIX
-> Maybe Text -> Maybe Text -> Text -> MatchmakingRuleSet
MatchmakingRuleSet'
(Maybe POSIX
-> Maybe Text -> Maybe Text -> Text -> MatchmakingRuleSet)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> Text -> MatchmakingRuleSet)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
Parser (Maybe Text -> Maybe Text -> Text -> MatchmakingRuleSet)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> MatchmakingRuleSet)
forall (f :: * -> *) a b. Applicative f => 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
"RuleSetName")
Parser (Maybe Text -> Text -> MatchmakingRuleSet)
-> Parser (Maybe Text) -> Parser (Text -> MatchmakingRuleSet)
forall (f :: * -> *) a b. Applicative f => 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
"RuleSetArn")
Parser (Text -> MatchmakingRuleSet)
-> Parser Text -> Parser MatchmakingRuleSet
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
"RuleSetBody")
)
instance Prelude.Hashable MatchmakingRuleSet
instance Prelude.NFData MatchmakingRuleSet