ftc_events_client 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +236 -0
  4. data/Rakefile +10 -0
  5. data/config.json +8 -0
  6. data/docs/AllianceModelVersion2.md +32 -0
  7. data/docs/AllianceScore2020.md +86 -0
  8. data/docs/AllianceSelectionApi.md +62 -0
  9. data/docs/AllianceSelectionModelVersion2.md +20 -0
  10. data/docs/ApiIndexModel.md +34 -0
  11. data/docs/AwardAssignmentModel.md +38 -0
  12. data/docs/AwardsApi.md +235 -0
  13. data/docs/AwardsModel.md +18 -0
  14. data/docs/EventMatchResultsModelVersion2.md +18 -0
  15. data/docs/EventRankingsModel.md +18 -0
  16. data/docs/EventScheduleHybridModelVersion2.md +18 -0
  17. data/docs/EventScheduleModelVersion2.md +18 -0
  18. data/docs/GeneralApi.md +51 -0
  19. data/docs/MatchResultModelVersion2.md +44 -0
  20. data/docs/MatchResultTeamModelVersion2.md +22 -0
  21. data/docs/MatchResultsApi.md +141 -0
  22. data/docs/MatchScoresModel.md +18 -0
  23. data/docs/MatchScoresModelMatchScoresOneOf.md +51 -0
  24. data/docs/RankingsApi.md +68 -0
  25. data/docs/ScheduleApi.md +135 -0
  26. data/docs/ScheduleHybridModelTeamVersion2.md +26 -0
  27. data/docs/ScheduleHybridModelVersion2.md +44 -0
  28. data/docs/ScheduledMatchModelVersion2.md +32 -0
  29. data/docs/ScheduledMatchTeamModelVersion2.md +24 -0
  30. data/docs/ScoreDetailAllianceModel2020.md +90 -0
  31. data/docs/ScoreDetailModel2019.md +22 -0
  32. data/docs/ScoreDetailModel2020.md +22 -0
  33. data/docs/ScoreDetailModelAlliance2019.md +84 -0
  34. data/docs/ScoreDetailModelSinglePlayer2020.md +24 -0
  35. data/docs/SeasonAwardListingsModel.md +18 -0
  36. data/docs/SeasonAwardsModel.md +24 -0
  37. data/docs/SeasonDataApi.md +182 -0
  38. data/docs/SeasonEventListingsModelVersion2.md +20 -0
  39. data/docs/SeasonEventModelVersion2.md +50 -0
  40. data/docs/SeasonSummaryModelChampionship.md +22 -0
  41. data/docs/SeasonSummaryModelVersion2.md +28 -0
  42. data/docs/SeasonTeamListingsModelVersion2.md +26 -0
  43. data/docs/SeasonTeamModelVersion2.md +40 -0
  44. data/docs/Stone.md +15 -0
  45. data/docs/TeamRankingModel.md +46 -0
  46. data/docs/TournamentLevel.md +15 -0
  47. data/ftc_events_client.gemspec +38 -0
  48. data/git_push.sh +58 -0
  49. data/lib/ftc_events_client.rb +80 -0
  50. data/lib/ftc_events_client/api/alliance_selection_api.rb +87 -0
  51. data/lib/ftc_events_client/api/awards_api.rb +296 -0
  52. data/lib/ftc_events_client/api/general_api.rb +79 -0
  53. data/lib/ftc_events_client/api/match_results_api.rb +185 -0
  54. data/lib/ftc_events_client/api/rankings_api.rb +93 -0
  55. data/lib/ftc_events_client/api/schedule_api.rb +176 -0
  56. data/lib/ftc_events_client/api/season_data_api.rb +229 -0
  57. data/lib/ftc_events_client/api_client.rb +390 -0
  58. data/lib/ftc_events_client/api_error.rb +57 -0
  59. data/lib/ftc_events_client/configuration.rb +275 -0
  60. data/lib/ftc_events_client/models/alliance_model_version2.rb +288 -0
  61. data/lib/ftc_events_client/models/alliance_score2020.rb +524 -0
  62. data/lib/ftc_events_client/models/alliance_selection_model_version2.rb +230 -0
  63. data/lib/ftc_events_client/models/api_index_model.rb +301 -0
  64. data/lib/ftc_events_client/models/award_assignment_model.rb +317 -0
  65. data/lib/ftc_events_client/models/awards_model.rb +221 -0
  66. data/lib/ftc_events_client/models/event_match_results_model_version2.rb +221 -0
  67. data/lib/ftc_events_client/models/event_rankings_model.rb +221 -0
  68. data/lib/ftc_events_client/models/event_schedule_hybrid_model_version2.rb +221 -0
  69. data/lib/ftc_events_client/models/event_schedule_model_version2.rb +221 -0
  70. data/lib/ftc_events_client/models/match_result_model_version2.rb +343 -0
  71. data/lib/ftc_events_client/models/match_result_team_model_version2.rb +237 -0
  72. data/lib/ftc_events_client/models/match_scores_model.rb +221 -0
  73. data/lib/ftc_events_client/models/match_scores_model_match_scores_one_of.rb +106 -0
  74. data/lib/ftc_events_client/models/schedule_hybrid_model_team_version2.rb +257 -0
  75. data/lib/ftc_events_client/models/schedule_hybrid_model_version2.rb +349 -0
  76. data/lib/ftc_events_client/models/scheduled_match_model_version2.rb +289 -0
  77. data/lib/ftc_events_client/models/scheduled_match_team_model_version2.rb +247 -0
  78. data/lib/ftc_events_client/models/score_detail_alliance_model2020.rb +543 -0
  79. data/lib/ftc_events_client/models/score_detail_model2019.rb +239 -0
  80. data/lib/ftc_events_client/models/score_detail_model2020.rb +239 -0
  81. data/lib/ftc_events_client/models/score_detail_model_alliance2019.rb +519 -0
  82. data/lib/ftc_events_client/models/score_detail_model_single_player2020.rb +245 -0
  83. data/lib/ftc_events_client/models/season_award_listings_model.rb +221 -0
  84. data/lib/ftc_events_client/models/season_awards_model.rb +247 -0
  85. data/lib/ftc_events_client/models/season_event_listings_model_version2.rb +230 -0
  86. data/lib/ftc_events_client/models/season_event_model_version2.rb +377 -0
  87. data/lib/ftc_events_client/models/season_summary_model_championship.rb +239 -0
  88. data/lib/ftc_events_client/models/season_summary_model_version2.rb +268 -0
  89. data/lib/ftc_events_client/models/season_team_listings_model_version2.rb +257 -0
  90. data/lib/ftc_events_client/models/season_team_model_version2.rb +328 -0
  91. data/lib/ftc_events_client/models/stone.rb +38 -0
  92. data/lib/ftc_events_client/models/team_ranking_model.rb +344 -0
  93. data/lib/ftc_events_client/models/tournament_level.rb +41 -0
  94. data/lib/ftc_events_client/version.rb +15 -0
  95. data/spec/api/alliance_selection_api_spec.rb +48 -0
  96. data/spec/api/awards_api_spec.rb +89 -0
  97. data/spec/api/general_api_spec.rb +46 -0
  98. data/spec/api/match_results_api_spec.rb +71 -0
  99. data/spec/api/rankings_api_spec.rb +50 -0
  100. data/spec/api/schedule_api_spec.rb +68 -0
  101. data/spec/api/season_data_api_spec.rb +77 -0
  102. data/spec/api_client_spec.rb +226 -0
  103. data/spec/configuration_spec.rb +42 -0
  104. data/spec/models/alliance_model_version2_spec.rb +76 -0
  105. data/spec/models/alliance_score2020_spec.rb +238 -0
  106. data/spec/models/alliance_selection_model_version2_spec.rb +40 -0
  107. data/spec/models/api_index_model_spec.rb +82 -0
  108. data/spec/models/award_assignment_model_spec.rb +94 -0
  109. data/spec/models/awards_model_spec.rb +34 -0
  110. data/spec/models/event_match_results_model_version2_spec.rb +34 -0
  111. data/spec/models/event_rankings_model_spec.rb +34 -0
  112. data/spec/models/event_schedule_hybrid_model_version2_spec.rb +34 -0
  113. data/spec/models/event_schedule_model_version2_spec.rb +34 -0
  114. data/spec/models/match_result_model_version2_spec.rb +112 -0
  115. data/spec/models/match_result_team_model_version2_spec.rb +46 -0
  116. data/spec/models/match_scores_model_match_scores_one_of_spec.rb +31 -0
  117. data/spec/models/match_scores_model_spec.rb +34 -0
  118. data/spec/models/schedule_hybrid_model_team_version2_spec.rb +58 -0
  119. data/spec/models/schedule_hybrid_model_version2_spec.rb +112 -0
  120. data/spec/models/scheduled_match_model_version2_spec.rb +76 -0
  121. data/spec/models/scheduled_match_team_model_version2_spec.rb +52 -0
  122. data/spec/models/score_detail_alliance_model2020_spec.rb +250 -0
  123. data/spec/models/score_detail_model2019_spec.rb +46 -0
  124. data/spec/models/score_detail_model2020_spec.rb +46 -0
  125. data/spec/models/score_detail_model_alliance2019_spec.rb +232 -0
  126. data/spec/models/score_detail_model_single_player2020_spec.rb +52 -0
  127. data/spec/models/season_award_listings_model_spec.rb +34 -0
  128. data/spec/models/season_awards_model_spec.rb +52 -0
  129. data/spec/models/season_event_listings_model_version2_spec.rb +40 -0
  130. data/spec/models/season_event_model_version2_spec.rb +130 -0
  131. data/spec/models/season_summary_model_championship_spec.rb +46 -0
  132. data/spec/models/season_summary_model_version2_spec.rb +64 -0
  133. data/spec/models/season_team_listings_model_version2_spec.rb +58 -0
  134. data/spec/models/season_team_model_version2_spec.rb +100 -0
  135. data/spec/models/stone_spec.rb +28 -0
  136. data/spec/models/team_ranking_model_spec.rb +118 -0
  137. data/spec/models/tournament_level_spec.rb +28 -0
  138. data/spec/spec_helper.rb +111 -0
  139. data/update.sh +8 -0
  140. metadata +265 -0
@@ -0,0 +1,87 @@
1
+ =begin
2
+ #FTC Events API
3
+
4
+ #FTC Events API is a service to return relevant information about the _FIRST_ Tech Challenge (FTC). Information is made available from events operating around the world Information is currently made available after the conclusion of the tournament. The API will provide data as soon as it has synced, and we do not add any artificial delays. ## Documentation Notes ### Timezones All times are listed in the local time to the event venue. HTTP-date values will show their timezone. ### Query Parameters If you specify a parameter, but no value for that parameter, it will be ignored. For example, if you request `URL?teamNumber=` the `teamNumber` parameter would be ignored. For all APIs that accept a query string in addition to the base URI, the order of parameters do not matter, but the name shown in the documentation must match exactly, as does the associated value format as described in details. For response codes that are not HTTP 200 (OK), the documentation will show a body message that represents a possible response value. While the \"title\" of the HTTP Status Code will match those shown in the response codes documentation section exactly, the body of the response will be a more detailed explanation of why that status code is being returned and may not always be exactly as shown in the examples. ### Experimenting with the API This documentation is rendered at both [api-docs](https://ftc-events.firstinspires.org/api-docs) and [try-it-out](https://ftc-events.firstinspires.org/try-it-out). [api-docs](https://ftc-events.firstinspires.org/api-docs) has a three panel, easy to read layout, while [try-it-out](https://ftc-events.firstinspires.org/try-it-out) has a feature that allows you try out endpoints from within the page. Additionally, the Open API Json is availabe at [Open API](https://ftc-events.firstinspires.org/swagger/v2.0/swagger.json). This can be imported into a tool such as [Postman](https://www.postman.com) for experimentation as well. ### Last-Modified, FMS-OnlyModifiedSince, and If-Modified-Since Headers The FTC Events API utilizes the `Last-Modified` and `If-Modified-Since` Headers to communicate with consumers regarding the age of the data they are requesting. With a couple of exceptions, all calls will return a `Last-Modified` Header set with the time at which the data at that endpoint was last modified. The Header will always be set in the HTTP-date format, as described in the HTTP Protocol. There are two exceptions: the `Last-Modified` Header is not set if the endpoint returns no results (such as a request for a schedule with no matches). Consumers should keep track of the `Last-Modified` Header, and return it on subsequent calls to the same endpoint as the If-Modified-Since. The server will recognize this request, and will only return a result if the data has been modified since the last request. If no changes have been made, an HTTP 304 will be returned. If data has been modified, ALL data on that call will be returned (for \"only modified\" data, see below). The FTC Events API also allows a custom header used to filter the return data to a specific subset. This is done by specifying a `FMS-OnlyModifiedSince` header with each call. As with the `If-Modified-Since` header, consumers should keep track of the Last-Modified Header, and return it on subsequent calls to the same endpoint as the `FMS-OnlyModifiedSince` Header. The server will recognize this request, and will only return a result if the data has been modified since the last request, and, if returned, the data will only be those portions modified since the included date. If no changes, have been made, an HTTP 304 will be returned. Using this method, the server and consumer save processing time by only receiving modified data that is in need of update on the consumer side. If the Headers are improperly passed (such as the wrong Day of Week for the matching date, or a date in the future), the endpoint will simply ignore the Header and return all results. If both headers are specified, the request will be denied. ## Response Codes The FTC Events API HTTP Status Codes correspond with the [common codes](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html), but occasionally with different \"titles\". The \"title\" used by the API is shown next to each of the below possible response HTTP Status Codes. Throughout the documentation, Apiary may automatically show the common \"title\" in example returns (like \"Not Found\" for 404) but on the production server, the \"title\" will instead match those listed below. ### HTTP 200 - \"OK\" The request has succeeded. An entity corresponding to the requested resource is sent in the response. This will be returned as the HTTP Status Code for all request that succeed, even if the body is empty (such as an event that has no rankings, but with a valid season and event code were used) ### HTTP 304 - \"Not Modified\" When utilizing a Header that allows filtered data returns, such as `If-Modified-Since`, this response indicates that no data meets the request. ### HTTP 400 - \"Invalid Season Requested\"/\"Malformed Parameter Format In Request\"/\"Missing Parameter In Request\"/\"Invalid API Version Requested\": The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. Specifically for this API, a 400 response indicates that the requested URI matches with a valid API, but one or more required parameter was malformed or invalid. Examples include an event code that is too short or team number that contains a letter. ### HTTP 401 - \"Unauthorized\" All requests against the API require authentication via a valid user token. Failing to provide one, or providing an invalid one, will warrant a 401 response. The client MAY repeat the request with a suitable Authorization header field. ### HTTP 404 - \"Invalid Event Requested\" Even though the 404 code usually indicates any not found status, a 404 will only be issued in this API when an event cannot be found for the requested season and event code. If the request didn't match a valid API or there were malformed parameters, the response would not receive a 404 but rather a 400 or 501. If this HTTP code is received, the season was a valid season and the event code matched the acceptable style of an event code, but there were no records of an event matching the combination of that season and event code. For example, HTTP 404 would be issued when the event had a different code in the requested season (the codes can change year to year based on event location). ### HTTP 500 - \"Internal Server Error\" The server encountered an unexpected condition which prevented it from fulfilling the request. This is a code sent directly by the server, and has no special alternate definition specific to this API. ### HTTP 501 - \"Request Did Not Match Any Current API Pattern\" The server does not support the functionality required to fulfill the request. Specifically, the request pattern did not match any of the possible APIs, and thus processing was discontinued. This code is also issued when too many optional parameters were included in a single request and fulfilling it would make the result confusing or misleading. Each API will specify which parameters or combination of parameters can be used at the same time. ### HTTP 503 - \"Service Unavailable\" The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a `Retry-After` header. This code will not always appear, sometimes the server may outright refuse the connection instead. This is a code sent directly by the server, and has no special alternate definition specific to this API. ## Authorization In order to make calls against the FTC Events API, you must include an HTTP Header called `Authorization` with the value set as specified below. If a request is made without this header, processing stops and an HTTP 401 is issued. All `Authorization` headers follow the same format: ``` Authorization: Basic 000000000000000000000000000000000000000000000000000000000000 ``` Where the Zeros are replaced by your Token. The Token can be formed by taking your username and your AuthorizationKey and adding a colon. For example, if your username is `sampleuser` and your AuthorizationKey is `7eaa6338-a097-4221-ac04-b6120fcc4d49` you would have this string: ``` sampleuser:7eaa6338-a097-4221-ac04-b6120fcc4d49 ``` This string must then be encoded using Base64 Encoded to form the Token, which will be the same length as the example above, but include letters and numbers. For our example, we would have: ``` c2FtcGxldXNlcjo3ZWFhNjMzOC1hMDk3LTQyMjEtYWMwNC1iNjEyMGZjYzRkNDk= ``` Most API client libraries can handle computing the authorization header using a username and password for you NOTICE: Publicly distributing an application, code snippet, etc, that has your username and token in it, encoded or not, WILL result in your token being blocked from the API. Each user should apply for their own token. If you wish to acquire a token for your development, you may do so by requesting a token through our automated system on this website.
5
+
6
+ The version of the OpenAPI document: v2.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module FtcEventsClient
16
+ class AllianceSelectionApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Event Alliances
23
+ # The alliances API returns details about alliance selection at a particular event in a particular season.
24
+ # @param season [Integer] Numeric year of the event from which the event alliances are requested. Must be 4 digits.
25
+ # @param event_code [String] Case insensitive alphanumeric `eventCode` of the event from which the alliance selection results are requested. Must be at least 3 characters.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [AllianceSelectionModelVersion2]
28
+ def v20_season_alliances_event_code_get(season, event_code, opts = {})
29
+ data, _status_code, _headers = v20_season_alliances_event_code_get_with_http_info(season, event_code, opts)
30
+ data
31
+ end
32
+
33
+ # Event Alliances
34
+ # The alliances API returns details about alliance selection at a particular event in a particular season.
35
+ # @param season [Integer] Numeric year of the event from which the event alliances are requested. Must be 4 digits.
36
+ # @param event_code [String] Case insensitive alphanumeric `eventCode` of the event from which the alliance selection results are requested. Must be at least 3 characters.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(AllianceSelectionModelVersion2, Integer, Hash)>] AllianceSelectionModelVersion2 data, response status code and response headers
39
+ def v20_season_alliances_event_code_get_with_http_info(season, event_code, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: AllianceSelectionApi.v20_season_alliances_event_code_get ...'
42
+ end
43
+ # verify the required parameter 'season' is set
44
+ if @api_client.config.client_side_validation && season.nil?
45
+ fail ArgumentError, "Missing the required parameter 'season' when calling AllianceSelectionApi.v20_season_alliances_event_code_get"
46
+ end
47
+ # resource path
48
+ local_var_path = '/v2.0/{season}/alliances/{eventCode}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s))
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:debug_body]
63
+
64
+ # return_type
65
+ return_type = opts[:debug_return_type] || 'AllianceSelectionModelVersion2'
66
+
67
+ # auth_names
68
+ auth_names = opts[:debug_auth_names] || ['basic']
69
+
70
+ new_options = opts.merge(
71
+ :operation => :"AllianceSelectionApi.v20_season_alliances_event_code_get",
72
+ :header_params => header_params,
73
+ :query_params => query_params,
74
+ :form_params => form_params,
75
+ :body => post_body,
76
+ :auth_names => auth_names,
77
+ :return_type => return_type
78
+ )
79
+
80
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
81
+ if @api_client.config.debugging
82
+ @api_client.config.logger.debug "API called: AllianceSelectionApi#v20_season_alliances_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
+ end
84
+ return data, status_code, headers
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,296 @@
1
+ =begin
2
+ #FTC Events API
3
+
4
+ #FTC Events API is a service to return relevant information about the _FIRST_ Tech Challenge (FTC). Information is made available from events operating around the world Information is currently made available after the conclusion of the tournament. The API will provide data as soon as it has synced, and we do not add any artificial delays. ## Documentation Notes ### Timezones All times are listed in the local time to the event venue. HTTP-date values will show their timezone. ### Query Parameters If you specify a parameter, but no value for that parameter, it will be ignored. For example, if you request `URL?teamNumber=` the `teamNumber` parameter would be ignored. For all APIs that accept a query string in addition to the base URI, the order of parameters do not matter, but the name shown in the documentation must match exactly, as does the associated value format as described in details. For response codes that are not HTTP 200 (OK), the documentation will show a body message that represents a possible response value. While the \"title\" of the HTTP Status Code will match those shown in the response codes documentation section exactly, the body of the response will be a more detailed explanation of why that status code is being returned and may not always be exactly as shown in the examples. ### Experimenting with the API This documentation is rendered at both [api-docs](https://ftc-events.firstinspires.org/api-docs) and [try-it-out](https://ftc-events.firstinspires.org/try-it-out). [api-docs](https://ftc-events.firstinspires.org/api-docs) has a three panel, easy to read layout, while [try-it-out](https://ftc-events.firstinspires.org/try-it-out) has a feature that allows you try out endpoints from within the page. Additionally, the Open API Json is availabe at [Open API](https://ftc-events.firstinspires.org/swagger/v2.0/swagger.json). This can be imported into a tool such as [Postman](https://www.postman.com) for experimentation as well. ### Last-Modified, FMS-OnlyModifiedSince, and If-Modified-Since Headers The FTC Events API utilizes the `Last-Modified` and `If-Modified-Since` Headers to communicate with consumers regarding the age of the data they are requesting. With a couple of exceptions, all calls will return a `Last-Modified` Header set with the time at which the data at that endpoint was last modified. The Header will always be set in the HTTP-date format, as described in the HTTP Protocol. There are two exceptions: the `Last-Modified` Header is not set if the endpoint returns no results (such as a request for a schedule with no matches). Consumers should keep track of the `Last-Modified` Header, and return it on subsequent calls to the same endpoint as the If-Modified-Since. The server will recognize this request, and will only return a result if the data has been modified since the last request. If no changes have been made, an HTTP 304 will be returned. If data has been modified, ALL data on that call will be returned (for \"only modified\" data, see below). The FTC Events API also allows a custom header used to filter the return data to a specific subset. This is done by specifying a `FMS-OnlyModifiedSince` header with each call. As with the `If-Modified-Since` header, consumers should keep track of the Last-Modified Header, and return it on subsequent calls to the same endpoint as the `FMS-OnlyModifiedSince` Header. The server will recognize this request, and will only return a result if the data has been modified since the last request, and, if returned, the data will only be those portions modified since the included date. If no changes, have been made, an HTTP 304 will be returned. Using this method, the server and consumer save processing time by only receiving modified data that is in need of update on the consumer side. If the Headers are improperly passed (such as the wrong Day of Week for the matching date, or a date in the future), the endpoint will simply ignore the Header and return all results. If both headers are specified, the request will be denied. ## Response Codes The FTC Events API HTTP Status Codes correspond with the [common codes](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html), but occasionally with different \"titles\". The \"title\" used by the API is shown next to each of the below possible response HTTP Status Codes. Throughout the documentation, Apiary may automatically show the common \"title\" in example returns (like \"Not Found\" for 404) but on the production server, the \"title\" will instead match those listed below. ### HTTP 200 - \"OK\" The request has succeeded. An entity corresponding to the requested resource is sent in the response. This will be returned as the HTTP Status Code for all request that succeed, even if the body is empty (such as an event that has no rankings, but with a valid season and event code were used) ### HTTP 304 - \"Not Modified\" When utilizing a Header that allows filtered data returns, such as `If-Modified-Since`, this response indicates that no data meets the request. ### HTTP 400 - \"Invalid Season Requested\"/\"Malformed Parameter Format In Request\"/\"Missing Parameter In Request\"/\"Invalid API Version Requested\": The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. Specifically for this API, a 400 response indicates that the requested URI matches with a valid API, but one or more required parameter was malformed or invalid. Examples include an event code that is too short or team number that contains a letter. ### HTTP 401 - \"Unauthorized\" All requests against the API require authentication via a valid user token. Failing to provide one, or providing an invalid one, will warrant a 401 response. The client MAY repeat the request with a suitable Authorization header field. ### HTTP 404 - \"Invalid Event Requested\" Even though the 404 code usually indicates any not found status, a 404 will only be issued in this API when an event cannot be found for the requested season and event code. If the request didn't match a valid API or there were malformed parameters, the response would not receive a 404 but rather a 400 or 501. If this HTTP code is received, the season was a valid season and the event code matched the acceptable style of an event code, but there were no records of an event matching the combination of that season and event code. For example, HTTP 404 would be issued when the event had a different code in the requested season (the codes can change year to year based on event location). ### HTTP 500 - \"Internal Server Error\" The server encountered an unexpected condition which prevented it from fulfilling the request. This is a code sent directly by the server, and has no special alternate definition specific to this API. ### HTTP 501 - \"Request Did Not Match Any Current API Pattern\" The server does not support the functionality required to fulfill the request. Specifically, the request pattern did not match any of the possible APIs, and thus processing was discontinued. This code is also issued when too many optional parameters were included in a single request and fulfilling it would make the result confusing or misleading. Each API will specify which parameters or combination of parameters can be used at the same time. ### HTTP 503 - \"Service Unavailable\" The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a `Retry-After` header. This code will not always appear, sometimes the server may outright refuse the connection instead. This is a code sent directly by the server, and has no special alternate definition specific to this API. ## Authorization In order to make calls against the FTC Events API, you must include an HTTP Header called `Authorization` with the value set as specified below. If a request is made without this header, processing stops and an HTTP 401 is issued. All `Authorization` headers follow the same format: ``` Authorization: Basic 000000000000000000000000000000000000000000000000000000000000 ``` Where the Zeros are replaced by your Token. The Token can be formed by taking your username and your AuthorizationKey and adding a colon. For example, if your username is `sampleuser` and your AuthorizationKey is `7eaa6338-a097-4221-ac04-b6120fcc4d49` you would have this string: ``` sampleuser:7eaa6338-a097-4221-ac04-b6120fcc4d49 ``` This string must then be encoded using Base64 Encoded to form the Token, which will be the same length as the example above, but include letters and numbers. For our example, we would have: ``` c2FtcGxldXNlcjo3ZWFhNjMzOC1hMDk3LTQyMjEtYWMwNC1iNjEyMGZjYzRkNDk= ``` Most API client libraries can handle computing the authorization header using a username and password for you NOTICE: Publicly distributing an application, code snippet, etc, that has your username and token in it, encoded or not, WILL result in your token being blocked from the API. Each user should apply for their own token. If you wish to acquire a token for your development, you may do so by requesting a token through our automated system on this website.
5
+
6
+ The version of the OpenAPI document: v2.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module FtcEventsClient
16
+ class AwardsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Event Awards
23
+ # The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either `teamNumber` or `person` values, and if the winner was a `person`, and that person is from a team, the `teamNumber` value *might* be set with their `teamNumber`. You must specify either an `eventCode` or a `teamNumber` or both. If you specify the `teamNumber` parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the `person` field is `null` or empty. If you specify only the `eventCode` field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the `teamNumber` at the `eventCode`.
24
+ # @param season [Integer] Numeric year of the event from which the award listings are requested. Must be 4 digits
25
+ # @param event_code [String] Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [Integer] :team_number &#x60;teamNumber&#x60; to search for within the results. (default to 0)
28
+ # @return [AwardsModel]
29
+ def v20_season_awards_event_code_get(season, event_code, opts = {})
30
+ data, _status_code, _headers = v20_season_awards_event_code_get_with_http_info(season, event_code, opts)
31
+ data
32
+ end
33
+
34
+ # Event Awards
35
+ # The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either &#x60;teamNumber&#x60; or &#x60;person&#x60; values, and if the winner was a &#x60;person&#x60;, and that person is from a team, the &#x60;teamNumber&#x60; value *might* be set with their &#x60;teamNumber&#x60;. You must specify either an &#x60;eventCode&#x60; or a &#x60;teamNumber&#x60; or both. If you specify the &#x60;teamNumber&#x60; parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the &#x60;person&#x60; field is &#x60;null&#x60; or empty. If you specify only the &#x60;eventCode&#x60; field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the &#x60;teamNumber&#x60; at the &#x60;eventCode&#x60;.
36
+ # @param season [Integer] Numeric year of the event from which the award listings are requested. Must be 4 digits
37
+ # @param event_code [String] Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [Integer] :team_number &#x60;teamNumber&#x60; to search for within the results.
40
+ # @return [Array<(AwardsModel, Integer, Hash)>] AwardsModel data, response status code and response headers
41
+ def v20_season_awards_event_code_get_with_http_info(season, event_code, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: AwardsApi.v20_season_awards_event_code_get ...'
44
+ end
45
+ # verify the required parameter 'season' is set
46
+ if @api_client.config.client_side_validation && season.nil?
47
+ fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_event_code_get"
48
+ end
49
+ # resource path
50
+ local_var_path = '/v2.0/{season}/awards/{eventCode}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+ query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil?
55
+
56
+ # header parameters
57
+ header_params = opts[:header_params] || {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body]
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'AwardsModel'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['basic']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"AwardsApi.v20_season_awards_event_code_get",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Event Awards
91
+ # The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either `teamNumber` or `person` values, and if the winner was a `person`, and that person is from a team, the `teamNumber` value *might* be set with their `teamNumber`. You must specify either an `eventCode` or a `teamNumber` or both. If you specify the `teamNumber` parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the `person` field is `null` or empty. If you specify only the `eventCode` field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the `teamNumber` at the `eventCode`.
92
+ # @param season [Integer] Numeric year of the event from which the award listings are requested. Must be 4 digits
93
+ # @param event_code [String] Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.
94
+ # @param team_number [Integer] &#x60;teamNumber&#x60; to search for within the results.
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [AwardsModel]
97
+ def v20_season_awards_event_code_team_number_get(season, event_code, team_number, opts = {})
98
+ data, _status_code, _headers = v20_season_awards_event_code_team_number_get_with_http_info(season, event_code, team_number, opts)
99
+ data
100
+ end
101
+
102
+ # Event Awards
103
+ # The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either &#x60;teamNumber&#x60; or &#x60;person&#x60; values, and if the winner was a &#x60;person&#x60;, and that person is from a team, the &#x60;teamNumber&#x60; value *might* be set with their &#x60;teamNumber&#x60;. You must specify either an &#x60;eventCode&#x60; or a &#x60;teamNumber&#x60; or both. If you specify the &#x60;teamNumber&#x60; parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the &#x60;person&#x60; field is &#x60;null&#x60; or empty. If you specify only the &#x60;eventCode&#x60; field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the &#x60;teamNumber&#x60; at the &#x60;eventCode&#x60;.
104
+ # @param season [Integer] Numeric year of the event from which the award listings are requested. Must be 4 digits
105
+ # @param event_code [String] Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.
106
+ # @param team_number [Integer] &#x60;teamNumber&#x60; to search for within the results.
107
+ # @param [Hash] opts the optional parameters
108
+ # @return [Array<(AwardsModel, Integer, Hash)>] AwardsModel data, response status code and response headers
109
+ def v20_season_awards_event_code_team_number_get_with_http_info(season, event_code, team_number, opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: AwardsApi.v20_season_awards_event_code_team_number_get ...'
112
+ end
113
+ # verify the required parameter 'season' is set
114
+ if @api_client.config.client_side_validation && season.nil?
115
+ fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_event_code_team_number_get"
116
+ end
117
+ # verify the required parameter 'team_number' is set
118
+ if @api_client.config.client_side_validation && team_number.nil?
119
+ fail ArgumentError, "Missing the required parameter 'team_number' when calling AwardsApi.v20_season_awards_event_code_team_number_get"
120
+ end
121
+ # resource path
122
+ local_var_path = '/v2.0/{season}/awards/{eventCode}/{teamNumber}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s)).sub('{' + 'teamNumber' + '}', CGI.escape(team_number.to_s))
123
+
124
+ # query parameters
125
+ query_params = opts[:query_params] || {}
126
+
127
+ # header parameters
128
+ header_params = opts[:header_params] || {}
129
+ # HTTP header 'Accept' (if needed)
130
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
131
+
132
+ # form parameters
133
+ form_params = opts[:form_params] || {}
134
+
135
+ # http body (model)
136
+ post_body = opts[:debug_body]
137
+
138
+ # return_type
139
+ return_type = opts[:debug_return_type] || 'AwardsModel'
140
+
141
+ # auth_names
142
+ auth_names = opts[:debug_auth_names] || ['basic']
143
+
144
+ new_options = opts.merge(
145
+ :operation => :"AwardsApi.v20_season_awards_event_code_team_number_get",
146
+ :header_params => header_params,
147
+ :query_params => query_params,
148
+ :form_params => form_params,
149
+ :body => post_body,
150
+ :auth_names => auth_names,
151
+ :return_type => return_type
152
+ )
153
+
154
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_event_code_team_number_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
157
+ end
158
+ return data, status_code, headers
159
+ end
160
+
161
+ # Award Listings
162
+ # The award listings API returns a listing of the various awards that can be distributed in the requested season. This is especially useful in order to avoid having to use the name field of the event awards API to know which award was won. Instead the awardId field can be matched between the two APIs.
163
+ # @param season [Integer] Numeric year of the event from which the award listings are requested. Must be 4 digits
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [SeasonAwardListingsModel]
166
+ def v20_season_awards_list_get(season, opts = {})
167
+ data, _status_code, _headers = v20_season_awards_list_get_with_http_info(season, opts)
168
+ data
169
+ end
170
+
171
+ # Award Listings
172
+ # The award listings API returns a listing of the various awards that can be distributed in the requested season. This is especially useful in order to avoid having to use the name field of the event awards API to know which award was won. Instead the awardId field can be matched between the two APIs.
173
+ # @param season [Integer] Numeric year of the event from which the award listings are requested. Must be 4 digits
174
+ # @param [Hash] opts the optional parameters
175
+ # @return [Array<(SeasonAwardListingsModel, Integer, Hash)>] SeasonAwardListingsModel data, response status code and response headers
176
+ def v20_season_awards_list_get_with_http_info(season, opts = {})
177
+ if @api_client.config.debugging
178
+ @api_client.config.logger.debug 'Calling API: AwardsApi.v20_season_awards_list_get ...'
179
+ end
180
+ # verify the required parameter 'season' is set
181
+ if @api_client.config.client_side_validation && season.nil?
182
+ fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_list_get"
183
+ end
184
+ # resource path
185
+ local_var_path = '/v2.0/{season}/awards/list'.sub('{' + 'season' + '}', CGI.escape(season.to_s))
186
+
187
+ # query parameters
188
+ query_params = opts[:query_params] || {}
189
+
190
+ # header parameters
191
+ header_params = opts[:header_params] || {}
192
+ # HTTP header 'Accept' (if needed)
193
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
194
+
195
+ # form parameters
196
+ form_params = opts[:form_params] || {}
197
+
198
+ # http body (model)
199
+ post_body = opts[:debug_body]
200
+
201
+ # return_type
202
+ return_type = opts[:debug_return_type] || 'SeasonAwardListingsModel'
203
+
204
+ # auth_names
205
+ auth_names = opts[:debug_auth_names] || ['basic']
206
+
207
+ new_options = opts.merge(
208
+ :operation => :"AwardsApi.v20_season_awards_list_get",
209
+ :header_params => header_params,
210
+ :query_params => query_params,
211
+ :form_params => form_params,
212
+ :body => post_body,
213
+ :auth_names => auth_names,
214
+ :return_type => return_type
215
+ )
216
+
217
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
218
+ if @api_client.config.debugging
219
+ @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_list_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
220
+ end
221
+ return data, status_code, headers
222
+ end
223
+
224
+ # Event Awards
225
+ # The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either `teamNumber` or `person` values, and if the winner was a `person`, and that person is from a team, the `teamNumber` value *might* be set with their `teamNumber`. You must specify either an `eventCode` or a `teamNumber` or both. If you specify the `teamNumber` parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the `person` field is `null` or empty. If you specify only the `eventCode` field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the `teamNumber` at the `eventCode`.
226
+ # @param season [Integer] Numeric year of the event from which the award listings are requested. Must be 4 digits
227
+ # @param team_number [Integer] &#x60;teamNumber&#x60; to search for within the results.
228
+ # @param [Hash] opts the optional parameters
229
+ # @option opts [String] :event_code Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested. (default to '')
230
+ # @return [AwardsModel]
231
+ def v20_season_awards_team_number_get(season, team_number, opts = {})
232
+ data, _status_code, _headers = v20_season_awards_team_number_get_with_http_info(season, team_number, opts)
233
+ data
234
+ end
235
+
236
+ # Event Awards
237
+ # The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either &#x60;teamNumber&#x60; or &#x60;person&#x60; values, and if the winner was a &#x60;person&#x60;, and that person is from a team, the &#x60;teamNumber&#x60; value *might* be set with their &#x60;teamNumber&#x60;. You must specify either an &#x60;eventCode&#x60; or a &#x60;teamNumber&#x60; or both. If you specify the &#x60;teamNumber&#x60; parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the &#x60;person&#x60; field is &#x60;null&#x60; or empty. If you specify only the &#x60;eventCode&#x60; field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the &#x60;teamNumber&#x60; at the &#x60;eventCode&#x60;.
238
+ # @param season [Integer] Numeric year of the event from which the award listings are requested. Must be 4 digits
239
+ # @param team_number [Integer] &#x60;teamNumber&#x60; to search for within the results.
240
+ # @param [Hash] opts the optional parameters
241
+ # @option opts [String] :event_code Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.
242
+ # @return [Array<(AwardsModel, Integer, Hash)>] AwardsModel data, response status code and response headers
243
+ def v20_season_awards_team_number_get_with_http_info(season, team_number, opts = {})
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug 'Calling API: AwardsApi.v20_season_awards_team_number_get ...'
246
+ end
247
+ # verify the required parameter 'season' is set
248
+ if @api_client.config.client_side_validation && season.nil?
249
+ fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_team_number_get"
250
+ end
251
+ # verify the required parameter 'team_number' is set
252
+ if @api_client.config.client_side_validation && team_number.nil?
253
+ fail ArgumentError, "Missing the required parameter 'team_number' when calling AwardsApi.v20_season_awards_team_number_get"
254
+ end
255
+ # resource path
256
+ local_var_path = '/v2.0/{season}/awards/{teamNumber}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'teamNumber' + '}', CGI.escape(team_number.to_s))
257
+
258
+ # query parameters
259
+ query_params = opts[:query_params] || {}
260
+ query_params[:'eventCode'] = opts[:'event_code'] if !opts[:'event_code'].nil?
261
+
262
+ # header parameters
263
+ header_params = opts[:header_params] || {}
264
+ # HTTP header 'Accept' (if needed)
265
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
266
+
267
+ # form parameters
268
+ form_params = opts[:form_params] || {}
269
+
270
+ # http body (model)
271
+ post_body = opts[:debug_body]
272
+
273
+ # return_type
274
+ return_type = opts[:debug_return_type] || 'AwardsModel'
275
+
276
+ # auth_names
277
+ auth_names = opts[:debug_auth_names] || ['basic']
278
+
279
+ new_options = opts.merge(
280
+ :operation => :"AwardsApi.v20_season_awards_team_number_get",
281
+ :header_params => header_params,
282
+ :query_params => query_params,
283
+ :form_params => form_params,
284
+ :body => post_body,
285
+ :auth_names => auth_names,
286
+ :return_type => return_type
287
+ )
288
+
289
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
290
+ if @api_client.config.debugging
291
+ @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_team_number_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
292
+ end
293
+ return data, status_code, headers
294
+ end
295
+ end
296
+ end
@@ -0,0 +1,79 @@
1
+ =begin
2
+ #FTC Events API
3
+
4
+ #FTC Events API is a service to return relevant information about the _FIRST_ Tech Challenge (FTC). Information is made available from events operating around the world Information is currently made available after the conclusion of the tournament. The API will provide data as soon as it has synced, and we do not add any artificial delays. ## Documentation Notes ### Timezones All times are listed in the local time to the event venue. HTTP-date values will show their timezone. ### Query Parameters If you specify a parameter, but no value for that parameter, it will be ignored. For example, if you request `URL?teamNumber=` the `teamNumber` parameter would be ignored. For all APIs that accept a query string in addition to the base URI, the order of parameters do not matter, but the name shown in the documentation must match exactly, as does the associated value format as described in details. For response codes that are not HTTP 200 (OK), the documentation will show a body message that represents a possible response value. While the \"title\" of the HTTP Status Code will match those shown in the response codes documentation section exactly, the body of the response will be a more detailed explanation of why that status code is being returned and may not always be exactly as shown in the examples. ### Experimenting with the API This documentation is rendered at both [api-docs](https://ftc-events.firstinspires.org/api-docs) and [try-it-out](https://ftc-events.firstinspires.org/try-it-out). [api-docs](https://ftc-events.firstinspires.org/api-docs) has a three panel, easy to read layout, while [try-it-out](https://ftc-events.firstinspires.org/try-it-out) has a feature that allows you try out endpoints from within the page. Additionally, the Open API Json is availabe at [Open API](https://ftc-events.firstinspires.org/swagger/v2.0/swagger.json). This can be imported into a tool such as [Postman](https://www.postman.com) for experimentation as well. ### Last-Modified, FMS-OnlyModifiedSince, and If-Modified-Since Headers The FTC Events API utilizes the `Last-Modified` and `If-Modified-Since` Headers to communicate with consumers regarding the age of the data they are requesting. With a couple of exceptions, all calls will return a `Last-Modified` Header set with the time at which the data at that endpoint was last modified. The Header will always be set in the HTTP-date format, as described in the HTTP Protocol. There are two exceptions: the `Last-Modified` Header is not set if the endpoint returns no results (such as a request for a schedule with no matches). Consumers should keep track of the `Last-Modified` Header, and return it on subsequent calls to the same endpoint as the If-Modified-Since. The server will recognize this request, and will only return a result if the data has been modified since the last request. If no changes have been made, an HTTP 304 will be returned. If data has been modified, ALL data on that call will be returned (for \"only modified\" data, see below). The FTC Events API also allows a custom header used to filter the return data to a specific subset. This is done by specifying a `FMS-OnlyModifiedSince` header with each call. As with the `If-Modified-Since` header, consumers should keep track of the Last-Modified Header, and return it on subsequent calls to the same endpoint as the `FMS-OnlyModifiedSince` Header. The server will recognize this request, and will only return a result if the data has been modified since the last request, and, if returned, the data will only be those portions modified since the included date. If no changes, have been made, an HTTP 304 will be returned. Using this method, the server and consumer save processing time by only receiving modified data that is in need of update on the consumer side. If the Headers are improperly passed (such as the wrong Day of Week for the matching date, or a date in the future), the endpoint will simply ignore the Header and return all results. If both headers are specified, the request will be denied. ## Response Codes The FTC Events API HTTP Status Codes correspond with the [common codes](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html), but occasionally with different \"titles\". The \"title\" used by the API is shown next to each of the below possible response HTTP Status Codes. Throughout the documentation, Apiary may automatically show the common \"title\" in example returns (like \"Not Found\" for 404) but on the production server, the \"title\" will instead match those listed below. ### HTTP 200 - \"OK\" The request has succeeded. An entity corresponding to the requested resource is sent in the response. This will be returned as the HTTP Status Code for all request that succeed, even if the body is empty (such as an event that has no rankings, but with a valid season and event code were used) ### HTTP 304 - \"Not Modified\" When utilizing a Header that allows filtered data returns, such as `If-Modified-Since`, this response indicates that no data meets the request. ### HTTP 400 - \"Invalid Season Requested\"/\"Malformed Parameter Format In Request\"/\"Missing Parameter In Request\"/\"Invalid API Version Requested\": The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. Specifically for this API, a 400 response indicates that the requested URI matches with a valid API, but one or more required parameter was malformed or invalid. Examples include an event code that is too short or team number that contains a letter. ### HTTP 401 - \"Unauthorized\" All requests against the API require authentication via a valid user token. Failing to provide one, or providing an invalid one, will warrant a 401 response. The client MAY repeat the request with a suitable Authorization header field. ### HTTP 404 - \"Invalid Event Requested\" Even though the 404 code usually indicates any not found status, a 404 will only be issued in this API when an event cannot be found for the requested season and event code. If the request didn't match a valid API or there were malformed parameters, the response would not receive a 404 but rather a 400 or 501. If this HTTP code is received, the season was a valid season and the event code matched the acceptable style of an event code, but there were no records of an event matching the combination of that season and event code. For example, HTTP 404 would be issued when the event had a different code in the requested season (the codes can change year to year based on event location). ### HTTP 500 - \"Internal Server Error\" The server encountered an unexpected condition which prevented it from fulfilling the request. This is a code sent directly by the server, and has no special alternate definition specific to this API. ### HTTP 501 - \"Request Did Not Match Any Current API Pattern\" The server does not support the functionality required to fulfill the request. Specifically, the request pattern did not match any of the possible APIs, and thus processing was discontinued. This code is also issued when too many optional parameters were included in a single request and fulfilling it would make the result confusing or misleading. Each API will specify which parameters or combination of parameters can be used at the same time. ### HTTP 503 - \"Service Unavailable\" The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a `Retry-After` header. This code will not always appear, sometimes the server may outright refuse the connection instead. This is a code sent directly by the server, and has no special alternate definition specific to this API. ## Authorization In order to make calls against the FTC Events API, you must include an HTTP Header called `Authorization` with the value set as specified below. If a request is made without this header, processing stops and an HTTP 401 is issued. All `Authorization` headers follow the same format: ``` Authorization: Basic 000000000000000000000000000000000000000000000000000000000000 ``` Where the Zeros are replaced by your Token. The Token can be formed by taking your username and your AuthorizationKey and adding a colon. For example, if your username is `sampleuser` and your AuthorizationKey is `7eaa6338-a097-4221-ac04-b6120fcc4d49` you would have this string: ``` sampleuser:7eaa6338-a097-4221-ac04-b6120fcc4d49 ``` This string must then be encoded using Base64 Encoded to form the Token, which will be the same length as the example above, but include letters and numbers. For our example, we would have: ``` c2FtcGxldXNlcjo3ZWFhNjMzOC1hMDk3LTQyMjEtYWMwNC1iNjEyMGZjYzRkNDk= ``` Most API client libraries can handle computing the authorization header using a username and password for you NOTICE: Publicly distributing an application, code snippet, etc, that has your username and token in it, encoded or not, WILL result in your token being blocked from the API. Each user should apply for their own token. If you wish to acquire a token for your development, you may do so by requesting a token through our automated system on this website.
5
+
6
+ The version of the OpenAPI document: v2.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module FtcEventsClient
16
+ class GeneralApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # API Index
23
+ # Root level call with no parameters.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [ApiIndexModel]
26
+ def v20_get(opts = {})
27
+ data, _status_code, _headers = v20_get_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # API Index
32
+ # Root level call with no parameters.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(ApiIndexModel, Integer, Hash)>] ApiIndexModel data, response status code and response headers
35
+ def v20_get_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: GeneralApi.v20_get ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/v2.0'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'ApiIndexModel'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || []
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"GeneralApi.v20_get",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: GeneralApi#v20_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+ end
79
+ end