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,185 @@
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 MatchResultsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Event Match Results
23
+ # The match results API returns the match results for all matches of a particular event in a particular season. Match results are only available once a match has been played, retrieving info about future matches requires the event schedule API. You cannot receive data about a match that is in progress. You can, however, request the Hybrid Schedule if you would like data about upcoming and played matches at the same time. If you specify the `matchNumber`, `start` and/or `end` optional parameters, you must also specify a `tournamentLevel`. If you specify the `teamNumber` parameter, you cannot specify a `matchNumber` parameter. If you specify the `matchNumber`, you cannot define a start or end. Note: If you specify `start`, and it is higher than the maximum match number at the event, you will not receive any match results in the response. The same is true in reverse for the `end` parameter.
24
+ # @param season [Integer] Numeric year of the event from which the match results are requested. Must be 4 digits.
25
+ # @param event_code [String] Case insensitive alphanumeric `eventCode` of the event from which the results are requested. Must be at least 3 characters.
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :tournament_level Required tournamentLevel of desired score details. (default to '0')
28
+ # @option opts [Integer] :team_number `teamNumber` to search for within the results. Only returns match results in which the requested team was a participant.
29
+ # @option opts [Integer] :match_number specific single `matchNumber` of result.
30
+ # @option opts [Integer] :start `start` match number for subset of results to return. (default to 0)
31
+ # @option opts [Integer] :_end `end` match number for subset of results to return (inclusive). (default to 999)
32
+ # @return [EventMatchResultsModelVersion2]
33
+ def v20_season_matches_event_code_get(season, event_code, opts = {})
34
+ data, _status_code, _headers = v20_season_matches_event_code_get_with_http_info(season, event_code, opts)
35
+ data
36
+ end
37
+
38
+ # Event Match Results
39
+ # The match results API returns the match results for all matches of a particular event in a particular season. Match results are only available once a match has been played, retrieving info about future matches requires the event schedule API. You cannot receive data about a match that is in progress. You can, however, request the Hybrid Schedule if you would like data about upcoming and played matches at the same time. If you specify the `matchNumber`, `start` and/or `end` optional parameters, you must also specify a `tournamentLevel`. If you specify the `teamNumber` parameter, you cannot specify a `matchNumber` parameter. If you specify the `matchNumber`, you cannot define a start or end. Note: If you specify `start`, and it is higher than the maximum match number at the event, you will not receive any match results in the response. The same is true in reverse for the `end` parameter.
40
+ # @param season [Integer] Numeric year of the event from which the match results are requested. Must be 4 digits.
41
+ # @param event_code [String] Case insensitive alphanumeric `eventCode` of the event from which the results are requested. Must be at least 3 characters.
42
+ # @param [Hash] opts the optional parameters
43
+ # @option opts [String] :tournament_level Required tournamentLevel of desired score details.
44
+ # @option opts [Integer] :team_number `teamNumber` to search for within the results. Only returns match results in which the requested team was a participant.
45
+ # @option opts [Integer] :match_number specific single `matchNumber` of result.
46
+ # @option opts [Integer] :start `start` match number for subset of results to return.
47
+ # @option opts [Integer] :_end `end` match number for subset of results to return (inclusive).
48
+ # @return [Array<(EventMatchResultsModelVersion2, Integer, Hash)>] EventMatchResultsModelVersion2 data, response status code and response headers
49
+ def v20_season_matches_event_code_get_with_http_info(season, event_code, opts = {})
50
+ if @api_client.config.debugging
51
+ @api_client.config.logger.debug 'Calling API: MatchResultsApi.v20_season_matches_event_code_get ...'
52
+ end
53
+ # verify the required parameter 'season' is set
54
+ if @api_client.config.client_side_validation && season.nil?
55
+ fail ArgumentError, "Missing the required parameter 'season' when calling MatchResultsApi.v20_season_matches_event_code_get"
56
+ end
57
+ allowable_values = ["qual", "playoff"]
58
+ if @api_client.config.client_side_validation && opts[:'tournament_level'] && !allowable_values.include?(opts[:'tournament_level'])
59
+ fail ArgumentError, "invalid value for \"tournament_level\", must be one of #{allowable_values}"
60
+ end
61
+ # resource path
62
+ local_var_path = '/v2.0/{season}/matches/{eventCode}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s))
63
+
64
+ # query parameters
65
+ query_params = opts[:query_params] || {}
66
+ query_params[:'tournamentLevel'] = opts[:'tournament_level'] if !opts[:'tournament_level'].nil?
67
+ query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil?
68
+ query_params[:'matchNumber'] = opts[:'match_number'] if !opts[:'match_number'].nil?
69
+ query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
70
+ query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?
71
+
72
+ # header parameters
73
+ header_params = opts[:header_params] || {}
74
+ # HTTP header 'Accept' (if needed)
75
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
76
+
77
+ # form parameters
78
+ form_params = opts[:form_params] || {}
79
+
80
+ # http body (model)
81
+ post_body = opts[:debug_body]
82
+
83
+ # return_type
84
+ return_type = opts[:debug_return_type] || 'EventMatchResultsModelVersion2'
85
+
86
+ # auth_names
87
+ auth_names = opts[:debug_auth_names] || ['basic']
88
+
89
+ new_options = opts.merge(
90
+ :operation => :"MatchResultsApi.v20_season_matches_event_code_get",
91
+ :header_params => header_params,
92
+ :query_params => query_params,
93
+ :form_params => form_params,
94
+ :body => post_body,
95
+ :auth_names => auth_names,
96
+ :return_type => return_type
97
+ )
98
+
99
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug "API called: MatchResultsApi#v20_season_matches_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
102
+ end
103
+ return data, status_code, headers
104
+ end
105
+
106
+ # Score Details
107
+ # The score details API returns the score detail for all matches of a particular event in a particular season and a particular tournament level. Score details are only available once a match has been played, retrieving info about future matches requires the event schedule API. You cannot receive data about a match that is in progress.
108
+ # @param season [Integer] Numeric year of the event from which the match results are requested. Must be 4 digits.
109
+ # @param event_code [String] Case insensitive alphanumeric eventCode of the event from which the details are requested. Must be at least 3 characters.
110
+ # @param tournament_level [String] Required tournamentLevel of desired score details.
111
+ # @param [Hash] opts the optional parameters
112
+ # @option opts [Integer] :team_number &#x60;teamNumber&#x60; to search for within the results. Only returns details in which the requested team was a participant.
113
+ # @option opts [Integer] :match_number specific single &#x60;matchNumber&#x60; of result.
114
+ # @option opts [Integer] :start &#x60;start&#x60; match number for subset of results to return (inclusive). (default to 0)
115
+ # @option opts [Integer] :_end &#x60;end&#x60; match number for subset of results to return (inclusive). (default to 999)
116
+ # @return [MatchScoresModel]
117
+ def v20_season_scores_event_code_tournament_level_get(season, event_code, tournament_level, opts = {})
118
+ data, _status_code, _headers = v20_season_scores_event_code_tournament_level_get_with_http_info(season, event_code, tournament_level, opts)
119
+ data
120
+ end
121
+
122
+ # Score Details
123
+ # The score details API returns the score detail for all matches of a particular event in a particular season and a particular tournament level. Score details are only available once a match has been played, retrieving info about future matches requires the event schedule API. You cannot receive data about a match that is in progress.
124
+ # @param season [Integer] Numeric year of the event from which the match results are requested. Must be 4 digits.
125
+ # @param event_code [String] Case insensitive alphanumeric eventCode of the event from which the details are requested. Must be at least 3 characters.
126
+ # @param tournament_level [String] Required tournamentLevel of desired score details.
127
+ # @param [Hash] opts the optional parameters
128
+ # @option opts [Integer] :team_number &#x60;teamNumber&#x60; to search for within the results. Only returns details in which the requested team was a participant.
129
+ # @option opts [Integer] :match_number specific single &#x60;matchNumber&#x60; of result.
130
+ # @option opts [Integer] :start &#x60;start&#x60; match number for subset of results to return (inclusive).
131
+ # @option opts [Integer] :_end &#x60;end&#x60; match number for subset of results to return (inclusive).
132
+ # @return [Array<(MatchScoresModel, Integer, Hash)>] MatchScoresModel data, response status code and response headers
133
+ def v20_season_scores_event_code_tournament_level_get_with_http_info(season, event_code, tournament_level, opts = {})
134
+ if @api_client.config.debugging
135
+ @api_client.config.logger.debug 'Calling API: MatchResultsApi.v20_season_scores_event_code_tournament_level_get ...'
136
+ end
137
+ # verify the required parameter 'season' is set
138
+ if @api_client.config.client_side_validation && season.nil?
139
+ fail ArgumentError, "Missing the required parameter 'season' when calling MatchResultsApi.v20_season_scores_event_code_tournament_level_get"
140
+ end
141
+ # resource path
142
+ local_var_path = '/v2.0/{season}/scores/{eventCode}/{tournamentLevel}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s)).sub('{' + 'tournamentLevel' + '}', CGI.escape(tournament_level.to_s))
143
+
144
+ # query parameters
145
+ query_params = opts[:query_params] || {}
146
+ query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil?
147
+ query_params[:'matchNumber'] = opts[:'match_number'] if !opts[:'match_number'].nil?
148
+ query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
149
+ query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?
150
+
151
+ # header parameters
152
+ header_params = opts[:header_params] || {}
153
+ # HTTP header 'Accept' (if needed)
154
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
155
+
156
+ # form parameters
157
+ form_params = opts[:form_params] || {}
158
+
159
+ # http body (model)
160
+ post_body = opts[:debug_body]
161
+
162
+ # return_type
163
+ return_type = opts[:debug_return_type] || 'MatchScoresModel'
164
+
165
+ # auth_names
166
+ auth_names = opts[:debug_auth_names] || ['basic']
167
+
168
+ new_options = opts.merge(
169
+ :operation => :"MatchResultsApi.v20_season_scores_event_code_tournament_level_get",
170
+ :header_params => header_params,
171
+ :query_params => query_params,
172
+ :form_params => form_params,
173
+ :body => post_body,
174
+ :auth_names => auth_names,
175
+ :return_type => return_type
176
+ )
177
+
178
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
179
+ if @api_client.config.debugging
180
+ @api_client.config.logger.debug "API called: MatchResultsApi#v20_season_scores_event_code_tournament_level_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
181
+ end
182
+ return data, status_code, headers
183
+ end
184
+ end
185
+ end
@@ -0,0 +1,93 @@
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 RankingsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Event Rankings
23
+ # The rankings API returns team ranking detail from a particular event in a particular season. Optionally, the `top` parameter can be added to the query string to request a subset of the rankings based on the highest ranked teams at the time of the request. Alternately, you can specify the `teamNumber` parameter to retrieve the ranking on one specific team. You cannot specify both a `top` and `teamNumber` in the same call.
24
+ # @param season [Integer] Numeric year of the event from which the rankings are requested. Must be 4 digits
25
+ # @param event_code [String] Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the rankings are requested. Must be at least 3 characters.
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [Integer] :team_number Team number of the team whose ranking is requested. (default to 0)
28
+ # @option opts [Integer] :top number of requested &#x60;top&#x60; ranked teams to return in result. (default to 0)
29
+ # @return [EventRankingsModel]
30
+ def v20_season_rankings_event_code_get(season, event_code, opts = {})
31
+ data, _status_code, _headers = v20_season_rankings_event_code_get_with_http_info(season, event_code, opts)
32
+ data
33
+ end
34
+
35
+ # Event Rankings
36
+ # The rankings API returns team ranking detail from a particular event in a particular season. Optionally, the &#x60;top&#x60; parameter can be added to the query string to request a subset of the rankings based on the highest ranked teams at the time of the request. Alternately, you can specify the &#x60;teamNumber&#x60; parameter to retrieve the ranking on one specific team. You cannot specify both a &#x60;top&#x60; and &#x60;teamNumber&#x60; in the same call.
37
+ # @param season [Integer] Numeric year of the event from which the rankings are requested. Must be 4 digits
38
+ # @param event_code [String] Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the rankings are requested. Must be at least 3 characters.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [Integer] :team_number Team number of the team whose ranking is requested.
41
+ # @option opts [Integer] :top number of requested &#x60;top&#x60; ranked teams to return in result.
42
+ # @return [Array<(EventRankingsModel, Integer, Hash)>] EventRankingsModel data, response status code and response headers
43
+ def v20_season_rankings_event_code_get_with_http_info(season, event_code, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: RankingsApi.v20_season_rankings_event_code_get ...'
46
+ end
47
+ # verify the required parameter 'season' is set
48
+ if @api_client.config.client_side_validation && season.nil?
49
+ fail ArgumentError, "Missing the required parameter 'season' when calling RankingsApi.v20_season_rankings_event_code_get"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v2.0/{season}/rankings/{eventCode}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+ query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil?
57
+ query_params[:'top'] = opts[:'top'] if !opts[:'top'].nil?
58
+
59
+ # header parameters
60
+ header_params = opts[:header_params] || {}
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body]
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'EventRankingsModel'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['basic']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"RankingsApi.v20_season_rankings_event_code_get",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: RankingsApi#v20_season_rankings_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,176 @@
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 ScheduleApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Event Schedule
23
+ # The schedule API returns the match schedule for the desired tournament level of a particular event in a particular season. You must also specify a `tournamentLevel` from which to return the results. Alternately, you can specify a `teamNumber` to filter the results to only those in which a particular team is participating. There is no validation that the `teamNumber` you request is actually competing at the event, if they are not, the response will be empty. You can also specify the parameters together, but cannot make a request without at least one of the two.
24
+ # @param season [Integer] Numeric year of the event from which the schedule is requested. Must be 4 digits
25
+ # @param event_code [String] Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the schedule are requested. Must be at least 3 characters.
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :tournament_level Required tournamentLevel of desired score details. (default to '0')
28
+ # @option opts [Integer] :team_number &#x60;teamNumber&#x60; to search for within the schedule. Only returns matches in which the requested team participated. (default to 0)
29
+ # @option opts [Integer] :start &#x60;start&#x60; match number for subset of results to return (inclusive). (default to 0)
30
+ # @option opts [Integer] :_end &#x60;end&#x60; match number for subset of results to return (inclusive). (default to 999)
31
+ # @return [EventScheduleModelVersion2]
32
+ def v20_season_schedule_event_code_get(season, event_code, opts = {})
33
+ data, _status_code, _headers = v20_season_schedule_event_code_get_with_http_info(season, event_code, opts)
34
+ data
35
+ end
36
+
37
+ # Event Schedule
38
+ # The schedule API returns the match schedule for the desired tournament level of a particular event in a particular season. You must also specify a &#x60;tournamentLevel&#x60; from which to return the results. Alternately, you can specify a &#x60;teamNumber&#x60; to filter the results to only those in which a particular team is participating. There is no validation that the &#x60;teamNumber&#x60; you request is actually competing at the event, if they are not, the response will be empty. You can also specify the parameters together, but cannot make a request without at least one of the two.
39
+ # @param season [Integer] Numeric year of the event from which the schedule is requested. Must be 4 digits
40
+ # @param event_code [String] Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the schedule are requested. Must be at least 3 characters.
41
+ # @param [Hash] opts the optional parameters
42
+ # @option opts [String] :tournament_level Required tournamentLevel of desired score details.
43
+ # @option opts [Integer] :team_number &#x60;teamNumber&#x60; to search for within the schedule. Only returns matches in which the requested team participated.
44
+ # @option opts [Integer] :start &#x60;start&#x60; match number for subset of results to return (inclusive).
45
+ # @option opts [Integer] :_end &#x60;end&#x60; match number for subset of results to return (inclusive).
46
+ # @return [Array<(EventScheduleModelVersion2, Integer, Hash)>] EventScheduleModelVersion2 data, response status code and response headers
47
+ def v20_season_schedule_event_code_get_with_http_info(season, event_code, opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: ScheduleApi.v20_season_schedule_event_code_get ...'
50
+ end
51
+ # verify the required parameter 'season' is set
52
+ if @api_client.config.client_side_validation && season.nil?
53
+ fail ArgumentError, "Missing the required parameter 'season' when calling ScheduleApi.v20_season_schedule_event_code_get"
54
+ end
55
+ allowable_values = ["qual", "playoff"]
56
+ if @api_client.config.client_side_validation && opts[:'tournament_level'] && !allowable_values.include?(opts[:'tournament_level'])
57
+ fail ArgumentError, "invalid value for \"tournament_level\", must be one of #{allowable_values}"
58
+ end
59
+ # resource path
60
+ local_var_path = '/v2.0/{season}/schedule/{eventCode}'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s))
61
+
62
+ # query parameters
63
+ query_params = opts[:query_params] || {}
64
+ query_params[:'tournamentLevel'] = opts[:'tournament_level'] if !opts[:'tournament_level'].nil?
65
+ query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil?
66
+ query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
67
+ query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
73
+
74
+ # form parameters
75
+ form_params = opts[:form_params] || {}
76
+
77
+ # http body (model)
78
+ post_body = opts[:debug_body]
79
+
80
+ # return_type
81
+ return_type = opts[:debug_return_type] || 'EventScheduleModelVersion2'
82
+
83
+ # auth_names
84
+ auth_names = opts[:debug_auth_names] || ['basic']
85
+
86
+ new_options = opts.merge(
87
+ :operation => :"ScheduleApi.v20_season_schedule_event_code_get",
88
+ :header_params => header_params,
89
+ :query_params => query_params,
90
+ :form_params => form_params,
91
+ :body => post_body,
92
+ :auth_names => auth_names,
93
+ :return_type => return_type
94
+ )
95
+
96
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug "API called: ScheduleApi#v20_season_schedule_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
99
+ end
100
+ return data, status_code, headers
101
+ end
102
+
103
+ # Hybrid Schedule
104
+ # The schedule API returns the match schedule for the desired tournament level of a particular event in a particular season in the hybrid format. When a match has been played, the match result related details will be filled. When a match has not yet happened, match result related fields will be null. All parameters, except start and end, are required for the hybrid schedule.
105
+ # @param season [Integer] Numeric year of the event from which the hybrid schedule is requested. Must be 4 digits
106
+ # @param event_code [String] Case insensitive alphanumeric eventCode of the event from which the hybrid schedule is requested. Must be at least 3 characters.
107
+ # @param tournament_level [String] Required tournamentLevel of desired score details.
108
+ # @param [Hash] opts the optional parameters
109
+ # @option opts [Integer] :start &#x60;start&#x60; match number for subset of results to return (inclusive). (default to 0)
110
+ # @option opts [Integer] :_end &#x60;end&#x60; match number for subset of results to return (inclusive). (default to 999)
111
+ # @return [EventScheduleHybridModelVersion2]
112
+ def v20_season_schedule_event_code_tournament_level_hybrid_get(season, event_code, tournament_level, opts = {})
113
+ data, _status_code, _headers = v20_season_schedule_event_code_tournament_level_hybrid_get_with_http_info(season, event_code, tournament_level, opts)
114
+ data
115
+ end
116
+
117
+ # Hybrid Schedule
118
+ # The schedule API returns the match schedule for the desired tournament level of a particular event in a particular season in the hybrid format. When a match has been played, the match result related details will be filled. When a match has not yet happened, match result related fields will be null. All parameters, except start and end, are required for the hybrid schedule.
119
+ # @param season [Integer] Numeric year of the event from which the hybrid schedule is requested. Must be 4 digits
120
+ # @param event_code [String] Case insensitive alphanumeric eventCode of the event from which the hybrid schedule is requested. Must be at least 3 characters.
121
+ # @param tournament_level [String] Required tournamentLevel of desired score details.
122
+ # @param [Hash] opts the optional parameters
123
+ # @option opts [Integer] :start &#x60;start&#x60; match number for subset of results to return (inclusive).
124
+ # @option opts [Integer] :_end &#x60;end&#x60; match number for subset of results to return (inclusive).
125
+ # @return [Array<(EventScheduleHybridModelVersion2, Integer, Hash)>] EventScheduleHybridModelVersion2 data, response status code and response headers
126
+ def v20_season_schedule_event_code_tournament_level_hybrid_get_with_http_info(season, event_code, tournament_level, opts = {})
127
+ if @api_client.config.debugging
128
+ @api_client.config.logger.debug 'Calling API: ScheduleApi.v20_season_schedule_event_code_tournament_level_hybrid_get ...'
129
+ end
130
+ # verify the required parameter 'season' is set
131
+ if @api_client.config.client_side_validation && season.nil?
132
+ fail ArgumentError, "Missing the required parameter 'season' when calling ScheduleApi.v20_season_schedule_event_code_tournament_level_hybrid_get"
133
+ end
134
+ # resource path
135
+ local_var_path = '/v2.0/{season}/schedule/{eventCode}/{tournamentLevel}/hybrid'.sub('{' + 'season' + '}', CGI.escape(season.to_s)).sub('{' + 'eventCode' + '}', CGI.escape(event_code.to_s)).sub('{' + 'tournamentLevel' + '}', CGI.escape(tournament_level.to_s))
136
+
137
+ # query parameters
138
+ query_params = opts[:query_params] || {}
139
+ query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
140
+ query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?
141
+
142
+ # header parameters
143
+ header_params = opts[:header_params] || {}
144
+ # HTTP header 'Accept' (if needed)
145
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
146
+
147
+ # form parameters
148
+ form_params = opts[:form_params] || {}
149
+
150
+ # http body (model)
151
+ post_body = opts[:debug_body]
152
+
153
+ # return_type
154
+ return_type = opts[:debug_return_type] || 'EventScheduleHybridModelVersion2'
155
+
156
+ # auth_names
157
+ auth_names = opts[:debug_auth_names] || ['basic']
158
+
159
+ new_options = opts.merge(
160
+ :operation => :"ScheduleApi.v20_season_schedule_event_code_tournament_level_hybrid_get",
161
+ :header_params => header_params,
162
+ :query_params => query_params,
163
+ :form_params => form_params,
164
+ :body => post_body,
165
+ :auth_names => auth_names,
166
+ :return_type => return_type
167
+ )
168
+
169
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
170
+ if @api_client.config.debugging
171
+ @api_client.config.logger.debug "API called: ScheduleApi#v20_season_schedule_event_code_tournament_level_hybrid_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
172
+ end
173
+ return data, status_code, headers
174
+ end
175
+ end
176
+ end