ftc_events_client 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +351 -101
  3. data/Rakefile +0 -2
  4. data/config.json +1 -1
  5. data/docs/AllianceModelVersion2.md +10 -28
  6. data/docs/AllianceScore2020.md +37 -82
  7. data/docs/AllianceSelectionApi.md +14 -14
  8. data/docs/AllianceSelectionModelVersion2.md +4 -16
  9. data/docs/ApiIndexModel.md +11 -30
  10. data/docs/AutoNavigatedStatus.md +6 -0
  11. data/docs/AwardAssignmentModel.md +13 -34
  12. data/docs/AwardsApi.md +47 -49
  13. data/docs/AwardsModel.md +3 -14
  14. data/docs/BarcodeElement.md +6 -0
  15. data/docs/EndgameParkedStatus.md +6 -0
  16. data/docs/EventMatchResultsModelVersion2.md +3 -14
  17. data/docs/EventRankingsModel.md +3 -14
  18. data/docs/EventScheduleHybridModelVersion2.md +3 -14
  19. data/docs/EventScheduleModelVersion2.md +3 -14
  20. data/docs/FTCEventLevel.md +6 -0
  21. data/docs/GeneralApi.md +9 -11
  22. data/docs/LeagueMemberListModel.md +7 -0
  23. data/docs/LeaguesApi.md +179 -0
  24. data/docs/MatchResultModelVersion2.md +16 -40
  25. data/docs/MatchResultTeamModelVersion2.md +6 -18
  26. data/docs/MatchResultsApi.md +33 -35
  27. data/docs/MatchScoresModel.md +3 -14
  28. data/docs/MatchScoresModelMatchScoresOneOf.md +5 -1
  29. data/docs/OneOfMatchScoresModelMatchScoresItems.md +6 -0
  30. data/docs/RankingsApi.md +16 -17
  31. data/docs/ScheduleApi.md +30 -32
  32. data/docs/ScheduleHybridModelTeamVersion2.md +8 -22
  33. data/docs/ScheduleHybridModelVersion2.md +18 -40
  34. data/docs/ScheduledMatchModelVersion2.md +10 -28
  35. data/docs/ScheduledMatchTeamModelVersion2.md +6 -20
  36. data/docs/ScoreDetailAllianceModel2020.md +39 -86
  37. data/docs/ScoreDetailAllianceModel2021.md +48 -0
  38. data/docs/ScoreDetailModel2019.md +6 -18
  39. data/docs/ScoreDetailModel2020.md +6 -18
  40. data/docs/ScoreDetailModel2021.md +10 -0
  41. data/docs/ScoreDetailModelAlliance2019.md +36 -80
  42. data/docs/ScoreDetailModelSinglePlayer2020.md +6 -20
  43. data/docs/ScoreDetailModelSinglePlayer2021.md +10 -0
  44. data/docs/ScoreDetailSinglePlayer2021.md +39 -0
  45. data/docs/SeasonAwardListingsModel.md +3 -14
  46. data/docs/SeasonAwardsModel.md +6 -20
  47. data/docs/SeasonDataApi.md +35 -37
  48. data/docs/SeasonEventListingsModelVersion2.md +4 -16
  49. data/docs/SeasonEventModelVersion2.md +24 -46
  50. data/docs/SeasonLeagueListingsModelVersion2.md +8 -0
  51. data/docs/SeasonLeagueModelVersion2.md +11 -0
  52. data/docs/SeasonSummaryModelChampionship.md +5 -18
  53. data/docs/SeasonSummaryModelVersion2.md +8 -24
  54. data/docs/SeasonTeamListingsModelVersion2.md +7 -22
  55. data/docs/SeasonTeamModelVersion2.md +14 -36
  56. data/docs/Stone.md +2 -11
  57. data/docs/TeamRankingModel.md +17 -42
  58. data/ftc_events_client.gemspec +5 -5
  59. data/git_push.sh +7 -10
  60. data/lib/ftc_events_client/api/alliance_selection_api.rb +17 -22
  61. data/lib/ftc_events_client/api/awards_api.rb +52 -74
  62. data/lib/ftc_events_client/api/general_api.rb +8 -17
  63. data/lib/ftc_events_client/api/leagues_api.rb +218 -0
  64. data/lib/ftc_events_client/api/match_results_api.rb +44 -45
  65. data/lib/ftc_events_client/api/rankings_api.rb +17 -22
  66. data/lib/ftc_events_client/api/schedule_api.rb +44 -45
  67. data/lib/ftc_events_client/api/season_data_api.rb +30 -53
  68. data/lib/ftc_events_client/api_client.rb +52 -54
  69. data/lib/ftc_events_client/api_error.rb +4 -4
  70. data/lib/ftc_events_client/configuration.rb +6 -76
  71. data/lib/ftc_events_client/models/alliance_model_version2.rb +19 -31
  72. data/lib/ftc_events_client/models/{alliance_score2020.rb → alliance_score_2020.rb} +46 -58
  73. data/lib/ftc_events_client/models/alliance_selection_model_version2.rb +13 -25
  74. data/lib/ftc_events_client/models/api_index_model.rb +20 -32
  75. data/lib/ftc_events_client/models/{tournament_level.rb → auto_navigated_status.rb} +11 -21
  76. data/lib/ftc_events_client/models/award_assignment_model.rb +22 -34
  77. data/lib/ftc_events_client/models/awards_model.rb +12 -24
  78. data/lib/ftc_events_client/models/barcode_element.rb +28 -0
  79. data/lib/ftc_events_client/models/endgame_parked_status.rb +29 -0
  80. data/lib/ftc_events_client/models/event_match_results_model_version2.rb +12 -24
  81. data/lib/ftc_events_client/models/event_rankings_model.rb +12 -24
  82. data/lib/ftc_events_client/models/event_schedule_hybrid_model_version2.rb +12 -24
  83. data/lib/ftc_events_client/models/event_schedule_model_version2.rb +12 -24
  84. data/lib/ftc_events_client/models/ftc_event_level.rb +31 -0
  85. data/lib/ftc_events_client/models/league_member_list_model.rb +209 -0
  86. data/lib/ftc_events_client/models/match_result_model_version2.rb +25 -37
  87. data/lib/ftc_events_client/models/match_result_team_model_version2.rb +26 -29
  88. data/lib/ftc_events_client/models/match_scores_model.rb +12 -24
  89. data/lib/ftc_events_client/models/one_of_match_scores_model_match_scores_items.rb +197 -0
  90. data/lib/ftc_events_client/models/schedule_hybrid_model_team_version2.rb +30 -32
  91. data/lib/ftc_events_client/models/schedule_hybrid_model_version2.rb +46 -38
  92. data/lib/ftc_events_client/models/scheduled_match_model_version2.rb +19 -31
  93. data/lib/ftc_events_client/models/scheduled_match_team_model_version2.rb +15 -27
  94. data/lib/ftc_events_client/models/{score_detail_alliance_model2020.rb → score_detail_alliance_model_2020.rb} +48 -60
  95. data/lib/ftc_events_client/models/score_detail_alliance_model_2021.rb +576 -0
  96. data/lib/ftc_events_client/models/{score_detail_model2019.rb → score_detail_model_2019.rb} +24 -27
  97. data/lib/ftc_events_client/models/{score_detail_model2020.rb → score_detail_model_2020.rb} +24 -27
  98. data/lib/ftc_events_client/models/score_detail_model_2021.rb +236 -0
  99. data/lib/ftc_events_client/models/{score_detail_model_alliance2019.rb → score_detail_model_alliance_2019.rb} +45 -57
  100. data/lib/ftc_events_client/models/{score_detail_model_single_player2020.rb → score_detail_model_single_player_2020.rb} +15 -27
  101. data/lib/ftc_events_client/models/score_detail_model_single_player_2021.rb +233 -0
  102. data/lib/ftc_events_client/models/score_detail_single_player_2021.rb +494 -0
  103. data/lib/ftc_events_client/models/season_award_listings_model.rb +12 -24
  104. data/lib/ftc_events_client/models/season_awards_model.rb +22 -34
  105. data/lib/ftc_events_client/models/season_event_listings_model_version2.rb +13 -25
  106. data/lib/ftc_events_client/models/season_event_model_version2.rb +77 -41
  107. data/lib/ftc_events_client/models/season_league_listings_model_version2.rb +218 -0
  108. data/lib/ftc_events_client/models/season_league_model_version2.rb +247 -0
  109. data/lib/ftc_events_client/models/season_summary_model_championship.rb +14 -26
  110. data/lib/ftc_events_client/models/season_summary_model_version2.rb +17 -29
  111. data/lib/ftc_events_client/models/season_team_listings_model_version2.rb +16 -28
  112. data/lib/ftc_events_client/models/season_team_model_version2.rb +23 -35
  113. data/lib/ftc_events_client/models/stone.rb +6 -15
  114. data/lib/ftc_events_client/models/team_ranking_model.rb +26 -38
  115. data/lib/ftc_events_client/version.rb +4 -5
  116. data/lib/ftc_events_client.rb +22 -12
  117. data/spec/api/leagues_api_spec.rb +77 -0
  118. data/spec/base_object_spec.rb +109 -0
  119. data/spec/configuration_spec.rb +3 -3
  120. data/spec/models/alliance_score_2020_spec.rb +244 -0
  121. data/spec/models/auto_navigated_status_spec.rb +28 -0
  122. data/spec/models/barcode_element_spec.rb +28 -0
  123. data/spec/models/endgame_parked_status_spec.rb +28 -0
  124. data/spec/models/ftc_event_level_spec.rb +28 -0
  125. data/spec/models/league_member_list_model_spec.rb +34 -0
  126. data/spec/models/one_of_match_scores_model_match_scores_items_spec.rb +34 -0
  127. data/spec/models/score_detail_alliance_model2021_spec.rb +280 -0
  128. data/spec/models/score_detail_alliance_model_2020_spec.rb +256 -0
  129. data/spec/models/score_detail_alliance_model_2021_spec.rb +286 -0
  130. data/spec/models/score_detail_model2021_spec.rb +52 -0
  131. data/spec/models/score_detail_model_2019_spec.rb +58 -0
  132. data/spec/models/score_detail_model_2020_spec.rb +58 -0
  133. data/spec/models/score_detail_model_2021_spec.rb +58 -0
  134. data/spec/models/score_detail_model_alliance_2019_spec.rb +238 -0
  135. data/spec/models/score_detail_model_single_player2021_spec.rb +52 -0
  136. data/spec/models/score_detail_model_single_player_2020_spec.rb +58 -0
  137. data/spec/models/score_detail_model_single_player_2021_spec.rb +58 -0
  138. data/spec/models/score_detail_single_player2021_spec.rb +226 -0
  139. data/spec/models/score_detail_single_player_2021_spec.rb +232 -0
  140. data/spec/models/season_league_listings_model_version2_spec.rb +40 -0
  141. data/{lib/ftc_events_client/models/match_scores_model_match_scores_one_of.rb → spec/models/season_league_model_version2_spec.rb} +35 -83
  142. data/update.sh +2 -2
  143. metadata +103 -11
@@ -3,15 +3,12 @@
3
3
 
4
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
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
6
+ OpenAPI spec version: v2.0
10
7
 
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.29
11
10
  =end
12
11
 
13
- require 'cgi'
14
-
15
12
  module FtcEventsClient
16
13
  class AwardsApi
17
14
  attr_accessor :api_client
@@ -21,8 +18,8 @@ module FtcEventsClient
21
18
  end
22
19
  # Event Awards
23
20
  # 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 `eventCode` of the event from which the awards are requested.
21
+ # @param season Numeric year of the event from which the award listings are requested. Must be 4 digits
22
+ # @param event_code Case insensitive alphanumeric `eventCode` of the event from which the awards are requested.
26
23
  # @param [Hash] opts the optional parameters
27
24
  # @option opts [Integer] :team_number `teamNumber` to search for within the results. (default to 0)
28
25
  # @return [AwardsModel]
@@ -33,8 +30,8 @@ module FtcEventsClient
33
30
 
34
31
  # Event Awards
35
32
  # 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`.
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 `eventCode` of the event from which the awards are requested.
33
+ # @param season Numeric year of the event from which the award listings are requested. Must be 4 digits
34
+ # @param event_code Case insensitive alphanumeric `eventCode` of the event from which the awards are requested.
38
35
  # @param [Hash] opts the optional parameters
39
36
  # @option opts [Integer] :team_number `teamNumber` to search for within the results.
40
37
  # @return [Array<(AwardsModel, Integer, Hash)>] AwardsModel data, response status code and response headers
@@ -46,8 +43,12 @@ module FtcEventsClient
46
43
  if @api_client.config.client_side_validation && season.nil?
47
44
  fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_event_code_get"
48
45
  end
46
+ # verify the required parameter 'event_code' is set
47
+ if @api_client.config.client_side_validation && event_code.nil?
48
+ fail ArgumentError, "Missing the required parameter 'event_code' when calling AwardsApi.v20_season_awards_event_code_get"
49
+ end
49
50
  # 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
+ local_var_path = '/v2.0/{season}/awards/{eventCode}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', event_code.to_s)
51
52
 
52
53
  # query parameters
53
54
  query_params = opts[:query_params] || {}
@@ -62,36 +63,29 @@ module FtcEventsClient
62
63
  form_params = opts[:form_params] || {}
63
64
 
64
65
  # http body (model)
65
- post_body = opts[:debug_body]
66
+ post_body = opts[:body]
66
67
 
67
- # return_type
68
- return_type = opts[:debug_return_type] || 'AwardsModel'
68
+ return_type = opts[:return_type] || 'AwardsModel'
69
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",
70
+ auth_names = opts[:auth_names] || ['basic']
71
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
75
72
  :header_params => header_params,
76
73
  :query_params => query_params,
77
74
  :form_params => form_params,
78
75
  :body => post_body,
79
76
  :auth_names => auth_names,
80
- :return_type => return_type
81
- )
77
+ :return_type => return_type)
82
78
 
83
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
84
79
  if @api_client.config.debugging
85
80
  @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
81
  end
87
82
  return data, status_code, headers
88
83
  end
89
-
90
84
  # Event Awards
91
85
  # 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.
86
+ # @param season Numeric year of the event from which the award listings are requested. Must be 4 digits
87
+ # @param event_code Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.
88
+ # @param team_number &#x60;teamNumber&#x60; to search for within the results.
95
89
  # @param [Hash] opts the optional parameters
96
90
  # @return [AwardsModel]
97
91
  def v20_season_awards_event_code_team_number_get(season, event_code, team_number, opts = {})
@@ -101,9 +95,9 @@ module FtcEventsClient
101
95
 
102
96
  # Event Awards
103
97
  # 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.
98
+ # @param season Numeric year of the event from which the award listings are requested. Must be 4 digits
99
+ # @param event_code Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.
100
+ # @param team_number &#x60;teamNumber&#x60; to search for within the results.
107
101
  # @param [Hash] opts the optional parameters
108
102
  # @return [Array<(AwardsModel, Integer, Hash)>] AwardsModel data, response status code and response headers
109
103
  def v20_season_awards_event_code_team_number_get_with_http_info(season, event_code, team_number, opts = {})
@@ -114,12 +108,16 @@ module FtcEventsClient
114
108
  if @api_client.config.client_side_validation && season.nil?
115
109
  fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_event_code_team_number_get"
116
110
  end
111
+ # verify the required parameter 'event_code' is set
112
+ if @api_client.config.client_side_validation && event_code.nil?
113
+ fail ArgumentError, "Missing the required parameter 'event_code' when calling AwardsApi.v20_season_awards_event_code_team_number_get"
114
+ end
117
115
  # verify the required parameter 'team_number' is set
118
116
  if @api_client.config.client_side_validation && team_number.nil?
119
117
  fail ArgumentError, "Missing the required parameter 'team_number' when calling AwardsApi.v20_season_awards_event_code_team_number_get"
120
118
  end
121
119
  # 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))
120
+ local_var_path = '/v2.0/{season}/awards/{eventCode}/{teamNumber}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', event_code.to_s).sub('{' + 'teamNumber' + '}', team_number.to_s)
123
121
 
124
122
  # query parameters
125
123
  query_params = opts[:query_params] || {}
@@ -133,34 +131,27 @@ module FtcEventsClient
133
131
  form_params = opts[:form_params] || {}
134
132
 
135
133
  # http body (model)
136
- post_body = opts[:debug_body]
134
+ post_body = opts[:body]
137
135
 
138
- # return_type
139
- return_type = opts[:debug_return_type] || 'AwardsModel'
136
+ return_type = opts[:return_type] || 'AwardsModel'
140
137
 
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",
138
+ auth_names = opts[:auth_names] || ['basic']
139
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
146
140
  :header_params => header_params,
147
141
  :query_params => query_params,
148
142
  :form_params => form_params,
149
143
  :body => post_body,
150
144
  :auth_names => auth_names,
151
- :return_type => return_type
152
- )
145
+ :return_type => return_type)
153
146
 
154
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
155
147
  if @api_client.config.debugging
156
148
  @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
149
  end
158
150
  return data, status_code, headers
159
151
  end
160
-
161
152
  # Award Listings
162
153
  # 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
154
+ # @param season Numeric year of the event from which the award listings are requested. Must be 4 digits
164
155
  # @param [Hash] opts the optional parameters
165
156
  # @return [SeasonAwardListingsModel]
166
157
  def v20_season_awards_list_get(season, opts = {})
@@ -170,7 +161,7 @@ module FtcEventsClient
170
161
 
171
162
  # Award Listings
172
163
  # 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
164
+ # @param season Numeric year of the event from which the award listings are requested. Must be 4 digits
174
165
  # @param [Hash] opts the optional parameters
175
166
  # @return [Array<(SeasonAwardListingsModel, Integer, Hash)>] SeasonAwardListingsModel data, response status code and response headers
176
167
  def v20_season_awards_list_get_with_http_info(season, opts = {})
@@ -182,7 +173,7 @@ module FtcEventsClient
182
173
  fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_list_get"
183
174
  end
184
175
  # resource path
185
- local_var_path = '/v2.0/{season}/awards/list'.sub('{' + 'season' + '}', CGI.escape(season.to_s))
176
+ local_var_path = '/v2.0/{season}/awards/list'.sub('{' + 'season' + '}', season.to_s)
186
177
 
187
178
  # query parameters
188
179
  query_params = opts[:query_params] || {}
@@ -196,37 +187,30 @@ module FtcEventsClient
196
187
  form_params = opts[:form_params] || {}
197
188
 
198
189
  # http body (model)
199
- post_body = opts[:debug_body]
200
-
201
- # return_type
202
- return_type = opts[:debug_return_type] || 'SeasonAwardListingsModel'
190
+ post_body = opts[:body]
203
191
 
204
- # auth_names
205
- auth_names = opts[:debug_auth_names] || ['basic']
192
+ return_type = opts[:return_type] || 'SeasonAwardListingsModel'
206
193
 
207
- new_options = opts.merge(
208
- :operation => :"AwardsApi.v20_season_awards_list_get",
194
+ auth_names = opts[:auth_names] || ['basic']
195
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
209
196
  :header_params => header_params,
210
197
  :query_params => query_params,
211
198
  :form_params => form_params,
212
199
  :body => post_body,
213
200
  :auth_names => auth_names,
214
- :return_type => return_type
215
- )
201
+ :return_type => return_type)
216
202
 
217
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
218
203
  if @api_client.config.debugging
219
204
  @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_list_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
220
205
  end
221
206
  return data, status_code, headers
222
207
  end
223
-
224
208
  # Event Awards
225
209
  # 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.
210
+ # @param season Numeric year of the event from which the award listings are requested. Must be 4 digits
211
+ # @param team_number &#x60;teamNumber&#x60; to search for within the results.
228
212
  # @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 '')
213
+ # @option opts [String] :event_code Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.
230
214
  # @return [AwardsModel]
231
215
  def v20_season_awards_team_number_get(season, team_number, opts = {})
232
216
  data, _status_code, _headers = v20_season_awards_team_number_get_with_http_info(season, team_number, opts)
@@ -235,8 +219,8 @@ module FtcEventsClient
235
219
 
236
220
  # Event Awards
237
221
  # 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.
222
+ # @param season Numeric year of the event from which the award listings are requested. Must be 4 digits
223
+ # @param team_number &#x60;teamNumber&#x60; to search for within the results.
240
224
  # @param [Hash] opts the optional parameters
241
225
  # @option opts [String] :event_code Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.
242
226
  # @return [Array<(AwardsModel, Integer, Hash)>] AwardsModel data, response status code and response headers
@@ -253,7 +237,7 @@ module FtcEventsClient
253
237
  fail ArgumentError, "Missing the required parameter 'team_number' when calling AwardsApi.v20_season_awards_team_number_get"
254
238
  end
255
239
  # 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))
240
+ local_var_path = '/v2.0/{season}/awards/{teamNumber}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'teamNumber' + '}', team_number.to_s)
257
241
 
258
242
  # query parameters
259
243
  query_params = opts[:query_params] || {}
@@ -268,25 +252,19 @@ module FtcEventsClient
268
252
  form_params = opts[:form_params] || {}
269
253
 
270
254
  # http body (model)
271
- post_body = opts[:debug_body]
272
-
273
- # return_type
274
- return_type = opts[:debug_return_type] || 'AwardsModel'
255
+ post_body = opts[:body]
275
256
 
276
- # auth_names
277
- auth_names = opts[:debug_auth_names] || ['basic']
257
+ return_type = opts[:return_type] || 'AwardsModel'
278
258
 
279
- new_options = opts.merge(
280
- :operation => :"AwardsApi.v20_season_awards_team_number_get",
259
+ auth_names = opts[:auth_names] || ['basic']
260
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
281
261
  :header_params => header_params,
282
262
  :query_params => query_params,
283
263
  :form_params => form_params,
284
264
  :body => post_body,
285
265
  :auth_names => auth_names,
286
- :return_type => return_type
287
- )
266
+ :return_type => return_type)
288
267
 
289
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
290
268
  if @api_client.config.debugging
291
269
  @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_team_number_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
292
270
  end
@@ -3,15 +3,12 @@
3
3
 
4
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
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
6
+ OpenAPI spec version: v2.0
10
7
 
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.29
11
10
  =end
12
11
 
13
- require 'cgi'
14
-
15
12
  module FtcEventsClient
16
13
  class GeneralApi
17
14
  attr_accessor :api_client
@@ -51,25 +48,19 @@ module FtcEventsClient
51
48
  form_params = opts[:form_params] || {}
52
49
 
53
50
  # http body (model)
54
- post_body = opts[:debug_body]
55
-
56
- # return_type
57
- return_type = opts[:debug_return_type] || 'ApiIndexModel'
51
+ post_body = opts[:body]
58
52
 
59
- # auth_names
60
- auth_names = opts[:debug_auth_names] || []
53
+ return_type = opts[:return_type] || 'ApiIndexModel'
61
54
 
62
- new_options = opts.merge(
63
- :operation => :"GeneralApi.v20_get",
55
+ auth_names = opts[:auth_names] || []
56
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
64
57
  :header_params => header_params,
65
58
  :query_params => query_params,
66
59
  :form_params => form_params,
67
60
  :body => post_body,
68
61
  :auth_names => auth_names,
69
- :return_type => return_type
70
- )
62
+ :return_type => return_type)
71
63
 
72
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
64
  if @api_client.config.debugging
74
65
  @api_client.config.logger.debug "API called: GeneralApi#v20_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
66
  end
@@ -0,0 +1,218 @@
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
+ OpenAPI spec version: v2.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.29
10
+ =end
11
+
12
+ module FtcEventsClient
13
+ class LeaguesApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # League Listings
20
+ # The league listings API returns all FTC leagues in a particular season. You can specify a `regionCode` to filter to leagues within a particular region. To filter to a specific league, supply both a `regionCode` and a `leagueCode`. The returned objects have a `parentLeagueCode` field, which indicates the league is a child league if not null and provides the code of the parent league. The `regionCode` of the parent league will always match the child.
21
+ # @param season Numeric year from which the league listings are requested. Must be 4 digits
22
+ # @param [Hash] opts the optional parameters
23
+ # @option opts [String] :region_code Case-sensitive alphanumeric &#x60;regionCode&#x60; of a region to filter for.
24
+ # @option opts [String] :league_code Case-sensitive alphanumeric &#x60;leagueCode&#x60; of the league within the specified region to query.
25
+ # @return [SeasonLeagueListingsModelVersion2]
26
+ def v20_season_leagues_get(season, opts = {})
27
+ data, _status_code, _headers = v20_season_leagues_get_with_http_info(season, opts)
28
+ data
29
+ end
30
+
31
+ # League Listings
32
+ # The league listings API returns all FTC leagues in a particular season. You can specify a &#x60;regionCode&#x60; to filter to leagues within a particular region. To filter to a specific league, supply both a &#x60;regionCode&#x60; and a &#x60;leagueCode&#x60;. The returned objects have a &#x60;parentLeagueCode&#x60; field, which indicates the league is a child league if not null and provides the code of the parent league. The &#x60;regionCode&#x60; of the parent league will always match the child.
33
+ # @param season Numeric year from which the league listings are requested. Must be 4 digits
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :region_code Case-sensitive alphanumeric &#x60;regionCode&#x60; of a region to filter for.
36
+ # @option opts [String] :league_code Case-sensitive alphanumeric &#x60;leagueCode&#x60; of the league within the specified region to query.
37
+ # @return [Array<(SeasonLeagueListingsModelVersion2, Integer, Hash)>] SeasonLeagueListingsModelVersion2 data, response status code and response headers
38
+ def v20_season_leagues_get_with_http_info(season, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug 'Calling API: LeaguesApi.v20_season_leagues_get ...'
41
+ end
42
+ # verify the required parameter 'season' is set
43
+ if @api_client.config.client_side_validation && season.nil?
44
+ fail ArgumentError, "Missing the required parameter 'season' when calling LeaguesApi.v20_season_leagues_get"
45
+ end
46
+ # resource path
47
+ local_var_path = '/v2.0/{season}/leagues'.sub('{' + 'season' + '}', season.to_s)
48
+
49
+ # query parameters
50
+ query_params = opts[:query_params] || {}
51
+ query_params[:'regionCode'] = opts[:'region_code'] if !opts[:'region_code'].nil?
52
+ query_params[:'leagueCode'] = opts[:'league_code'] if !opts[:'league_code'].nil?
53
+
54
+ # header parameters
55
+ header_params = opts[:header_params] || {}
56
+ # HTTP header 'Accept' (if needed)
57
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:body]
64
+
65
+ return_type = opts[:return_type] || 'SeasonLeagueListingsModelVersion2'
66
+
67
+ auth_names = opts[:auth_names] || ['basic']
68
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => return_type)
75
+
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: LeaguesApi#v20_season_leagues_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+ # League Membership
82
+ # The league membership API returns the list of team numbers for the teams that are members of a particular league. Leagues are specified by a `regionCode` in combination with a `leagueCode`.
83
+ # @param season Numeric year. Must be 4 digits
84
+ # @param region_code Case sensitive alphanumeric &#x60;regionCode&#x60; of the region the league belongs to.
85
+ # @param league_code Case sensitive alphanumeric &#x60;leagueCode&#x60; of the league.
86
+ # @param [Hash] opts the optional parameters
87
+ # @return [LeagueMemberListModel]
88
+ def v20_season_leagues_members_region_code_league_code_get(season, region_code, league_code, opts = {})
89
+ data, _status_code, _headers = v20_season_leagues_members_region_code_league_code_get_with_http_info(season, region_code, league_code, opts)
90
+ data
91
+ end
92
+
93
+ # League Membership
94
+ # The league membership API returns the list of team numbers for the teams that are members of a particular league. Leagues are specified by a &#x60;regionCode&#x60; in combination with a &#x60;leagueCode&#x60;.
95
+ # @param season Numeric year. Must be 4 digits
96
+ # @param region_code Case sensitive alphanumeric &#x60;regionCode&#x60; of the region the league belongs to.
97
+ # @param league_code Case sensitive alphanumeric &#x60;leagueCode&#x60; of the league.
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Array<(LeagueMemberListModel, Integer, Hash)>] LeagueMemberListModel data, response status code and response headers
100
+ def v20_season_leagues_members_region_code_league_code_get_with_http_info(season, region_code, league_code, opts = {})
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug 'Calling API: LeaguesApi.v20_season_leagues_members_region_code_league_code_get ...'
103
+ end
104
+ # verify the required parameter 'season' is set
105
+ if @api_client.config.client_side_validation && season.nil?
106
+ fail ArgumentError, "Missing the required parameter 'season' when calling LeaguesApi.v20_season_leagues_members_region_code_league_code_get"
107
+ end
108
+ # verify the required parameter 'region_code' is set
109
+ if @api_client.config.client_side_validation && region_code.nil?
110
+ fail ArgumentError, "Missing the required parameter 'region_code' when calling LeaguesApi.v20_season_leagues_members_region_code_league_code_get"
111
+ end
112
+ # verify the required parameter 'league_code' is set
113
+ if @api_client.config.client_side_validation && league_code.nil?
114
+ fail ArgumentError, "Missing the required parameter 'league_code' when calling LeaguesApi.v20_season_leagues_members_region_code_league_code_get"
115
+ end
116
+ # resource path
117
+ local_var_path = '/v2.0/{season}/leagues/members/{regionCode}/{leagueCode}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'regionCode' + '}', region_code.to_s).sub('{' + 'leagueCode' + '}', league_code.to_s)
118
+
119
+ # query parameters
120
+ query_params = opts[:query_params] || {}
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
126
+
127
+ # form parameters
128
+ form_params = opts[:form_params] || {}
129
+
130
+ # http body (model)
131
+ post_body = opts[:body]
132
+
133
+ return_type = opts[:return_type] || 'LeagueMemberListModel'
134
+
135
+ auth_names = opts[:auth_names] || ['basic']
136
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
137
+ :header_params => header_params,
138
+ :query_params => query_params,
139
+ :form_params => form_params,
140
+ :body => post_body,
141
+ :auth_names => auth_names,
142
+ :return_type => return_type)
143
+
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug "API called: LeaguesApi#v20_season_leagues_members_region_code_league_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
+ end
147
+ return data, status_code, headers
148
+ end
149
+ # League Rankings
150
+ # The league rankings API returns team ranking detail from a particular league in a particular season. League rankings are only the cumulative rankings from League Meets - they do not include performance at the League Tournament. To get League Tournament Rankings, use the Event Rankings endpoint.
151
+ # @param season Numeric year. Must be 4 digits
152
+ # @param region_code Case sensitive alphanumeric &#x60;regionCode&#x60; of the region the league belongs to.
153
+ # @param league_code Case sensitive alphanumeric &#x60;leagueCode&#x60; of the league.
154
+ # @param [Hash] opts the optional parameters
155
+ # @return [EventRankingsModel]
156
+ def v20_season_leagues_rankings_region_code_league_code_get(season, region_code, league_code, opts = {})
157
+ data, _status_code, _headers = v20_season_leagues_rankings_region_code_league_code_get_with_http_info(season, region_code, league_code, opts)
158
+ data
159
+ end
160
+
161
+ # League Rankings
162
+ # The league rankings API returns team ranking detail from a particular league in a particular season. League rankings are only the cumulative rankings from League Meets - they do not include performance at the League Tournament. To get League Tournament Rankings, use the Event Rankings endpoint.
163
+ # @param season Numeric year. Must be 4 digits
164
+ # @param region_code Case sensitive alphanumeric &#x60;regionCode&#x60; of the region the league belongs to.
165
+ # @param league_code Case sensitive alphanumeric &#x60;leagueCode&#x60; of the league.
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [Array<(EventRankingsModel, Integer, Hash)>] EventRankingsModel data, response status code and response headers
168
+ def v20_season_leagues_rankings_region_code_league_code_get_with_http_info(season, region_code, league_code, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: LeaguesApi.v20_season_leagues_rankings_region_code_league_code_get ...'
171
+ end
172
+ # verify the required parameter 'season' is set
173
+ if @api_client.config.client_side_validation && season.nil?
174
+ fail ArgumentError, "Missing the required parameter 'season' when calling LeaguesApi.v20_season_leagues_rankings_region_code_league_code_get"
175
+ end
176
+ # verify the required parameter 'region_code' is set
177
+ if @api_client.config.client_side_validation && region_code.nil?
178
+ fail ArgumentError, "Missing the required parameter 'region_code' when calling LeaguesApi.v20_season_leagues_rankings_region_code_league_code_get"
179
+ end
180
+ # verify the required parameter 'league_code' is set
181
+ if @api_client.config.client_side_validation && league_code.nil?
182
+ fail ArgumentError, "Missing the required parameter 'league_code' when calling LeaguesApi.v20_season_leagues_rankings_region_code_league_code_get"
183
+ end
184
+ # resource path
185
+ local_var_path = '/v2.0/{season}/leagues/rankings/{regionCode}/{leagueCode}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'regionCode' + '}', region_code.to_s).sub('{' + 'leagueCode' + '}', league_code.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[:body]
200
+
201
+ return_type = opts[:return_type] || 'EventRankingsModel'
202
+
203
+ auth_names = opts[:auth_names] || ['basic']
204
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
205
+ :header_params => header_params,
206
+ :query_params => query_params,
207
+ :form_params => form_params,
208
+ :body => post_body,
209
+ :auth_names => auth_names,
210
+ :return_type => return_type)
211
+
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug "API called: LeaguesApi#v20_season_leagues_rankings_region_code_league_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
214
+ end
215
+ return data, status_code, headers
216
+ end
217
+ end
218
+ end