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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +661 -0
- data/LICENSE~ +1 -0
- data/Makefile +39 -0
- data/Makefile~ +7 -0
- data/README.md +276 -0
- data/Rakefile +10 -0
- data/docs/Account200Response.md +20 -0
- data/docs/AccountApi.md +345 -0
- data/docs/AccountEmail200Response.md +18 -0
- data/docs/AccountKid200Response.md +18 -0
- data/docs/AnalysisApi.md +77 -0
- data/docs/ApiStreamEvent200Response.md +53 -0
- data/docs/ApiUsersStatus200ResponseInner.md +30 -0
- data/docs/ArenaTournaments.md +22 -0
- data/docs/ArenaTournamentsApi.md +601 -0
- data/docs/BoardApi.md +659 -0
- data/docs/BoardGameStream200Response.md +51 -0
- data/docs/BoardGameTakebackAcceptParameter.md +15 -0
- data/docs/BotApi.md +634 -0
- data/docs/ChallengeDeclinedEvent.md +20 -0
- data/docs/ChallengeEvent.md +20 -0
- data/docs/ChallengeJson.md +42 -0
- data/docs/ChallengeJsonPerf.md +20 -0
- data/docs/ChallengeJsonTimeControl.md +51 -0
- data/docs/ChallengeJsonTimeControlOneOf.md +28 -0
- data/docs/ChallengeJsonTimeControlOneOf1.md +20 -0
- data/docs/ChallengeJsonTimeControlOneOf2.md +18 -0
- data/docs/ChallengeUser.md +30 -0
- data/docs/ChallengesApi.md +414 -0
- data/docs/ChatLineEvent.md +24 -0
- data/docs/Clock.md +24 -0
- data/docs/Count.md +38 -0
- data/docs/Error.md +18 -0
- data/docs/GameEventInfo.md +22 -0
- data/docs/GameEventInfoCompat.md +20 -0
- data/docs/GameEventPlayer.md +28 -0
- data/docs/GameFinishEvent.md +20 -0
- data/docs/GameFullEvent.md +42 -0
- data/docs/GameFullEventPerf.md +18 -0
- data/docs/GameJson.md +50 -0
- data/docs/GameJsonAnalysisInner.md +24 -0
- data/docs/GameJsonAnalysisInnerJudgment.md +20 -0
- data/docs/GameJsonClock.md +26 -0
- data/docs/GameJsonPlayers.md +20 -0
- data/docs/GameStartEvent.md +20 -0
- data/docs/GameStateEvent.md +38 -0
- data/docs/GameStatus.md +15 -0
- data/docs/GameUser.md +32 -0
- data/docs/GameUserAnalysis.md +24 -0
- data/docs/GamesApi.md +473 -0
- data/docs/LightUser.md +24 -0
- data/docs/LightUserTitle.md +49 -0
- data/docs/MessagingApi.md +79 -0
- data/docs/Move.md +28 -0
- data/docs/NotFound.md +18 -0
- data/docs/OAuthError.md +20 -0
- data/docs/Ok.md +18 -0
- data/docs/Perf.md +26 -0
- data/docs/PerfType.md +15 -0
- data/docs/Perfs.md +30 -0
- data/docs/PlayTime.md +20 -0
- data/docs/Profile.md +28 -0
- data/docs/PuzzleRoundJson.md +24 -0
- data/docs/PuzzlesApi.md +211 -0
- data/docs/SimulsApi.md +69 -0
- data/docs/Speed.md +15 -0
- data/docs/StudiesApi.md +233 -0
- data/docs/TVApi.md +208 -0
- data/docs/Team.md +32 -0
- data/docs/TeamAll200Response.md +30 -0
- data/docs/TeamRequest.md +24 -0
- data/docs/TeamRequestWithUser.md +20 -0
- data/docs/TeamsApi.md +702 -0
- data/docs/Title.md +15 -0
- data/docs/User.md +42 -0
- data/docs/UserExtended.md +60 -0
- data/docs/UserPreferences.md +72 -0
- data/docs/UsersApi.md +667 -0
- data/docs/Variant.md +22 -0
- data/docs/VariantKey.md +15 -0
- data/git_push.sh +57 -0
- data/lib/lishogi/api/account_api.rb +314 -0
- data/lib/lishogi/api/analysis_api.rb +92 -0
- data/lib/lishogi/api/arena_tournaments_api.rb +681 -0
- data/lib/lishogi/api/board_api.rb +685 -0
- data/lib/lishogi/api/bot_api.rb +608 -0
- data/lib/lishogi/api/challenges_api.rb +554 -0
- data/lib/lishogi/api/games_api.rb +514 -0
- data/lib/lishogi/api/messaging_api.rb +97 -0
- data/lib/lishogi/api/puzzles_api.rb +210 -0
- data/lib/lishogi/api/simuls_api.rb +79 -0
- data/lib/lishogi/api/studies_api.rb +244 -0
- data/lib/lishogi/api/teams_api.rb +678 -0
- data/lib/lishogi/api/tv_api.rb +222 -0
- data/lib/lishogi/api/users_api.rb +677 -0
- data/lib/lishogi/api_client.rb +437 -0
- data/lib/lishogi/api_error.rb +58 -0
- data/lib/lishogi/configuration.rb +392 -0
- data/lib/lishogi/models/account200_response.rb +223 -0
- data/lib/lishogi/models/account_email200_response.rb +214 -0
- data/lib/lishogi/models/account_kid200_response.rb +214 -0
- data/lib/lishogi/models/api_stream_event200_response.rb +107 -0
- data/lib/lishogi/models/api_users_status200_response_inner.rb +273 -0
- data/lib/lishogi/models/arena_tournaments.rb +238 -0
- data/lib/lishogi/models/board_game_stream200_response.rb +106 -0
- data/lib/lishogi/models/board_game_takeback_accept_parameter.rb +104 -0
- data/lib/lishogi/models/challenge_declined_event.rb +257 -0
- data/lib/lishogi/models/challenge_event.rb +257 -0
- data/lib/lishogi/models/challenge_json.rb +453 -0
- data/lib/lishogi/models/challenge_json_perf.rb +223 -0
- data/lib/lishogi/models/challenge_json_time_control.rb +106 -0
- data/lib/lishogi/models/challenge_json_time_control_one_of.rb +259 -0
- data/lib/lishogi/models/challenge_json_time_control_one_of1.rb +223 -0
- data/lib/lishogi/models/challenge_json_time_control_one_of2.rb +214 -0
- data/lib/lishogi/models/challenge_user.rb +275 -0
- data/lib/lishogi/models/chat_line_event.rb +315 -0
- data/lib/lishogi/models/clock.rb +242 -0
- data/lib/lishogi/models/count.rb +304 -0
- data/lib/lishogi/models/error.rb +215 -0
- data/lib/lishogi/models/game_event_info.rb +266 -0
- data/lib/lishogi/models/game_event_info_compat.rb +223 -0
- data/lib/lishogi/models/game_event_player.rb +260 -0
- data/lib/lishogi/models/game_finish_event.rb +257 -0
- data/lib/lishogi/models/game_full_event.rb +436 -0
- data/lib/lishogi/models/game_full_event_perf.rb +215 -0
- data/lib/lishogi/models/game_json.rb +457 -0
- data/lib/lishogi/models/game_json_analysis_inner.rb +251 -0
- data/lib/lishogi/models/game_json_analysis_inner_judgment.rb +258 -0
- data/lib/lishogi/models/game_json_clock.rb +250 -0
- data/lib/lishogi/models/game_json_players.rb +223 -0
- data/lib/lishogi/models/game_start_event.rb +257 -0
- data/lib/lishogi/models/game_state_event.rb +396 -0
- data/lib/lishogi/models/game_status.rb +52 -0
- data/lib/lishogi/models/game_user.rb +277 -0
- data/lib/lishogi/models/game_user_analysis.rb +269 -0
- data/lib/lishogi/models/light_user.rb +241 -0
- data/lib/lishogi/models/light_user_title.rb +105 -0
- data/lib/lishogi/models/move.rb +259 -0
- data/lib/lishogi/models/not_found.rb +214 -0
- data/lib/lishogi/models/o_auth_error.rb +225 -0
- data/lib/lishogi/models/ok.rb +214 -0
- data/lib/lishogi/models/perf.rb +250 -0
- data/lib/lishogi/models/perf_type.rb +49 -0
- data/lib/lishogi/models/perfs.rb +268 -0
- data/lib/lishogi/models/play_time.rb +223 -0
- data/lib/lishogi/models/profile.rb +259 -0
- data/lib/lishogi/models/puzzle_round_json.rb +241 -0
- data/lib/lishogi/models/speed.rb +44 -0
- data/lib/lishogi/models/team.rb +280 -0
- data/lib/lishogi/models/team_all200_response.rb +272 -0
- data/lib/lishogi/models/team_request.rb +241 -0
- data/lib/lishogi/models/team_request_with_user.rb +223 -0
- data/lib/lishogi/models/title.rb +64 -0
- data/lib/lishogi/models/user.rb +322 -0
- data/lib/lishogi/models/user_extended.rb +410 -0
- data/lib/lishogi/models/user_preferences.rb +515 -0
- data/lib/lishogi/models/variant.rb +256 -0
- data/lib/lishogi/models/variant_key.rb +44 -0
- data/lib/lishogi/version.rb +15 -0
- data/lib/lishogi.rb +112 -0
- data/lishogi-api.patched.yaml +5806 -0
- data/lishogi-api.yaml +5811 -0
- data/lishogi.gemspec +41 -0
- data/manifest.scm +1 -0
- data/manifest.scm~ +1 -0
- data/patch +5 -0
- data/patch~ +1 -0
- data/pkg/lishogi-0.1.0.gem +0 -0
- data/smoke +5 -0
- data/smoke~ +2 -0
- data/spec/api/account_api_spec.rb +91 -0
- data/spec/api/analysis_api_spec.rb +49 -0
- data/spec/api/arena_tournaments_api_spec.rb +160 -0
- data/spec/api/board_api_spec.rb +154 -0
- data/spec/api/bot_api_spec.rb +144 -0
- data/spec/api/challenges_api_spec.rb +123 -0
- data/spec/api/games_api_spec.rb +135 -0
- data/spec/api/messaging_api_spec.rb +48 -0
- data/spec/api/puzzles_api_spec.rb +70 -0
- data/spec/api/simuls_api_spec.rb +46 -0
- data/spec/api/studies_api_spec.rb +81 -0
- data/spec/api/teams_api_spec.rb +160 -0
- data/spec/api/tv_api_spec.rb +74 -0
- data/spec/api/users_api_spec.rb +157 -0
- data/spec/models/account200_response_spec.rb +42 -0
- data/spec/models/account_email200_response_spec.rb +36 -0
- data/spec/models/account_kid200_response_spec.rb +36 -0
- data/spec/models/api_stream_event200_response_spec.rb +32 -0
- data/spec/models/api_users_status200_response_inner_spec.rb +72 -0
- data/spec/models/arena_tournaments_spec.rb +48 -0
- data/spec/models/board_game_stream200_response_spec.rb +32 -0
- data/spec/models/board_game_takeback_accept_parameter_spec.rb +21 -0
- data/spec/models/challenge_declined_event_spec.rb +46 -0
- data/spec/models/challenge_event_spec.rb +46 -0
- data/spec/models/challenge_json_perf_spec.rb +42 -0
- data/spec/models/challenge_json_spec.rb +120 -0
- data/spec/models/challenge_json_time_control_one_of1_spec.rb +42 -0
- data/spec/models/challenge_json_time_control_one_of2_spec.rb +36 -0
- data/spec/models/challenge_json_time_control_one_of_spec.rb +66 -0
- data/spec/models/challenge_json_time_control_spec.rb +32 -0
- data/spec/models/challenge_user_spec.rb +72 -0
- data/spec/models/chat_line_event_spec.rb +62 -0
- data/spec/models/clock_spec.rb +54 -0
- data/spec/models/count_spec.rb +96 -0
- data/spec/models/error_spec.rb +36 -0
- data/spec/models/game_event_info_compat_spec.rb +42 -0
- data/spec/models/game_event_info_spec.rb +52 -0
- data/spec/models/game_event_player_spec.rb +66 -0
- data/spec/models/game_finish_event_spec.rb +46 -0
- data/spec/models/game_full_event_perf_spec.rb +36 -0
- data/spec/models/game_full_event_spec.rb +112 -0
- data/spec/models/game_json_analysis_inner_judgment_spec.rb +46 -0
- data/spec/models/game_json_analysis_inner_spec.rb +54 -0
- data/spec/models/game_json_clock_spec.rb +60 -0
- data/spec/models/game_json_players_spec.rb +42 -0
- data/spec/models/game_json_spec.rb +136 -0
- data/spec/models/game_start_event_spec.rb +46 -0
- data/spec/models/game_state_event_spec.rb +100 -0
- data/spec/models/game_status_spec.rb +30 -0
- data/spec/models/game_user_analysis_spec.rb +54 -0
- data/spec/models/game_user_spec.rb +78 -0
- data/spec/models/light_user_spec.rb +54 -0
- data/spec/models/light_user_title_spec.rb +32 -0
- data/spec/models/move_spec.rb +66 -0
- data/spec/models/not_found_spec.rb +36 -0
- data/spec/models/o_auth_error_spec.rb +42 -0
- data/spec/models/ok_spec.rb +36 -0
- data/spec/models/perf_spec.rb +60 -0
- data/spec/models/perf_type_spec.rb +30 -0
- data/spec/models/perfs_spec.rb +72 -0
- data/spec/models/play_time_spec.rb +42 -0
- data/spec/models/profile_spec.rb +66 -0
- data/spec/models/puzzle_round_json_spec.rb +54 -0
- data/spec/models/speed_spec.rb +30 -0
- data/spec/models/team_all200_response_spec.rb +72 -0
- data/spec/models/team_request_spec.rb +54 -0
- data/spec/models/team_request_with_user_spec.rb +42 -0
- data/spec/models/team_spec.rb +78 -0
- data/spec/models/title_spec.rb +30 -0
- data/spec/models/user_extended_spec.rb +162 -0
- data/spec/models/user_preferences_spec.rb +210 -0
- data/spec/models/user_spec.rb +108 -0
- data/spec/models/variant_key_spec.rb +30 -0
- data/spec/models/variant_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +446 -0
data/docs/UsersApi.md
ADDED
@@ -0,0 +1,667 @@
|
|
1
|
+
# Lishogi::UsersApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://lishogi.org*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**api_crosstable**](UsersApi.md#api_crosstable) | **GET** /api/crosstable/{user1}/{user2} | Get crosstable |
|
8
|
+
| [**api_user**](UsersApi.md#api_user) | **GET** /api/user/{username} | Get user public data |
|
9
|
+
| [**api_user_activity**](UsersApi.md#api_user_activity) | **GET** /api/user/{username}/activity | Get user activity |
|
10
|
+
| [**api_user_rating_history**](UsersApi.md#api_user_rating_history) | **GET** /api/user/{username}/rating-history | Get rating history of a user |
|
11
|
+
| [**api_users**](UsersApi.md#api_users) | **POST** /api/users | Get users by ID |
|
12
|
+
| [**api_users_status**](UsersApi.md#api_users_status) | **GET** /api/users/status | Get real-time users status |
|
13
|
+
| [**player**](UsersApi.md#player) | **GET** /player | Get all top 10 |
|
14
|
+
| [**player_top_nb_perf_type**](UsersApi.md#player_top_nb_perf_type) | **GET** /player/top/{nb}/{perfType} | Get one leaderboard |
|
15
|
+
| [**streamer_live**](UsersApi.md#streamer_live) | **GET** /streamer/live | Get live streamers |
|
16
|
+
| [**team_id_users**](UsersApi.md#team_id_users) | **GET** /api/team/{teamId}/users | Get members of a team |
|
17
|
+
|
18
|
+
|
19
|
+
## api_crosstable
|
20
|
+
|
21
|
+
> Object api_crosstable(user1, user2, opts)
|
22
|
+
|
23
|
+
Get crosstable
|
24
|
+
|
25
|
+
Get total number of games, and current score, of any two users. If the `matchup` flag is provided, and the users are currently playing, also gets the current match game number and scores.
|
26
|
+
|
27
|
+
### Examples
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'time'
|
31
|
+
require 'lishogi'
|
32
|
+
|
33
|
+
api_instance = Lishogi::UsersApi.new
|
34
|
+
user1 = 'user1_example' # String |
|
35
|
+
user2 = 'user2_example' # String |
|
36
|
+
opts = {
|
37
|
+
matchup: true # Boolean | Whether to get the current match data, if any
|
38
|
+
}
|
39
|
+
|
40
|
+
begin
|
41
|
+
# Get crosstable
|
42
|
+
result = api_instance.api_crosstable(user1, user2, opts)
|
43
|
+
p result
|
44
|
+
rescue Lishogi::ApiError => e
|
45
|
+
puts "Error when calling UsersApi->api_crosstable: #{e}"
|
46
|
+
end
|
47
|
+
```
|
48
|
+
|
49
|
+
#### Using the api_crosstable_with_http_info variant
|
50
|
+
|
51
|
+
This returns an Array which contains the response data, status code and headers.
|
52
|
+
|
53
|
+
> <Array(Object, Integer, Hash)> api_crosstable_with_http_info(user1, user2, opts)
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
begin
|
57
|
+
# Get crosstable
|
58
|
+
data, status_code, headers = api_instance.api_crosstable_with_http_info(user1, user2, opts)
|
59
|
+
p status_code # => 2xx
|
60
|
+
p headers # => { ... }
|
61
|
+
p data # => Object
|
62
|
+
rescue Lishogi::ApiError => e
|
63
|
+
puts "Error when calling UsersApi->api_crosstable_with_http_info: #{e}"
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
### Parameters
|
68
|
+
|
69
|
+
| Name | Type | Description | Notes |
|
70
|
+
| ---- | ---- | ----------- | ----- |
|
71
|
+
| **user1** | **String** | | |
|
72
|
+
| **user2** | **String** | | |
|
73
|
+
| **matchup** | **Boolean** | Whether to get the current match data, if any | [optional] |
|
74
|
+
|
75
|
+
### Return type
|
76
|
+
|
77
|
+
**Object**
|
78
|
+
|
79
|
+
### Authorization
|
80
|
+
|
81
|
+
No authorization required
|
82
|
+
|
83
|
+
### HTTP request headers
|
84
|
+
|
85
|
+
- **Content-Type**: Not defined
|
86
|
+
- **Accept**: application/json
|
87
|
+
|
88
|
+
|
89
|
+
## api_user
|
90
|
+
|
91
|
+
> <UserExtended> api_user(username)
|
92
|
+
|
93
|
+
Get user public data
|
94
|
+
|
95
|
+
Read public data of a user.
|
96
|
+
|
97
|
+
### Examples
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
require 'time'
|
101
|
+
require 'lishogi'
|
102
|
+
|
103
|
+
api_instance = Lishogi::UsersApi.new
|
104
|
+
username = 'username_example' # String |
|
105
|
+
|
106
|
+
begin
|
107
|
+
# Get user public data
|
108
|
+
result = api_instance.api_user(username)
|
109
|
+
p result
|
110
|
+
rescue Lishogi::ApiError => e
|
111
|
+
puts "Error when calling UsersApi->api_user: #{e}"
|
112
|
+
end
|
113
|
+
```
|
114
|
+
|
115
|
+
#### Using the api_user_with_http_info variant
|
116
|
+
|
117
|
+
This returns an Array which contains the response data, status code and headers.
|
118
|
+
|
119
|
+
> <Array(<UserExtended>, Integer, Hash)> api_user_with_http_info(username)
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
begin
|
123
|
+
# Get user public data
|
124
|
+
data, status_code, headers = api_instance.api_user_with_http_info(username)
|
125
|
+
p status_code # => 2xx
|
126
|
+
p headers # => { ... }
|
127
|
+
p data # => <UserExtended>
|
128
|
+
rescue Lishogi::ApiError => e
|
129
|
+
puts "Error when calling UsersApi->api_user_with_http_info: #{e}"
|
130
|
+
end
|
131
|
+
```
|
132
|
+
|
133
|
+
### Parameters
|
134
|
+
|
135
|
+
| Name | Type | Description | Notes |
|
136
|
+
| ---- | ---- | ----------- | ----- |
|
137
|
+
| **username** | **String** | | |
|
138
|
+
|
139
|
+
### Return type
|
140
|
+
|
141
|
+
[**UserExtended**](UserExtended.md)
|
142
|
+
|
143
|
+
### Authorization
|
144
|
+
|
145
|
+
No authorization required
|
146
|
+
|
147
|
+
### HTTP request headers
|
148
|
+
|
149
|
+
- **Content-Type**: Not defined
|
150
|
+
- **Accept**: application/json
|
151
|
+
|
152
|
+
|
153
|
+
## api_user_activity
|
154
|
+
|
155
|
+
> api_user_activity(username)
|
156
|
+
|
157
|
+
Get user activity
|
158
|
+
|
159
|
+
Read data to generate the activity feed of a user.
|
160
|
+
|
161
|
+
### Examples
|
162
|
+
|
163
|
+
```ruby
|
164
|
+
require 'time'
|
165
|
+
require 'lishogi'
|
166
|
+
|
167
|
+
api_instance = Lishogi::UsersApi.new
|
168
|
+
username = 'username_example' # String |
|
169
|
+
|
170
|
+
begin
|
171
|
+
# Get user activity
|
172
|
+
api_instance.api_user_activity(username)
|
173
|
+
rescue Lishogi::ApiError => e
|
174
|
+
puts "Error when calling UsersApi->api_user_activity: #{e}"
|
175
|
+
end
|
176
|
+
```
|
177
|
+
|
178
|
+
#### Using the api_user_activity_with_http_info variant
|
179
|
+
|
180
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
181
|
+
|
182
|
+
> <Array(nil, Integer, Hash)> api_user_activity_with_http_info(username)
|
183
|
+
|
184
|
+
```ruby
|
185
|
+
begin
|
186
|
+
# Get user activity
|
187
|
+
data, status_code, headers = api_instance.api_user_activity_with_http_info(username)
|
188
|
+
p status_code # => 2xx
|
189
|
+
p headers # => { ... }
|
190
|
+
p data # => nil
|
191
|
+
rescue Lishogi::ApiError => e
|
192
|
+
puts "Error when calling UsersApi->api_user_activity_with_http_info: #{e}"
|
193
|
+
end
|
194
|
+
```
|
195
|
+
|
196
|
+
### Parameters
|
197
|
+
|
198
|
+
| Name | Type | Description | Notes |
|
199
|
+
| ---- | ---- | ----------- | ----- |
|
200
|
+
| **username** | **String** | | |
|
201
|
+
|
202
|
+
### Return type
|
203
|
+
|
204
|
+
nil (empty response body)
|
205
|
+
|
206
|
+
### Authorization
|
207
|
+
|
208
|
+
No authorization required
|
209
|
+
|
210
|
+
### HTTP request headers
|
211
|
+
|
212
|
+
- **Content-Type**: Not defined
|
213
|
+
- **Accept**: application/json
|
214
|
+
|
215
|
+
|
216
|
+
## api_user_rating_history
|
217
|
+
|
218
|
+
> Object api_user_rating_history(username)
|
219
|
+
|
220
|
+
Get rating history of a user
|
221
|
+
|
222
|
+
Read rating history of a user, for all perf types. There is at most one entry per day. Format of an entry is `[year, month, day, rating]`. `month` starts at zero (January).
|
223
|
+
|
224
|
+
### Examples
|
225
|
+
|
226
|
+
```ruby
|
227
|
+
require 'time'
|
228
|
+
require 'lishogi'
|
229
|
+
|
230
|
+
api_instance = Lishogi::UsersApi.new
|
231
|
+
username = 'username_example' # String |
|
232
|
+
|
233
|
+
begin
|
234
|
+
# Get rating history of a user
|
235
|
+
result = api_instance.api_user_rating_history(username)
|
236
|
+
p result
|
237
|
+
rescue Lishogi::ApiError => e
|
238
|
+
puts "Error when calling UsersApi->api_user_rating_history: #{e}"
|
239
|
+
end
|
240
|
+
```
|
241
|
+
|
242
|
+
#### Using the api_user_rating_history_with_http_info variant
|
243
|
+
|
244
|
+
This returns an Array which contains the response data, status code and headers.
|
245
|
+
|
246
|
+
> <Array(Object, Integer, Hash)> api_user_rating_history_with_http_info(username)
|
247
|
+
|
248
|
+
```ruby
|
249
|
+
begin
|
250
|
+
# Get rating history of a user
|
251
|
+
data, status_code, headers = api_instance.api_user_rating_history_with_http_info(username)
|
252
|
+
p status_code # => 2xx
|
253
|
+
p headers # => { ... }
|
254
|
+
p data # => Object
|
255
|
+
rescue Lishogi::ApiError => e
|
256
|
+
puts "Error when calling UsersApi->api_user_rating_history_with_http_info: #{e}"
|
257
|
+
end
|
258
|
+
```
|
259
|
+
|
260
|
+
### Parameters
|
261
|
+
|
262
|
+
| Name | Type | Description | Notes |
|
263
|
+
| ---- | ---- | ----------- | ----- |
|
264
|
+
| **username** | **String** | | |
|
265
|
+
|
266
|
+
### Return type
|
267
|
+
|
268
|
+
**Object**
|
269
|
+
|
270
|
+
### Authorization
|
271
|
+
|
272
|
+
No authorization required
|
273
|
+
|
274
|
+
### HTTP request headers
|
275
|
+
|
276
|
+
- **Content-Type**: Not defined
|
277
|
+
- **Accept**: application/json
|
278
|
+
|
279
|
+
|
280
|
+
## api_users
|
281
|
+
|
282
|
+
> <Array<User>> api_users(body)
|
283
|
+
|
284
|
+
Get users by ID
|
285
|
+
|
286
|
+
Get up to 300 users by their IDs. Users are returned in the same order as the IDs. The method is `POST` so a longer list of IDs can be sent in the request body.
|
287
|
+
|
288
|
+
### Examples
|
289
|
+
|
290
|
+
```ruby
|
291
|
+
require 'time'
|
292
|
+
require 'lishogi'
|
293
|
+
|
294
|
+
api_instance = Lishogi::UsersApi.new
|
295
|
+
body = 'yokoyamatomoki,shogi_harbour,yohaansethnathan' # String | User IDs separated by commas.
|
296
|
+
|
297
|
+
begin
|
298
|
+
# Get users by ID
|
299
|
+
result = api_instance.api_users(body)
|
300
|
+
p result
|
301
|
+
rescue Lishogi::ApiError => e
|
302
|
+
puts "Error when calling UsersApi->api_users: #{e}"
|
303
|
+
end
|
304
|
+
```
|
305
|
+
|
306
|
+
#### Using the api_users_with_http_info variant
|
307
|
+
|
308
|
+
This returns an Array which contains the response data, status code and headers.
|
309
|
+
|
310
|
+
> <Array(<Array<User>>, Integer, Hash)> api_users_with_http_info(body)
|
311
|
+
|
312
|
+
```ruby
|
313
|
+
begin
|
314
|
+
# Get users by ID
|
315
|
+
data, status_code, headers = api_instance.api_users_with_http_info(body)
|
316
|
+
p status_code # => 2xx
|
317
|
+
p headers # => { ... }
|
318
|
+
p data # => <Array<User>>
|
319
|
+
rescue Lishogi::ApiError => e
|
320
|
+
puts "Error when calling UsersApi->api_users_with_http_info: #{e}"
|
321
|
+
end
|
322
|
+
```
|
323
|
+
|
324
|
+
### Parameters
|
325
|
+
|
326
|
+
| Name | Type | Description | Notes |
|
327
|
+
| ---- | ---- | ----------- | ----- |
|
328
|
+
| **body** | **String** | User IDs separated by commas. | |
|
329
|
+
|
330
|
+
### Return type
|
331
|
+
|
332
|
+
[**Array<User>**](User.md)
|
333
|
+
|
334
|
+
### Authorization
|
335
|
+
|
336
|
+
No authorization required
|
337
|
+
|
338
|
+
### HTTP request headers
|
339
|
+
|
340
|
+
- **Content-Type**: text/plain
|
341
|
+
- **Accept**: application/json
|
342
|
+
|
343
|
+
|
344
|
+
## api_users_status
|
345
|
+
|
346
|
+
> <Array<ApiUsersStatus200ResponseInner>> api_users_status(ids, opts)
|
347
|
+
|
348
|
+
Get real-time users status
|
349
|
+
|
350
|
+
Read the `online`, `playing` and `streaming` flags of several users. This API is very fast and cheap on lishogi side. So you can call it quite often (like once every 5 seconds). Use it to track players and know when they're connected on lishogi and playing games.
|
351
|
+
|
352
|
+
### Examples
|
353
|
+
|
354
|
+
```ruby
|
355
|
+
require 'time'
|
356
|
+
require 'lishogi'
|
357
|
+
|
358
|
+
api_instance = Lishogi::UsersApi.new
|
359
|
+
ids = 'yokoyamatomoki,shogi_harbour,yohaansethnathan' # String | User IDs separated by commas. Up to 100 IDs.
|
360
|
+
opts = {
|
361
|
+
with_game_ids: true # Boolean | Also return the ID of the game being played, if any, for each player, in a `playingId` field. Defaults to `false` to preserve server resources.
|
362
|
+
}
|
363
|
+
|
364
|
+
begin
|
365
|
+
# Get real-time users status
|
366
|
+
result = api_instance.api_users_status(ids, opts)
|
367
|
+
p result
|
368
|
+
rescue Lishogi::ApiError => e
|
369
|
+
puts "Error when calling UsersApi->api_users_status: #{e}"
|
370
|
+
end
|
371
|
+
```
|
372
|
+
|
373
|
+
#### Using the api_users_status_with_http_info variant
|
374
|
+
|
375
|
+
This returns an Array which contains the response data, status code and headers.
|
376
|
+
|
377
|
+
> <Array(<Array<ApiUsersStatus200ResponseInner>>, Integer, Hash)> api_users_status_with_http_info(ids, opts)
|
378
|
+
|
379
|
+
```ruby
|
380
|
+
begin
|
381
|
+
# Get real-time users status
|
382
|
+
data, status_code, headers = api_instance.api_users_status_with_http_info(ids, opts)
|
383
|
+
p status_code # => 2xx
|
384
|
+
p headers # => { ... }
|
385
|
+
p data # => <Array<ApiUsersStatus200ResponseInner>>
|
386
|
+
rescue Lishogi::ApiError => e
|
387
|
+
puts "Error when calling UsersApi->api_users_status_with_http_info: #{e}"
|
388
|
+
end
|
389
|
+
```
|
390
|
+
|
391
|
+
### Parameters
|
392
|
+
|
393
|
+
| Name | Type | Description | Notes |
|
394
|
+
| ---- | ---- | ----------- | ----- |
|
395
|
+
| **ids** | **String** | User IDs separated by commas. Up to 100 IDs. | |
|
396
|
+
| **with_game_ids** | **Boolean** | Also return the ID of the game being played, if any, for each player, in a `playingId` field. Defaults to `false` to preserve server resources. | [optional] |
|
397
|
+
|
398
|
+
### Return type
|
399
|
+
|
400
|
+
[**Array<ApiUsersStatus200ResponseInner>**](ApiUsersStatus200ResponseInner.md)
|
401
|
+
|
402
|
+
### Authorization
|
403
|
+
|
404
|
+
No authorization required
|
405
|
+
|
406
|
+
### HTTP request headers
|
407
|
+
|
408
|
+
- **Content-Type**: Not defined
|
409
|
+
- **Accept**: application/json
|
410
|
+
|
411
|
+
|
412
|
+
## player
|
413
|
+
|
414
|
+
> Object player
|
415
|
+
|
416
|
+
Get all top 10
|
417
|
+
|
418
|
+
Get the top 10 players for each speed and variant. See <https://lishogi.org/player>.
|
419
|
+
|
420
|
+
### Examples
|
421
|
+
|
422
|
+
```ruby
|
423
|
+
require 'time'
|
424
|
+
require 'lishogi'
|
425
|
+
|
426
|
+
api_instance = Lishogi::UsersApi.new
|
427
|
+
|
428
|
+
begin
|
429
|
+
# Get all top 10
|
430
|
+
result = api_instance.player
|
431
|
+
p result
|
432
|
+
rescue Lishogi::ApiError => e
|
433
|
+
puts "Error when calling UsersApi->player: #{e}"
|
434
|
+
end
|
435
|
+
```
|
436
|
+
|
437
|
+
#### Using the player_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)> player_with_http_info
|
442
|
+
|
443
|
+
```ruby
|
444
|
+
begin
|
445
|
+
# Get all top 10
|
446
|
+
data, status_code, headers = api_instance.player_with_http_info
|
447
|
+
p status_code # => 2xx
|
448
|
+
p headers # => { ... }
|
449
|
+
p data # => Object
|
450
|
+
rescue Lishogi::ApiError => e
|
451
|
+
puts "Error when calling UsersApi->player_with_http_info: #{e}"
|
452
|
+
end
|
453
|
+
```
|
454
|
+
|
455
|
+
### Parameters
|
456
|
+
|
457
|
+
This endpoint does not need any parameter.
|
458
|
+
|
459
|
+
### Return type
|
460
|
+
|
461
|
+
**Object**
|
462
|
+
|
463
|
+
### Authorization
|
464
|
+
|
465
|
+
No authorization required
|
466
|
+
|
467
|
+
### HTTP request headers
|
468
|
+
|
469
|
+
- **Content-Type**: Not defined
|
470
|
+
- **Accept**: application/vnd.lishogi.v3+json
|
471
|
+
|
472
|
+
|
473
|
+
## player_top_nb_perf_type
|
474
|
+
|
475
|
+
> Object player_top_nb_perf_type(nb, perf_type)
|
476
|
+
|
477
|
+
Get one leaderboard
|
478
|
+
|
479
|
+
Get the leaderboard for a single speed or variant (a.k.a. `perfType`). There is no leaderboard for correspondence or puzzles. See <https://lishogi.org/player/top/200/bullet>.
|
480
|
+
|
481
|
+
### Examples
|
482
|
+
|
483
|
+
```ruby
|
484
|
+
require 'time'
|
485
|
+
require 'lishogi'
|
486
|
+
|
487
|
+
api_instance = Lishogi::UsersApi.new
|
488
|
+
nb = 100 # Integer | How many users to fetch
|
489
|
+
perf_type = 'ultraBullet' # String | The speed or variant
|
490
|
+
|
491
|
+
begin
|
492
|
+
# Get one leaderboard
|
493
|
+
result = api_instance.player_top_nb_perf_type(nb, perf_type)
|
494
|
+
p result
|
495
|
+
rescue Lishogi::ApiError => e
|
496
|
+
puts "Error when calling UsersApi->player_top_nb_perf_type: #{e}"
|
497
|
+
end
|
498
|
+
```
|
499
|
+
|
500
|
+
#### Using the player_top_nb_perf_type_with_http_info variant
|
501
|
+
|
502
|
+
This returns an Array which contains the response data, status code and headers.
|
503
|
+
|
504
|
+
> <Array(Object, Integer, Hash)> player_top_nb_perf_type_with_http_info(nb, perf_type)
|
505
|
+
|
506
|
+
```ruby
|
507
|
+
begin
|
508
|
+
# Get one leaderboard
|
509
|
+
data, status_code, headers = api_instance.player_top_nb_perf_type_with_http_info(nb, perf_type)
|
510
|
+
p status_code # => 2xx
|
511
|
+
p headers # => { ... }
|
512
|
+
p data # => Object
|
513
|
+
rescue Lishogi::ApiError => e
|
514
|
+
puts "Error when calling UsersApi->player_top_nb_perf_type_with_http_info: #{e}"
|
515
|
+
end
|
516
|
+
```
|
517
|
+
|
518
|
+
### Parameters
|
519
|
+
|
520
|
+
| Name | Type | Description | Notes |
|
521
|
+
| ---- | ---- | ----------- | ----- |
|
522
|
+
| **nb** | **Integer** | How many users to fetch | |
|
523
|
+
| **perf_type** | **String** | The speed or variant | |
|
524
|
+
|
525
|
+
### Return type
|
526
|
+
|
527
|
+
**Object**
|
528
|
+
|
529
|
+
### Authorization
|
530
|
+
|
531
|
+
No authorization required
|
532
|
+
|
533
|
+
### HTTP request headers
|
534
|
+
|
535
|
+
- **Content-Type**: Not defined
|
536
|
+
- **Accept**: application/vnd.lishogi.v3+json
|
537
|
+
|
538
|
+
|
539
|
+
## streamer_live
|
540
|
+
|
541
|
+
> <Array<LightUser>> streamer_live
|
542
|
+
|
543
|
+
Get live streamers
|
544
|
+
|
545
|
+
Get basic info about currently streaming users. This API is very fast and cheap on lishogi side. So you can call it quite often (like once every 5 seconds).
|
546
|
+
|
547
|
+
### Examples
|
548
|
+
|
549
|
+
```ruby
|
550
|
+
require 'time'
|
551
|
+
require 'lishogi'
|
552
|
+
|
553
|
+
api_instance = Lishogi::UsersApi.new
|
554
|
+
|
555
|
+
begin
|
556
|
+
# Get live streamers
|
557
|
+
result = api_instance.streamer_live
|
558
|
+
p result
|
559
|
+
rescue Lishogi::ApiError => e
|
560
|
+
puts "Error when calling UsersApi->streamer_live: #{e}"
|
561
|
+
end
|
562
|
+
```
|
563
|
+
|
564
|
+
#### Using the streamer_live_with_http_info variant
|
565
|
+
|
566
|
+
This returns an Array which contains the response data, status code and headers.
|
567
|
+
|
568
|
+
> <Array(<Array<LightUser>>, Integer, Hash)> streamer_live_with_http_info
|
569
|
+
|
570
|
+
```ruby
|
571
|
+
begin
|
572
|
+
# Get live streamers
|
573
|
+
data, status_code, headers = api_instance.streamer_live_with_http_info
|
574
|
+
p status_code # => 2xx
|
575
|
+
p headers # => { ... }
|
576
|
+
p data # => <Array<LightUser>>
|
577
|
+
rescue Lishogi::ApiError => e
|
578
|
+
puts "Error when calling UsersApi->streamer_live_with_http_info: #{e}"
|
579
|
+
end
|
580
|
+
```
|
581
|
+
|
582
|
+
### Parameters
|
583
|
+
|
584
|
+
This endpoint does not need any parameter.
|
585
|
+
|
586
|
+
### Return type
|
587
|
+
|
588
|
+
[**Array<LightUser>**](LightUser.md)
|
589
|
+
|
590
|
+
### Authorization
|
591
|
+
|
592
|
+
No authorization required
|
593
|
+
|
594
|
+
### HTTP request headers
|
595
|
+
|
596
|
+
- **Content-Type**: Not defined
|
597
|
+
- **Accept**: application/json
|
598
|
+
|
599
|
+
|
600
|
+
## team_id_users
|
601
|
+
|
602
|
+
> <UserExtended> team_id_users(team_id)
|
603
|
+
|
604
|
+
Get members of a team
|
605
|
+
|
606
|
+
Members are sorted by reverse chronological order of joining the team (most recent first). OAuth only required if the list of members is private. Members are streamed as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
|
607
|
+
|
608
|
+
### Examples
|
609
|
+
|
610
|
+
```ruby
|
611
|
+
require 'time'
|
612
|
+
require 'lishogi'
|
613
|
+
# setup authorization
|
614
|
+
Lishogi.configure do |config|
|
615
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
616
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
617
|
+
end
|
618
|
+
|
619
|
+
api_instance = Lishogi::UsersApi.new
|
620
|
+
team_id = 'shogi-is-hard' # String |
|
621
|
+
|
622
|
+
begin
|
623
|
+
# Get members of a team
|
624
|
+
result = api_instance.team_id_users(team_id)
|
625
|
+
p result
|
626
|
+
rescue Lishogi::ApiError => e
|
627
|
+
puts "Error when calling UsersApi->team_id_users: #{e}"
|
628
|
+
end
|
629
|
+
```
|
630
|
+
|
631
|
+
#### Using the team_id_users_with_http_info variant
|
632
|
+
|
633
|
+
This returns an Array which contains the response data, status code and headers.
|
634
|
+
|
635
|
+
> <Array(<UserExtended>, Integer, Hash)> team_id_users_with_http_info(team_id)
|
636
|
+
|
637
|
+
```ruby
|
638
|
+
begin
|
639
|
+
# Get members of a team
|
640
|
+
data, status_code, headers = api_instance.team_id_users_with_http_info(team_id)
|
641
|
+
p status_code # => 2xx
|
642
|
+
p headers # => { ... }
|
643
|
+
p data # => <UserExtended>
|
644
|
+
rescue Lishogi::ApiError => e
|
645
|
+
puts "Error when calling UsersApi->team_id_users_with_http_info: #{e}"
|
646
|
+
end
|
647
|
+
```
|
648
|
+
|
649
|
+
### Parameters
|
650
|
+
|
651
|
+
| Name | Type | Description | Notes |
|
652
|
+
| ---- | ---- | ----------- | ----- |
|
653
|
+
| **team_id** | **String** | | |
|
654
|
+
|
655
|
+
### Return type
|
656
|
+
|
657
|
+
[**UserExtended**](UserExtended.md)
|
658
|
+
|
659
|
+
### Authorization
|
660
|
+
|
661
|
+
[OAuth2](../README.md#OAuth2)
|
662
|
+
|
663
|
+
### HTTP request headers
|
664
|
+
|
665
|
+
- **Content-Type**: Not defined
|
666
|
+
- **Accept**: application/x-ndjson
|
667
|
+
|
data/docs/Variant.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Lishogi::Variant
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **key** | [**VariantKey**](VariantKey.md) | | [optional][default to 'standard'] |
|
8
|
+
| **name** | **String** | | [optional] |
|
9
|
+
| **short** | **String** | | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'lishogi'
|
15
|
+
|
16
|
+
instance = Lishogi::Variant.new(
|
17
|
+
key: null,
|
18
|
+
name: null,
|
19
|
+
short: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
data/docs/VariantKey.md
ADDED