{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GameLift.CreateMatchmakingRuleSet
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new rule set for FlexMatch matchmaking. A rule set describes
-- the type of match to create, such as the number and size of teams. It
-- also sets the parameters for acceptable player matches, such as minimum
-- skill level or character type. A rule set is used by a
-- MatchmakingConfiguration.
--
-- To create a matchmaking rule set, provide unique rule set name and the
-- rule set body in JSON format. Rule sets must be defined in the same
-- Region as the matchmaking configuration they are used with.
--
-- Since matchmaking rule sets cannot be edited, it is a good idea to check
-- the rule set syntax using ValidateMatchmakingRuleSet before creating a
-- new rule set.
--
-- __Learn more__
--
-- -   <https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html Build a rule set>
--
-- -   <https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-configuration.html Design a matchmaker>
--
-- -   <https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-intro.html Matchmaking with FlexMatch>
--
-- __Related actions__
--
-- CreateMatchmakingConfiguration | DescribeMatchmakingConfigurations |
-- UpdateMatchmakingConfiguration | DeleteMatchmakingConfiguration |
-- CreateMatchmakingRuleSet | DescribeMatchmakingRuleSets |
-- ValidateMatchmakingRuleSet | DeleteMatchmakingRuleSet |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.CreateMatchmakingRuleSet
  ( -- * Creating a Request
    CreateMatchmakingRuleSet (..),
    newCreateMatchmakingRuleSet,

    -- * Request Lenses
    createMatchmakingRuleSet_tags,
    createMatchmakingRuleSet_name,
    createMatchmakingRuleSet_ruleSetBody,

    -- * Destructuring the Response
    CreateMatchmakingRuleSetResponse (..),
    newCreateMatchmakingRuleSetResponse,

    -- * Response Lenses
    createMatchmakingRuleSetResponse_httpStatus,
    createMatchmakingRuleSetResponse_ruleSet,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input for a request operation.
--
-- /See:/ 'newCreateMatchmakingRuleSet' smart constructor.
data CreateMatchmakingRuleSet = CreateMatchmakingRuleSet'
  { -- | A list of labels to assign to the new matchmaking rule set resource.
    -- Tags are developer-defined key-value pairs. Tagging AWS resources are
    -- useful for resource management, access management and cost allocation.
    -- For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
    -- in the /AWS General Reference/. Once the resource is created, you can
    -- use TagResource, UntagResource, and ListTagsForResource to add, remove,
    -- and view tags. The maximum tag limit may be lower than stated. See the
    -- AWS General Reference for actual tagging limits.
    CreateMatchmakingRuleSet -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A unique identifier for the matchmaking rule set. A matchmaking
    -- configuration identifies the rule set it uses by this name value. Note
    -- that the rule set name is different from the optional @name@ field in
    -- the rule set body.
    CreateMatchmakingRuleSet -> Text
name :: Prelude.Text,
    -- | A collection of matchmaking rules, formatted as a JSON string. Comments
    -- are not allowed in JSON, but most elements support a description field.
    CreateMatchmakingRuleSet -> Text
ruleSetBody :: Prelude.Text
  }
  deriving (CreateMatchmakingRuleSet -> CreateMatchmakingRuleSet -> Bool
(CreateMatchmakingRuleSet -> CreateMatchmakingRuleSet -> Bool)
-> (CreateMatchmakingRuleSet -> CreateMatchmakingRuleSet -> Bool)
-> Eq CreateMatchmakingRuleSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMatchmakingRuleSet -> CreateMatchmakingRuleSet -> Bool
$c/= :: CreateMatchmakingRuleSet -> CreateMatchmakingRuleSet -> Bool
== :: CreateMatchmakingRuleSet -> CreateMatchmakingRuleSet -> Bool
$c== :: CreateMatchmakingRuleSet -> CreateMatchmakingRuleSet -> Bool
Prelude.Eq, ReadPrec [CreateMatchmakingRuleSet]
ReadPrec CreateMatchmakingRuleSet
Int -> ReadS CreateMatchmakingRuleSet
ReadS [CreateMatchmakingRuleSet]
(Int -> ReadS CreateMatchmakingRuleSet)
-> ReadS [CreateMatchmakingRuleSet]
-> ReadPrec CreateMatchmakingRuleSet
-> ReadPrec [CreateMatchmakingRuleSet]
-> Read CreateMatchmakingRuleSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMatchmakingRuleSet]
$creadListPrec :: ReadPrec [CreateMatchmakingRuleSet]
readPrec :: ReadPrec CreateMatchmakingRuleSet
$creadPrec :: ReadPrec CreateMatchmakingRuleSet
readList :: ReadS [CreateMatchmakingRuleSet]
$creadList :: ReadS [CreateMatchmakingRuleSet]
readsPrec :: Int -> ReadS CreateMatchmakingRuleSet
$creadsPrec :: Int -> ReadS CreateMatchmakingRuleSet
Prelude.Read, Int -> CreateMatchmakingRuleSet -> ShowS
[CreateMatchmakingRuleSet] -> ShowS
CreateMatchmakingRuleSet -> String
(Int -> CreateMatchmakingRuleSet -> ShowS)
-> (CreateMatchmakingRuleSet -> String)
-> ([CreateMatchmakingRuleSet] -> ShowS)
-> Show CreateMatchmakingRuleSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMatchmakingRuleSet] -> ShowS
$cshowList :: [CreateMatchmakingRuleSet] -> ShowS
show :: CreateMatchmakingRuleSet -> String
$cshow :: CreateMatchmakingRuleSet -> String
showsPrec :: Int -> CreateMatchmakingRuleSet -> ShowS
$cshowsPrec :: Int -> CreateMatchmakingRuleSet -> ShowS
Prelude.Show, (forall x.
 CreateMatchmakingRuleSet -> Rep CreateMatchmakingRuleSet x)
-> (forall x.
    Rep CreateMatchmakingRuleSet x -> CreateMatchmakingRuleSet)
-> Generic CreateMatchmakingRuleSet
forall x.
Rep CreateMatchmakingRuleSet x -> CreateMatchmakingRuleSet
forall x.
CreateMatchmakingRuleSet -> Rep CreateMatchmakingRuleSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateMatchmakingRuleSet x -> CreateMatchmakingRuleSet
$cfrom :: forall x.
CreateMatchmakingRuleSet -> Rep CreateMatchmakingRuleSet x
Prelude.Generic)

-- |
-- Create a value of 'CreateMatchmakingRuleSet' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'tags', 'createMatchmakingRuleSet_tags' - A list of labels to assign to the new matchmaking rule set resource.
-- Tags are developer-defined key-value pairs. Tagging AWS resources are
-- useful for resource management, access management and cost allocation.
-- For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
-- in the /AWS General Reference/. Once the resource is created, you can
-- use TagResource, UntagResource, and ListTagsForResource to add, remove,
-- and view tags. The maximum tag limit may be lower than stated. See the
-- AWS General Reference for actual tagging limits.
--
-- 'name', 'createMatchmakingRuleSet_name' - A unique identifier for the matchmaking rule set. A matchmaking
-- configuration identifies the rule set it uses by this name value. Note
-- that the rule set name is different from the optional @name@ field in
-- the rule set body.
--
-- 'ruleSetBody', 'createMatchmakingRuleSet_ruleSetBody' - A collection of matchmaking rules, formatted as a JSON string. Comments
-- are not allowed in JSON, but most elements support a description field.
newCreateMatchmakingRuleSet ::
  -- | 'name'
  Prelude.Text ->
  -- | 'ruleSetBody'
  Prelude.Text ->
  CreateMatchmakingRuleSet
newCreateMatchmakingRuleSet :: Text -> Text -> CreateMatchmakingRuleSet
newCreateMatchmakingRuleSet Text
pName_ Text
pRuleSetBody_ =
  CreateMatchmakingRuleSet' :: Maybe [Tag] -> Text -> Text -> CreateMatchmakingRuleSet
CreateMatchmakingRuleSet'
    { $sel:tags:CreateMatchmakingRuleSet' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateMatchmakingRuleSet' :: Text
name = Text
pName_,
      $sel:ruleSetBody:CreateMatchmakingRuleSet' :: Text
ruleSetBody = Text
pRuleSetBody_
    }

-- | A list of labels to assign to the new matchmaking rule set resource.
-- Tags are developer-defined key-value pairs. Tagging AWS resources are
-- useful for resource management, access management and cost allocation.
-- For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
-- in the /AWS General Reference/. Once the resource is created, you can
-- use TagResource, UntagResource, and ListTagsForResource to add, remove,
-- and view tags. The maximum tag limit may be lower than stated. See the
-- AWS General Reference for actual tagging limits.
createMatchmakingRuleSet_tags :: Lens.Lens' CreateMatchmakingRuleSet (Prelude.Maybe [Tag])
createMatchmakingRuleSet_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateMatchmakingRuleSet -> f CreateMatchmakingRuleSet
createMatchmakingRuleSet_tags = (CreateMatchmakingRuleSet -> Maybe [Tag])
-> (CreateMatchmakingRuleSet
    -> Maybe [Tag] -> CreateMatchmakingRuleSet)
-> Lens
     CreateMatchmakingRuleSet
     CreateMatchmakingRuleSet
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMatchmakingRuleSet' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateMatchmakingRuleSet' :: CreateMatchmakingRuleSet -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateMatchmakingRuleSet
s@CreateMatchmakingRuleSet' {} Maybe [Tag]
a -> CreateMatchmakingRuleSet
s {$sel:tags:CreateMatchmakingRuleSet' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateMatchmakingRuleSet) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateMatchmakingRuleSet -> f CreateMatchmakingRuleSet)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateMatchmakingRuleSet
-> f CreateMatchmakingRuleSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique identifier for the matchmaking rule set. A matchmaking
-- configuration identifies the rule set it uses by this name value. Note
-- that the rule set name is different from the optional @name@ field in
-- the rule set body.
createMatchmakingRuleSet_name :: Lens.Lens' CreateMatchmakingRuleSet Prelude.Text
createMatchmakingRuleSet_name :: (Text -> f Text)
-> CreateMatchmakingRuleSet -> f CreateMatchmakingRuleSet
createMatchmakingRuleSet_name = (CreateMatchmakingRuleSet -> Text)
-> (CreateMatchmakingRuleSet -> Text -> CreateMatchmakingRuleSet)
-> Lens CreateMatchmakingRuleSet CreateMatchmakingRuleSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMatchmakingRuleSet' {Text
name :: Text
$sel:name:CreateMatchmakingRuleSet' :: CreateMatchmakingRuleSet -> Text
name} -> Text
name) (\s :: CreateMatchmakingRuleSet
s@CreateMatchmakingRuleSet' {} Text
a -> CreateMatchmakingRuleSet
s {$sel:name:CreateMatchmakingRuleSet' :: Text
name = Text
a} :: CreateMatchmakingRuleSet)

-- | A collection of matchmaking rules, formatted as a JSON string. Comments
-- are not allowed in JSON, but most elements support a description field.
createMatchmakingRuleSet_ruleSetBody :: Lens.Lens' CreateMatchmakingRuleSet Prelude.Text
createMatchmakingRuleSet_ruleSetBody :: (Text -> f Text)
-> CreateMatchmakingRuleSet -> f CreateMatchmakingRuleSet
createMatchmakingRuleSet_ruleSetBody = (CreateMatchmakingRuleSet -> Text)
-> (CreateMatchmakingRuleSet -> Text -> CreateMatchmakingRuleSet)
-> Lens CreateMatchmakingRuleSet CreateMatchmakingRuleSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMatchmakingRuleSet' {Text
ruleSetBody :: Text
$sel:ruleSetBody:CreateMatchmakingRuleSet' :: CreateMatchmakingRuleSet -> Text
ruleSetBody} -> Text
ruleSetBody) (\s :: CreateMatchmakingRuleSet
s@CreateMatchmakingRuleSet' {} Text
a -> CreateMatchmakingRuleSet
s {$sel:ruleSetBody:CreateMatchmakingRuleSet' :: Text
ruleSetBody = Text
a} :: CreateMatchmakingRuleSet)

instance Core.AWSRequest CreateMatchmakingRuleSet where
  type
    AWSResponse CreateMatchmakingRuleSet =
      CreateMatchmakingRuleSetResponse
  request :: CreateMatchmakingRuleSet -> Request CreateMatchmakingRuleSet
request = Service
-> CreateMatchmakingRuleSet -> Request CreateMatchmakingRuleSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateMatchmakingRuleSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateMatchmakingRuleSet)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateMatchmakingRuleSet))
-> Logger
-> Service
-> Proxy CreateMatchmakingRuleSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateMatchmakingRuleSet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> MatchmakingRuleSet -> CreateMatchmakingRuleSetResponse
CreateMatchmakingRuleSetResponse'
            (Int -> MatchmakingRuleSet -> CreateMatchmakingRuleSetResponse)
-> Either String Int
-> Either
     String (MatchmakingRuleSet -> CreateMatchmakingRuleSetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String (MatchmakingRuleSet -> CreateMatchmakingRuleSetResponse)
-> Either String MatchmakingRuleSet
-> Either String CreateMatchmakingRuleSetResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String MatchmakingRuleSet
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"RuleSet")
      )

instance Prelude.Hashable CreateMatchmakingRuleSet

instance Prelude.NFData CreateMatchmakingRuleSet

instance Core.ToHeaders CreateMatchmakingRuleSet where
  toHeaders :: CreateMatchmakingRuleSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateMatchmakingRuleSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"GameLift.CreateMatchmakingRuleSet" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateMatchmakingRuleSet where
  toJSON :: CreateMatchmakingRuleSet -> Value
toJSON CreateMatchmakingRuleSet' {Maybe [Tag]
Text
ruleSetBody :: Text
name :: Text
tags :: Maybe [Tag]
$sel:ruleSetBody:CreateMatchmakingRuleSet' :: CreateMatchmakingRuleSet -> Text
$sel:name:CreateMatchmakingRuleSet' :: CreateMatchmakingRuleSet -> Text
$sel:tags:CreateMatchmakingRuleSet' :: CreateMatchmakingRuleSet -> Maybe [Tag]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RuleSetBody" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ruleSetBody)
          ]
      )

instance Core.ToPath CreateMatchmakingRuleSet where
  toPath :: CreateMatchmakingRuleSet -> ByteString
toPath = ByteString -> CreateMatchmakingRuleSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery CreateMatchmakingRuleSet where
  toQuery :: CreateMatchmakingRuleSet -> QueryString
toQuery = QueryString -> CreateMatchmakingRuleSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | Represents the returned data in response to a request operation.
--
-- /See:/ 'newCreateMatchmakingRuleSetResponse' smart constructor.
data CreateMatchmakingRuleSetResponse = CreateMatchmakingRuleSetResponse'
  { -- | The response's http status code.
    CreateMatchmakingRuleSetResponse -> Int
httpStatus :: Prelude.Int,
    -- | The newly created matchmaking rule set.
    CreateMatchmakingRuleSetResponse -> MatchmakingRuleSet
ruleSet :: MatchmakingRuleSet
  }
  deriving (CreateMatchmakingRuleSetResponse
-> CreateMatchmakingRuleSetResponse -> Bool
(CreateMatchmakingRuleSetResponse
 -> CreateMatchmakingRuleSetResponse -> Bool)
-> (CreateMatchmakingRuleSetResponse
    -> CreateMatchmakingRuleSetResponse -> Bool)
-> Eq CreateMatchmakingRuleSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMatchmakingRuleSetResponse
-> CreateMatchmakingRuleSetResponse -> Bool
$c/= :: CreateMatchmakingRuleSetResponse
-> CreateMatchmakingRuleSetResponse -> Bool
== :: CreateMatchmakingRuleSetResponse
-> CreateMatchmakingRuleSetResponse -> Bool
$c== :: CreateMatchmakingRuleSetResponse
-> CreateMatchmakingRuleSetResponse -> Bool
Prelude.Eq, ReadPrec [CreateMatchmakingRuleSetResponse]
ReadPrec CreateMatchmakingRuleSetResponse
Int -> ReadS CreateMatchmakingRuleSetResponse
ReadS [CreateMatchmakingRuleSetResponse]
(Int -> ReadS CreateMatchmakingRuleSetResponse)
-> ReadS [CreateMatchmakingRuleSetResponse]
-> ReadPrec CreateMatchmakingRuleSetResponse
-> ReadPrec [CreateMatchmakingRuleSetResponse]
-> Read CreateMatchmakingRuleSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMatchmakingRuleSetResponse]
$creadListPrec :: ReadPrec [CreateMatchmakingRuleSetResponse]
readPrec :: ReadPrec CreateMatchmakingRuleSetResponse
$creadPrec :: ReadPrec CreateMatchmakingRuleSetResponse
readList :: ReadS [CreateMatchmakingRuleSetResponse]
$creadList :: ReadS [CreateMatchmakingRuleSetResponse]
readsPrec :: Int -> ReadS CreateMatchmakingRuleSetResponse
$creadsPrec :: Int -> ReadS CreateMatchmakingRuleSetResponse
Prelude.Read, Int -> CreateMatchmakingRuleSetResponse -> ShowS
[CreateMatchmakingRuleSetResponse] -> ShowS
CreateMatchmakingRuleSetResponse -> String
(Int -> CreateMatchmakingRuleSetResponse -> ShowS)
-> (CreateMatchmakingRuleSetResponse -> String)
-> ([CreateMatchmakingRuleSetResponse] -> ShowS)
-> Show CreateMatchmakingRuleSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMatchmakingRuleSetResponse] -> ShowS
$cshowList :: [CreateMatchmakingRuleSetResponse] -> ShowS
show :: CreateMatchmakingRuleSetResponse -> String
$cshow :: CreateMatchmakingRuleSetResponse -> String
showsPrec :: Int -> CreateMatchmakingRuleSetResponse -> ShowS
$cshowsPrec :: Int -> CreateMatchmakingRuleSetResponse -> ShowS
Prelude.Show, (forall x.
 CreateMatchmakingRuleSetResponse
 -> Rep CreateMatchmakingRuleSetResponse x)
-> (forall x.
    Rep CreateMatchmakingRuleSetResponse x
    -> CreateMatchmakingRuleSetResponse)
-> Generic CreateMatchmakingRuleSetResponse
forall x.
Rep CreateMatchmakingRuleSetResponse x
-> CreateMatchmakingRuleSetResponse
forall x.
CreateMatchmakingRuleSetResponse
-> Rep CreateMatchmakingRuleSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateMatchmakingRuleSetResponse x
-> CreateMatchmakingRuleSetResponse
$cfrom :: forall x.
CreateMatchmakingRuleSetResponse
-> Rep CreateMatchmakingRuleSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateMatchmakingRuleSetResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'createMatchmakingRuleSetResponse_httpStatus' - The response's http status code.
--
-- 'ruleSet', 'createMatchmakingRuleSetResponse_ruleSet' - The newly created matchmaking rule set.
newCreateMatchmakingRuleSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'ruleSet'
  MatchmakingRuleSet ->
  CreateMatchmakingRuleSetResponse
newCreateMatchmakingRuleSetResponse :: Int -> MatchmakingRuleSet -> CreateMatchmakingRuleSetResponse
newCreateMatchmakingRuleSetResponse
  Int
pHttpStatus_
  MatchmakingRuleSet
pRuleSet_ =
    CreateMatchmakingRuleSetResponse' :: Int -> MatchmakingRuleSet -> CreateMatchmakingRuleSetResponse
CreateMatchmakingRuleSetResponse'
      { $sel:httpStatus:CreateMatchmakingRuleSetResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:ruleSet:CreateMatchmakingRuleSetResponse' :: MatchmakingRuleSet
ruleSet = MatchmakingRuleSet
pRuleSet_
      }

-- | The response's http status code.
createMatchmakingRuleSetResponse_httpStatus :: Lens.Lens' CreateMatchmakingRuleSetResponse Prelude.Int
createMatchmakingRuleSetResponse_httpStatus :: (Int -> f Int)
-> CreateMatchmakingRuleSetResponse
-> f CreateMatchmakingRuleSetResponse
createMatchmakingRuleSetResponse_httpStatus = (CreateMatchmakingRuleSetResponse -> Int)
-> (CreateMatchmakingRuleSetResponse
    -> Int -> CreateMatchmakingRuleSetResponse)
-> Lens
     CreateMatchmakingRuleSetResponse
     CreateMatchmakingRuleSetResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMatchmakingRuleSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateMatchmakingRuleSetResponse' :: CreateMatchmakingRuleSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateMatchmakingRuleSetResponse
s@CreateMatchmakingRuleSetResponse' {} Int
a -> CreateMatchmakingRuleSetResponse
s {$sel:httpStatus:CreateMatchmakingRuleSetResponse' :: Int
httpStatus = Int
a} :: CreateMatchmakingRuleSetResponse)

-- | The newly created matchmaking rule set.
createMatchmakingRuleSetResponse_ruleSet :: Lens.Lens' CreateMatchmakingRuleSetResponse MatchmakingRuleSet
createMatchmakingRuleSetResponse_ruleSet :: (MatchmakingRuleSet -> f MatchmakingRuleSet)
-> CreateMatchmakingRuleSetResponse
-> f CreateMatchmakingRuleSetResponse
createMatchmakingRuleSetResponse_ruleSet = (CreateMatchmakingRuleSetResponse -> MatchmakingRuleSet)
-> (CreateMatchmakingRuleSetResponse
    -> MatchmakingRuleSet -> CreateMatchmakingRuleSetResponse)
-> Lens
     CreateMatchmakingRuleSetResponse
     CreateMatchmakingRuleSetResponse
     MatchmakingRuleSet
     MatchmakingRuleSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMatchmakingRuleSetResponse' {MatchmakingRuleSet
ruleSet :: MatchmakingRuleSet
$sel:ruleSet:CreateMatchmakingRuleSetResponse' :: CreateMatchmakingRuleSetResponse -> MatchmakingRuleSet
ruleSet} -> MatchmakingRuleSet
ruleSet) (\s :: CreateMatchmakingRuleSetResponse
s@CreateMatchmakingRuleSetResponse' {} MatchmakingRuleSet
a -> CreateMatchmakingRuleSetResponse
s {$sel:ruleSet:CreateMatchmakingRuleSetResponse' :: MatchmakingRuleSet
ruleSet = MatchmakingRuleSet
a} :: CreateMatchmakingRuleSetResponse)

instance
  Prelude.NFData
    CreateMatchmakingRuleSetResponse