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