ftc_events_client 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +101 -5
  3. data/build.sh +0 -0
  4. data/config.json +1 -1
  5. data/docs/AdvancementApi.md +120 -0
  6. data/docs/AdvancementModel.md +9 -0
  7. data/docs/AdvancementSlot.md +13 -0
  8. data/docs/AdvancementSourceModel.md +10 -0
  9. data/docs/AllianceModelVersion2.md +3 -0
  10. data/docs/AllianceSelectionApi.md +56 -1
  11. data/docs/AllianceSelectionDetailModel.md +8 -0
  12. data/docs/ApiAdvancementStatus.md +6 -0
  13. data/docs/AutoNavigation.md +6 -0
  14. data/docs/AwardAssignmentModel.md +1 -0
  15. data/docs/AwardsApi.md +1 -1
  16. data/docs/Coordinate.md +12 -0
  17. data/docs/CoordinateEqualityComparer.md +6 -0
  18. data/docs/CoordinateSequence.md +17 -0
  19. data/docs/CoordinateSequenceFactory.md +7 -0
  20. data/docs/Dimension.md +6 -0
  21. data/docs/EndGameLocation.md +6 -0
  22. data/docs/Envelope.md +18 -0
  23. data/docs/FieldSide.md +6 -0
  24. data/docs/GeneralApi.md +1 -1
  25. data/docs/Geometry.md +30 -0
  26. data/docs/GeometryFactory.md +10 -0
  27. data/docs/GeometryOverlay.md +6 -0
  28. data/docs/JunctionElement.md +6 -0
  29. data/docs/LeaguesApi.md +1 -1
  30. data/docs/MatchResultsApi.md +1 -1
  31. data/docs/NtsGeometryServices.md +11 -0
  32. data/docs/OgcGeometryType.md +6 -0
  33. data/docs/Ordinates.md +6 -0
  34. data/docs/Point.md +35 -0
  35. data/docs/PrecisionModel.md +11 -0
  36. data/docs/PrecisionModels.md +6 -0
  37. data/docs/RankingsApi.md +1 -1
  38. data/docs/ScheduleApi.md +1 -1
  39. data/docs/ScheduleHybridModelTeamVersion2.md +2 -0
  40. data/docs/ScheduleHybridModelVersion2.md +2 -0
  41. data/docs/ScheduledMatchTeamModelVersion2.md +3 -0
  42. data/docs/ScoreDetailAllianceModel2022.md +42 -0
  43. data/docs/ScoreDetailAllianceModel2023.md +44 -0
  44. data/docs/ScoreDetailModel2021.md +1 -0
  45. data/docs/ScoreDetailModel2022.md +11 -0
  46. data/docs/ScoreDetailModel2023.md +11 -0
  47. data/docs/ScoreDetailModelSinglePlayer2021.md +1 -0
  48. data/docs/ScoreDetailModelSinglePlayer2022.md +11 -0
  49. data/docs/ScoreDetailModelSinglePlayer2023.md +11 -0
  50. data/docs/ScoreDetailSinglePlayer2022.md +35 -0
  51. data/docs/ScoreDetailSinglePlayer2023.md +36 -0
  52. data/docs/SeasonDataApi.md +1 -1
  53. data/docs/SeasonEventModelVersion2.md +3 -0
  54. data/docs/SeasonLeagueModelVersion2.md +2 -0
  55. data/docs/SeasonTeamModelVersion2.md +3 -0
  56. data/docs/SelectionModel.md +9 -0
  57. data/docs/SelectionResult.md +6 -0
  58. data/docs/TeamRankingModel.md +2 -0
  59. data/ftc_events_client.gemspec +1 -1
  60. data/git_push.sh +0 -0
  61. data/lib/ftc_events_client/api/advancement_api.rb +147 -0
  62. data/lib/ftc_events_client/api/alliance_selection_api.rb +63 -1
  63. data/lib/ftc_events_client/api/awards_api.rb +1 -1
  64. data/lib/ftc_events_client/api/general_api.rb +1 -1
  65. data/lib/ftc_events_client/api/leagues_api.rb +1 -1
  66. data/lib/ftc_events_client/api/match_results_api.rb +1 -1
  67. data/lib/ftc_events_client/api/rankings_api.rb +1 -1
  68. data/lib/ftc_events_client/api/schedule_api.rb +1 -1
  69. data/lib/ftc_events_client/api/season_data_api.rb +1 -1
  70. data/lib/ftc_events_client/api_client.rb +3 -13
  71. data/lib/ftc_events_client/api_error.rb +1 -1
  72. data/lib/ftc_events_client/configuration.rb +2 -2
  73. data/lib/ftc_events_client/models/advancement_model.rb +231 -0
  74. data/lib/ftc_events_client/models/advancement_slot.rb +269 -0
  75. data/lib/ftc_events_client/models/advancement_source_model.rb +242 -0
  76. data/lib/ftc_events_client/models/alliance_model_version2.rb +32 -2
  77. data/lib/ftc_events_client/models/alliance_score_2020.rb +1 -1
  78. data/lib/ftc_events_client/models/alliance_selection_detail_model.rb +218 -0
  79. data/lib/ftc_events_client/models/alliance_selection_model_version2.rb +1 -1
  80. data/lib/ftc_events_client/models/api_advancement_status.rb +31 -0
  81. data/lib/ftc_events_client/models/api_index_model.rb +1 -1
  82. data/lib/ftc_events_client/models/auto_navigated_status.rb +1 -1
  83. data/lib/ftc_events_client/models/auto_navigation.rb +29 -0
  84. data/lib/ftc_events_client/models/award_assignment_model.rb +12 -2
  85. data/lib/ftc_events_client/models/awards_model.rb +1 -1
  86. data/lib/ftc_events_client/models/barcode_element.rb +1 -1
  87. data/lib/ftc_events_client/models/coordinate.rb +251 -0
  88. data/lib/ftc_events_client/models/coordinate_equality_comparer.rb +197 -0
  89. data/lib/ftc_events_client/models/coordinate_sequence.rb +296 -0
  90. data/lib/ftc_events_client/models/coordinate_sequence_factory.rb +206 -0
  91. data/lib/ftc_events_client/models/dimension.rb +33 -0
  92. data/lib/ftc_events_client/models/end_game_location.rb +29 -0
  93. data/lib/ftc_events_client/models/endgame_parked_status.rb +1 -1
  94. data/lib/ftc_events_client/models/envelope.rb +305 -0
  95. data/lib/ftc_events_client/models/event_match_results_model_version2.rb +1 -1
  96. data/lib/ftc_events_client/models/event_rankings_model.rb +1 -1
  97. data/lib/ftc_events_client/models/event_schedule_hybrid_model_version2.rb +1 -1
  98. data/lib/ftc_events_client/models/event_schedule_model_version2.rb +1 -1
  99. data/lib/ftc_events_client/models/field_side.rb +28 -0
  100. data/lib/ftc_events_client/models/ftc_event_level.rb +1 -1
  101. data/lib/ftc_events_client/models/geometry.rb +418 -0
  102. data/lib/ftc_events_client/models/geometry_factory.rb +233 -0
  103. data/lib/ftc_events_client/models/geometry_overlay.rb +197 -0
  104. data/lib/ftc_events_client/models/junction_element.rb +32 -0
  105. data/lib/ftc_events_client/models/league_member_list_model.rb +1 -1
  106. data/lib/ftc_events_client/models/match_result_model_version2.rb +1 -1
  107. data/lib/ftc_events_client/models/match_result_team_model_version2.rb +1 -1
  108. data/lib/ftc_events_client/models/match_scores_model.rb +1 -1
  109. data/lib/ftc_events_client/models/nts_geometry_services.rb +242 -0
  110. data/lib/ftc_events_client/models/ogc_geometry_type.rb +42 -0
  111. data/lib/ftc_events_client/models/one_of_match_scores_model_match_scores_items.rb +1 -1
  112. data/lib/ftc_events_client/models/ordinates.rb +66 -0
  113. data/lib/ftc_events_client/models/point.rb +463 -0
  114. data/lib/ftc_events_client/models/precision_model.rb +242 -0
  115. data/lib/ftc_events_client/models/precision_models.rb +29 -0
  116. data/lib/ftc_events_client/models/schedule_hybrid_model_team_version2.rb +26 -6
  117. data/lib/ftc_events_client/models/schedule_hybrid_model_version2.rb +22 -2
  118. data/lib/ftc_events_client/models/scheduled_match_model_version2.rb +1 -1
  119. data/lib/ftc_events_client/models/scheduled_match_team_model_version2.rb +32 -2
  120. data/lib/ftc_events_client/models/score_detail_alliance_model_2020.rb +1 -1
  121. data/lib/ftc_events_client/models/score_detail_alliance_model_2021.rb +1 -1
  122. data/lib/ftc_events_client/models/score_detail_alliance_model_2022.rb +540 -0
  123. data/lib/ftc_events_client/models/score_detail_alliance_model_2023.rb +540 -0
  124. data/lib/ftc_events_client/models/score_detail_model_2019.rb +1 -1
  125. data/lib/ftc_events_client/models/score_detail_model_2020.rb +1 -1
  126. data/lib/ftc_events_client/models/score_detail_model_2021.rb +11 -2
  127. data/lib/ftc_events_client/models/score_detail_model_2022.rb +245 -0
  128. data/lib/ftc_events_client/models/score_detail_model_2023.rb +245 -0
  129. data/lib/ftc_events_client/models/score_detail_model_alliance_2019.rb +1 -1
  130. data/lib/ftc_events_client/models/score_detail_model_single_player_2020.rb +1 -1
  131. data/lib/ftc_events_client/models/score_detail_model_single_player_2021.rb +11 -2
  132. data/lib/ftc_events_client/models/score_detail_model_single_player_2022.rb +242 -0
  133. data/lib/ftc_events_client/models/score_detail_model_single_player_2023.rb +242 -0
  134. data/lib/ftc_events_client/models/score_detail_single_player_2021.rb +1 -1
  135. data/lib/ftc_events_client/models/score_detail_single_player_2022.rb +474 -0
  136. data/lib/ftc_events_client/models/score_detail_single_player_2023.rb +467 -0
  137. data/lib/ftc_events_client/models/season_award_listings_model.rb +1 -1
  138. data/lib/ftc_events_client/models/season_awards_model.rb +1 -1
  139. data/lib/ftc_events_client/models/season_event_listings_model_version2.rb +1 -1
  140. data/lib/ftc_events_client/models/season_event_model_version2.rb +30 -2
  141. data/lib/ftc_events_client/models/season_league_listings_model_version2.rb +1 -1
  142. data/lib/ftc_events_client/models/season_league_model_version2.rb +22 -2
  143. data/lib/ftc_events_client/models/season_summary_model_championship.rb +1 -1
  144. data/lib/ftc_events_client/models/season_summary_model_version2.rb +1 -1
  145. data/lib/ftc_events_client/models/season_team_listings_model_version2.rb +1 -1
  146. data/lib/ftc_events_client/models/season_team_model_version2.rb +36 -6
  147. data/lib/ftc_events_client/models/selection_model.rb +224 -0
  148. data/lib/ftc_events_client/models/selection_result.rb +29 -0
  149. data/lib/ftc_events_client/models/stone.rb +1 -1
  150. data/lib/ftc_events_client/models/team_ranking_model.rb +22 -2
  151. data/lib/ftc_events_client/version.rb +2 -2
  152. data/lib/ftc_events_client.rb +36 -1
  153. data/spec/api/advancement_api_spec.rb +61 -0
  154. data/spec/models/advancement_model_spec.rb +52 -0
  155. data/spec/models/advancement_slot_spec.rb +76 -0
  156. data/spec/models/advancement_source_model_spec.rb +58 -0
  157. data/spec/models/alliance_selection_detail_model_spec.rb +46 -0
  158. data/spec/models/api_advancement_status_spec.rb +34 -0
  159. data/spec/models/auto_navigation_spec.rb +34 -0
  160. data/spec/models/coordinate_equality_comparer_spec.rb +34 -0
  161. data/spec/models/coordinate_sequence_factory_spec.rb +40 -0
  162. data/spec/models/coordinate_sequence_spec.rb +100 -0
  163. data/spec/models/coordinate_spec.rb +70 -0
  164. data/spec/models/dimension_spec.rb +34 -0
  165. data/spec/models/end_game_location_spec.rb +34 -0
  166. data/spec/models/envelope_spec.rb +106 -0
  167. data/spec/models/field_side_spec.rb +34 -0
  168. data/spec/models/geometry_factory_spec.rb +58 -0
  169. data/spec/models/geometry_overlay_spec.rb +34 -0
  170. data/spec/models/geometry_spec.rb +178 -0
  171. data/spec/models/junction_element_spec.rb +34 -0
  172. data/spec/models/nts_geometry_services_spec.rb +64 -0
  173. data/spec/models/ogc_geometry_type_spec.rb +34 -0
  174. data/spec/models/ordinates_spec.rb +34 -0
  175. data/spec/models/point_spec.rb +208 -0
  176. data/spec/models/precision_model_spec.rb +64 -0
  177. data/spec/models/precision_models_spec.rb +34 -0
  178. data/spec/models/score_detail_alliance_model_2022_spec.rb +250 -0
  179. data/spec/models/score_detail_alliance_model_2023_spec.rb +262 -0
  180. data/spec/models/score_detail_model_2022_spec.rb +64 -0
  181. data/spec/models/score_detail_model_2023_spec.rb +64 -0
  182. data/spec/models/score_detail_model_single_player_2022_spec.rb +64 -0
  183. data/spec/models/score_detail_model_single_player_2023_spec.rb +64 -0
  184. data/spec/models/score_detail_single_player_2022_spec.rb +208 -0
  185. data/spec/models/score_detail_single_player_2023_spec.rb +214 -0
  186. data/spec/models/selection_model_spec.rb +52 -0
  187. data/spec/models/selection_result_spec.rb +34 -0
  188. metadata +144 -3
@@ -0,0 +1,540 @@
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.52
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module FtcEventsClient
15
+ class ScoreDetailAllianceModel2022
16
+ attr_accessor :side_of_field
17
+
18
+ attr_accessor :init_signal_sleeve1
19
+
20
+ attr_accessor :init_signal_sleeve2
21
+
22
+ attr_accessor :robot1_auto
23
+
24
+ attr_accessor :robot2_auto
25
+
26
+ attr_accessor :auto_terminal
27
+
28
+ # Two dimensional array of lists of items scored on junctions in autonomous. [0,0] is the upper-left corner of the field as viewed from the audience side of the field (V5). The array is indexed by row, then column. (e.g [0,4] is in the upper right corner of the field (Z5).) Each junction is stored bottom up (index 0 is the bottom-most element on the field). MY_* elements belong to the alliance whose score object the element appears in, OTHER_* elements belong to the opposing alliance. (e.g in a set of scores for the red alliance, MY_CONE is a red cone and OTHER_CONE is a blue cone.) For a complete example, if red.autoJunctions[4][0][1] is OTHER_CONE, there is a blue cone in the bottom left cornerof the field (V1) on top of one other cone.
29
+ attr_accessor :auto_junctions
30
+
31
+ # Two dimensional array of lists of items scored on junctions in driver-controlled. [0,0] is the upper-left corner of the field as viewed from the audience side of the field (V5). The array is indexed by crow, then column. (e.g [0,4] is in the upper right corner of the field (Z5).) Each junction is stored bottom up (index 0 is the bottom-most element on the field). MY_* elements belong to the alliance whose score object the element appears in, OTHER_* elements belong to the opposing alliance. (e.g in a set of scores for the red alliance, MY_CONE is a red cone and OTHER_CONE is a blue cone.) *_R1_BEACON means the beacon scored by robot 1 on the corresponding alliance. For a complete example, if red.dcJunctions[4][0][1] is OTHER_CONE, there is a blue cone in the bottom left cornerof the field (V1) on top of one other cone.
32
+ attr_accessor :dc_junctions
33
+
34
+ # Number of Scored cones in the alliance-colored terminal on the side of the field closest to the alliance station.
35
+ attr_accessor :dc_terminal_near
36
+
37
+ # Number of Scored cones in the alliance-colored terminal on the side of the field opposite the alliance station.
38
+ attr_accessor :dc_terminal_far
39
+
40
+ attr_accessor :eg_navigated1
41
+
42
+ attr_accessor :eg_navigated2
43
+
44
+ attr_accessor :minor_penalties
45
+
46
+ attr_accessor :major_penalties
47
+
48
+ attr_accessor :auto_navigation_points
49
+
50
+ attr_accessor :signal_bonus_points
51
+
52
+ attr_accessor :auto_junction_cone_points
53
+
54
+ attr_accessor :auto_terminal_cone_points
55
+
56
+ attr_accessor :dc_junction_cone_points
57
+
58
+ attr_accessor :dc_terminal_cone_points
59
+
60
+ attr_accessor :ownership_points
61
+
62
+ attr_accessor :circuit_points
63
+
64
+ attr_accessor :eg_navigation_points
65
+
66
+ attr_accessor :auto_points
67
+
68
+ attr_accessor :dc_points
69
+
70
+ attr_accessor :endgame_points
71
+
72
+ attr_accessor :penalty_points_committed
73
+
74
+ attr_accessor :pre_penalty_total
75
+
76
+ # Array of 4 cone counts scored by this alliance on ground, low, medium, and high junctions respectively, scored in autonomous. E.g. red.autoJunctionCones[2] is the total number of cones scored by red on medium-height junctions.
77
+ attr_accessor :auto_junction_cones
78
+
79
+ # Array of 4 cone counts scored by this alliance on ground, low, medium, and high junctions respectively, scored in driver-controlled. E.g. red.dcJunctionCones[2] is the total number of cones scored by red on medium-height junctions.
80
+ attr_accessor :dc_junction_cones
81
+
82
+ attr_accessor :beacons
83
+
84
+ attr_accessor :owned_junctions
85
+
86
+ attr_accessor :circuit
87
+
88
+ attr_accessor :total_points
89
+
90
+ attr_accessor :alliance
91
+
92
+ attr_accessor :team
93
+
94
+ # Attribute mapping from ruby-style variable name to JSON key.
95
+ def self.attribute_map
96
+ {
97
+ :'side_of_field' => :'sideOfField',
98
+ :'init_signal_sleeve1' => :'initSignalSleeve1',
99
+ :'init_signal_sleeve2' => :'initSignalSleeve2',
100
+ :'robot1_auto' => :'robot1Auto',
101
+ :'robot2_auto' => :'robot2Auto',
102
+ :'auto_terminal' => :'autoTerminal',
103
+ :'auto_junctions' => :'autoJunctions',
104
+ :'dc_junctions' => :'dcJunctions',
105
+ :'dc_terminal_near' => :'dcTerminalNear',
106
+ :'dc_terminal_far' => :'dcTerminalFar',
107
+ :'eg_navigated1' => :'egNavigated1',
108
+ :'eg_navigated2' => :'egNavigated2',
109
+ :'minor_penalties' => :'minorPenalties',
110
+ :'major_penalties' => :'majorPenalties',
111
+ :'auto_navigation_points' => :'autoNavigationPoints',
112
+ :'signal_bonus_points' => :'signalBonusPoints',
113
+ :'auto_junction_cone_points' => :'autoJunctionConePoints',
114
+ :'auto_terminal_cone_points' => :'autoTerminalConePoints',
115
+ :'dc_junction_cone_points' => :'dcJunctionConePoints',
116
+ :'dc_terminal_cone_points' => :'dcTerminalConePoints',
117
+ :'ownership_points' => :'ownershipPoints',
118
+ :'circuit_points' => :'circuitPoints',
119
+ :'eg_navigation_points' => :'egNavigationPoints',
120
+ :'auto_points' => :'autoPoints',
121
+ :'dc_points' => :'dcPoints',
122
+ :'endgame_points' => :'endgamePoints',
123
+ :'penalty_points_committed' => :'penaltyPointsCommitted',
124
+ :'pre_penalty_total' => :'prePenaltyTotal',
125
+ :'auto_junction_cones' => :'autoJunctionCones',
126
+ :'dc_junction_cones' => :'dcJunctionCones',
127
+ :'beacons' => :'beacons',
128
+ :'owned_junctions' => :'ownedJunctions',
129
+ :'circuit' => :'circuit',
130
+ :'total_points' => :'totalPoints',
131
+ :'alliance' => :'alliance',
132
+ :'team' => :'team'
133
+ }
134
+ end
135
+
136
+ # Attribute type mapping.
137
+ def self.openapi_types
138
+ {
139
+ :'side_of_field' => :'Object',
140
+ :'init_signal_sleeve1' => :'Object',
141
+ :'init_signal_sleeve2' => :'Object',
142
+ :'robot1_auto' => :'Object',
143
+ :'robot2_auto' => :'Object',
144
+ :'auto_terminal' => :'Object',
145
+ :'auto_junctions' => :'Object',
146
+ :'dc_junctions' => :'Object',
147
+ :'dc_terminal_near' => :'Object',
148
+ :'dc_terminal_far' => :'Object',
149
+ :'eg_navigated1' => :'Object',
150
+ :'eg_navigated2' => :'Object',
151
+ :'minor_penalties' => :'Object',
152
+ :'major_penalties' => :'Object',
153
+ :'auto_navigation_points' => :'Object',
154
+ :'signal_bonus_points' => :'Object',
155
+ :'auto_junction_cone_points' => :'Object',
156
+ :'auto_terminal_cone_points' => :'Object',
157
+ :'dc_junction_cone_points' => :'Object',
158
+ :'dc_terminal_cone_points' => :'Object',
159
+ :'ownership_points' => :'Object',
160
+ :'circuit_points' => :'Object',
161
+ :'eg_navigation_points' => :'Object',
162
+ :'auto_points' => :'Object',
163
+ :'dc_points' => :'Object',
164
+ :'endgame_points' => :'Object',
165
+ :'penalty_points_committed' => :'Object',
166
+ :'pre_penalty_total' => :'Object',
167
+ :'auto_junction_cones' => :'Object',
168
+ :'dc_junction_cones' => :'Object',
169
+ :'beacons' => :'Object',
170
+ :'owned_junctions' => :'Object',
171
+ :'circuit' => :'Object',
172
+ :'total_points' => :'Object',
173
+ :'alliance' => :'Object',
174
+ :'team' => :'Object'
175
+ }
176
+ end
177
+
178
+ # List of attributes with nullable: true
179
+ def self.openapi_nullable
180
+ Set.new([
181
+ :'auto_junctions',
182
+ :'dc_junctions',
183
+ :'auto_junction_cones',
184
+ :'dc_junction_cones',
185
+ :'alliance',
186
+ ])
187
+ end
188
+
189
+ # Initializes the object
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ def initialize(attributes = {})
192
+ if (!attributes.is_a?(Hash))
193
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FtcEventsClient::ScoreDetailAllianceModel2022` initialize method"
194
+ end
195
+
196
+ # check to see if the attribute exists and convert string to symbol for hash key
197
+ attributes = attributes.each_with_object({}) { |(k, v), h|
198
+ if (!self.class.attribute_map.key?(k.to_sym))
199
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FtcEventsClient::ScoreDetailAllianceModel2022`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
200
+ end
201
+ h[k.to_sym] = v
202
+ }
203
+
204
+ if attributes.key?(:'side_of_field')
205
+ self.side_of_field = attributes[:'side_of_field']
206
+ end
207
+
208
+ if attributes.key?(:'init_signal_sleeve1')
209
+ self.init_signal_sleeve1 = attributes[:'init_signal_sleeve1']
210
+ end
211
+
212
+ if attributes.key?(:'init_signal_sleeve2')
213
+ self.init_signal_sleeve2 = attributes[:'init_signal_sleeve2']
214
+ end
215
+
216
+ if attributes.key?(:'robot1_auto')
217
+ self.robot1_auto = attributes[:'robot1_auto']
218
+ end
219
+
220
+ if attributes.key?(:'robot2_auto')
221
+ self.robot2_auto = attributes[:'robot2_auto']
222
+ end
223
+
224
+ if attributes.key?(:'auto_terminal')
225
+ self.auto_terminal = attributes[:'auto_terminal']
226
+ end
227
+
228
+ if attributes.key?(:'auto_junctions')
229
+ if (value = attributes[:'auto_junctions']).is_a?(Array)
230
+ self.auto_junctions = value
231
+ end
232
+ end
233
+
234
+ if attributes.key?(:'dc_junctions')
235
+ if (value = attributes[:'dc_junctions']).is_a?(Array)
236
+ self.dc_junctions = value
237
+ end
238
+ end
239
+
240
+ if attributes.key?(:'dc_terminal_near')
241
+ self.dc_terminal_near = attributes[:'dc_terminal_near']
242
+ end
243
+
244
+ if attributes.key?(:'dc_terminal_far')
245
+ self.dc_terminal_far = attributes[:'dc_terminal_far']
246
+ end
247
+
248
+ if attributes.key?(:'eg_navigated1')
249
+ self.eg_navigated1 = attributes[:'eg_navigated1']
250
+ end
251
+
252
+ if attributes.key?(:'eg_navigated2')
253
+ self.eg_navigated2 = attributes[:'eg_navigated2']
254
+ end
255
+
256
+ if attributes.key?(:'minor_penalties')
257
+ self.minor_penalties = attributes[:'minor_penalties']
258
+ end
259
+
260
+ if attributes.key?(:'major_penalties')
261
+ self.major_penalties = attributes[:'major_penalties']
262
+ end
263
+
264
+ if attributes.key?(:'auto_navigation_points')
265
+ self.auto_navigation_points = attributes[:'auto_navigation_points']
266
+ end
267
+
268
+ if attributes.key?(:'signal_bonus_points')
269
+ self.signal_bonus_points = attributes[:'signal_bonus_points']
270
+ end
271
+
272
+ if attributes.key?(:'auto_junction_cone_points')
273
+ self.auto_junction_cone_points = attributes[:'auto_junction_cone_points']
274
+ end
275
+
276
+ if attributes.key?(:'auto_terminal_cone_points')
277
+ self.auto_terminal_cone_points = attributes[:'auto_terminal_cone_points']
278
+ end
279
+
280
+ if attributes.key?(:'dc_junction_cone_points')
281
+ self.dc_junction_cone_points = attributes[:'dc_junction_cone_points']
282
+ end
283
+
284
+ if attributes.key?(:'dc_terminal_cone_points')
285
+ self.dc_terminal_cone_points = attributes[:'dc_terminal_cone_points']
286
+ end
287
+
288
+ if attributes.key?(:'ownership_points')
289
+ self.ownership_points = attributes[:'ownership_points']
290
+ end
291
+
292
+ if attributes.key?(:'circuit_points')
293
+ self.circuit_points = attributes[:'circuit_points']
294
+ end
295
+
296
+ if attributes.key?(:'eg_navigation_points')
297
+ self.eg_navigation_points = attributes[:'eg_navigation_points']
298
+ end
299
+
300
+ if attributes.key?(:'auto_points')
301
+ self.auto_points = attributes[:'auto_points']
302
+ end
303
+
304
+ if attributes.key?(:'dc_points')
305
+ self.dc_points = attributes[:'dc_points']
306
+ end
307
+
308
+ if attributes.key?(:'endgame_points')
309
+ self.endgame_points = attributes[:'endgame_points']
310
+ end
311
+
312
+ if attributes.key?(:'penalty_points_committed')
313
+ self.penalty_points_committed = attributes[:'penalty_points_committed']
314
+ end
315
+
316
+ if attributes.key?(:'pre_penalty_total')
317
+ self.pre_penalty_total = attributes[:'pre_penalty_total']
318
+ end
319
+
320
+ if attributes.key?(:'auto_junction_cones')
321
+ if (value = attributes[:'auto_junction_cones']).is_a?(Array)
322
+ self.auto_junction_cones = value
323
+ end
324
+ end
325
+
326
+ if attributes.key?(:'dc_junction_cones')
327
+ if (value = attributes[:'dc_junction_cones']).is_a?(Array)
328
+ self.dc_junction_cones = value
329
+ end
330
+ end
331
+
332
+ if attributes.key?(:'beacons')
333
+ self.beacons = attributes[:'beacons']
334
+ end
335
+
336
+ if attributes.key?(:'owned_junctions')
337
+ self.owned_junctions = attributes[:'owned_junctions']
338
+ end
339
+
340
+ if attributes.key?(:'circuit')
341
+ self.circuit = attributes[:'circuit']
342
+ end
343
+
344
+ if attributes.key?(:'total_points')
345
+ self.total_points = attributes[:'total_points']
346
+ end
347
+
348
+ if attributes.key?(:'alliance')
349
+ self.alliance = attributes[:'alliance']
350
+ end
351
+
352
+ if attributes.key?(:'team')
353
+ self.team = attributes[:'team']
354
+ end
355
+ end
356
+
357
+ # Show invalid properties with the reasons. Usually used together with valid?
358
+ # @return Array for valid properties with the reasons
359
+ def list_invalid_properties
360
+ invalid_properties = Array.new
361
+ invalid_properties
362
+ end
363
+
364
+ # Check to see if the all the properties in the model are valid
365
+ # @return true if the model is valid
366
+ def valid?
367
+ true
368
+ end
369
+
370
+ # Checks equality by comparing each attribute.
371
+ # @param [Object] Object to be compared
372
+ def ==(o)
373
+ return true if self.equal?(o)
374
+ self.class == o.class &&
375
+ side_of_field == o.side_of_field &&
376
+ init_signal_sleeve1 == o.init_signal_sleeve1 &&
377
+ init_signal_sleeve2 == o.init_signal_sleeve2 &&
378
+ robot1_auto == o.robot1_auto &&
379
+ robot2_auto == o.robot2_auto &&
380
+ auto_terminal == o.auto_terminal &&
381
+ auto_junctions == o.auto_junctions &&
382
+ dc_junctions == o.dc_junctions &&
383
+ dc_terminal_near == o.dc_terminal_near &&
384
+ dc_terminal_far == o.dc_terminal_far &&
385
+ eg_navigated1 == o.eg_navigated1 &&
386
+ eg_navigated2 == o.eg_navigated2 &&
387
+ minor_penalties == o.minor_penalties &&
388
+ major_penalties == o.major_penalties &&
389
+ auto_navigation_points == o.auto_navigation_points &&
390
+ signal_bonus_points == o.signal_bonus_points &&
391
+ auto_junction_cone_points == o.auto_junction_cone_points &&
392
+ auto_terminal_cone_points == o.auto_terminal_cone_points &&
393
+ dc_junction_cone_points == o.dc_junction_cone_points &&
394
+ dc_terminal_cone_points == o.dc_terminal_cone_points &&
395
+ ownership_points == o.ownership_points &&
396
+ circuit_points == o.circuit_points &&
397
+ eg_navigation_points == o.eg_navigation_points &&
398
+ auto_points == o.auto_points &&
399
+ dc_points == o.dc_points &&
400
+ endgame_points == o.endgame_points &&
401
+ penalty_points_committed == o.penalty_points_committed &&
402
+ pre_penalty_total == o.pre_penalty_total &&
403
+ auto_junction_cones == o.auto_junction_cones &&
404
+ dc_junction_cones == o.dc_junction_cones &&
405
+ beacons == o.beacons &&
406
+ owned_junctions == o.owned_junctions &&
407
+ circuit == o.circuit &&
408
+ total_points == o.total_points &&
409
+ alliance == o.alliance &&
410
+ team == o.team
411
+ end
412
+
413
+ # @see the `==` method
414
+ # @param [Object] Object to be compared
415
+ def eql?(o)
416
+ self == o
417
+ end
418
+
419
+ # Calculates hash code according to all attributes.
420
+ # @return [Integer] Hash code
421
+ def hash
422
+ [side_of_field, init_signal_sleeve1, init_signal_sleeve2, robot1_auto, robot2_auto, auto_terminal, auto_junctions, dc_junctions, dc_terminal_near, dc_terminal_far, eg_navigated1, eg_navigated2, minor_penalties, major_penalties, auto_navigation_points, signal_bonus_points, auto_junction_cone_points, auto_terminal_cone_points, dc_junction_cone_points, dc_terminal_cone_points, ownership_points, circuit_points, eg_navigation_points, auto_points, dc_points, endgame_points, penalty_points_committed, pre_penalty_total, auto_junction_cones, dc_junction_cones, beacons, owned_junctions, circuit, total_points, alliance, team].hash
423
+ end
424
+
425
+ # Builds the object from hash
426
+ # @param [Hash] attributes Model attributes in the form of hash
427
+ # @return [Object] Returns the model itself
428
+ def self.build_from_hash(attributes)
429
+ new.build_from_hash(attributes)
430
+ end
431
+
432
+ # Builds the object from hash
433
+ # @param [Hash] attributes Model attributes in the form of hash
434
+ # @return [Object] Returns the model itself
435
+ def build_from_hash(attributes)
436
+ return nil unless attributes.is_a?(Hash)
437
+ self.class.openapi_types.each_pair do |key, type|
438
+ if 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
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
447
+ self.send("#{key}=", nil)
448
+ end
449
+ end
450
+
451
+ self
452
+ end
453
+
454
+ # Deserializes the data based on type
455
+ # @param string type Data type
456
+ # @param string value Value to be deserialized
457
+ # @return [Object] Deserialized data
458
+ def _deserialize(type, value)
459
+ case type.to_sym
460
+ when :DateTime
461
+ DateTime.parse(value)
462
+ when :Date
463
+ Date.parse(value)
464
+ when :String
465
+ value.to_s
466
+ when :Integer
467
+ value.to_i
468
+ when :Float
469
+ value.to_f
470
+ when :Boolean
471
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
472
+ true
473
+ else
474
+ false
475
+ end
476
+ when :Object
477
+ # generic object (usually a Hash), return directly
478
+ value
479
+ when /\AArray<(?<inner_type>.+)>\z/
480
+ inner_type = Regexp.last_match[:inner_type]
481
+ value.map { |v| _deserialize(inner_type, v) }
482
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
483
+ k_type = Regexp.last_match[:k_type]
484
+ v_type = Regexp.last_match[:v_type]
485
+ {}.tap do |hash|
486
+ value.each do |k, v|
487
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
488
+ end
489
+ end
490
+ else # model
491
+ FtcEventsClient.const_get(type).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 end
540
+ end