lishogi 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +661 -0
  4. data/LICENSE~ +1 -0
  5. data/Makefile +39 -0
  6. data/Makefile~ +7 -0
  7. data/README.md +276 -0
  8. data/Rakefile +10 -0
  9. data/docs/Account200Response.md +20 -0
  10. data/docs/AccountApi.md +345 -0
  11. data/docs/AccountEmail200Response.md +18 -0
  12. data/docs/AccountKid200Response.md +18 -0
  13. data/docs/AnalysisApi.md +77 -0
  14. data/docs/ApiStreamEvent200Response.md +53 -0
  15. data/docs/ApiUsersStatus200ResponseInner.md +30 -0
  16. data/docs/ArenaTournaments.md +22 -0
  17. data/docs/ArenaTournamentsApi.md +601 -0
  18. data/docs/BoardApi.md +659 -0
  19. data/docs/BoardGameStream200Response.md +51 -0
  20. data/docs/BoardGameTakebackAcceptParameter.md +15 -0
  21. data/docs/BotApi.md +634 -0
  22. data/docs/ChallengeDeclinedEvent.md +20 -0
  23. data/docs/ChallengeEvent.md +20 -0
  24. data/docs/ChallengeJson.md +42 -0
  25. data/docs/ChallengeJsonPerf.md +20 -0
  26. data/docs/ChallengeJsonTimeControl.md +51 -0
  27. data/docs/ChallengeJsonTimeControlOneOf.md +28 -0
  28. data/docs/ChallengeJsonTimeControlOneOf1.md +20 -0
  29. data/docs/ChallengeJsonTimeControlOneOf2.md +18 -0
  30. data/docs/ChallengeUser.md +30 -0
  31. data/docs/ChallengesApi.md +414 -0
  32. data/docs/ChatLineEvent.md +24 -0
  33. data/docs/Clock.md +24 -0
  34. data/docs/Count.md +38 -0
  35. data/docs/Error.md +18 -0
  36. data/docs/GameEventInfo.md +22 -0
  37. data/docs/GameEventInfoCompat.md +20 -0
  38. data/docs/GameEventPlayer.md +28 -0
  39. data/docs/GameFinishEvent.md +20 -0
  40. data/docs/GameFullEvent.md +42 -0
  41. data/docs/GameFullEventPerf.md +18 -0
  42. data/docs/GameJson.md +50 -0
  43. data/docs/GameJsonAnalysisInner.md +24 -0
  44. data/docs/GameJsonAnalysisInnerJudgment.md +20 -0
  45. data/docs/GameJsonClock.md +26 -0
  46. data/docs/GameJsonPlayers.md +20 -0
  47. data/docs/GameStartEvent.md +20 -0
  48. data/docs/GameStateEvent.md +38 -0
  49. data/docs/GameStatus.md +15 -0
  50. data/docs/GameUser.md +32 -0
  51. data/docs/GameUserAnalysis.md +24 -0
  52. data/docs/GamesApi.md +473 -0
  53. data/docs/LightUser.md +24 -0
  54. data/docs/LightUserTitle.md +49 -0
  55. data/docs/MessagingApi.md +79 -0
  56. data/docs/Move.md +28 -0
  57. data/docs/NotFound.md +18 -0
  58. data/docs/OAuthError.md +20 -0
  59. data/docs/Ok.md +18 -0
  60. data/docs/Perf.md +26 -0
  61. data/docs/PerfType.md +15 -0
  62. data/docs/Perfs.md +30 -0
  63. data/docs/PlayTime.md +20 -0
  64. data/docs/Profile.md +28 -0
  65. data/docs/PuzzleRoundJson.md +24 -0
  66. data/docs/PuzzlesApi.md +211 -0
  67. data/docs/SimulsApi.md +69 -0
  68. data/docs/Speed.md +15 -0
  69. data/docs/StudiesApi.md +233 -0
  70. data/docs/TVApi.md +208 -0
  71. data/docs/Team.md +32 -0
  72. data/docs/TeamAll200Response.md +30 -0
  73. data/docs/TeamRequest.md +24 -0
  74. data/docs/TeamRequestWithUser.md +20 -0
  75. data/docs/TeamsApi.md +702 -0
  76. data/docs/Title.md +15 -0
  77. data/docs/User.md +42 -0
  78. data/docs/UserExtended.md +60 -0
  79. data/docs/UserPreferences.md +72 -0
  80. data/docs/UsersApi.md +667 -0
  81. data/docs/Variant.md +22 -0
  82. data/docs/VariantKey.md +15 -0
  83. data/git_push.sh +57 -0
  84. data/lib/lishogi/api/account_api.rb +314 -0
  85. data/lib/lishogi/api/analysis_api.rb +92 -0
  86. data/lib/lishogi/api/arena_tournaments_api.rb +681 -0
  87. data/lib/lishogi/api/board_api.rb +685 -0
  88. data/lib/lishogi/api/bot_api.rb +608 -0
  89. data/lib/lishogi/api/challenges_api.rb +554 -0
  90. data/lib/lishogi/api/games_api.rb +514 -0
  91. data/lib/lishogi/api/messaging_api.rb +97 -0
  92. data/lib/lishogi/api/puzzles_api.rb +210 -0
  93. data/lib/lishogi/api/simuls_api.rb +79 -0
  94. data/lib/lishogi/api/studies_api.rb +244 -0
  95. data/lib/lishogi/api/teams_api.rb +678 -0
  96. data/lib/lishogi/api/tv_api.rb +222 -0
  97. data/lib/lishogi/api/users_api.rb +677 -0
  98. data/lib/lishogi/api_client.rb +437 -0
  99. data/lib/lishogi/api_error.rb +58 -0
  100. data/lib/lishogi/configuration.rb +392 -0
  101. data/lib/lishogi/models/account200_response.rb +223 -0
  102. data/lib/lishogi/models/account_email200_response.rb +214 -0
  103. data/lib/lishogi/models/account_kid200_response.rb +214 -0
  104. data/lib/lishogi/models/api_stream_event200_response.rb +107 -0
  105. data/lib/lishogi/models/api_users_status200_response_inner.rb +273 -0
  106. data/lib/lishogi/models/arena_tournaments.rb +238 -0
  107. data/lib/lishogi/models/board_game_stream200_response.rb +106 -0
  108. data/lib/lishogi/models/board_game_takeback_accept_parameter.rb +104 -0
  109. data/lib/lishogi/models/challenge_declined_event.rb +257 -0
  110. data/lib/lishogi/models/challenge_event.rb +257 -0
  111. data/lib/lishogi/models/challenge_json.rb +453 -0
  112. data/lib/lishogi/models/challenge_json_perf.rb +223 -0
  113. data/lib/lishogi/models/challenge_json_time_control.rb +106 -0
  114. data/lib/lishogi/models/challenge_json_time_control_one_of.rb +259 -0
  115. data/lib/lishogi/models/challenge_json_time_control_one_of1.rb +223 -0
  116. data/lib/lishogi/models/challenge_json_time_control_one_of2.rb +214 -0
  117. data/lib/lishogi/models/challenge_user.rb +275 -0
  118. data/lib/lishogi/models/chat_line_event.rb +315 -0
  119. data/lib/lishogi/models/clock.rb +242 -0
  120. data/lib/lishogi/models/count.rb +304 -0
  121. data/lib/lishogi/models/error.rb +215 -0
  122. data/lib/lishogi/models/game_event_info.rb +266 -0
  123. data/lib/lishogi/models/game_event_info_compat.rb +223 -0
  124. data/lib/lishogi/models/game_event_player.rb +260 -0
  125. data/lib/lishogi/models/game_finish_event.rb +257 -0
  126. data/lib/lishogi/models/game_full_event.rb +436 -0
  127. data/lib/lishogi/models/game_full_event_perf.rb +215 -0
  128. data/lib/lishogi/models/game_json.rb +457 -0
  129. data/lib/lishogi/models/game_json_analysis_inner.rb +251 -0
  130. data/lib/lishogi/models/game_json_analysis_inner_judgment.rb +258 -0
  131. data/lib/lishogi/models/game_json_clock.rb +250 -0
  132. data/lib/lishogi/models/game_json_players.rb +223 -0
  133. data/lib/lishogi/models/game_start_event.rb +257 -0
  134. data/lib/lishogi/models/game_state_event.rb +396 -0
  135. data/lib/lishogi/models/game_status.rb +52 -0
  136. data/lib/lishogi/models/game_user.rb +277 -0
  137. data/lib/lishogi/models/game_user_analysis.rb +269 -0
  138. data/lib/lishogi/models/light_user.rb +241 -0
  139. data/lib/lishogi/models/light_user_title.rb +105 -0
  140. data/lib/lishogi/models/move.rb +259 -0
  141. data/lib/lishogi/models/not_found.rb +214 -0
  142. data/lib/lishogi/models/o_auth_error.rb +225 -0
  143. data/lib/lishogi/models/ok.rb +214 -0
  144. data/lib/lishogi/models/perf.rb +250 -0
  145. data/lib/lishogi/models/perf_type.rb +49 -0
  146. data/lib/lishogi/models/perfs.rb +268 -0
  147. data/lib/lishogi/models/play_time.rb +223 -0
  148. data/lib/lishogi/models/profile.rb +259 -0
  149. data/lib/lishogi/models/puzzle_round_json.rb +241 -0
  150. data/lib/lishogi/models/speed.rb +44 -0
  151. data/lib/lishogi/models/team.rb +280 -0
  152. data/lib/lishogi/models/team_all200_response.rb +272 -0
  153. data/lib/lishogi/models/team_request.rb +241 -0
  154. data/lib/lishogi/models/team_request_with_user.rb +223 -0
  155. data/lib/lishogi/models/title.rb +64 -0
  156. data/lib/lishogi/models/user.rb +322 -0
  157. data/lib/lishogi/models/user_extended.rb +410 -0
  158. data/lib/lishogi/models/user_preferences.rb +515 -0
  159. data/lib/lishogi/models/variant.rb +256 -0
  160. data/lib/lishogi/models/variant_key.rb +44 -0
  161. data/lib/lishogi/version.rb +15 -0
  162. data/lib/lishogi.rb +112 -0
  163. data/lishogi-api.patched.yaml +5806 -0
  164. data/lishogi-api.yaml +5811 -0
  165. data/lishogi.gemspec +41 -0
  166. data/manifest.scm +1 -0
  167. data/manifest.scm~ +1 -0
  168. data/patch +5 -0
  169. data/patch~ +1 -0
  170. data/pkg/lishogi-0.1.0.gem +0 -0
  171. data/smoke +5 -0
  172. data/smoke~ +2 -0
  173. data/spec/api/account_api_spec.rb +91 -0
  174. data/spec/api/analysis_api_spec.rb +49 -0
  175. data/spec/api/arena_tournaments_api_spec.rb +160 -0
  176. data/spec/api/board_api_spec.rb +154 -0
  177. data/spec/api/bot_api_spec.rb +144 -0
  178. data/spec/api/challenges_api_spec.rb +123 -0
  179. data/spec/api/games_api_spec.rb +135 -0
  180. data/spec/api/messaging_api_spec.rb +48 -0
  181. data/spec/api/puzzles_api_spec.rb +70 -0
  182. data/spec/api/simuls_api_spec.rb +46 -0
  183. data/spec/api/studies_api_spec.rb +81 -0
  184. data/spec/api/teams_api_spec.rb +160 -0
  185. data/spec/api/tv_api_spec.rb +74 -0
  186. data/spec/api/users_api_spec.rb +157 -0
  187. data/spec/models/account200_response_spec.rb +42 -0
  188. data/spec/models/account_email200_response_spec.rb +36 -0
  189. data/spec/models/account_kid200_response_spec.rb +36 -0
  190. data/spec/models/api_stream_event200_response_spec.rb +32 -0
  191. data/spec/models/api_users_status200_response_inner_spec.rb +72 -0
  192. data/spec/models/arena_tournaments_spec.rb +48 -0
  193. data/spec/models/board_game_stream200_response_spec.rb +32 -0
  194. data/spec/models/board_game_takeback_accept_parameter_spec.rb +21 -0
  195. data/spec/models/challenge_declined_event_spec.rb +46 -0
  196. data/spec/models/challenge_event_spec.rb +46 -0
  197. data/spec/models/challenge_json_perf_spec.rb +42 -0
  198. data/spec/models/challenge_json_spec.rb +120 -0
  199. data/spec/models/challenge_json_time_control_one_of1_spec.rb +42 -0
  200. data/spec/models/challenge_json_time_control_one_of2_spec.rb +36 -0
  201. data/spec/models/challenge_json_time_control_one_of_spec.rb +66 -0
  202. data/spec/models/challenge_json_time_control_spec.rb +32 -0
  203. data/spec/models/challenge_user_spec.rb +72 -0
  204. data/spec/models/chat_line_event_spec.rb +62 -0
  205. data/spec/models/clock_spec.rb +54 -0
  206. data/spec/models/count_spec.rb +96 -0
  207. data/spec/models/error_spec.rb +36 -0
  208. data/spec/models/game_event_info_compat_spec.rb +42 -0
  209. data/spec/models/game_event_info_spec.rb +52 -0
  210. data/spec/models/game_event_player_spec.rb +66 -0
  211. data/spec/models/game_finish_event_spec.rb +46 -0
  212. data/spec/models/game_full_event_perf_spec.rb +36 -0
  213. data/spec/models/game_full_event_spec.rb +112 -0
  214. data/spec/models/game_json_analysis_inner_judgment_spec.rb +46 -0
  215. data/spec/models/game_json_analysis_inner_spec.rb +54 -0
  216. data/spec/models/game_json_clock_spec.rb +60 -0
  217. data/spec/models/game_json_players_spec.rb +42 -0
  218. data/spec/models/game_json_spec.rb +136 -0
  219. data/spec/models/game_start_event_spec.rb +46 -0
  220. data/spec/models/game_state_event_spec.rb +100 -0
  221. data/spec/models/game_status_spec.rb +30 -0
  222. data/spec/models/game_user_analysis_spec.rb +54 -0
  223. data/spec/models/game_user_spec.rb +78 -0
  224. data/spec/models/light_user_spec.rb +54 -0
  225. data/spec/models/light_user_title_spec.rb +32 -0
  226. data/spec/models/move_spec.rb +66 -0
  227. data/spec/models/not_found_spec.rb +36 -0
  228. data/spec/models/o_auth_error_spec.rb +42 -0
  229. data/spec/models/ok_spec.rb +36 -0
  230. data/spec/models/perf_spec.rb +60 -0
  231. data/spec/models/perf_type_spec.rb +30 -0
  232. data/spec/models/perfs_spec.rb +72 -0
  233. data/spec/models/play_time_spec.rb +42 -0
  234. data/spec/models/profile_spec.rb +66 -0
  235. data/spec/models/puzzle_round_json_spec.rb +54 -0
  236. data/spec/models/speed_spec.rb +30 -0
  237. data/spec/models/team_all200_response_spec.rb +72 -0
  238. data/spec/models/team_request_spec.rb +54 -0
  239. data/spec/models/team_request_with_user_spec.rb +42 -0
  240. data/spec/models/team_spec.rb +78 -0
  241. data/spec/models/title_spec.rb +30 -0
  242. data/spec/models/user_extended_spec.rb +162 -0
  243. data/spec/models/user_preferences_spec.rb +210 -0
  244. data/spec/models/user_spec.rb +108 -0
  245. data/spec/models/variant_key_spec.rb +30 -0
  246. data/spec/models/variant_spec.rb +48 -0
  247. data/spec/spec_helper.rb +111 -0
  248. metadata +446 -0
data/docs/GamesApi.md ADDED
@@ -0,0 +1,473 @@
1
+ # Lishogi::GamesApi
2
+
3
+ All URIs are relative to *https://lishogi.org*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**api_account_playing**](GamesApi.md#api_account_playing) | **GET** /api/account/playing | Get my ongoing games |
8
+ | [**api_games_user**](GamesApi.md#api_games_user) | **GET** /api/games/user/{username} | Export games of a user |
9
+ | [**api_user_current_game**](GamesApi.md#api_user_current_game) | **GET** /api/user/{username}/current-game | Export ongoing game of a user |
10
+ | [**game_kif**](GamesApi.md#game_kif) | **GET** /game/export/{gameId} | Export one game |
11
+ | [**games_by_users**](GamesApi.md#games_by_users) | **POST** /api/stream/games-by-users | Stream games of users |
12
+ | [**stream_game**](GamesApi.md#stream_game) | **GET** /api/stream/game/{id} | Stream moves of a game |
13
+
14
+
15
+ ## api_account_playing
16
+
17
+ > Object api_account_playing(opts)
18
+
19
+ Get my ongoing games
20
+
21
+ Get the ongoing games of the current user. Real-time and correspondence games are included. The most urgent games are listed first.
22
+
23
+ ### Examples
24
+
25
+ ```ruby
26
+ require 'time'
27
+ require 'lishogi'
28
+ # setup authorization
29
+ Lishogi.configure do |config|
30
+ # Configure OAuth2 access token for authorization: OAuth2
31
+ config.access_token = 'YOUR ACCESS TOKEN'
32
+ end
33
+
34
+ api_instance = Lishogi::GamesApi.new
35
+ opts = {
36
+ nb: 56 # Integer | Max number of games to fetch
37
+ }
38
+
39
+ begin
40
+ # Get my ongoing games
41
+ result = api_instance.api_account_playing(opts)
42
+ p result
43
+ rescue Lishogi::ApiError => e
44
+ puts "Error when calling GamesApi->api_account_playing: #{e}"
45
+ end
46
+ ```
47
+
48
+ #### Using the api_account_playing_with_http_info variant
49
+
50
+ This returns an Array which contains the response data, status code and headers.
51
+
52
+ > <Array(Object, Integer, Hash)> api_account_playing_with_http_info(opts)
53
+
54
+ ```ruby
55
+ begin
56
+ # Get my ongoing games
57
+ data, status_code, headers = api_instance.api_account_playing_with_http_info(opts)
58
+ p status_code # => 2xx
59
+ p headers # => { ... }
60
+ p data # => Object
61
+ rescue Lishogi::ApiError => e
62
+ puts "Error when calling GamesApi->api_account_playing_with_http_info: #{e}"
63
+ end
64
+ ```
65
+
66
+ ### Parameters
67
+
68
+ | Name | Type | Description | Notes |
69
+ | ---- | ---- | ----------- | ----- |
70
+ | **nb** | **Integer** | Max number of games to fetch | [optional][default to 9] |
71
+
72
+ ### Return type
73
+
74
+ **Object**
75
+
76
+ ### Authorization
77
+
78
+ [OAuth2](../README.md#OAuth2)
79
+
80
+ ### HTTP request headers
81
+
82
+ - **Content-Type**: Not defined
83
+ - **Accept**: application/json
84
+
85
+
86
+ ## api_games_user
87
+
88
+ > Object api_games_user(username, opts)
89
+
90
+ Export games of a user
91
+
92
+ Download all games of any user in KIF or [ndjson](#section/Introduction/Streaming-with-ND-JSON) format. Games are sorted by reverse chronological order (most recent first). We recommend streaming the response, for it can be very long. <https://lishogi.org/@/YoBot_v2> for instance has more than 15,000 games. The game stream is throttled, depending on who is making the request: - Anonymous request: 20 games per second - [OAuth2 authenticated](#section/Authentication) request: 30 games per second - Authenticated, downloading your own games: 60 games per second
93
+
94
+ ### Examples
95
+
96
+ ```ruby
97
+ require 'time'
98
+ require 'lishogi'
99
+ # setup authorization
100
+ Lishogi.configure do |config|
101
+ # Configure OAuth2 access token for authorization: OAuth2
102
+ config.access_token = 'YOUR ACCESS TOKEN'
103
+ end
104
+
105
+ api_instance = Lishogi::GamesApi.new
106
+ username = 'username_example' # String | The user name.
107
+ opts = {
108
+ since: 56, # Integer | Download games played since this timestamp. Defaults to account creation date.
109
+ _until: 56, # Integer | Download games played until this timestamp. Defaults to now.
110
+ max: 56, # Integer | How many games to download. Leave empty to download all games.
111
+ vs: 'vs_example', # String | [Filter] Only games played against this opponent
112
+ rated: true, # Boolean | [Filter] Only rated (`true`) or casual (`false`) games
113
+ perf_type: Lishogi::PerfType::ULTRA_BULLET, # PerfType | [Filter] Only games in these speeds or variants. Multiple perf types can be specified, separated by a comma. Example: blitz,rapid,classical
114
+ color: 'sente', # String | [Filter] Only games played as this color.
115
+ analysed: true, # Boolean | [Filter] Only games with or without a computer analysis available
116
+ moves: true, # Boolean | Include the KIF moves.
117
+ pgn_in_json: true, # Boolean | Include the full KIF within the JSON response, in a `notation` field. The response type must be set to `application/x-ndjson` by the request `Accept` header.
118
+ tags: true, # Boolean | Include the KIF tags.
119
+ clocks: true, # Boolean | Include clock comments in the KIF moves, when available. Example: `22 同 玉(51) (00:02/00:00:13)`
120
+ evals: true, # Boolean | Include analysis evaluation comments in the KIF, when available. Example: `9 7八銀(79) * [%eval -1.48]`
121
+ ongoing: true, # Boolean | Include ongoing games. The last 3 moves will be omitted.
122
+ finished: true, # Boolean | Include finished games. Set to `false` to only get ongoing games.
123
+ players: 'players_example', # String | URL of a text file containing real names and ratings, to replace Lishogi usernames and ratings in the KIF. Example: <https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt>
124
+ sort: 'dateAsc' # String | Sort order of the games.
125
+ }
126
+
127
+ begin
128
+ # Export games of a user
129
+ result = api_instance.api_games_user(username, opts)
130
+ p result
131
+ rescue Lishogi::ApiError => e
132
+ puts "Error when calling GamesApi->api_games_user: #{e}"
133
+ end
134
+ ```
135
+
136
+ #### Using the api_games_user_with_http_info variant
137
+
138
+ This returns an Array which contains the response data, status code and headers.
139
+
140
+ > <Array(Object, Integer, Hash)> api_games_user_with_http_info(username, opts)
141
+
142
+ ```ruby
143
+ begin
144
+ # Export games of a user
145
+ data, status_code, headers = api_instance.api_games_user_with_http_info(username, opts)
146
+ p status_code # => 2xx
147
+ p headers # => { ... }
148
+ p data # => Object
149
+ rescue Lishogi::ApiError => e
150
+ puts "Error when calling GamesApi->api_games_user_with_http_info: #{e}"
151
+ end
152
+ ```
153
+
154
+ ### Parameters
155
+
156
+ | Name | Type | Description | Notes |
157
+ | ---- | ---- | ----------- | ----- |
158
+ | **username** | **String** | The user name. | |
159
+ | **since** | **Integer** | Download games played since this timestamp. Defaults to account creation date. | [optional] |
160
+ | **_until** | **Integer** | Download games played until this timestamp. Defaults to now. | [optional] |
161
+ | **max** | **Integer** | How many games to download. Leave empty to download all games. | [optional] |
162
+ | **vs** | **String** | [Filter] Only games played against this opponent | [optional] |
163
+ | **rated** | **Boolean** | [Filter] Only rated (&#x60;true&#x60;) or casual (&#x60;false&#x60;) games | [optional] |
164
+ | **perf_type** | [**PerfType**](.md) | [Filter] Only games in these speeds or variants. Multiple perf types can be specified, separated by a comma. Example: blitz,rapid,classical | [optional] |
165
+ | **color** | **String** | [Filter] Only games played as this color. | [optional] |
166
+ | **analysed** | **Boolean** | [Filter] Only games with or without a computer analysis available | [optional] |
167
+ | **moves** | **Boolean** | Include the KIF moves. | [optional] |
168
+ | **pgn_in_json** | **Boolean** | Include the full KIF within the JSON response, in a &#x60;notation&#x60; field. The response type must be set to &#x60;application/x-ndjson&#x60; by the request &#x60;Accept&#x60; header. | [optional][default to false] |
169
+ | **tags** | **Boolean** | Include the KIF tags. | [optional][default to true] |
170
+ | **clocks** | **Boolean** | Include clock comments in the KIF moves, when available. Example: &#x60;22 同 玉(51) (00:02/00:00:13)&#x60; | [optional][default to false] |
171
+ | **evals** | **Boolean** | Include analysis evaluation comments in the KIF, when available. Example: &#x60;9 7八銀(79) * [%eval -1.48]&#x60; | [optional][default to false] |
172
+ | **ongoing** | **Boolean** | Include ongoing games. The last 3 moves will be omitted. | [optional][default to false] |
173
+ | **finished** | **Boolean** | Include finished games. Set to &#x60;false&#x60; to only get ongoing games. | [optional][default to true] |
174
+ | **players** | **String** | URL of a text file containing real names and ratings, to replace Lishogi usernames and ratings in the KIF. Example: &lt;https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt&gt; | [optional] |
175
+ | **sort** | **String** | Sort order of the games. | [optional][default to &#39;dateDesc&#39;] |
176
+
177
+ ### Return type
178
+
179
+ **Object**
180
+
181
+ ### Authorization
182
+
183
+ [OAuth2](../README.md#OAuth2)
184
+
185
+ ### HTTP request headers
186
+
187
+ - **Content-Type**: Not defined
188
+ - **Accept**: text/plain, application/x-ndjson
189
+
190
+
191
+ ## api_user_current_game
192
+
193
+ > Object api_user_current_game(username, opts)
194
+
195
+ Export ongoing game of a user
196
+
197
+ Download the ongoing game, or the last game played, of a user. Available in either KIF or JSON format. If the game is ongoing, the 3 last moves are omitted.
198
+
199
+ ### Examples
200
+
201
+ ```ruby
202
+ require 'time'
203
+ require 'lishogi'
204
+
205
+ api_instance = Lishogi::GamesApi.new
206
+ username = 'username_example' # String |
207
+ opts = {
208
+ moves: true, # Boolean | Include the KIF moves.
209
+ tags: true, # Boolean | Include the KIF tags.
210
+ clocks: true, # Boolean | Include clock comments in the KIF moves, when available. Example: `22 同 玉(51) (00:02/00:00:13)`
211
+ evals: true, # Boolean | Include analysis evaluation comments in the KIF, when available. Example: `9 7八銀(79) * [%eval -1.48]`
212
+ players: 'players_example' # String | URL of a text file containing real names and ratings, to replace Lishogi usernames and ratings in the KIF. Example: <https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt>
213
+ }
214
+
215
+ begin
216
+ # Export ongoing game of a user
217
+ result = api_instance.api_user_current_game(username, opts)
218
+ p result
219
+ rescue Lishogi::ApiError => e
220
+ puts "Error when calling GamesApi->api_user_current_game: #{e}"
221
+ end
222
+ ```
223
+
224
+ #### Using the api_user_current_game_with_http_info variant
225
+
226
+ This returns an Array which contains the response data, status code and headers.
227
+
228
+ > <Array(Object, Integer, Hash)> api_user_current_game_with_http_info(username, opts)
229
+
230
+ ```ruby
231
+ begin
232
+ # Export ongoing game of a user
233
+ data, status_code, headers = api_instance.api_user_current_game_with_http_info(username, opts)
234
+ p status_code # => 2xx
235
+ p headers # => { ... }
236
+ p data # => Object
237
+ rescue Lishogi::ApiError => e
238
+ puts "Error when calling GamesApi->api_user_current_game_with_http_info: #{e}"
239
+ end
240
+ ```
241
+
242
+ ### Parameters
243
+
244
+ | Name | Type | Description | Notes |
245
+ | ---- | ---- | ----------- | ----- |
246
+ | **username** | **String** | | |
247
+ | **moves** | **Boolean** | Include the KIF moves. | [optional][default to true] |
248
+ | **tags** | **Boolean** | Include the KIF tags. | [optional][default to true] |
249
+ | **clocks** | **Boolean** | Include clock comments in the KIF moves, when available. Example: &#x60;22 同 玉(51) (00:02/00:00:13)&#x60; | [optional][default to true] |
250
+ | **evals** | **Boolean** | Include analysis evaluation comments in the KIF, when available. Example: &#x60;9 7八銀(79) * [%eval -1.48]&#x60; | [optional][default to true] |
251
+ | **players** | **String** | URL of a text file containing real names and ratings, to replace Lishogi usernames and ratings in the KIF. Example: &lt;https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt&gt; | [optional] |
252
+
253
+ ### Return type
254
+
255
+ **Object**
256
+
257
+ ### Authorization
258
+
259
+ No authorization required
260
+
261
+ ### HTTP request headers
262
+
263
+ - **Content-Type**: Not defined
264
+ - **Accept**: text/plain, application/json
265
+
266
+
267
+ ## game_kif
268
+
269
+ > Object game_kif(game_id, opts)
270
+
271
+ Export one game
272
+
273
+ Download one game in either KIF or JSON format. Ongoing games have their last 3 moves omitted, after move 5.
274
+
275
+ ### Examples
276
+
277
+ ```ruby
278
+ require 'time'
279
+ require 'lishogi'
280
+
281
+ api_instance = Lishogi::GamesApi.new
282
+ game_id = 'game_id_example' # String | The game ID (8 characters).
283
+ opts = {
284
+ moves: true, # Boolean | Include the KIF moves.
285
+ tags: true, # Boolean | Include the KIF tags.
286
+ clocks: true, # Boolean | Include clock comments in the KIF moves, when available. Example: `22 同 玉(51) (00:02/00:00:13)`
287
+ evals: true, # Boolean | Include analysis evaluation comments in the KIF, when available. Example: `9 7八銀(79) * [%eval -1.48]`
288
+ players: 'players_example' # String | URL of a text file containing real names and ratings, to replace Lishogi usernames and ratings in the KIF. Example: <https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt>
289
+ }
290
+
291
+ begin
292
+ # Export one game
293
+ result = api_instance.game_kif(game_id, opts)
294
+ p result
295
+ rescue Lishogi::ApiError => e
296
+ puts "Error when calling GamesApi->game_kif: #{e}"
297
+ end
298
+ ```
299
+
300
+ #### Using the game_kif_with_http_info variant
301
+
302
+ This returns an Array which contains the response data, status code and headers.
303
+
304
+ > <Array(Object, Integer, Hash)> game_kif_with_http_info(game_id, opts)
305
+
306
+ ```ruby
307
+ begin
308
+ # Export one game
309
+ data, status_code, headers = api_instance.game_kif_with_http_info(game_id, opts)
310
+ p status_code # => 2xx
311
+ p headers # => { ... }
312
+ p data # => Object
313
+ rescue Lishogi::ApiError => e
314
+ puts "Error when calling GamesApi->game_kif_with_http_info: #{e}"
315
+ end
316
+ ```
317
+
318
+ ### Parameters
319
+
320
+ | Name | Type | Description | Notes |
321
+ | ---- | ---- | ----------- | ----- |
322
+ | **game_id** | **String** | The game ID (8 characters). | |
323
+ | **moves** | **Boolean** | Include the KIF moves. | [optional][default to true] |
324
+ | **tags** | **Boolean** | Include the KIF tags. | [optional][default to true] |
325
+ | **clocks** | **Boolean** | Include clock comments in the KIF moves, when available. Example: &#x60;22 同 玉(51) (00:02/00:00:13)&#x60; | [optional][default to true] |
326
+ | **evals** | **Boolean** | Include analysis evaluation comments in the KIF, when available. Example: &#x60;9 7八銀(79) * [%eval -1.48]&#x60; | [optional][default to true] |
327
+ | **players** | **String** | URL of a text file containing real names and ratings, to replace Lishogi usernames and ratings in the KIF. Example: &lt;https://gist.githubusercontent.com/ornicar/6bfa91eb61a2dcae7bcd14cce1b2a4eb/raw/768b9f6cc8a8471d2555e47ba40fb0095e5fba37/gistfile1.txt&gt; | [optional] |
328
+
329
+ ### Return type
330
+
331
+ **Object**
332
+
333
+ ### Authorization
334
+
335
+ No authorization required
336
+
337
+ ### HTTP request headers
338
+
339
+ - **Content-Type**: Not defined
340
+ - **Accept**: text/plain, application/json
341
+
342
+
343
+ ## games_by_users
344
+
345
+ > Object games_by_users(body, opts)
346
+
347
+ Stream games of users
348
+
349
+ Stream the games played between a list of users, in real time. Only games where **both players** are part of the list are included. By default, games are only sent to the stream when they start. To also get all ongoing games at the beginning of the stream, use the `withCurrentGames` flag. Maximum number of users: 300. Games are streamed as [ndjson](#section/Introduction/Streaming-with-ND-JSON). The method is `POST` so a longer list of IDs can be sent in the request body.
350
+
351
+ ### Examples
352
+
353
+ ```ruby
354
+ require 'time'
355
+ require 'lishogi'
356
+
357
+ api_instance = Lishogi::GamesApi.new
358
+ body = 'yokoyamatomoki,shogi_harbour,yohaansethnathan' # String | Up to 300 user IDs separated by commas.
359
+ opts = {
360
+ with_current_games: true # Boolean | Include the already started games at the beginning of the stream.
361
+ }
362
+
363
+ begin
364
+ # Stream games of users
365
+ result = api_instance.games_by_users(body, opts)
366
+ p result
367
+ rescue Lishogi::ApiError => e
368
+ puts "Error when calling GamesApi->games_by_users: #{e}"
369
+ end
370
+ ```
371
+
372
+ #### Using the games_by_users_with_http_info variant
373
+
374
+ This returns an Array which contains the response data, status code and headers.
375
+
376
+ > <Array(Object, Integer, Hash)> games_by_users_with_http_info(body, opts)
377
+
378
+ ```ruby
379
+ begin
380
+ # Stream games of users
381
+ data, status_code, headers = api_instance.games_by_users_with_http_info(body, opts)
382
+ p status_code # => 2xx
383
+ p headers # => { ... }
384
+ p data # => Object
385
+ rescue Lishogi::ApiError => e
386
+ puts "Error when calling GamesApi->games_by_users_with_http_info: #{e}"
387
+ end
388
+ ```
389
+
390
+ ### Parameters
391
+
392
+ | Name | Type | Description | Notes |
393
+ | ---- | ---- | ----------- | ----- |
394
+ | **body** | **String** | Up to 300 user IDs separated by commas. | |
395
+ | **with_current_games** | **Boolean** | Include the already started games at the beginning of the stream. | [optional][default to false] |
396
+
397
+ ### Return type
398
+
399
+ **Object**
400
+
401
+ ### Authorization
402
+
403
+ No authorization required
404
+
405
+ ### HTTP request headers
406
+
407
+ - **Content-Type**: text/plain
408
+ - **Accept**: application/x-ndjson
409
+
410
+
411
+ ## stream_game
412
+
413
+ > Object stream_game(id)
414
+
415
+ Stream moves of a game
416
+
417
+ Stream positions and moves of any ongoing game, in [ndjson](#section/Introduction/Streaming-with-ND-JSON). A description of the game is sent as a first message. Then a message is sent each time a move is played. Finally a description of the game is sent when it finishes, and the stream is closed. After move 5, the stream intentionally remains 3 moves behind the game status, as to prevent cheat bots from using this API. No more than 8 game streams can be opened at the same time from the same IP address.
418
+
419
+ ### Examples
420
+
421
+ ```ruby
422
+ require 'time'
423
+ require 'lishogi'
424
+
425
+ api_instance = Lishogi::GamesApi.new
426
+ id = 'LuGQwhBb' # String |
427
+
428
+ begin
429
+ # Stream moves of a game
430
+ result = api_instance.stream_game(id)
431
+ p result
432
+ rescue Lishogi::ApiError => e
433
+ puts "Error when calling GamesApi->stream_game: #{e}"
434
+ end
435
+ ```
436
+
437
+ #### Using the stream_game_with_http_info variant
438
+
439
+ This returns an Array which contains the response data, status code and headers.
440
+
441
+ > <Array(Object, Integer, Hash)> stream_game_with_http_info(id)
442
+
443
+ ```ruby
444
+ begin
445
+ # Stream moves of a game
446
+ data, status_code, headers = api_instance.stream_game_with_http_info(id)
447
+ p status_code # => 2xx
448
+ p headers # => { ... }
449
+ p data # => Object
450
+ rescue Lishogi::ApiError => e
451
+ puts "Error when calling GamesApi->stream_game_with_http_info: #{e}"
452
+ end
453
+ ```
454
+
455
+ ### Parameters
456
+
457
+ | Name | Type | Description | Notes |
458
+ | ---- | ---- | ----------- | ----- |
459
+ | **id** | **String** | | |
460
+
461
+ ### Return type
462
+
463
+ **Object**
464
+
465
+ ### Authorization
466
+
467
+ No authorization required
468
+
469
+ ### HTTP request headers
470
+
471
+ - **Content-Type**: Not defined
472
+ - **Accept**: application/x-ndjson
473
+
data/docs/LightUser.md ADDED
@@ -0,0 +1,24 @@
1
+ # Lishogi::LightUser
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | | [optional] |
8
+ | **title** | [**LightUserTitle**](LightUserTitle.md) | | [optional] |
9
+ | **patron** | **Boolean** | | [optional] |
10
+ | **id** | **String** | | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'lishogi'
16
+
17
+ instance = Lishogi::LightUser.new(
18
+ name: Shogi_Harbour,
19
+ title: null,
20
+ patron: true,
21
+ id: shogi_harbour
22
+ )
23
+ ```
24
+
@@ -0,0 +1,49 @@
1
+ # Lishogi::LightUserTitle
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'lishogi'
13
+
14
+ Lishogi::LightUserTitle.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'LP',
18
+ # :'String'
19
+ # ]
20
+ ```
21
+
22
+ ### build
23
+
24
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
+
26
+ #### Example
27
+
28
+ ```ruby
29
+ require 'lishogi'
30
+
31
+ Lishogi::LightUserTitle.build(data)
32
+ # => #<LP:0x00007fdd4aab02a0>
33
+
34
+ Lishogi::LightUserTitle.build(data_that_doesnt_match)
35
+ # => nil
36
+ ```
37
+
38
+ #### Parameters
39
+
40
+ | Name | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
+
44
+ #### Return type
45
+
46
+ - `LP`
47
+ - `String`
48
+ - `nil` (if no type matches)
49
+
@@ -0,0 +1,79 @@
1
+ # Lishogi::MessagingApi
2
+
3
+ All URIs are relative to *https://lishogi.org*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**inbox_username**](MessagingApi.md#inbox_username) | **POST** /inbox/{username} | Send a private message |
8
+
9
+
10
+ ## inbox_username
11
+
12
+ > <Ok> inbox_username(username, text)
13
+
14
+ Send a private message
15
+
16
+ Send a private message to another player.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'lishogi'
23
+ # setup authorization
24
+ Lishogi.configure do |config|
25
+ # Configure OAuth2 access token for authorization: OAuth2
26
+ config.access_token = 'YOUR ACCESS TOKEN'
27
+ end
28
+
29
+ api_instance = Lishogi::MessagingApi.new
30
+ username = 'wandererxii' # String |
31
+ text = 'text_example' # String |
32
+
33
+ begin
34
+ # Send a private message
35
+ result = api_instance.inbox_username(username, text)
36
+ p result
37
+ rescue Lishogi::ApiError => e
38
+ puts "Error when calling MessagingApi->inbox_username: #{e}"
39
+ end
40
+ ```
41
+
42
+ #### Using the inbox_username_with_http_info variant
43
+
44
+ This returns an Array which contains the response data, status code and headers.
45
+
46
+ > <Array(<Ok>, Integer, Hash)> inbox_username_with_http_info(username, text)
47
+
48
+ ```ruby
49
+ begin
50
+ # Send a private message
51
+ data, status_code, headers = api_instance.inbox_username_with_http_info(username, text)
52
+ p status_code # => 2xx
53
+ p headers # => { ... }
54
+ p data # => <Ok>
55
+ rescue Lishogi::ApiError => e
56
+ puts "Error when calling MessagingApi->inbox_username_with_http_info: #{e}"
57
+ end
58
+ ```
59
+
60
+ ### Parameters
61
+
62
+ | Name | Type | Description | Notes |
63
+ | ---- | ---- | ----------- | ----- |
64
+ | **username** | **String** | | |
65
+ | **text** | **String** | | |
66
+
67
+ ### Return type
68
+
69
+ [**Ok**](Ok.md)
70
+
71
+ ### Authorization
72
+
73
+ [OAuth2](../README.md#OAuth2)
74
+
75
+ ### HTTP request headers
76
+
77
+ - **Content-Type**: application/x-www-form-urlencoded
78
+ - **Accept**: application/json
79
+
data/docs/Move.md ADDED
@@ -0,0 +1,28 @@
1
+ # Lishogi::Move
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **usi** | **String** | | [optional] |
8
+ | **checkmate** | **Boolean** | | [optional] |
9
+ | **stalemate** | **Boolean** | | [optional] |
10
+ | **variant_win** | **Boolean** | | [optional] |
11
+ | **variant_loss** | **Boolean** | | [optional] |
12
+ | **insufficient_material** | **Boolean** | | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'lishogi'
18
+
19
+ instance = Lishogi::Move.new(
20
+ usi: 7g7f+,
21
+ checkmate: null,
22
+ stalemate: null,
23
+ variant_win: null,
24
+ variant_loss: null,
25
+ insufficient_material: null
26
+ )
27
+ ```
28
+
data/docs/NotFound.md ADDED
@@ -0,0 +1,18 @@
1
+ # Lishogi::NotFound
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **error** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'lishogi'
13
+
14
+ instance = Lishogi::NotFound.new(
15
+ error: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,20 @@
1
+ # Lishogi::OAuthError
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **error** | **String** | The cause of the error. | [optional] |
8
+ | **error_description** | **String** | The reason why the request was rejected. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'lishogi'
14
+
15
+ instance = Lishogi::OAuthError.new(
16
+ error: null,
17
+ error_description: null
18
+ )
19
+ ```
20
+