class FtcEventsClient::SeasonDataApi
Attributes
Public Class Methods
# File lib/ftc_events_client/api/season_data_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Event Listings The event listings API returns all FTC official regional events in a particular season. You can specify an `eventCode` if you would only like data about one specific event. If you specify an `eventCode` you cannot specify any other optional parameters. Alternately, you can specify a `teamNumber` to retrieve only the listings of events being attended by the particular team. If you specify a `teamNumber` you cannot specify an `eventCode`. The response for event listings contains a special field called divisionCode. For example, the FIRST Championship contains two Divisions. As an example of a response, the event listings for a Division will have a divisionCode that matches the FIRST Championship event code (as they are divisions of that event). This allows you to see the full structure of events, and how they relate to each other. @param season [Integer] Numeric year from which the event listings are requested. Must be 4 digits @param [Hash] opts the optional parameters @option opts [String] :event_code Case insensitive alphanumeric `eventCode` of the event about which details are requested. (default to '0') @option opts [Integer] :team_number Numeric `teamNumber` of the team from which the attending event listings are requested. (default to 0) @return [SeasonEventListingsModelVersion2]
# File lib/ftc_events_client/api/season_data_api.rb, line 29 def v20_season_events_get(season, opts = {}) data, _status_code, _headers = v20_season_events_get_with_http_info(season, opts) data end
Event Listings The event listings API returns all FTC official regional events in a particular season. You can specify an `eventCode` if you would only like data about one specific event. If you specify an `eventCode` you cannot specify any other optional parameters. Alternately, you can specify a `teamNumber` to retrieve only the listings of events being attended by the particular team. If you specify a `teamNumber` you cannot specify an `eventCode`. The response for event listings contains a special field called divisionCode. For example, the FIRST Championship contains two Divisions. As an example of a response, the event listings for a Division will have a divisionCode that matches the FIRST Championship event code (as they are divisions of that event). This allows you to see the full structure of events, and how they relate to each other. @param season [Integer] Numeric year from which the event listings are requested. Must be 4 digits @param [Hash] opts the optional parameters @option opts [String] :event_code Case insensitive alphanumeric `eventCode` of the event about which details are requested. @option opts [Integer] :team_number Numeric `teamNumber` of the team from which the attending event listings are requested. @return [Array<(SeasonEventListingsModelVersion2
, Integer, Hash)>] SeasonEventListingsModelVersion2
data, response status code and response headers
# File lib/ftc_events_client/api/season_data_api.rb, line 41 def v20_season_events_get_with_http_info(season, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SeasonDataApi.v20_season_events_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 SeasonDataApi.v20_season_events_get" end # resource path local_var_path = '/v2.0/{season}/events'.sub('{' + 'season' + '}', CGI.escape(season.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'eventCode'] = opts[:'event_code'] if !opts[:'event_code'].nil? query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].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] || 'SeasonEventListingsModelVersion2' # auth_names auth_names = opts[:debug_auth_names] || ['basic'] new_options = opts.merge( :operation => :"SeasonDataApi.v20_season_events_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: SeasonDataApi#v20_season_events_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Season Summary The season summary API returns a high level glance of a particular FTC season. @param season [Integer] Numeric year of the event from which the season summary is requested. Must be 4 digits. @param [Hash] opts the optional parameters @return [SeasonSummaryModelVersion2]
# File lib/ftc_events_client/api/season_data_api.rb, line 96 def v20_season_get(season, opts = {}) data, _status_code, _headers = v20_season_get_with_http_info(season, opts) data end
Season Summary The season summary API returns a high level glance of a particular FTC season. @param season [Integer] Numeric year of the event from which the season summary is requested. Must be 4 digits. @param [Hash] opts the optional parameters @return [Array<(SeasonSummaryModelVersion2
, Integer, Hash)>] SeasonSummaryModelVersion2
data, response status code and response headers
# File lib/ftc_events_client/api/season_data_api.rb, line 106 def v20_season_get_with_http_info(season, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SeasonDataApi.v20_season_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 SeasonDataApi.v20_season_get" end # resource path local_var_path = '/v2.0/{season}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)) # query parameters query_params = opts[:query_params] || {} # 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] || 'SeasonSummaryModelVersion2' # auth_names auth_names = opts[:debug_auth_names] || ['basic'] new_options = opts.merge( :operation => :"SeasonDataApi.v20_season_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: SeasonDataApi#v20_season_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Team Listings The team listings API returns all FTC official teams in a particular season. If specified, the `teamNumber` parameter will return only one result with the details of the requested `teamNumber`. Alternately, the `eventCode` parameter allows sorting of the team list to only those teams attending a particular event in the particular season. If you specify a teamNumber parameter, you cannot additionally specify an `eventCode` and/or `state` in the same request, or you will receive an HTTP 501. If you specify the `state` parameter, it should be the full legal name of the US state or international state/prov, such as New Hampshire or Ontario. Values on this endpoint are "pass through" values from the TIMS registration system. As such, if the team does not specify a value for a field, it may be presented in the API as null. @param season [Integer] Numeric year from which the team listings are requested. Must be 4 digits. @param [Hash] opts the optional parameters @option opts [Integer] :team_number Numeric `teamNumber` of the team about which information is requested. Must be 1 to 5 digits. (default to 0) @option opts [String] :event_code Case insensitive alphanumeric `eventCode` of the event from which details are requested. (default to '0') @option opts [String] :state Full legal name of the US state or international state/prov (default to '') @option opts [Integer] :page Numeric page of results to return. (default to 1) @return [SeasonTeamListingsModelVersion2]
# File lib/ftc_events_client/api/season_data_api.rb, line 163 def v20_season_teams_get(season, opts = {}) data, _status_code, _headers = v20_season_teams_get_with_http_info(season, opts) data end
Team Listings The team listings API returns all FTC official teams in a particular season. If specified, the `teamNumber` parameter will return only one result with the details of the requested `teamNumber`. Alternately, the `eventCode` parameter allows sorting of the team list to only those teams attending a particular event in the particular season. If you specify a teamNumber parameter, you cannot additionally specify an `eventCode` and/or `state` in the same request, or you will receive an HTTP 501. If you specify the `state` parameter, it should be the full legal name of the US state or international state/prov, such as New Hampshire or Ontario. Values on this endpoint are "pass through" values from the TIMS registration system. As such, if the team does not specify a value for a field, it may be presented in the API as null. @param season [Integer] Numeric year from which the team listings are requested. Must be 4 digits. @param [Hash] opts the optional parameters @option opts [Integer] :team_number Numeric `teamNumber` of the team about which information is requested. Must be 1 to 5 digits. @option opts [String] :event_code Case insensitive alphanumeric `eventCode` of the event from which details are requested. @option opts [String] :state Full legal name of the US state or international state/prov @option opts [Integer] :page Numeric page of results to return. @return [Array<(SeasonTeamListingsModelVersion2
, Integer, Hash)>] SeasonTeamListingsModelVersion2
data, response status code and response headers
# File lib/ftc_events_client/api/season_data_api.rb, line 177 def v20_season_teams_get_with_http_info(season, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SeasonDataApi.v20_season_teams_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 SeasonDataApi.v20_season_teams_get" end # resource path local_var_path = '/v2.0/{season}/teams'.sub('{' + 'season' + '}', CGI.escape(season.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil? query_params[:'eventCode'] = opts[:'event_code'] if !opts[:'event_code'].nil? query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].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] || 'SeasonTeamListingsModelVersion2' # auth_names auth_names = opts[:debug_auth_names] || ['basic'] new_options = opts.merge( :operation => :"SeasonDataApi.v20_season_teams_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: SeasonDataApi#v20_season_teams_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end