class FtcEventsClient::MatchResultsApi
Attributes
Public Class Methods
# File lib/ftc_events_client/api/match_results_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Event Match Results The match results API returns the match results for all matches of a particular event in a particular season. Match results are only available once a match has been played, retrieving info about future matches requires the event schedule API. You cannot receive data about a match that is in progress. You can, however, request the Hybrid Schedule if you would like data about upcoming and played matches at the same time. If you specify the `matchNumber`, `start` and/or `end` optional parameters, you must also specify a `tournamentLevel`. If you specify the `teamNumber` parameter, you cannot specify a `matchNumber` parameter. If you specify the `matchNumber`, you cannot define a start or end. Note: If you specify `start`, and it is higher than the maximum match number at the event, you will not receive any match results in the response. The same is true in reverse for the `end` parameter. @param season [Integer] Numeric year of the event from which the match results are requested. Must be 4 digits. @param event_code [String] Case insensitive alphanumeric `eventCode` of the event from which the results are requested. Must be at least 3 characters. @param [Hash] opts the optional parameters @option opts [String] :tournament_level Required tournamentLevel of desired score details. (default to '0') @option opts [Integer] :team_number `teamNumber` to search for within the results. Only returns match results in which the requested team was a participant. @option opts [Integer] :match_number specific single `matchNumber` of result. @option opts [Integer] :start `start` match number for subset of results to return. (default to 0) @option opts [Integer] :_end `end` match number for subset of results to return (inclusive). (default to 999) @return [EventMatchResultsModelVersion2]
# File lib/ftc_events_client/api/match_results_api.rb, line 33 def v20_season_matches_event_code_get(season, event_code, opts = {}) data, _status_code, _headers = v20_season_matches_event_code_get_with_http_info(season, event_code, opts) data end
Event Match Results The match results API returns the match results for all matches of a particular event in a particular season. Match results are only available once a match has been played, retrieving info about future matches requires the event schedule API. You cannot receive data about a match that is in progress. You can, however, request the Hybrid Schedule if you would like data about upcoming and played matches at the same time. If you specify the `matchNumber`, `start` and/or `end` optional parameters, you must also specify a `tournamentLevel`. If you specify the `teamNumber` parameter, you cannot specify a `matchNumber` parameter. If you specify the `matchNumber`, you cannot define a start or end. Note: If you specify `start`, and it is higher than the maximum match number at the event, you will not receive any match results in the response. The same is true in reverse for the `end` parameter. @param season [Integer] Numeric year of the event from which the match results are requested. Must be 4 digits. @param event_code [String] Case insensitive alphanumeric `eventCode` of the event from which the results are requested. Must be at least 3 characters. @param [Hash] opts the optional parameters @option opts [String] :tournament_level Required tournamentLevel of desired score details. @option opts [Integer] :team_number `teamNumber` to search for within the results. Only returns match results in which the requested team was a participant. @option opts [Integer] :match_number specific single `matchNumber` of result. @option opts [Integer] :start `start` match number for subset of results to return. @option opts [Integer] :_end `end` match number for subset of results to return (inclusive). @return [Array<(EventMatchResultsModelVersion2
, Integer, Hash)>] EventMatchResultsModelVersion2
data, response status code and response headers
# File lib/ftc_events_client/api/match_results_api.rb, line 49 def v20_season_matches_event_code_get_with_http_info(season, event_code, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MatchResultsApi.v20_season_matches_event_code_get ...' end # verify the required parameter 'season' is set if @api_client.config.client_side_validation && season.nil? fail ArgumentError, "Missing the required parameter 'season' when calling MatchResultsApi.v20_season_matches_event_code_get" end allowable_values = ["qual", "playoff"] if @api_client.config.client_side_validation && opts[:'tournament_level'] && !allowable_values.include?(opts[:'tournament_level']) fail ArgumentError, "invalid value for \"tournament_level\", must be one of #{allowable_values}" end # resource path local_var_path = '/v2.0/{season}/matches/{eventCode}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'tournamentLevel'] = opts[:'tournament_level'] if !opts[:'tournament_level'].nil? query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil? query_params[:'matchNumber'] = opts[:'match_number'] if !opts[:'match_number'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EventMatchResultsModelVersion2' # auth_names auth_names = opts[:debug_auth_names] || ['basic'] new_options = opts.merge( :operation => :"MatchResultsApi.v20_season_matches_event_code_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MatchResultsApi#v20_season_matches_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Score Details The score details API returns the score detail for all matches of a particular event in a particular season and a particular tournament level. Score details are only available once a match has been played, retrieving info about future matches requires the event schedule API. You cannot receive data about a match that is in progress. @param season [Integer] Numeric year of the event from which the match results are requested. Must be 4 digits. @param event_code [String] Case insensitive alphanumeric eventCode of the event from which the details are requested. Must be at least 3 characters. @param tournament_level [String] Required tournamentLevel of desired score details. @param [Hash] opts the optional parameters @option opts [Integer] :team_number `teamNumber` to search for within the results. Only returns details in which the requested team was a participant. @option opts [Integer] :match_number specific single `matchNumber` of result. @option opts [Integer] :start `start` match number for subset of results to return (inclusive). (default to 0) @option opts [Integer] :_end `end` match number for subset of results to return (inclusive). (default to 999) @return [MatchScoresModel]
# File lib/ftc_events_client/api/match_results_api.rb, line 117 def v20_season_scores_event_code_tournament_level_get(season, event_code, tournament_level, opts = {}) data, _status_code, _headers = v20_season_scores_event_code_tournament_level_get_with_http_info(season, event_code, tournament_level, opts) data end
Score Details The score details API returns the score detail for all matches of a particular event in a particular season and a particular tournament level. Score details are only available once a match has been played, retrieving info about future matches requires the event schedule API. You cannot receive data about a match that is in progress. @param season [Integer] Numeric year of the event from which the match results are requested. Must be 4 digits. @param event_code [String] Case insensitive alphanumeric eventCode of the event from which the details are requested. Must be at least 3 characters. @param tournament_level [String] Required tournamentLevel of desired score details. @param [Hash] opts the optional parameters @option opts [Integer] :team_number `teamNumber` to search for within the results. Only returns details in which the requested team was a participant. @option opts [Integer] :match_number specific single `matchNumber` of result. @option opts [Integer] :start `start` match number for subset of results to return (inclusive). @option opts [Integer] :_end `end` match number for subset of results to return (inclusive). @return [Array<(MatchScoresModel
, Integer, Hash)>] MatchScoresModel
data, response status code and response headers
# File lib/ftc_events_client/api/match_results_api.rb, line 133 def v20_season_scores_event_code_tournament_level_get_with_http_info(season, event_code, tournament_level, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MatchResultsApi.v20_season_scores_event_code_tournament_level_get ...' end # verify the required parameter 'season' is set if @api_client.config.client_side_validation && season.nil? fail ArgumentError, "Missing the required parameter 'season' when calling MatchResultsApi.v20_season_scores_event_code_tournament_level_get" end # resource path local_var_path = '/v2.0/{season}/scores/{eventCode}/{tournamentLevel}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s)).sub('{' + 'tournamentLevel' + '}', CGI.escape(tournament_level.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil? query_params[:'matchNumber'] = opts[:'match_number'] if !opts[:'match_number'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'MatchScoresModel' # auth_names auth_names = opts[:debug_auth_names] || ['basic'] new_options = opts.merge( :operation => :"MatchResultsApi.v20_season_scores_event_code_tournament_level_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MatchResultsApi#v20_season_scores_event_code_tournament_level_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end