def create_codes tournament_id:, count: nil, allowed_participants: nil,
                       map_type: "SUMMONERS_RIFT", metadata: nil, team_size: 5,
                       pick_type: "TOURNAMENT_DRAFT", spectator_type: "ALL"
      body = {
        "allowedSummonerIds" => allowed_participants,
        "mapType"            => map_type,
        "metadata"           => metadata,
        "pickType"           => pick_type,
        "spectatorType"      => spectator_type,
        "teamSize"           => team_size
      }.compact
      uri_params = {
        "tournamentId" => tournament_id,
        "count"        => count
      }.compact
      perform_request api_url("codes", uri_params), :post, body
    end
def create_codes tournament_id:, count: nil, allowed_participants: nil,
                       map_type: "SUMMONERS_RIFT", metadata: nil, team_size: 5,
                       pick_type: "TOURNAMENT_DRAFT", spectator_type: "ALL"
      body = {
        "allowedSummonerIds" => allowed_participants,
        "mapType"            => map_type,
        "metadata"           => metadata,
        "pickType"           => pick_type,
        "spectatorType"      => spectator_type,
        "teamSize"           => team_size
      }.compact
      uri_params = {
        "tournamentId" => tournament_id,
        "count"        => count
      }.compact
      perform_request api_url("codes", uri_params), :post, body
    end
Create a tournament code for the given tournament.
 @param [Integer] count The number of codes to create (max 1000)
 @param [Integer] tournament_id The tournament ID
 @param [String] spectator_type The spectator type of the game. Valid values are NONE, LOBBYONLY, ALL.
 @param [Integer] team_size The team size of the game. Valid values are 1-5.
 @param [String] pick_type The pick type of the game. Valid values are BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT.
 @param [String] map_type The map type of the game. Valid values are SUMMONERS_RIFT, TWISTED_TREELINE, CRYSTAL_SCAR, and HOWLING_ABYSS.
 @param [Array<Integer>] allowed_participants List of participants in order to validate the players eligible to join the lobby.
 @param [String] metadata Optional string that may contain any data in any format, if specified at all. Used to denote any custom information about the game.
 @return [Array<String>] generated tournament codes