Class: FtcEventsClient::RankingsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RankingsApi

Returns a new instance of RankingsApi.



16
17
18
# File 'lib/ftc_events_client/api/rankings_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/rankings_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#v20_season_rankings_event_code_get(season, event_code, opts = {}) ⇒ EventRankingsModel

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.

Parameters:

  • season

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

  • event_code

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

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

    the optional parameters

Options Hash (opts):

  • :team_number (Integer)

    Team number of the team whose ranking is requested. (default to 0)

  • :top (Integer)

    number of requested `top` ranked teams to return in result. (default to 0)

Returns:



27
28
29
30
# File 'lib/ftc_events_client/api/rankings_api.rb', line 27

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 = {}) ⇒ Array<(EventRankingsModel, Integer, Hash)>

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.

Parameters:

  • season

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

  • event_code

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

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

    the optional parameters

Options Hash (opts):

  • :team_number (Integer)

    Team number of the team whose ranking is requested.

  • :top (Integer)

    number of requested &#x60;top&#x60; ranked teams to return in result.

Returns:

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

    EventRankingsModel data, response status code and response headers



40
41
42
43
44
45
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
# File 'lib/ftc_events_client/api/rankings_api.rb', line 40

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
  # 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 RankingsApi.v20_season_rankings_event_code_get"
  end
  # resource path
  local_var_path = '/v2.0/{season}/rankings/{eventCode}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', 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[:body] 

  return_type = opts[:return_type] || 'EventRankingsModel' 

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