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
@@ -0,0 +1,601 @@
|
|
1
|
+
# Lishogi::ArenaTournamentsApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://lishogi.org*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**api_team_arena**](ArenaTournamentsApi.md#api_team_arena) | **GET** /api/team/{teamId}/arena | Get team Arena tournaments |
|
8
|
+
| [**api_tournament**](ArenaTournamentsApi.md#api_tournament) | **GET** /api/tournament | Get current tournaments |
|
9
|
+
| [**api_tournament_post**](ArenaTournamentsApi.md#api_tournament_post) | **POST** /api/tournament | Create a new Arena tournament |
|
10
|
+
| [**api_user_name_tournament_created**](ArenaTournamentsApi.md#api_user_name_tournament_created) | **GET** /api/user/{username}/tournament/created | Get tournaments created by a user |
|
11
|
+
| [**games_by_tournament**](ArenaTournamentsApi.md#games_by_tournament) | **GET** /api/tournament/{id}/games | Export games of an Arena tournament |
|
12
|
+
| [**results_by_tournament**](ArenaTournamentsApi.md#results_by_tournament) | **GET** /api/tournament/{id}/results | Get results of an Arena tournament |
|
13
|
+
| [**teams_by_tournament**](ArenaTournamentsApi.md#teams_by_tournament) | **GET** /api/tournament/{id}/teams | Get team standing of a team battle |
|
14
|
+
| [**tournament**](ArenaTournamentsApi.md#tournament) | **GET** /api/tournament/{id} | Get info about an Arena tournament |
|
15
|
+
|
16
|
+
|
17
|
+
## api_team_arena
|
18
|
+
|
19
|
+
> Array<Object> api_team_arena(team_id, opts)
|
20
|
+
|
21
|
+
Get team Arena tournaments
|
22
|
+
|
23
|
+
Get all Arena tournaments relevant to a team. Tournaments are sorted by reverse chronological order of start date (last starting first). Tournaments are streamed as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
|
24
|
+
|
25
|
+
### Examples
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
require 'time'
|
29
|
+
require 'lishogi'
|
30
|
+
|
31
|
+
api_instance = Lishogi::ArenaTournamentsApi.new
|
32
|
+
team_id = 'team_id_example' # String | ID of the team
|
33
|
+
opts = {
|
34
|
+
max: 56 # Integer | How many tournaments to download.
|
35
|
+
}
|
36
|
+
|
37
|
+
begin
|
38
|
+
# Get team Arena tournaments
|
39
|
+
result = api_instance.api_team_arena(team_id, opts)
|
40
|
+
p result
|
41
|
+
rescue Lishogi::ApiError => e
|
42
|
+
puts "Error when calling ArenaTournamentsApi->api_team_arena: #{e}"
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
#### Using the api_team_arena_with_http_info variant
|
47
|
+
|
48
|
+
This returns an Array which contains the response data, status code and headers.
|
49
|
+
|
50
|
+
> <Array(Array<Object>, Integer, Hash)> api_team_arena_with_http_info(team_id, opts)
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
begin
|
54
|
+
# Get team Arena tournaments
|
55
|
+
data, status_code, headers = api_instance.api_team_arena_with_http_info(team_id, opts)
|
56
|
+
p status_code # => 2xx
|
57
|
+
p headers # => { ... }
|
58
|
+
p data # => Array<Object>
|
59
|
+
rescue Lishogi::ApiError => e
|
60
|
+
puts "Error when calling ArenaTournamentsApi->api_team_arena_with_http_info: #{e}"
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
### Parameters
|
65
|
+
|
66
|
+
| Name | Type | Description | Notes |
|
67
|
+
| ---- | ---- | ----------- | ----- |
|
68
|
+
| **team_id** | **String** | ID of the team | |
|
69
|
+
| **max** | **Integer** | How many tournaments to download. | [optional][default to 100] |
|
70
|
+
|
71
|
+
### Return type
|
72
|
+
|
73
|
+
**Array<Object>**
|
74
|
+
|
75
|
+
### Authorization
|
76
|
+
|
77
|
+
No authorization required
|
78
|
+
|
79
|
+
### HTTP request headers
|
80
|
+
|
81
|
+
- **Content-Type**: Not defined
|
82
|
+
- **Accept**: application/json
|
83
|
+
|
84
|
+
|
85
|
+
## api_tournament
|
86
|
+
|
87
|
+
> <ArenaTournaments> api_tournament
|
88
|
+
|
89
|
+
Get current tournaments
|
90
|
+
|
91
|
+
Get recently finished, ongoing, and upcoming tournaments. This API is used to display the [Lishogi tournament schedule](https://lishogi.org/tournament).
|
92
|
+
|
93
|
+
### Examples
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
require 'time'
|
97
|
+
require 'lishogi'
|
98
|
+
|
99
|
+
api_instance = Lishogi::ArenaTournamentsApi.new
|
100
|
+
|
101
|
+
begin
|
102
|
+
# Get current tournaments
|
103
|
+
result = api_instance.api_tournament
|
104
|
+
p result
|
105
|
+
rescue Lishogi::ApiError => e
|
106
|
+
puts "Error when calling ArenaTournamentsApi->api_tournament: #{e}"
|
107
|
+
end
|
108
|
+
```
|
109
|
+
|
110
|
+
#### Using the api_tournament_with_http_info variant
|
111
|
+
|
112
|
+
This returns an Array which contains the response data, status code and headers.
|
113
|
+
|
114
|
+
> <Array(<ArenaTournaments>, Integer, Hash)> api_tournament_with_http_info
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
begin
|
118
|
+
# Get current tournaments
|
119
|
+
data, status_code, headers = api_instance.api_tournament_with_http_info
|
120
|
+
p status_code # => 2xx
|
121
|
+
p headers # => { ... }
|
122
|
+
p data # => <ArenaTournaments>
|
123
|
+
rescue Lishogi::ApiError => e
|
124
|
+
puts "Error when calling ArenaTournamentsApi->api_tournament_with_http_info: #{e}"
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
128
|
+
### Parameters
|
129
|
+
|
130
|
+
This endpoint does not need any parameter.
|
131
|
+
|
132
|
+
### Return type
|
133
|
+
|
134
|
+
[**ArenaTournaments**](ArenaTournaments.md)
|
135
|
+
|
136
|
+
### Authorization
|
137
|
+
|
138
|
+
No authorization required
|
139
|
+
|
140
|
+
### HTTP request headers
|
141
|
+
|
142
|
+
- **Content-Type**: Not defined
|
143
|
+
- **Accept**: application/json
|
144
|
+
|
145
|
+
|
146
|
+
## api_tournament_post
|
147
|
+
|
148
|
+
> Object api_tournament_post(clock_time, clock_increment, clock_byoyomi, periods, minutes, opts)
|
149
|
+
|
150
|
+
Create a new Arena tournament
|
151
|
+
|
152
|
+
Create a public or private Arena tournament. This endpoint mirrors the form on <https://lishogi.org/tournament/new>. You can create up to 12 public tournaments per day, or 24 private tournaments. A team battle can be created by specifying the `teambBattleByTeam` argument.
|
153
|
+
|
154
|
+
### Examples
|
155
|
+
|
156
|
+
```ruby
|
157
|
+
require 'time'
|
158
|
+
require 'lishogi'
|
159
|
+
# setup authorization
|
160
|
+
Lishogi.configure do |config|
|
161
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
162
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
163
|
+
end
|
164
|
+
|
165
|
+
api_instance = Lishogi::ArenaTournamentsApi.new
|
166
|
+
clock_time = 0 # Float | Clock initial time in minutes
|
167
|
+
clock_increment = 0 # Integer | Clock increment in seconds
|
168
|
+
clock_byoyomi = 0 # Integer | Clock byoyomi in seconds
|
169
|
+
periods = 0 # Integer | Clock periods for byoyomi
|
170
|
+
minutes = 20 # Integer | How long the tournament lasts, in minutes
|
171
|
+
opts = {
|
172
|
+
name: 'name_example', # String | The tournament name. Leave empty to get a random Grandmaster name
|
173
|
+
wait_minutes: 1, # Integer | How long to wait before starting the tournament, from now, in minutes
|
174
|
+
start_date: 56, # Integer | Timestamp to start the tournament at a given date and time. Overrides the `waitMinutes` setting
|
175
|
+
variant: Lishogi::VariantKey::STANDARD, # VariantKey |
|
176
|
+
rated: true, # Boolean | Games are rated and impact players ratings
|
177
|
+
position: 'position_example', # String | Custom initial position (in SFEN) for all games of the tournament. Must be a legal shogi position. Only works with standard shogi, not variants.
|
178
|
+
berserkable: true, # Boolean | Whether the players can use berserk
|
179
|
+
streakable: true, # Boolean | After 2 wins, consecutive wins grant 4 points instead of 2.
|
180
|
+
has_chat: true, # Boolean | Whether the players can discuss in a chat
|
181
|
+
description: 'description_example', # String | Anything you want to tell players about the tournament
|
182
|
+
password: 'password_example', # String | Make the tournament private, and restrict access with a password. You can also [generate user-specific entry codes](https://github.com/lishogi-org/api/tree/master/example/tournament-entry-code) based on this password.
|
183
|
+
team_battle_by_team: 'team_battle_by_team_example', # String | Set the ID of a team you lead to create a team battle. The other teams can be added using the [team battle edit endpoint](#operation/apiTournamentTeamBattlePost).
|
184
|
+
conditions_team_member_team_id: 'conditions_team_member_team_id_example', # String | Restrict entry to members of a team. The teamId is the last part of a team URL, e.g. `https://lishogi.org/team/shogi-is-hard` has teamId = `shogi-is-hard`. Leave empty to let everyone join the tournament. Do not use this to create team battles, use `teamBattleByTeam` instead.
|
185
|
+
conditions_min_rating_rating: 56, # Integer | Minimum rating to join. Leave empty to let everyone join the tournament.
|
186
|
+
conditions_max_rating_rating: 56, # Integer | Maximum rating to join. Based on best rating reached in the last 7 days. Leave empty to let everyone join the tournament.
|
187
|
+
conditions_nb_rated_game_nb: 56 # Integer | Minimum number of rated games required to join.
|
188
|
+
}
|
189
|
+
|
190
|
+
begin
|
191
|
+
# Create a new Arena tournament
|
192
|
+
result = api_instance.api_tournament_post(clock_time, clock_increment, clock_byoyomi, periods, minutes, opts)
|
193
|
+
p result
|
194
|
+
rescue Lishogi::ApiError => e
|
195
|
+
puts "Error when calling ArenaTournamentsApi->api_tournament_post: #{e}"
|
196
|
+
end
|
197
|
+
```
|
198
|
+
|
199
|
+
#### Using the api_tournament_post_with_http_info variant
|
200
|
+
|
201
|
+
This returns an Array which contains the response data, status code and headers.
|
202
|
+
|
203
|
+
> <Array(Object, Integer, Hash)> api_tournament_post_with_http_info(clock_time, clock_increment, clock_byoyomi, periods, minutes, opts)
|
204
|
+
|
205
|
+
```ruby
|
206
|
+
begin
|
207
|
+
# Create a new Arena tournament
|
208
|
+
data, status_code, headers = api_instance.api_tournament_post_with_http_info(clock_time, clock_increment, clock_byoyomi, periods, minutes, opts)
|
209
|
+
p status_code # => 2xx
|
210
|
+
p headers # => { ... }
|
211
|
+
p data # => Object
|
212
|
+
rescue Lishogi::ApiError => e
|
213
|
+
puts "Error when calling ArenaTournamentsApi->api_tournament_post_with_http_info: #{e}"
|
214
|
+
end
|
215
|
+
```
|
216
|
+
|
217
|
+
### Parameters
|
218
|
+
|
219
|
+
| Name | Type | Description | Notes |
|
220
|
+
| ---- | ---- | ----------- | ----- |
|
221
|
+
| **clock_time** | **Float** | Clock initial time in minutes | |
|
222
|
+
| **clock_increment** | **Integer** | Clock increment in seconds | |
|
223
|
+
| **clock_byoyomi** | **Integer** | Clock byoyomi in seconds | |
|
224
|
+
| **periods** | **Integer** | Clock periods for byoyomi | |
|
225
|
+
| **minutes** | **Integer** | How long the tournament lasts, in minutes | |
|
226
|
+
| **name** | **String** | The tournament name. Leave empty to get a random Grandmaster name | [optional] |
|
227
|
+
| **wait_minutes** | **Integer** | How long to wait before starting the tournament, from now, in minutes | [optional][default to 5] |
|
228
|
+
| **start_date** | **Integer** | Timestamp to start the tournament at a given date and time. Overrides the `waitMinutes` setting | [optional] |
|
229
|
+
| **variant** | [**VariantKey**](VariantKey.md) | | [optional][default to 'standard'] |
|
230
|
+
| **rated** | **Boolean** | Games are rated and impact players ratings | [optional][default to true] |
|
231
|
+
| **position** | **String** | Custom initial position (in SFEN) for all games of the tournament. Must be a legal shogi position. Only works with standard shogi, not variants. | [optional] |
|
232
|
+
| **berserkable** | **Boolean** | Whether the players can use berserk | [optional][default to true] |
|
233
|
+
| **streakable** | **Boolean** | After 2 wins, consecutive wins grant 4 points instead of 2. | [optional][default to true] |
|
234
|
+
| **has_chat** | **Boolean** | Whether the players can discuss in a chat | [optional][default to true] |
|
235
|
+
| **description** | **String** | Anything you want to tell players about the tournament | [optional] |
|
236
|
+
| **password** | **String** | Make the tournament private, and restrict access with a password. You can also [generate user-specific entry codes](https://github.com/lishogi-org/api/tree/master/example/tournament-entry-code) based on this password. | [optional] |
|
237
|
+
| **team_battle_by_team** | **String** | Set the ID of a team you lead to create a team battle. The other teams can be added using the [team battle edit endpoint](#operation/apiTournamentTeamBattlePost). | [optional] |
|
238
|
+
| **conditions_team_member_team_id** | **String** | Restrict entry to members of a team. The teamId is the last part of a team URL, e.g. `https://lishogi.org/team/shogi-is-hard` has teamId = `shogi-is-hard`. Leave empty to let everyone join the tournament. Do not use this to create team battles, use `teamBattleByTeam` instead. | [optional] |
|
239
|
+
| **conditions_min_rating_rating** | **Integer** | Minimum rating to join. Leave empty to let everyone join the tournament. | [optional] |
|
240
|
+
| **conditions_max_rating_rating** | **Integer** | Maximum rating to join. Based on best rating reached in the last 7 days. Leave empty to let everyone join the tournament. | [optional] |
|
241
|
+
| **conditions_nb_rated_game_nb** | **Integer** | Minimum number of rated games required to join. | [optional] |
|
242
|
+
|
243
|
+
### Return type
|
244
|
+
|
245
|
+
**Object**
|
246
|
+
|
247
|
+
### Authorization
|
248
|
+
|
249
|
+
[OAuth2](../README.md#OAuth2)
|
250
|
+
|
251
|
+
### HTTP request headers
|
252
|
+
|
253
|
+
- **Content-Type**: application/x-www-form-urlencoded
|
254
|
+
- **Accept**: application/json
|
255
|
+
|
256
|
+
|
257
|
+
## api_user_name_tournament_created
|
258
|
+
|
259
|
+
> Object api_user_name_tournament_created(username, opts)
|
260
|
+
|
261
|
+
Get tournaments created by a user
|
262
|
+
|
263
|
+
Get all tournaments created by a given user. Tournaments are sorted by reverse chronological order of start date (last starting first). Tournaments are streamed as [ndjson](#section/Introduction/Streaming-with-ND-JSON).
|
264
|
+
|
265
|
+
### Examples
|
266
|
+
|
267
|
+
```ruby
|
268
|
+
require 'time'
|
269
|
+
require 'lishogi'
|
270
|
+
|
271
|
+
api_instance = Lishogi::ArenaTournamentsApi.new
|
272
|
+
username = 'username_example' # String | The user whose created tournaments to fetch
|
273
|
+
opts = {
|
274
|
+
status: 10 # Integer | Include tournaments in the given status: \"Created\" (10), \"Started\" (20), \"Finished\" (30) You can add this parameter more than once to include tournaments in different statuses. Example: `?status=10&status=20`
|
275
|
+
}
|
276
|
+
|
277
|
+
begin
|
278
|
+
# Get tournaments created by a user
|
279
|
+
result = api_instance.api_user_name_tournament_created(username, opts)
|
280
|
+
p result
|
281
|
+
rescue Lishogi::ApiError => e
|
282
|
+
puts "Error when calling ArenaTournamentsApi->api_user_name_tournament_created: #{e}"
|
283
|
+
end
|
284
|
+
```
|
285
|
+
|
286
|
+
#### Using the api_user_name_tournament_created_with_http_info variant
|
287
|
+
|
288
|
+
This returns an Array which contains the response data, status code and headers.
|
289
|
+
|
290
|
+
> <Array(Object, Integer, Hash)> api_user_name_tournament_created_with_http_info(username, opts)
|
291
|
+
|
292
|
+
```ruby
|
293
|
+
begin
|
294
|
+
# Get tournaments created by a user
|
295
|
+
data, status_code, headers = api_instance.api_user_name_tournament_created_with_http_info(username, opts)
|
296
|
+
p status_code # => 2xx
|
297
|
+
p headers # => { ... }
|
298
|
+
p data # => Object
|
299
|
+
rescue Lishogi::ApiError => e
|
300
|
+
puts "Error when calling ArenaTournamentsApi->api_user_name_tournament_created_with_http_info: #{e}"
|
301
|
+
end
|
302
|
+
```
|
303
|
+
|
304
|
+
### Parameters
|
305
|
+
|
306
|
+
| Name | Type | Description | Notes |
|
307
|
+
| ---- | ---- | ----------- | ----- |
|
308
|
+
| **username** | **String** | The user whose created tournaments to fetch | |
|
309
|
+
| **status** | **Integer** | Include tournaments in the given status: \"Created\" (10), \"Started\" (20), \"Finished\" (30) You can add this parameter more than once to include tournaments in different statuses. Example: `?status=10&status=20` | [optional] |
|
310
|
+
|
311
|
+
### Return type
|
312
|
+
|
313
|
+
**Object**
|
314
|
+
|
315
|
+
### Authorization
|
316
|
+
|
317
|
+
No authorization required
|
318
|
+
|
319
|
+
### HTTP request headers
|
320
|
+
|
321
|
+
- **Content-Type**: Not defined
|
322
|
+
- **Accept**: application/x-ndjson
|
323
|
+
|
324
|
+
|
325
|
+
## games_by_tournament
|
326
|
+
|
327
|
+
> Object games_by_tournament(id, opts)
|
328
|
+
|
329
|
+
Export games of an Arena tournament
|
330
|
+
|
331
|
+
Download games of a tournament in KIF or [ndjson](#section/Introduction/Streaming-with-ND-JSON) format. Games are sorted by reverse chronological order (most recent first). 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
|
332
|
+
|
333
|
+
### Examples
|
334
|
+
|
335
|
+
```ruby
|
336
|
+
require 'time'
|
337
|
+
require 'lishogi'
|
338
|
+
|
339
|
+
api_instance = Lishogi::ArenaTournamentsApi.new
|
340
|
+
id = 'id_example' # String | The tournament ID.
|
341
|
+
opts = {
|
342
|
+
player: 'player_example', # String | Only games of a particular player. Leave empty to fetch games of all players.
|
343
|
+
moves: true, # Boolean | Include the KIF moves.
|
344
|
+
pgn_in_json: true, # Boolean | Include the full KIF within the JSON response, in a `notation` field.
|
345
|
+
tags: true, # Boolean | Include the KIF tags.
|
346
|
+
clocks: true, # Boolean | Include clock comments in the KIF moves, when available. Example: `22 同 玉(51) (00:02/00:00:13)`
|
347
|
+
evals: true # Boolean | Include analysis evaluation comments in the KIF, when available. Example: `9 7八銀(79) * [%eval -1.48]`
|
348
|
+
}
|
349
|
+
|
350
|
+
begin
|
351
|
+
# Export games of an Arena tournament
|
352
|
+
result = api_instance.games_by_tournament(id, opts)
|
353
|
+
p result
|
354
|
+
rescue Lishogi::ApiError => e
|
355
|
+
puts "Error when calling ArenaTournamentsApi->games_by_tournament: #{e}"
|
356
|
+
end
|
357
|
+
```
|
358
|
+
|
359
|
+
#### Using the games_by_tournament_with_http_info variant
|
360
|
+
|
361
|
+
This returns an Array which contains the response data, status code and headers.
|
362
|
+
|
363
|
+
> <Array(Object, Integer, Hash)> games_by_tournament_with_http_info(id, opts)
|
364
|
+
|
365
|
+
```ruby
|
366
|
+
begin
|
367
|
+
# Export games of an Arena tournament
|
368
|
+
data, status_code, headers = api_instance.games_by_tournament_with_http_info(id, opts)
|
369
|
+
p status_code # => 2xx
|
370
|
+
p headers # => { ... }
|
371
|
+
p data # => Object
|
372
|
+
rescue Lishogi::ApiError => e
|
373
|
+
puts "Error when calling ArenaTournamentsApi->games_by_tournament_with_http_info: #{e}"
|
374
|
+
end
|
375
|
+
```
|
376
|
+
|
377
|
+
### Parameters
|
378
|
+
|
379
|
+
| Name | Type | Description | Notes |
|
380
|
+
| ---- | ---- | ----------- | ----- |
|
381
|
+
| **id** | **String** | The tournament ID. | |
|
382
|
+
| **player** | **String** | Only games of a particular player. Leave empty to fetch games of all players. | [optional] |
|
383
|
+
| **moves** | **Boolean** | Include the KIF moves. | [optional][default to true] |
|
384
|
+
| **pgn_in_json** | **Boolean** | Include the full KIF within the JSON response, in a `notation` field. | [optional][default to false] |
|
385
|
+
| **tags** | **Boolean** | Include the KIF tags. | [optional][default to true] |
|
386
|
+
| **clocks** | **Boolean** | Include clock comments in the KIF moves, when available. Example: `22 同 玉(51) (00:02/00:00:13)` | [optional][default to false] |
|
387
|
+
| **evals** | **Boolean** | Include analysis evaluation comments in the KIF, when available. Example: `9 7八銀(79) * [%eval -1.48]` | [optional][default to false] |
|
388
|
+
|
389
|
+
### Return type
|
390
|
+
|
391
|
+
**Object**
|
392
|
+
|
393
|
+
### Authorization
|
394
|
+
|
395
|
+
No authorization required
|
396
|
+
|
397
|
+
### HTTP request headers
|
398
|
+
|
399
|
+
- **Content-Type**: Not defined
|
400
|
+
- **Accept**: text/plain, application/x-ndjson
|
401
|
+
|
402
|
+
|
403
|
+
## results_by_tournament
|
404
|
+
|
405
|
+
> Object results_by_tournament(id, opts)
|
406
|
+
|
407
|
+
Get results of an Arena tournament
|
408
|
+
|
409
|
+
Players of an Arena tournament, with their score and performance, sorted by rank (best first). **Players are streamed as [ndjson](#section/Introduction/Streaming-with-ND-JSON)**, i.e. one JSON object per line. If called on an ongoing tournament, results can be inconsistent due to ranking changes while the players are being streamed. Use on finished tournaments for guaranteed consistency.
|
410
|
+
|
411
|
+
### Examples
|
412
|
+
|
413
|
+
```ruby
|
414
|
+
require 'time'
|
415
|
+
require 'lishogi'
|
416
|
+
|
417
|
+
api_instance = Lishogi::ArenaTournamentsApi.new
|
418
|
+
id = 'id_example' # String | The tournament ID.
|
419
|
+
opts = {
|
420
|
+
nb: 56 # Integer | Max number of players to fetch
|
421
|
+
}
|
422
|
+
|
423
|
+
begin
|
424
|
+
# Get results of an Arena tournament
|
425
|
+
result = api_instance.results_by_tournament(id, opts)
|
426
|
+
p result
|
427
|
+
rescue Lishogi::ApiError => e
|
428
|
+
puts "Error when calling ArenaTournamentsApi->results_by_tournament: #{e}"
|
429
|
+
end
|
430
|
+
```
|
431
|
+
|
432
|
+
#### Using the results_by_tournament_with_http_info variant
|
433
|
+
|
434
|
+
This returns an Array which contains the response data, status code and headers.
|
435
|
+
|
436
|
+
> <Array(Object, Integer, Hash)> results_by_tournament_with_http_info(id, opts)
|
437
|
+
|
438
|
+
```ruby
|
439
|
+
begin
|
440
|
+
# Get results of an Arena tournament
|
441
|
+
data, status_code, headers = api_instance.results_by_tournament_with_http_info(id, opts)
|
442
|
+
p status_code # => 2xx
|
443
|
+
p headers # => { ... }
|
444
|
+
p data # => Object
|
445
|
+
rescue Lishogi::ApiError => e
|
446
|
+
puts "Error when calling ArenaTournamentsApi->results_by_tournament_with_http_info: #{e}"
|
447
|
+
end
|
448
|
+
```
|
449
|
+
|
450
|
+
### Parameters
|
451
|
+
|
452
|
+
| Name | Type | Description | Notes |
|
453
|
+
| ---- | ---- | ----------- | ----- |
|
454
|
+
| **id** | **String** | The tournament ID. | |
|
455
|
+
| **nb** | **Integer** | Max number of players to fetch | [optional] |
|
456
|
+
|
457
|
+
### Return type
|
458
|
+
|
459
|
+
**Object**
|
460
|
+
|
461
|
+
### Authorization
|
462
|
+
|
463
|
+
No authorization required
|
464
|
+
|
465
|
+
### HTTP request headers
|
466
|
+
|
467
|
+
- **Content-Type**: Not defined
|
468
|
+
- **Accept**: application/x-ndjson
|
469
|
+
|
470
|
+
|
471
|
+
## teams_by_tournament
|
472
|
+
|
473
|
+
> Object teams_by_tournament(id)
|
474
|
+
|
475
|
+
Get team standing of a team battle
|
476
|
+
|
477
|
+
Teams of a team battle tournament, with top players, sorted by rank (best first).
|
478
|
+
|
479
|
+
### Examples
|
480
|
+
|
481
|
+
```ruby
|
482
|
+
require 'time'
|
483
|
+
require 'lishogi'
|
484
|
+
|
485
|
+
api_instance = Lishogi::ArenaTournamentsApi.new
|
486
|
+
id = 'id_example' # String | The tournament ID.
|
487
|
+
|
488
|
+
begin
|
489
|
+
# Get team standing of a team battle
|
490
|
+
result = api_instance.teams_by_tournament(id)
|
491
|
+
p result
|
492
|
+
rescue Lishogi::ApiError => e
|
493
|
+
puts "Error when calling ArenaTournamentsApi->teams_by_tournament: #{e}"
|
494
|
+
end
|
495
|
+
```
|
496
|
+
|
497
|
+
#### Using the teams_by_tournament_with_http_info variant
|
498
|
+
|
499
|
+
This returns an Array which contains the response data, status code and headers.
|
500
|
+
|
501
|
+
> <Array(Object, Integer, Hash)> teams_by_tournament_with_http_info(id)
|
502
|
+
|
503
|
+
```ruby
|
504
|
+
begin
|
505
|
+
# Get team standing of a team battle
|
506
|
+
data, status_code, headers = api_instance.teams_by_tournament_with_http_info(id)
|
507
|
+
p status_code # => 2xx
|
508
|
+
p headers # => { ... }
|
509
|
+
p data # => Object
|
510
|
+
rescue Lishogi::ApiError => e
|
511
|
+
puts "Error when calling ArenaTournamentsApi->teams_by_tournament_with_http_info: #{e}"
|
512
|
+
end
|
513
|
+
```
|
514
|
+
|
515
|
+
### Parameters
|
516
|
+
|
517
|
+
| Name | Type | Description | Notes |
|
518
|
+
| ---- | ---- | ----------- | ----- |
|
519
|
+
| **id** | **String** | The tournament ID. | |
|
520
|
+
|
521
|
+
### Return type
|
522
|
+
|
523
|
+
**Object**
|
524
|
+
|
525
|
+
### Authorization
|
526
|
+
|
527
|
+
No authorization required
|
528
|
+
|
529
|
+
### HTTP request headers
|
530
|
+
|
531
|
+
- **Content-Type**: Not defined
|
532
|
+
- **Accept**: application/json
|
533
|
+
|
534
|
+
|
535
|
+
## tournament
|
536
|
+
|
537
|
+
> Object tournament(id, opts)
|
538
|
+
|
539
|
+
Get info about an Arena tournament
|
540
|
+
|
541
|
+
Get detailed info about recently finished, current, or upcoming tournament's duels, player standings, and other info.
|
542
|
+
|
543
|
+
### Examples
|
544
|
+
|
545
|
+
```ruby
|
546
|
+
require 'time'
|
547
|
+
require 'lishogi'
|
548
|
+
|
549
|
+
api_instance = Lishogi::ArenaTournamentsApi.new
|
550
|
+
id = 'id_example' # String | The tournament ID.
|
551
|
+
opts = {
|
552
|
+
page: 1 # Float | Specify which page of player standings to view.
|
553
|
+
}
|
554
|
+
|
555
|
+
begin
|
556
|
+
# Get info about an Arena tournament
|
557
|
+
result = api_instance.tournament(id, opts)
|
558
|
+
p result
|
559
|
+
rescue Lishogi::ApiError => e
|
560
|
+
puts "Error when calling ArenaTournamentsApi->tournament: #{e}"
|
561
|
+
end
|
562
|
+
```
|
563
|
+
|
564
|
+
#### Using the tournament_with_http_info variant
|
565
|
+
|
566
|
+
This returns an Array which contains the response data, status code and headers.
|
567
|
+
|
568
|
+
> <Array(Object, Integer, Hash)> tournament_with_http_info(id, opts)
|
569
|
+
|
570
|
+
```ruby
|
571
|
+
begin
|
572
|
+
# Get info about an Arena tournament
|
573
|
+
data, status_code, headers = api_instance.tournament_with_http_info(id, opts)
|
574
|
+
p status_code # => 2xx
|
575
|
+
p headers # => { ... }
|
576
|
+
p data # => Object
|
577
|
+
rescue Lishogi::ApiError => e
|
578
|
+
puts "Error when calling ArenaTournamentsApi->tournament_with_http_info: #{e}"
|
579
|
+
end
|
580
|
+
```
|
581
|
+
|
582
|
+
### Parameters
|
583
|
+
|
584
|
+
| Name | Type | Description | Notes |
|
585
|
+
| ---- | ---- | ----------- | ----- |
|
586
|
+
| **id** | **String** | The tournament ID. | |
|
587
|
+
| **page** | **Float** | Specify which page of player standings to view. | [optional][default to 1] |
|
588
|
+
|
589
|
+
### Return type
|
590
|
+
|
591
|
+
**Object**
|
592
|
+
|
593
|
+
### Authorization
|
594
|
+
|
595
|
+
No authorization required
|
596
|
+
|
597
|
+
### HTTP request headers
|
598
|
+
|
599
|
+
- **Content-Type**: Not defined
|
600
|
+
- **Accept**: application/json
|
601
|
+
|