Class: FtcEventsClient::MatchResultsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ftc_events_client/api/match_results_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_clientObject

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.

Parameters:

  • season

    Numeric year of the event from which the match results are requested. Must be 4 digits.

  • event_code

    Case insensitive alphanumeric `eventCode` of the event from which the results are requested. Must be at least 3 characters.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :tournament_level (String)

    Required tournamentLevel of desired score details. (default to 0)

  • :team_number (Integer)

    `teamNumber` to search for within the results. Only returns match results in which the requested team was a participant.

  • :match_number (Integer)

    specific single `matchNumber` of result.

  • :start (Integer)

    `start` match number for subset of results to return. (default to 0)

  • :_end (Integer)

    `end` match number for subset of results to return (inclusive). (default to 999)

Returns:



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 &#x60;matchNumber&#x60;, &#x60;start&#x60; and/or &#x60;end&#x60; optional parameters, you must also specify a &#x60;tournamentLevel&#x60;. If you specify the &#x60;teamNumber&#x60; parameter, you cannot specify a &#x60;matchNumber&#x60; parameter. If you specify the &#x60;matchNumber&#x60;, you cannot define a start or end. Note: If you specify &#x60;start&#x60;, 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 &#x60;end&#x60; parameter.

Parameters:

  • season

    Numeric year of the event from which the match results are requested. Must be 4 digits.

  • event_code

    Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the results are requested. Must be at least 3 characters.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :tournament_level (String)

    Required tournamentLevel of desired score details.

  • :team_number (Integer)

    &#x60;teamNumber&#x60; to search for within the results. Only returns match results in which the requested team was a participant.

  • :match_number (Integer)

    specific single &#x60;matchNumber&#x60; of result.

  • :start (Integer)

    &#x60;start&#x60; match number for subset of results to return.

  • :_end (Integer)

    &#x60;end&#x60; match number for subset of results to return (inclusive).

Returns:



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.

Parameters:

  • season

    Numeric year of the event from which the match results are requested. Must be 4 digits.

  • event_code

    Case insensitive alphanumeric eventCode of the event from which the details are requested. Must be at least 3 characters.

  • tournament_level

    Required tournamentLevel of desired score details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :team_number (Integer)

    &#x60;teamNumber&#x60; to search for within the results. Only returns details in which the requested team was a participant.

  • :match_number (Integer)

    specific single &#x60;matchNumber&#x60; of result.

  • :start (Integer)

    &#x60;start&#x60; match number for subset of results to return (inclusive). (default to 0)

  • :_end (Integer)

    &#x60;end&#x60; match number for subset of results to return (inclusive). (default to 999)

Returns:



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.

Parameters:

  • season

    Numeric year of the event from which the match results are requested. Must be 4 digits.

  • event_code

    Case insensitive alphanumeric eventCode of the event from which the details are requested. Must be at least 3 characters.

  • tournament_level

    Required tournamentLevel of desired score details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :team_number (Integer)

    &#x60;teamNumber&#x60; to search for within the results. Only returns details in which the requested team was a participant.

  • :match_number (Integer)

    specific single &#x60;matchNumber&#x60; of result.

  • :start (Integer)

    &#x60;start&#x60; match number for subset of results to return (inclusive).

  • :_end (Integer)

    &#x60;end&#x60; match number for subset of results to return (inclusive).

Returns:

  • (Array<(MatchScoresModel, Integer, Hash)>)

    MatchScoresModel data, response status code and response headers



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