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,15 @@
|
|
1
|
+
# Lishogi::BoardGameTakebackAcceptParameter
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'lishogi'
|
12
|
+
|
13
|
+
instance = Lishogi::BoardGameTakebackAcceptParameter.new()
|
14
|
+
```
|
15
|
+
|
data/docs/BotApi.md
ADDED
@@ -0,0 +1,634 @@
|
|
1
|
+
# Lishogi::BotApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://lishogi.org*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**api_bot_online**](BotApi.md#api_bot_online) | **GET** /api/bot/online | Get online bots |
|
8
|
+
| [**api_stream_event**](BotApi.md#api_stream_event) | **GET** /api/stream/event | Stream incoming events |
|
9
|
+
| [**bot_account_upgrade**](BotApi.md#bot_account_upgrade) | **POST** /api/bot/account/upgrade | Upgrade to Bot account |
|
10
|
+
| [**bot_game_abort**](BotApi.md#bot_game_abort) | **POST** /api/bot/game/{gameId}/abort | Abort a game |
|
11
|
+
| [**bot_game_chat**](BotApi.md#bot_game_chat) | **POST** /api/bot/game/{gameId}/chat | Write in the chat |
|
12
|
+
| [**bot_game_chat_get**](BotApi.md#bot_game_chat_get) | **GET** /api/bot/game/{gameId}/chat | Fetch the game chat |
|
13
|
+
| [**bot_game_move**](BotApi.md#bot_game_move) | **POST** /api/bot/game/{gameId}/move/{move} | Make a Bot move |
|
14
|
+
| [**bot_game_resign**](BotApi.md#bot_game_resign) | **POST** /api/bot/game/{gameId}/resign | Resign a game |
|
15
|
+
| [**bot_game_stream**](BotApi.md#bot_game_stream) | **GET** /api/bot/game/stream/{gameId} | Stream Bot game state |
|
16
|
+
|
17
|
+
|
18
|
+
## api_bot_online
|
19
|
+
|
20
|
+
> <User> api_bot_online(opts)
|
21
|
+
|
22
|
+
Get online bots
|
23
|
+
|
24
|
+
Stream the [online bot users](https://lishogi.org/player/bots), as [ndjson](#section/Introduction/Streaming-with-ND-JSON). Throttled to 50 bot users per second.
|
25
|
+
|
26
|
+
### Examples
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'time'
|
30
|
+
require 'lishogi'
|
31
|
+
|
32
|
+
api_instance = Lishogi::BotApi.new
|
33
|
+
opts = {
|
34
|
+
nb: 20 # Integer | How many bot users to fetch
|
35
|
+
}
|
36
|
+
|
37
|
+
begin
|
38
|
+
# Get online bots
|
39
|
+
result = api_instance.api_bot_online(opts)
|
40
|
+
p result
|
41
|
+
rescue Lishogi::ApiError => e
|
42
|
+
puts "Error when calling BotApi->api_bot_online: #{e}"
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
#### Using the api_bot_online_with_http_info variant
|
47
|
+
|
48
|
+
This returns an Array which contains the response data, status code and headers.
|
49
|
+
|
50
|
+
> <Array(<User>, Integer, Hash)> api_bot_online_with_http_info(opts)
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
begin
|
54
|
+
# Get online bots
|
55
|
+
data, status_code, headers = api_instance.api_bot_online_with_http_info(opts)
|
56
|
+
p status_code # => 2xx
|
57
|
+
p headers # => { ... }
|
58
|
+
p data # => <User>
|
59
|
+
rescue Lishogi::ApiError => e
|
60
|
+
puts "Error when calling BotApi->api_bot_online_with_http_info: #{e}"
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
### Parameters
|
65
|
+
|
66
|
+
| Name | Type | Description | Notes |
|
67
|
+
| ---- | ---- | ----------- | ----- |
|
68
|
+
| **nb** | **Integer** | How many bot users to fetch | [optional] |
|
69
|
+
|
70
|
+
### Return type
|
71
|
+
|
72
|
+
[**User**](User.md)
|
73
|
+
|
74
|
+
### Authorization
|
75
|
+
|
76
|
+
No authorization required
|
77
|
+
|
78
|
+
### HTTP request headers
|
79
|
+
|
80
|
+
- **Content-Type**: Not defined
|
81
|
+
- **Accept**: application/x-ndjson
|
82
|
+
|
83
|
+
|
84
|
+
## api_stream_event
|
85
|
+
|
86
|
+
> <ApiStreamEvent200Response> api_stream_event
|
87
|
+
|
88
|
+
Stream incoming events
|
89
|
+
|
90
|
+
Stream the events reaching a lishogi user in real time as [ndjson](#section/Introduction/Streaming-with-ND-JSON). Each line is a JSON object containing a `type` field. Possible values are: - `gameStart` Start of a game - `gameFinish` Completion of a game - `challenge` A player sends you a challenge or you challenge someone - `challengeDeclined` The opponent declines your challenge When the stream opens, all current challenges and games are sent.
|
91
|
+
|
92
|
+
### Examples
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
require 'time'
|
96
|
+
require 'lishogi'
|
97
|
+
# setup authorization
|
98
|
+
Lishogi.configure do |config|
|
99
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
100
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
101
|
+
end
|
102
|
+
|
103
|
+
api_instance = Lishogi::BotApi.new
|
104
|
+
|
105
|
+
begin
|
106
|
+
# Stream incoming events
|
107
|
+
result = api_instance.api_stream_event
|
108
|
+
p result
|
109
|
+
rescue Lishogi::ApiError => e
|
110
|
+
puts "Error when calling BotApi->api_stream_event: #{e}"
|
111
|
+
end
|
112
|
+
```
|
113
|
+
|
114
|
+
#### Using the api_stream_event_with_http_info variant
|
115
|
+
|
116
|
+
This returns an Array which contains the response data, status code and headers.
|
117
|
+
|
118
|
+
> <Array(<ApiStreamEvent200Response>, Integer, Hash)> api_stream_event_with_http_info
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
begin
|
122
|
+
# Stream incoming events
|
123
|
+
data, status_code, headers = api_instance.api_stream_event_with_http_info
|
124
|
+
p status_code # => 2xx
|
125
|
+
p headers # => { ... }
|
126
|
+
p data # => <ApiStreamEvent200Response>
|
127
|
+
rescue Lishogi::ApiError => e
|
128
|
+
puts "Error when calling BotApi->api_stream_event_with_http_info: #{e}"
|
129
|
+
end
|
130
|
+
```
|
131
|
+
|
132
|
+
### Parameters
|
133
|
+
|
134
|
+
This endpoint does not need any parameter.
|
135
|
+
|
136
|
+
### Return type
|
137
|
+
|
138
|
+
[**ApiStreamEvent200Response**](ApiStreamEvent200Response.md)
|
139
|
+
|
140
|
+
### Authorization
|
141
|
+
|
142
|
+
[OAuth2](../README.md#OAuth2)
|
143
|
+
|
144
|
+
### HTTP request headers
|
145
|
+
|
146
|
+
- **Content-Type**: Not defined
|
147
|
+
- **Accept**: application/x-ndjson
|
148
|
+
|
149
|
+
|
150
|
+
## bot_account_upgrade
|
151
|
+
|
152
|
+
> <Ok> bot_account_upgrade
|
153
|
+
|
154
|
+
Upgrade to Bot account
|
155
|
+
|
156
|
+
Upgrade a lishogi player account into a Bot account. Only Bot accounts can use the Bot API. The account **cannot have played any game** before becoming a Bot account. The upgrade is **irreversible**. The account will only be able to play as a Bot. To upgrade an account to Bot, use the [official lishogi-bot client](https://github.com/ShailChoksi/lishogi-bot), or follow these steps: - Create an [API access token](https://lishogi.org/account/oauth/token/create?scopes[]=bot:play) with \"Play bot moves\" permission. - `curl -d '' https://lishogi.org/api/bot/account/upgrade -H \"Authorization: Bearer <yourTokenHere>\"` To know if an account has already been upgraded, use the [Get my profile API](#operation/accountMe): the `title` field should be set to `BOT`.
|
157
|
+
|
158
|
+
### Examples
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
require 'time'
|
162
|
+
require 'lishogi'
|
163
|
+
# setup authorization
|
164
|
+
Lishogi.configure do |config|
|
165
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
166
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
167
|
+
end
|
168
|
+
|
169
|
+
api_instance = Lishogi::BotApi.new
|
170
|
+
|
171
|
+
begin
|
172
|
+
# Upgrade to Bot account
|
173
|
+
result = api_instance.bot_account_upgrade
|
174
|
+
p result
|
175
|
+
rescue Lishogi::ApiError => e
|
176
|
+
puts "Error when calling BotApi->bot_account_upgrade: #{e}"
|
177
|
+
end
|
178
|
+
```
|
179
|
+
|
180
|
+
#### Using the bot_account_upgrade_with_http_info variant
|
181
|
+
|
182
|
+
This returns an Array which contains the response data, status code and headers.
|
183
|
+
|
184
|
+
> <Array(<Ok>, Integer, Hash)> bot_account_upgrade_with_http_info
|
185
|
+
|
186
|
+
```ruby
|
187
|
+
begin
|
188
|
+
# Upgrade to Bot account
|
189
|
+
data, status_code, headers = api_instance.bot_account_upgrade_with_http_info
|
190
|
+
p status_code # => 2xx
|
191
|
+
p headers # => { ... }
|
192
|
+
p data # => <Ok>
|
193
|
+
rescue Lishogi::ApiError => e
|
194
|
+
puts "Error when calling BotApi->bot_account_upgrade_with_http_info: #{e}"
|
195
|
+
end
|
196
|
+
```
|
197
|
+
|
198
|
+
### Parameters
|
199
|
+
|
200
|
+
This endpoint does not need any parameter.
|
201
|
+
|
202
|
+
### Return type
|
203
|
+
|
204
|
+
[**Ok**](Ok.md)
|
205
|
+
|
206
|
+
### Authorization
|
207
|
+
|
208
|
+
[OAuth2](../README.md#OAuth2)
|
209
|
+
|
210
|
+
### HTTP request headers
|
211
|
+
|
212
|
+
- **Content-Type**: Not defined
|
213
|
+
- **Accept**: application/json
|
214
|
+
|
215
|
+
|
216
|
+
## bot_game_abort
|
217
|
+
|
218
|
+
> <Ok> bot_game_abort(game_id)
|
219
|
+
|
220
|
+
Abort a game
|
221
|
+
|
222
|
+
Abort a game being played with the Bot API.
|
223
|
+
|
224
|
+
### Examples
|
225
|
+
|
226
|
+
```ruby
|
227
|
+
require 'time'
|
228
|
+
require 'lishogi'
|
229
|
+
# setup authorization
|
230
|
+
Lishogi.configure do |config|
|
231
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
232
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
233
|
+
end
|
234
|
+
|
235
|
+
api_instance = Lishogi::BotApi.new
|
236
|
+
game_id = '5IrD6Gzz' # String |
|
237
|
+
|
238
|
+
begin
|
239
|
+
# Abort a game
|
240
|
+
result = api_instance.bot_game_abort(game_id)
|
241
|
+
p result
|
242
|
+
rescue Lishogi::ApiError => e
|
243
|
+
puts "Error when calling BotApi->bot_game_abort: #{e}"
|
244
|
+
end
|
245
|
+
```
|
246
|
+
|
247
|
+
#### Using the bot_game_abort_with_http_info variant
|
248
|
+
|
249
|
+
This returns an Array which contains the response data, status code and headers.
|
250
|
+
|
251
|
+
> <Array(<Ok>, Integer, Hash)> bot_game_abort_with_http_info(game_id)
|
252
|
+
|
253
|
+
```ruby
|
254
|
+
begin
|
255
|
+
# Abort a game
|
256
|
+
data, status_code, headers = api_instance.bot_game_abort_with_http_info(game_id)
|
257
|
+
p status_code # => 2xx
|
258
|
+
p headers # => { ... }
|
259
|
+
p data # => <Ok>
|
260
|
+
rescue Lishogi::ApiError => e
|
261
|
+
puts "Error when calling BotApi->bot_game_abort_with_http_info: #{e}"
|
262
|
+
end
|
263
|
+
```
|
264
|
+
|
265
|
+
### Parameters
|
266
|
+
|
267
|
+
| Name | Type | Description | Notes |
|
268
|
+
| ---- | ---- | ----------- | ----- |
|
269
|
+
| **game_id** | **String** | | |
|
270
|
+
|
271
|
+
### Return type
|
272
|
+
|
273
|
+
[**Ok**](Ok.md)
|
274
|
+
|
275
|
+
### Authorization
|
276
|
+
|
277
|
+
[OAuth2](../README.md#OAuth2)
|
278
|
+
|
279
|
+
### HTTP request headers
|
280
|
+
|
281
|
+
- **Content-Type**: Not defined
|
282
|
+
- **Accept**: application/json
|
283
|
+
|
284
|
+
|
285
|
+
## bot_game_chat
|
286
|
+
|
287
|
+
> <Ok> bot_game_chat(game_id, room, text)
|
288
|
+
|
289
|
+
Write in the chat
|
290
|
+
|
291
|
+
Post a message to the player or spectator chat, in a game being played with the Bot API.
|
292
|
+
|
293
|
+
### Examples
|
294
|
+
|
295
|
+
```ruby
|
296
|
+
require 'time'
|
297
|
+
require 'lishogi'
|
298
|
+
# setup authorization
|
299
|
+
Lishogi.configure do |config|
|
300
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
301
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
302
|
+
end
|
303
|
+
|
304
|
+
api_instance = Lishogi::BotApi.new
|
305
|
+
game_id = '5IrD6Gzz' # String |
|
306
|
+
room = 'player' # String |
|
307
|
+
text = 'text_example' # String |
|
308
|
+
|
309
|
+
begin
|
310
|
+
# Write in the chat
|
311
|
+
result = api_instance.bot_game_chat(game_id, room, text)
|
312
|
+
p result
|
313
|
+
rescue Lishogi::ApiError => e
|
314
|
+
puts "Error when calling BotApi->bot_game_chat: #{e}"
|
315
|
+
end
|
316
|
+
```
|
317
|
+
|
318
|
+
#### Using the bot_game_chat_with_http_info variant
|
319
|
+
|
320
|
+
This returns an Array which contains the response data, status code and headers.
|
321
|
+
|
322
|
+
> <Array(<Ok>, Integer, Hash)> bot_game_chat_with_http_info(game_id, room, text)
|
323
|
+
|
324
|
+
```ruby
|
325
|
+
begin
|
326
|
+
# Write in the chat
|
327
|
+
data, status_code, headers = api_instance.bot_game_chat_with_http_info(game_id, room, text)
|
328
|
+
p status_code # => 2xx
|
329
|
+
p headers # => { ... }
|
330
|
+
p data # => <Ok>
|
331
|
+
rescue Lishogi::ApiError => e
|
332
|
+
puts "Error when calling BotApi->bot_game_chat_with_http_info: #{e}"
|
333
|
+
end
|
334
|
+
```
|
335
|
+
|
336
|
+
### Parameters
|
337
|
+
|
338
|
+
| Name | Type | Description | Notes |
|
339
|
+
| ---- | ---- | ----------- | ----- |
|
340
|
+
| **game_id** | **String** | | |
|
341
|
+
| **room** | **String** | | |
|
342
|
+
| **text** | **String** | | |
|
343
|
+
|
344
|
+
### Return type
|
345
|
+
|
346
|
+
[**Ok**](Ok.md)
|
347
|
+
|
348
|
+
### Authorization
|
349
|
+
|
350
|
+
[OAuth2](../README.md#OAuth2)
|
351
|
+
|
352
|
+
### HTTP request headers
|
353
|
+
|
354
|
+
- **Content-Type**: application/x-www-form-urlencoded
|
355
|
+
- **Accept**: application/json
|
356
|
+
|
357
|
+
|
358
|
+
## bot_game_chat_get
|
359
|
+
|
360
|
+
> Object bot_game_chat_get(game_id)
|
361
|
+
|
362
|
+
Fetch the game chat
|
363
|
+
|
364
|
+
Get the messages posted in the game chat
|
365
|
+
|
366
|
+
### Examples
|
367
|
+
|
368
|
+
```ruby
|
369
|
+
require 'time'
|
370
|
+
require 'lishogi'
|
371
|
+
# setup authorization
|
372
|
+
Lishogi.configure do |config|
|
373
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
374
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
375
|
+
end
|
376
|
+
|
377
|
+
api_instance = Lishogi::BotApi.new
|
378
|
+
game_id = '5IrD6Gzz' # String |
|
379
|
+
|
380
|
+
begin
|
381
|
+
# Fetch the game chat
|
382
|
+
result = api_instance.bot_game_chat_get(game_id)
|
383
|
+
p result
|
384
|
+
rescue Lishogi::ApiError => e
|
385
|
+
puts "Error when calling BotApi->bot_game_chat_get: #{e}"
|
386
|
+
end
|
387
|
+
```
|
388
|
+
|
389
|
+
#### Using the bot_game_chat_get_with_http_info variant
|
390
|
+
|
391
|
+
This returns an Array which contains the response data, status code and headers.
|
392
|
+
|
393
|
+
> <Array(Object, Integer, Hash)> bot_game_chat_get_with_http_info(game_id)
|
394
|
+
|
395
|
+
```ruby
|
396
|
+
begin
|
397
|
+
# Fetch the game chat
|
398
|
+
data, status_code, headers = api_instance.bot_game_chat_get_with_http_info(game_id)
|
399
|
+
p status_code # => 2xx
|
400
|
+
p headers # => { ... }
|
401
|
+
p data # => Object
|
402
|
+
rescue Lishogi::ApiError => e
|
403
|
+
puts "Error when calling BotApi->bot_game_chat_get_with_http_info: #{e}"
|
404
|
+
end
|
405
|
+
```
|
406
|
+
|
407
|
+
### Parameters
|
408
|
+
|
409
|
+
| Name | Type | Description | Notes |
|
410
|
+
| ---- | ---- | ----------- | ----- |
|
411
|
+
| **game_id** | **String** | | |
|
412
|
+
|
413
|
+
### Return type
|
414
|
+
|
415
|
+
**Object**
|
416
|
+
|
417
|
+
### Authorization
|
418
|
+
|
419
|
+
[OAuth2](../README.md#OAuth2)
|
420
|
+
|
421
|
+
### HTTP request headers
|
422
|
+
|
423
|
+
- **Content-Type**: Not defined
|
424
|
+
- **Accept**: application/x-ndjson
|
425
|
+
|
426
|
+
|
427
|
+
## bot_game_move
|
428
|
+
|
429
|
+
> <Ok> bot_game_move(game_id, move)
|
430
|
+
|
431
|
+
Make a Bot move
|
432
|
+
|
433
|
+
Make a move in a game being played with the Bot API.
|
434
|
+
|
435
|
+
### Examples
|
436
|
+
|
437
|
+
```ruby
|
438
|
+
require 'time'
|
439
|
+
require 'lishogi'
|
440
|
+
# setup authorization
|
441
|
+
Lishogi.configure do |config|
|
442
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
443
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
444
|
+
end
|
445
|
+
|
446
|
+
api_instance = Lishogi::BotApi.new
|
447
|
+
game_id = '5IrD6Gzz' # String |
|
448
|
+
move = 'e2e4' # String | The move to play, in USI format
|
449
|
+
|
450
|
+
begin
|
451
|
+
# Make a Bot move
|
452
|
+
result = api_instance.bot_game_move(game_id, move)
|
453
|
+
p result
|
454
|
+
rescue Lishogi::ApiError => e
|
455
|
+
puts "Error when calling BotApi->bot_game_move: #{e}"
|
456
|
+
end
|
457
|
+
```
|
458
|
+
|
459
|
+
#### Using the bot_game_move_with_http_info variant
|
460
|
+
|
461
|
+
This returns an Array which contains the response data, status code and headers.
|
462
|
+
|
463
|
+
> <Array(<Ok>, Integer, Hash)> bot_game_move_with_http_info(game_id, move)
|
464
|
+
|
465
|
+
```ruby
|
466
|
+
begin
|
467
|
+
# Make a Bot move
|
468
|
+
data, status_code, headers = api_instance.bot_game_move_with_http_info(game_id, move)
|
469
|
+
p status_code # => 2xx
|
470
|
+
p headers # => { ... }
|
471
|
+
p data # => <Ok>
|
472
|
+
rescue Lishogi::ApiError => e
|
473
|
+
puts "Error when calling BotApi->bot_game_move_with_http_info: #{e}"
|
474
|
+
end
|
475
|
+
```
|
476
|
+
|
477
|
+
### Parameters
|
478
|
+
|
479
|
+
| Name | Type | Description | Notes |
|
480
|
+
| ---- | ---- | ----------- | ----- |
|
481
|
+
| **game_id** | **String** | | |
|
482
|
+
| **move** | **String** | The move to play, in USI format | |
|
483
|
+
|
484
|
+
### Return type
|
485
|
+
|
486
|
+
[**Ok**](Ok.md)
|
487
|
+
|
488
|
+
### Authorization
|
489
|
+
|
490
|
+
[OAuth2](../README.md#OAuth2)
|
491
|
+
|
492
|
+
### HTTP request headers
|
493
|
+
|
494
|
+
- **Content-Type**: Not defined
|
495
|
+
- **Accept**: application/json
|
496
|
+
|
497
|
+
|
498
|
+
## bot_game_resign
|
499
|
+
|
500
|
+
> <Ok> bot_game_resign(game_id)
|
501
|
+
|
502
|
+
Resign a game
|
503
|
+
|
504
|
+
Resign a game being played with the Bot API.
|
505
|
+
|
506
|
+
### Examples
|
507
|
+
|
508
|
+
```ruby
|
509
|
+
require 'time'
|
510
|
+
require 'lishogi'
|
511
|
+
# setup authorization
|
512
|
+
Lishogi.configure do |config|
|
513
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
514
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
515
|
+
end
|
516
|
+
|
517
|
+
api_instance = Lishogi::BotApi.new
|
518
|
+
game_id = '5IrD6Gzz' # String |
|
519
|
+
|
520
|
+
begin
|
521
|
+
# Resign a game
|
522
|
+
result = api_instance.bot_game_resign(game_id)
|
523
|
+
p result
|
524
|
+
rescue Lishogi::ApiError => e
|
525
|
+
puts "Error when calling BotApi->bot_game_resign: #{e}"
|
526
|
+
end
|
527
|
+
```
|
528
|
+
|
529
|
+
#### Using the bot_game_resign_with_http_info variant
|
530
|
+
|
531
|
+
This returns an Array which contains the response data, status code and headers.
|
532
|
+
|
533
|
+
> <Array(<Ok>, Integer, Hash)> bot_game_resign_with_http_info(game_id)
|
534
|
+
|
535
|
+
```ruby
|
536
|
+
begin
|
537
|
+
# Resign a game
|
538
|
+
data, status_code, headers = api_instance.bot_game_resign_with_http_info(game_id)
|
539
|
+
p status_code # => 2xx
|
540
|
+
p headers # => { ... }
|
541
|
+
p data # => <Ok>
|
542
|
+
rescue Lishogi::ApiError => e
|
543
|
+
puts "Error when calling BotApi->bot_game_resign_with_http_info: #{e}"
|
544
|
+
end
|
545
|
+
```
|
546
|
+
|
547
|
+
### Parameters
|
548
|
+
|
549
|
+
| Name | Type | Description | Notes |
|
550
|
+
| ---- | ---- | ----------- | ----- |
|
551
|
+
| **game_id** | **String** | | |
|
552
|
+
|
553
|
+
### Return type
|
554
|
+
|
555
|
+
[**Ok**](Ok.md)
|
556
|
+
|
557
|
+
### Authorization
|
558
|
+
|
559
|
+
[OAuth2](../README.md#OAuth2)
|
560
|
+
|
561
|
+
### HTTP request headers
|
562
|
+
|
563
|
+
- **Content-Type**: Not defined
|
564
|
+
- **Accept**: application/json
|
565
|
+
|
566
|
+
|
567
|
+
## bot_game_stream
|
568
|
+
|
569
|
+
> <BoardGameStream200Response> bot_game_stream(game_id)
|
570
|
+
|
571
|
+
Stream Bot game state
|
572
|
+
|
573
|
+
Stream the state of a game being played with the Bot API, as [ndjson](#section/Introduction/Streaming-with-ND-JSON). Use this endpoint to get updates about the game in real-time, with a single request. Each line is a JSON object containing a `type` field. Possible values are: - `gameFull` Full game data. All values are immutable, except for the `state` field. - `gameState` Current state of the game. Immutable values not included. - `chatLine` Chat message sent by a user (or the bot itself) in the `room` \"player\" or \"spectator\". The first line is always of type `gameFull`.
|
574
|
+
|
575
|
+
### Examples
|
576
|
+
|
577
|
+
```ruby
|
578
|
+
require 'time'
|
579
|
+
require 'lishogi'
|
580
|
+
# setup authorization
|
581
|
+
Lishogi.configure do |config|
|
582
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
583
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
584
|
+
end
|
585
|
+
|
586
|
+
api_instance = Lishogi::BotApi.new
|
587
|
+
game_id = '5IrD6Gzz' # String |
|
588
|
+
|
589
|
+
begin
|
590
|
+
# Stream Bot game state
|
591
|
+
result = api_instance.bot_game_stream(game_id)
|
592
|
+
p result
|
593
|
+
rescue Lishogi::ApiError => e
|
594
|
+
puts "Error when calling BotApi->bot_game_stream: #{e}"
|
595
|
+
end
|
596
|
+
```
|
597
|
+
|
598
|
+
#### Using the bot_game_stream_with_http_info variant
|
599
|
+
|
600
|
+
This returns an Array which contains the response data, status code and headers.
|
601
|
+
|
602
|
+
> <Array(<BoardGameStream200Response>, Integer, Hash)> bot_game_stream_with_http_info(game_id)
|
603
|
+
|
604
|
+
```ruby
|
605
|
+
begin
|
606
|
+
# Stream Bot game state
|
607
|
+
data, status_code, headers = api_instance.bot_game_stream_with_http_info(game_id)
|
608
|
+
p status_code # => 2xx
|
609
|
+
p headers # => { ... }
|
610
|
+
p data # => <BoardGameStream200Response>
|
611
|
+
rescue Lishogi::ApiError => e
|
612
|
+
puts "Error when calling BotApi->bot_game_stream_with_http_info: #{e}"
|
613
|
+
end
|
614
|
+
```
|
615
|
+
|
616
|
+
### Parameters
|
617
|
+
|
618
|
+
| Name | Type | Description | Notes |
|
619
|
+
| ---- | ---- | ----------- | ----- |
|
620
|
+
| **game_id** | **String** | | |
|
621
|
+
|
622
|
+
### Return type
|
623
|
+
|
624
|
+
[**BoardGameStream200Response**](BoardGameStream200Response.md)
|
625
|
+
|
626
|
+
### Authorization
|
627
|
+
|
628
|
+
[OAuth2](../README.md#OAuth2)
|
629
|
+
|
630
|
+
### HTTP request headers
|
631
|
+
|
632
|
+
- **Content-Type**: Not defined
|
633
|
+
- **Accept**: application/x-ndjson, application/json
|
634
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Lishogi::ChallengeDeclinedEvent
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **type** | **String** | | [optional] |
|
8
|
+
| **challenge** | [**ChallengeJson**](ChallengeJson.md) | | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'lishogi'
|
14
|
+
|
15
|
+
instance = Lishogi::ChallengeDeclinedEvent.new(
|
16
|
+
type: null,
|
17
|
+
challenge: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Lishogi::ChallengeEvent
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **type** | **String** | | [optional] |
|
8
|
+
| **challenge** | [**ChallengeJson**](ChallengeJson.md) | | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'lishogi'
|
14
|
+
|
15
|
+
instance = Lishogi::ChallengeEvent.new(
|
16
|
+
type: null,
|
17
|
+
challenge: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|