class FtcEventsClient::RankingsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/ftc_events_client/api/rankings_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

v20_season_rankings_event_code_get(season, event_code, opts = {}) click to toggle source

Event Rankings The rankings API returns team ranking detail from a particular event in a particular season. Optionally, the `top` parameter can be added to the query string to request a subset of the rankings based on the highest ranked teams at the time of the request. Alternately, you can specify the `teamNumber` parameter to retrieve the ranking on one specific team. You cannot specify both a `top` and `teamNumber` in the same call. @param season [Integer] Numeric year of the event from which the rankings are requested. Must be 4 digits @param event_code [String] Case insensitive alphanumeric `eventCode` of the event from which the rankings are requested. Must be at least 3 characters. @param [Hash] opts the optional parameters @option opts [Integer] :team_number Team number of the team whose ranking is requested. (default to 0) @option opts [Integer] :top number of requested `top` ranked teams to return in result. (default to 0) @return [EventRankingsModel]

# File lib/ftc_events_client/api/rankings_api.rb, line 30
def v20_season_rankings_event_code_get(season, event_code, opts = {})
  data, _status_code, _headers = v20_season_rankings_event_code_get_with_http_info(season, event_code, opts)
  data
end
v20_season_rankings_event_code_get_with_http_info(season, event_code, opts = {}) click to toggle source

Event Rankings The rankings API returns team ranking detail from a particular event in a particular season. Optionally, the &#x60;top&#x60; parameter can be added to the query string to request a subset of the rankings based on the highest ranked teams at the time of the request. Alternately, you can specify the &#x60;teamNumber&#x60; parameter to retrieve the ranking on one specific team. You cannot specify both a &#x60;top&#x60; and &#x60;teamNumber&#x60; in the same call. @param season [Integer] Numeric year of the event from which the rankings are requested. Must be 4 digits @param event_code [String] Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the rankings are requested. Must be at least 3 characters. @param [Hash] opts the optional parameters @option opts [Integer] :team_number Team number of the team whose ranking is requested. @option opts [Integer] :top number of requested &#x60;top&#x60; ranked teams to return in result. @return [Array<(EventRankingsModel, Integer, Hash)>] EventRankingsModel data, response status code and response headers

# File lib/ftc_events_client/api/rankings_api.rb, line 43
def v20_season_rankings_event_code_get_with_http_info(season, event_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RankingsApi.v20_season_rankings_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 RankingsApi.v20_season_rankings_event_code_get"
  end
  # resource path
  local_var_path = '/v2.0/{season}/rankings/{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[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil?
  query_params[:'top'] = opts[:'top'] if !opts[:'top'].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] || 'EventRankingsModel'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basic']

  new_options = opts.merge(
    :operation => :"RankingsApi.v20_season_rankings_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: RankingsApi#v20_season_rankings_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end