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