module Stratosphere.GameLift.MatchmakingRuleSet (
        MatchmakingRuleSet(..), mkMatchmakingRuleSet
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data MatchmakingRuleSet
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-matchmakingruleset.html>
    MatchmakingRuleSet {MatchmakingRuleSet -> ()
haddock_workaround_ :: (),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-matchmakingruleset.html#cfn-gamelift-matchmakingruleset-name>
                        MatchmakingRuleSet -> Value Text
name :: (Value Prelude.Text),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-matchmakingruleset.html#cfn-gamelift-matchmakingruleset-rulesetbody>
                        MatchmakingRuleSet -> Value Text
ruleSetBody :: (Value Prelude.Text),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-matchmakingruleset.html#cfn-gamelift-matchmakingruleset-tags>
                        MatchmakingRuleSet -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
(MatchmakingRuleSet -> MatchmakingRuleSet -> Bool)
-> (MatchmakingRuleSet -> MatchmakingRuleSet -> Bool)
-> Eq MatchmakingRuleSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
== :: MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
$c/= :: MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
/= :: MatchmakingRuleSet -> MatchmakingRuleSet -> Bool
Prelude.Eq, 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
$cshowsPrec :: Int -> MatchmakingRuleSet -> ShowS
showsPrec :: Int -> MatchmakingRuleSet -> ShowS
$cshow :: MatchmakingRuleSet -> String
show :: MatchmakingRuleSet -> String
$cshowList :: [MatchmakingRuleSet] -> ShowS
showList :: [MatchmakingRuleSet] -> ShowS
Prelude.Show)
mkMatchmakingRuleSet ::
  Value Prelude.Text -> Value Prelude.Text -> MatchmakingRuleSet
mkMatchmakingRuleSet :: Value Text -> Value Text -> MatchmakingRuleSet
mkMatchmakingRuleSet Value Text
name Value Text
ruleSetBody
  = MatchmakingRuleSet
      {haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name, ruleSetBody :: Value Text
ruleSetBody = Value Text
ruleSetBody,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MatchmakingRuleSet where
  toResourceProperties :: MatchmakingRuleSet -> ResourceProperties
toResourceProperties MatchmakingRuleSet {Maybe [Tag]
()
Value Text
haddock_workaround_ :: MatchmakingRuleSet -> ()
name :: MatchmakingRuleSet -> Value Text
ruleSetBody :: MatchmakingRuleSet -> Value Text
tags :: MatchmakingRuleSet -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
ruleSetBody :: Value Text
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::GameLift::MatchmakingRuleSet",
         supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name, Key
"RuleSetBody" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
ruleSetBody]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON MatchmakingRuleSet where
  toJSON :: MatchmakingRuleSet -> Value
toJSON MatchmakingRuleSet {Maybe [Tag]
()
Value Text
haddock_workaround_ :: MatchmakingRuleSet -> ()
name :: MatchmakingRuleSet -> Value Text
ruleSetBody :: MatchmakingRuleSet -> Value Text
tags :: MatchmakingRuleSet -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
ruleSetBody :: Value Text
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name, Key
"RuleSetBody" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
ruleSetBody]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "Name" MatchmakingRuleSet where
  type PropertyType "Name" MatchmakingRuleSet = Value Prelude.Text
  set :: PropertyType "Name" MatchmakingRuleSet
-> MatchmakingRuleSet -> MatchmakingRuleSet
set PropertyType "Name" MatchmakingRuleSet
newValue MatchmakingRuleSet {Maybe [Tag]
()
Value Text
haddock_workaround_ :: MatchmakingRuleSet -> ()
name :: MatchmakingRuleSet -> Value Text
ruleSetBody :: MatchmakingRuleSet -> Value Text
tags :: MatchmakingRuleSet -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
ruleSetBody :: Value Text
tags :: Maybe [Tag]
..}
    = MatchmakingRuleSet {name :: Value Text
name = PropertyType "Name" MatchmakingRuleSet
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
ruleSetBody :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
ruleSetBody :: Value Text
tags :: Maybe [Tag]
..}
instance Property "RuleSetBody" MatchmakingRuleSet where
  type PropertyType "RuleSetBody" MatchmakingRuleSet = Value Prelude.Text
  set :: PropertyType "RuleSetBody" MatchmakingRuleSet
-> MatchmakingRuleSet -> MatchmakingRuleSet
set PropertyType "RuleSetBody" MatchmakingRuleSet
newValue MatchmakingRuleSet {Maybe [Tag]
()
Value Text
haddock_workaround_ :: MatchmakingRuleSet -> ()
name :: MatchmakingRuleSet -> Value Text
ruleSetBody :: MatchmakingRuleSet -> Value Text
tags :: MatchmakingRuleSet -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
ruleSetBody :: Value Text
tags :: Maybe [Tag]
..}
    = MatchmakingRuleSet {ruleSetBody :: Value Text
ruleSetBody = PropertyType "RuleSetBody" MatchmakingRuleSet
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Tags" MatchmakingRuleSet where
  type PropertyType "Tags" MatchmakingRuleSet = [Tag]
  set :: PropertyType "Tags" MatchmakingRuleSet
-> MatchmakingRuleSet -> MatchmakingRuleSet
set PropertyType "Tags" MatchmakingRuleSet
newValue MatchmakingRuleSet {Maybe [Tag]
()
Value Text
haddock_workaround_ :: MatchmakingRuleSet -> ()
name :: MatchmakingRuleSet -> Value Text
ruleSetBody :: MatchmakingRuleSet -> Value Text
tags :: MatchmakingRuleSet -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
ruleSetBody :: Value Text
tags :: Maybe [Tag]
..}
    = MatchmakingRuleSet {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" MatchmakingRuleSet
newValue, ()
Value Text
haddock_workaround_ :: ()
name :: Value Text
ruleSetBody :: Value Text
haddock_workaround_ :: ()
name :: Value Text
ruleSetBody :: Value Text
..}