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
@@ -0,0 +1,494 @@
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
+ require 'date'
13
+
14
+ module FtcEventsClient
15
+ class ScoreDetailSinglePlayer2021
16
+ attr_accessor :barcode_element
17
+
18
+ attr_accessor :carousel
19
+
20
+ attr_accessor :auto_navigated
21
+
22
+ attr_accessor :auto_bonus
23
+
24
+ attr_accessor :auto_storage_freight
25
+
26
+ attr_accessor :auto_freight1
27
+
28
+ attr_accessor :auto_freight2
29
+
30
+ attr_accessor :auto_freight3
31
+
32
+ attr_accessor :driver_controlled_storage_freight
33
+
34
+ attr_accessor :driver_controlled_freight1
35
+
36
+ attr_accessor :driver_controlled_freight2
37
+
38
+ attr_accessor :driver_controlled_freight3
39
+
40
+ attr_accessor :endgame_delivered
41
+
42
+ attr_accessor :alliance_balanced
43
+
44
+ attr_accessor :endgame_parked
45
+
46
+ attr_accessor :capped
47
+
48
+ attr_accessor :minor_penalties
49
+
50
+ attr_accessor :major_penalties
51
+
52
+ attr_accessor :carousel_points
53
+
54
+ attr_accessor :auto_navigation_points
55
+
56
+ attr_accessor :auto_freight_points
57
+
58
+ attr_accessor :auto_bonus_points
59
+
60
+ attr_accessor :driver_controlled_alliance_hub_points
61
+
62
+ attr_accessor :driver_controlled_storage_points
63
+
64
+ attr_accessor :endgame_delivery_points
65
+
66
+ attr_accessor :alliance_balanced_points
67
+
68
+ attr_accessor :endgame_parking_points
69
+
70
+ attr_accessor :capping_points
71
+
72
+ attr_accessor :auto_points
73
+
74
+ attr_accessor :driver_controlled_points
75
+
76
+ attr_accessor :endgame_points
77
+
78
+ attr_accessor :penalty_points
79
+
80
+ attr_accessor :total_points
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'barcode_element' => :'barcodeElement',
86
+ :'carousel' => :'carousel',
87
+ :'auto_navigated' => :'autoNavigated',
88
+ :'auto_bonus' => :'autoBonus',
89
+ :'auto_storage_freight' => :'autoStorageFreight',
90
+ :'auto_freight1' => :'autoFreight1',
91
+ :'auto_freight2' => :'autoFreight2',
92
+ :'auto_freight3' => :'autoFreight3',
93
+ :'driver_controlled_storage_freight' => :'driverControlledStorageFreight',
94
+ :'driver_controlled_freight1' => :'driverControlledFreight1',
95
+ :'driver_controlled_freight2' => :'driverControlledFreight2',
96
+ :'driver_controlled_freight3' => :'driverControlledFreight3',
97
+ :'endgame_delivered' => :'endgameDelivered',
98
+ :'alliance_balanced' => :'allianceBalanced',
99
+ :'endgame_parked' => :'endgameParked',
100
+ :'capped' => :'capped',
101
+ :'minor_penalties' => :'minorPenalties',
102
+ :'major_penalties' => :'majorPenalties',
103
+ :'carousel_points' => :'carouselPoints',
104
+ :'auto_navigation_points' => :'autoNavigationPoints',
105
+ :'auto_freight_points' => :'autoFreightPoints',
106
+ :'auto_bonus_points' => :'autoBonusPoints',
107
+ :'driver_controlled_alliance_hub_points' => :'driverControlledAllianceHubPoints',
108
+ :'driver_controlled_storage_points' => :'driverControlledStoragePoints',
109
+ :'endgame_delivery_points' => :'endgameDeliveryPoints',
110
+ :'alliance_balanced_points' => :'allianceBalancedPoints',
111
+ :'endgame_parking_points' => :'endgameParkingPoints',
112
+ :'capping_points' => :'cappingPoints',
113
+ :'auto_points' => :'autoPoints',
114
+ :'driver_controlled_points' => :'driverControlledPoints',
115
+ :'endgame_points' => :'endgamePoints',
116
+ :'penalty_points' => :'penaltyPoints',
117
+ :'total_points' => :'totalPoints'
118
+ }
119
+ end
120
+
121
+ # Attribute type mapping.
122
+ def self.openapi_types
123
+ {
124
+ :'barcode_element' => :'Object',
125
+ :'carousel' => :'Object',
126
+ :'auto_navigated' => :'Object',
127
+ :'auto_bonus' => :'Object',
128
+ :'auto_storage_freight' => :'Object',
129
+ :'auto_freight1' => :'Object',
130
+ :'auto_freight2' => :'Object',
131
+ :'auto_freight3' => :'Object',
132
+ :'driver_controlled_storage_freight' => :'Object',
133
+ :'driver_controlled_freight1' => :'Object',
134
+ :'driver_controlled_freight2' => :'Object',
135
+ :'driver_controlled_freight3' => :'Object',
136
+ :'endgame_delivered' => :'Object',
137
+ :'alliance_balanced' => :'Object',
138
+ :'endgame_parked' => :'Object',
139
+ :'capped' => :'Object',
140
+ :'minor_penalties' => :'Object',
141
+ :'major_penalties' => :'Object',
142
+ :'carousel_points' => :'Object',
143
+ :'auto_navigation_points' => :'Object',
144
+ :'auto_freight_points' => :'Object',
145
+ :'auto_bonus_points' => :'Object',
146
+ :'driver_controlled_alliance_hub_points' => :'Object',
147
+ :'driver_controlled_storage_points' => :'Object',
148
+ :'endgame_delivery_points' => :'Object',
149
+ :'alliance_balanced_points' => :'Object',
150
+ :'endgame_parking_points' => :'Object',
151
+ :'capping_points' => :'Object',
152
+ :'auto_points' => :'Object',
153
+ :'driver_controlled_points' => :'Object',
154
+ :'endgame_points' => :'Object',
155
+ :'penalty_points' => :'Object',
156
+ :'total_points' => :'Object'
157
+ }
158
+ end
159
+
160
+ # List of attributes with nullable: true
161
+ def self.openapi_nullable
162
+ Set.new([
163
+ ])
164
+ end
165
+
166
+ # Initializes the object
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ def initialize(attributes = {})
169
+ if (!attributes.is_a?(Hash))
170
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FtcEventsClient::ScoreDetailSinglePlayer2021` initialize method"
171
+ end
172
+
173
+ # check to see if the attribute exists and convert string to symbol for hash key
174
+ attributes = attributes.each_with_object({}) { |(k, v), h|
175
+ if (!self.class.attribute_map.key?(k.to_sym))
176
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FtcEventsClient::ScoreDetailSinglePlayer2021`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
177
+ end
178
+ h[k.to_sym] = v
179
+ }
180
+
181
+ if attributes.key?(:'barcode_element')
182
+ self.barcode_element = attributes[:'barcode_element']
183
+ end
184
+
185
+ if attributes.key?(:'carousel')
186
+ self.carousel = attributes[:'carousel']
187
+ end
188
+
189
+ if attributes.key?(:'auto_navigated')
190
+ self.auto_navigated = attributes[:'auto_navigated']
191
+ end
192
+
193
+ if attributes.key?(:'auto_bonus')
194
+ self.auto_bonus = attributes[:'auto_bonus']
195
+ end
196
+
197
+ if attributes.key?(:'auto_storage_freight')
198
+ self.auto_storage_freight = attributes[:'auto_storage_freight']
199
+ end
200
+
201
+ if attributes.key?(:'auto_freight1')
202
+ self.auto_freight1 = attributes[:'auto_freight1']
203
+ end
204
+
205
+ if attributes.key?(:'auto_freight2')
206
+ self.auto_freight2 = attributes[:'auto_freight2']
207
+ end
208
+
209
+ if attributes.key?(:'auto_freight3')
210
+ self.auto_freight3 = attributes[:'auto_freight3']
211
+ end
212
+
213
+ if attributes.key?(:'driver_controlled_storage_freight')
214
+ self.driver_controlled_storage_freight = attributes[:'driver_controlled_storage_freight']
215
+ end
216
+
217
+ if attributes.key?(:'driver_controlled_freight1')
218
+ self.driver_controlled_freight1 = attributes[:'driver_controlled_freight1']
219
+ end
220
+
221
+ if attributes.key?(:'driver_controlled_freight2')
222
+ self.driver_controlled_freight2 = attributes[:'driver_controlled_freight2']
223
+ end
224
+
225
+ if attributes.key?(:'driver_controlled_freight3')
226
+ self.driver_controlled_freight3 = attributes[:'driver_controlled_freight3']
227
+ end
228
+
229
+ if attributes.key?(:'endgame_delivered')
230
+ self.endgame_delivered = attributes[:'endgame_delivered']
231
+ end
232
+
233
+ if attributes.key?(:'alliance_balanced')
234
+ self.alliance_balanced = attributes[:'alliance_balanced']
235
+ end
236
+
237
+ if attributes.key?(:'endgame_parked')
238
+ self.endgame_parked = attributes[:'endgame_parked']
239
+ end
240
+
241
+ if attributes.key?(:'capped')
242
+ self.capped = attributes[:'capped']
243
+ end
244
+
245
+ if attributes.key?(:'minor_penalties')
246
+ self.minor_penalties = attributes[:'minor_penalties']
247
+ end
248
+
249
+ if attributes.key?(:'major_penalties')
250
+ self.major_penalties = attributes[:'major_penalties']
251
+ end
252
+
253
+ if attributes.key?(:'carousel_points')
254
+ self.carousel_points = attributes[:'carousel_points']
255
+ end
256
+
257
+ if attributes.key?(:'auto_navigation_points')
258
+ self.auto_navigation_points = attributes[:'auto_navigation_points']
259
+ end
260
+
261
+ if attributes.key?(:'auto_freight_points')
262
+ self.auto_freight_points = attributes[:'auto_freight_points']
263
+ end
264
+
265
+ if attributes.key?(:'auto_bonus_points')
266
+ self.auto_bonus_points = attributes[:'auto_bonus_points']
267
+ end
268
+
269
+ if attributes.key?(:'driver_controlled_alliance_hub_points')
270
+ self.driver_controlled_alliance_hub_points = attributes[:'driver_controlled_alliance_hub_points']
271
+ end
272
+
273
+ if attributes.key?(:'driver_controlled_storage_points')
274
+ self.driver_controlled_storage_points = attributes[:'driver_controlled_storage_points']
275
+ end
276
+
277
+ if attributes.key?(:'endgame_delivery_points')
278
+ self.endgame_delivery_points = attributes[:'endgame_delivery_points']
279
+ end
280
+
281
+ if attributes.key?(:'alliance_balanced_points')
282
+ self.alliance_balanced_points = attributes[:'alliance_balanced_points']
283
+ end
284
+
285
+ if attributes.key?(:'endgame_parking_points')
286
+ self.endgame_parking_points = attributes[:'endgame_parking_points']
287
+ end
288
+
289
+ if attributes.key?(:'capping_points')
290
+ self.capping_points = attributes[:'capping_points']
291
+ end
292
+
293
+ if attributes.key?(:'auto_points')
294
+ self.auto_points = attributes[:'auto_points']
295
+ end
296
+
297
+ if attributes.key?(:'driver_controlled_points')
298
+ self.driver_controlled_points = attributes[:'driver_controlled_points']
299
+ end
300
+
301
+ if attributes.key?(:'endgame_points')
302
+ self.endgame_points = attributes[:'endgame_points']
303
+ end
304
+
305
+ if attributes.key?(:'penalty_points')
306
+ self.penalty_points = attributes[:'penalty_points']
307
+ end
308
+
309
+ if attributes.key?(:'total_points')
310
+ self.total_points = attributes[:'total_points']
311
+ end
312
+ end
313
+
314
+ # Show invalid properties with the reasons. Usually used together with valid?
315
+ # @return Array for valid properties with the reasons
316
+ def list_invalid_properties
317
+ invalid_properties = Array.new
318
+ invalid_properties
319
+ end
320
+
321
+ # Check to see if the all the properties in the model are valid
322
+ # @return true if the model is valid
323
+ def valid?
324
+ true
325
+ end
326
+
327
+ # Checks equality by comparing each attribute.
328
+ # @param [Object] Object to be compared
329
+ def ==(o)
330
+ return true if self.equal?(o)
331
+ self.class == o.class &&
332
+ barcode_element == o.barcode_element &&
333
+ carousel == o.carousel &&
334
+ auto_navigated == o.auto_navigated &&
335
+ auto_bonus == o.auto_bonus &&
336
+ auto_storage_freight == o.auto_storage_freight &&
337
+ auto_freight1 == o.auto_freight1 &&
338
+ auto_freight2 == o.auto_freight2 &&
339
+ auto_freight3 == o.auto_freight3 &&
340
+ driver_controlled_storage_freight == o.driver_controlled_storage_freight &&
341
+ driver_controlled_freight1 == o.driver_controlled_freight1 &&
342
+ driver_controlled_freight2 == o.driver_controlled_freight2 &&
343
+ driver_controlled_freight3 == o.driver_controlled_freight3 &&
344
+ endgame_delivered == o.endgame_delivered &&
345
+ alliance_balanced == o.alliance_balanced &&
346
+ endgame_parked == o.endgame_parked &&
347
+ capped == o.capped &&
348
+ minor_penalties == o.minor_penalties &&
349
+ major_penalties == o.major_penalties &&
350
+ carousel_points == o.carousel_points &&
351
+ auto_navigation_points == o.auto_navigation_points &&
352
+ auto_freight_points == o.auto_freight_points &&
353
+ auto_bonus_points == o.auto_bonus_points &&
354
+ driver_controlled_alliance_hub_points == o.driver_controlled_alliance_hub_points &&
355
+ driver_controlled_storage_points == o.driver_controlled_storage_points &&
356
+ endgame_delivery_points == o.endgame_delivery_points &&
357
+ alliance_balanced_points == o.alliance_balanced_points &&
358
+ endgame_parking_points == o.endgame_parking_points &&
359
+ capping_points == o.capping_points &&
360
+ auto_points == o.auto_points &&
361
+ driver_controlled_points == o.driver_controlled_points &&
362
+ endgame_points == o.endgame_points &&
363
+ penalty_points == o.penalty_points &&
364
+ total_points == o.total_points
365
+ end
366
+
367
+ # @see the `==` method
368
+ # @param [Object] Object to be compared
369
+ def eql?(o)
370
+ self == o
371
+ end
372
+
373
+ # Calculates hash code according to all attributes.
374
+ # @return [Integer] Hash code
375
+ def hash
376
+ [barcode_element, carousel, auto_navigated, auto_bonus, auto_storage_freight, auto_freight1, auto_freight2, auto_freight3, driver_controlled_storage_freight, driver_controlled_freight1, driver_controlled_freight2, driver_controlled_freight3, endgame_delivered, alliance_balanced, endgame_parked, capped, minor_penalties, major_penalties, carousel_points, auto_navigation_points, auto_freight_points, auto_bonus_points, driver_controlled_alliance_hub_points, driver_controlled_storage_points, endgame_delivery_points, alliance_balanced_points, endgame_parking_points, capping_points, auto_points, driver_controlled_points, endgame_points, penalty_points, total_points].hash
377
+ end
378
+
379
+ # Builds the object from hash
380
+ # @param [Hash] attributes Model attributes in the form of hash
381
+ # @return [Object] Returns the model itself
382
+ def self.build_from_hash(attributes)
383
+ new.build_from_hash(attributes)
384
+ end
385
+
386
+ # Builds the object from hash
387
+ # @param [Hash] attributes Model attributes in the form of hash
388
+ # @return [Object] Returns the model itself
389
+ def build_from_hash(attributes)
390
+ return nil unless attributes.is_a?(Hash)
391
+ self.class.openapi_types.each_pair do |key, type|
392
+ if type =~ /\AArray<(.*)>/i
393
+ # check to ensure the input is an array given that the attribute
394
+ # is documented as an array but the input is not
395
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
396
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
397
+ end
398
+ elsif !attributes[self.class.attribute_map[key]].nil?
399
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
400
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
401
+ self.send("#{key}=", nil)
402
+ end
403
+ end
404
+
405
+ self
406
+ end
407
+
408
+ # Deserializes the data based on type
409
+ # @param string type Data type
410
+ # @param string value Value to be deserialized
411
+ # @return [Object] Deserialized data
412
+ def _deserialize(type, value)
413
+ case type.to_sym
414
+ when :DateTime
415
+ DateTime.parse(value)
416
+ when :Date
417
+ Date.parse(value)
418
+ when :String
419
+ value.to_s
420
+ when :Integer
421
+ value.to_i
422
+ when :Float
423
+ value.to_f
424
+ when :Boolean
425
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
426
+ true
427
+ else
428
+ false
429
+ end
430
+ when :Object
431
+ # generic object (usually a Hash), return directly
432
+ value
433
+ when /\AArray<(?<inner_type>.+)>\z/
434
+ inner_type = Regexp.last_match[:inner_type]
435
+ value.map { |v| _deserialize(inner_type, v) }
436
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
437
+ k_type = Regexp.last_match[:k_type]
438
+ v_type = Regexp.last_match[:v_type]
439
+ {}.tap do |hash|
440
+ value.each do |k, v|
441
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
442
+ end
443
+ end
444
+ else # model
445
+ FtcEventsClient.const_get(type).build_from_hash(value)
446
+ end
447
+ end
448
+
449
+ # Returns the string representation of the object
450
+ # @return [String] String presentation of the object
451
+ def to_s
452
+ to_hash.to_s
453
+ end
454
+
455
+ # to_body is an alias to to_hash (backward compatibility)
456
+ # @return [Hash] Returns the object in the form of hash
457
+ def to_body
458
+ to_hash
459
+ end
460
+
461
+ # Returns the object in the form of hash
462
+ # @return [Hash] Returns the object in the form of hash
463
+ def to_hash
464
+ hash = {}
465
+ self.class.attribute_map.each_pair do |attr, param|
466
+ value = self.send(attr)
467
+ if value.nil?
468
+ is_nullable = self.class.openapi_nullable.include?(attr)
469
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
470
+ end
471
+
472
+ hash[param] = _to_hash(value)
473
+ end
474
+ hash
475
+ end
476
+
477
+ # Outputs non-array value in the form of hash
478
+ # For object, use to_hash. Otherwise, just return the value
479
+ # @param [Object] value Any valid value
480
+ # @return [Hash] Returns the value in the form of hash
481
+ def _to_hash(value)
482
+ if value.is_a?(Array)
483
+ value.compact.map { |v| _to_hash(v) }
484
+ elsif value.is_a?(Hash)
485
+ {}.tap do |hash|
486
+ value.each { |k, v| hash[k] = _to_hash(v) }
487
+ end
488
+ elsif value.respond_to? :to_hash
489
+ value.to_hash
490
+ else
491
+ value
492
+ end
493
+ end end
494
+ end
@@ -3,15 +3,13 @@
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
12
  require 'date'
14
- require 'time'
15
13
 
16
14
  module FtcEventsClient
17
15
  class SeasonAwardListingsModel
@@ -24,15 +22,10 @@ module FtcEventsClient
24
22
  }
25
23
  end
26
24
 
27
- # Returns all the JSON keys this model knows about
28
- def self.acceptable_attributes
29
- attribute_map.values
30
- end
31
-
32
25
  # Attribute type mapping.
33
26
  def self.openapi_types
34
27
  {
35
- :'awards' => :'Array<SeasonAwardsModel>'
28
+ :'awards' => :'Object'
36
29
  }
37
30
  end
38
31
 
@@ -42,7 +35,7 @@ module FtcEventsClient
42
35
  :'awards'
43
36
  ])
44
37
  end
45
-
38
+
46
39
  # Initializes the object
47
40
  # @param [Hash] attributes Model attributes in the form of hash
48
41
  def initialize(attributes = {})
@@ -111,9 +104,7 @@ module FtcEventsClient
111
104
  def build_from_hash(attributes)
112
105
  return nil unless attributes.is_a?(Hash)
113
106
  self.class.openapi_types.each_pair do |key, type|
114
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
- self.send("#{key}=", nil)
116
- elsif type =~ /\AArray<(.*)>/i
107
+ if type =~ /\AArray<(.*)>/i
117
108
  # check to ensure the input is an array given that the attribute
118
109
  # is documented as an array but the input is not
119
110
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -121,6 +112,8 @@ module FtcEventsClient
121
112
  end
122
113
  elsif !attributes[self.class.attribute_map[key]].nil?
123
114
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
116
+ self.send("#{key}=", nil)
124
117
  end
125
118
  end
126
119
 
@@ -133,8 +126,8 @@ module FtcEventsClient
133
126
  # @return [Object] Deserialized data
134
127
  def _deserialize(type, value)
135
128
  case type.to_sym
136
- when :Time
137
- Time.parse(value)
129
+ when :DateTime
130
+ DateTime.parse(value)
138
131
  when :Date
139
132
  Date.parse(value)
140
133
  when :String
@@ -164,9 +157,7 @@ module FtcEventsClient
164
157
  end
165
158
  end
166
159
  else # model
167
- # models (e.g. Pet) or oneOf
168
- klass = FtcEventsClient.const_get(type)
169
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
160
+ FtcEventsClient.const_get(type).build_from_hash(value)
170
161
  end
171
162
  end
172
163
 
@@ -214,8 +205,5 @@ module FtcEventsClient
214
205
  else
215
206
  value
216
207
  end
217
- end
218
-
219
- end
220
-
208
+ end end
221
209
  end