Class: FtcEventsClient::MatchResultsApi
- Inherits:
-
Object
- Object
- FtcEventsClient::MatchResultsApi
- Defined in:
- lib/ftc_events_client/api/match_results_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ MatchResultsApi
constructor
A new instance of MatchResultsApi.
-
#v20_season_matches_event_code_get(season, event_code, opts = {}) ⇒ EventMatchResultsModelVersion2
Event Match Results The match results API returns the match results for all matches of a particular event in a particular season.
-
#v20_season_matches_event_code_get_with_http_info(season, event_code, opts = {}) ⇒ Array<(EventMatchResultsModelVersion2, Integer, Hash)>
Event Match Results The match results API returns the match results for all matches of a particular event in a particular season.
-
#v20_season_scores_event_code_tournament_level_get(season, event_code, tournament_level, opts = {}) ⇒ MatchScoresModel
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.
-
#v20_season_scores_event_code_tournament_level_get_with_http_info(season, event_code, tournament_level, opts = {}) ⇒ Array<(MatchScoresModel, Integer, Hash)>
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.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ MatchResultsApi
Returns a new instance of MatchResultsApi.
16 17 18 |
# File 'lib/ftc_events_client/api/match_results_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/ftc_events_client/api/match_results_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#v20_season_matches_event_code_get(season, event_code, opts = {}) ⇒ EventMatchResultsModelVersion2
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.
30 31 32 33 |
# File 'lib/ftc_events_client/api/match_results_api.rb', line 30 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 |
#v20_season_matches_event_code_get_with_http_info(season, event_code, opts = {}) ⇒ Array<(EventMatchResultsModelVersion2, Integer, Hash)>
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.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/ftc_events_client/api/match_results_api.rb', line 46 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 # verify the required parameter 'event_code' is set if @api_client.config.client_side_validation && event_code.nil? fail ArgumentError, "Missing the required parameter 'event_code' when calling MatchResultsApi.v20_season_matches_event_code_get" end if @api_client.config.client_side_validation && opts[:'tournament_level'] && !['qual', 'playoff'].include?(opts[:'tournament_level']) fail ArgumentError, 'invalid value for "tournament_level", must be one of qual, playoff' end # resource path local_var_path = '/v2.0/{season}/matches/{eventCode}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', 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[:body] return_type = opts[:return_type] || 'EventMatchResultsModelVersion2' auth_names = opts[:auth_names] || ['basic'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) 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 |
#v20_season_scores_event_code_tournament_level_get(season, event_code, tournament_level, opts = {}) ⇒ MatchScoresModel
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.
110 111 112 113 |
# File 'lib/ftc_events_client/api/match_results_api.rb', line 110 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 |
#v20_season_scores_event_code_tournament_level_get_with_http_info(season, event_code, tournament_level, opts = {}) ⇒ Array<(MatchScoresModel, Integer, Hash)>
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.
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/ftc_events_client/api/match_results_api.rb', line 126 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 # verify the required parameter 'event_code' is set if @api_client.config.client_side_validation && event_code.nil? fail ArgumentError, "Missing the required parameter 'event_code' when calling MatchResultsApi.v20_season_scores_event_code_tournament_level_get" end # verify the required parameter 'tournament_level' is set if @api_client.config.client_side_validation && tournament_level.nil? fail ArgumentError, "Missing the required parameter 'tournament_level' when calling MatchResultsApi.v20_season_scores_event_code_tournament_level_get" end # verify enum value if @api_client.config.client_side_validation && !['qual', 'playoff'].include?(tournament_level) fail ArgumentError, "invalid value for 'tournament_level', must be one of qual, playoff" end # resource path local_var_path = '/v2.0/{season}/scores/{eventCode}/{tournamentLevel}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', event_code.to_s).sub('{' + 'tournamentLevel' + '}', 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[:body] return_type = opts[:return_type] || 'MatchScoresModel' auth_names = opts[:auth_names] || ['basic'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) 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 |