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/git_push.sh
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=$(git remote)
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
@@ -0,0 +1,314 @@
|
|
1
|
+
=begin
|
2
|
+
#Lishogi.org API reference
|
3
|
+
|
4
|
+
## Introduction Welcome to the reference for the Lishogi API! Lishogi is free/libre, open-source shogi server forked from lichess powered by volunteers and donations. Currently this page is a work in progress, certain information here might be wrong and incorrect! Expect it to be done during 2022. - Get help in the [Lishogi Discord channel](https://discord.gg/YFtpMGg3rR) - [Contribute to this documentation on Github](https://github.com/WandererXII/lishogi/blob/master/public/doc/lishogi-api.yaml) - Check out [Lishogi widgets to embed in your website](https://lishogi.org/developers) ## Endpoint All requests go to `https://lishogi.org` (unless otherwise specified). ## Rate limiting All requests are rate limited using various strategies, to ensure the API remains responsive for everyone. Only make one request at a time. If you receive an HTTP response with a [429 status](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#429), please wait a full minute before resuming API usage. ## Streaming with ND-JSON Some API endpoints stream their responses as [Newline Delimited JSON a.k.a. **nd-json**](http://ndjson.org/), with one JSON object per line. Here's a [JavaScript utility function (for lichess)](https://gist.github.com/ornicar/a097406810939cf7be1df8ea30e94f3e) to help reading NDJSON streamed responses.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
Contact: contact@lishogi.org
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.10.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Lishogi
|
16
|
+
class AccountApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get my preferences
|
23
|
+
# Read the preferences of the logged in user. - <https://lishogi.org/account/preferences/game-display> - <https://github.com/WandererXII/lishogi/blob/master/modules/pref/src/main/Pref.scala>
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [Account200Response]
|
26
|
+
def account(opts = {})
|
27
|
+
data, _status_code, _headers = account_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Get my preferences
|
32
|
+
# Read the preferences of the logged in user. - <https://lishogi.org/account/preferences/game-display> - <https://github.com/WandererXII/lishogi/blob/master/modules/pref/src/main/Pref.scala>
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(Account200Response, Integer, Hash)>] Account200Response data, response status code and response headers
|
35
|
+
def account_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/api/account/preferences'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
49
|
+
|
50
|
+
# form parameters
|
51
|
+
form_params = opts[:form_params] || {}
|
52
|
+
|
53
|
+
# http body (model)
|
54
|
+
post_body = opts[:debug_body]
|
55
|
+
|
56
|
+
# return_type
|
57
|
+
return_type = opts[:debug_return_type] || 'Account200Response'
|
58
|
+
|
59
|
+
# auth_names
|
60
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
61
|
+
|
62
|
+
new_options = opts.merge(
|
63
|
+
:operation => :"AccountApi.account",
|
64
|
+
:header_params => header_params,
|
65
|
+
:query_params => query_params,
|
66
|
+
:form_params => form_params,
|
67
|
+
:body => post_body,
|
68
|
+
:auth_names => auth_names,
|
69
|
+
:return_type => return_type
|
70
|
+
)
|
71
|
+
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
73
|
+
if @api_client.config.debugging
|
74
|
+
@api_client.config.logger.debug "API called: AccountApi#account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
+
end
|
76
|
+
return data, status_code, headers
|
77
|
+
end
|
78
|
+
|
79
|
+
# Get my email address
|
80
|
+
# Read the email address of the logged in user.
|
81
|
+
# @param [Hash] opts the optional parameters
|
82
|
+
# @return [AccountEmail200Response]
|
83
|
+
def account_email(opts = {})
|
84
|
+
data, _status_code, _headers = account_email_with_http_info(opts)
|
85
|
+
data
|
86
|
+
end
|
87
|
+
|
88
|
+
# Get my email address
|
89
|
+
# Read the email address of the logged in user.
|
90
|
+
# @param [Hash] opts the optional parameters
|
91
|
+
# @return [Array<(AccountEmail200Response, Integer, Hash)>] AccountEmail200Response data, response status code and response headers
|
92
|
+
def account_email_with_http_info(opts = {})
|
93
|
+
if @api_client.config.debugging
|
94
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account_email ...'
|
95
|
+
end
|
96
|
+
# resource path
|
97
|
+
local_var_path = '/api/account/email'
|
98
|
+
|
99
|
+
# query parameters
|
100
|
+
query_params = opts[:query_params] || {}
|
101
|
+
|
102
|
+
# header parameters
|
103
|
+
header_params = opts[:header_params] || {}
|
104
|
+
# HTTP header 'Accept' (if needed)
|
105
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
106
|
+
|
107
|
+
# form parameters
|
108
|
+
form_params = opts[:form_params] || {}
|
109
|
+
|
110
|
+
# http body (model)
|
111
|
+
post_body = opts[:debug_body]
|
112
|
+
|
113
|
+
# return_type
|
114
|
+
return_type = opts[:debug_return_type] || 'AccountEmail200Response'
|
115
|
+
|
116
|
+
# auth_names
|
117
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
118
|
+
|
119
|
+
new_options = opts.merge(
|
120
|
+
:operation => :"AccountApi.account_email",
|
121
|
+
:header_params => header_params,
|
122
|
+
:query_params => query_params,
|
123
|
+
:form_params => form_params,
|
124
|
+
:body => post_body,
|
125
|
+
:auth_names => auth_names,
|
126
|
+
:return_type => return_type
|
127
|
+
)
|
128
|
+
|
129
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
130
|
+
if @api_client.config.debugging
|
131
|
+
@api_client.config.logger.debug "API called: AccountApi#account_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
|
+
end
|
133
|
+
return data, status_code, headers
|
134
|
+
end
|
135
|
+
|
136
|
+
# Get my kid mode status
|
137
|
+
# Read the kid mode status of the logged in user. - <https://lishogi.org/account/kid>
|
138
|
+
# @param [Hash] opts the optional parameters
|
139
|
+
# @return [AccountKid200Response]
|
140
|
+
def account_kid(opts = {})
|
141
|
+
data, _status_code, _headers = account_kid_with_http_info(opts)
|
142
|
+
data
|
143
|
+
end
|
144
|
+
|
145
|
+
# Get my kid mode status
|
146
|
+
# Read the kid mode status of the logged in user. - <https://lishogi.org/account/kid>
|
147
|
+
# @param [Hash] opts the optional parameters
|
148
|
+
# @return [Array<(AccountKid200Response, Integer, Hash)>] AccountKid200Response data, response status code and response headers
|
149
|
+
def account_kid_with_http_info(opts = {})
|
150
|
+
if @api_client.config.debugging
|
151
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account_kid ...'
|
152
|
+
end
|
153
|
+
# resource path
|
154
|
+
local_var_path = '/api/account/kid'
|
155
|
+
|
156
|
+
# query parameters
|
157
|
+
query_params = opts[:query_params] || {}
|
158
|
+
|
159
|
+
# header parameters
|
160
|
+
header_params = opts[:header_params] || {}
|
161
|
+
# HTTP header 'Accept' (if needed)
|
162
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
163
|
+
|
164
|
+
# form parameters
|
165
|
+
form_params = opts[:form_params] || {}
|
166
|
+
|
167
|
+
# http body (model)
|
168
|
+
post_body = opts[:debug_body]
|
169
|
+
|
170
|
+
# return_type
|
171
|
+
return_type = opts[:debug_return_type] || 'AccountKid200Response'
|
172
|
+
|
173
|
+
# auth_names
|
174
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
175
|
+
|
176
|
+
new_options = opts.merge(
|
177
|
+
:operation => :"AccountApi.account_kid",
|
178
|
+
:header_params => header_params,
|
179
|
+
:query_params => query_params,
|
180
|
+
:form_params => form_params,
|
181
|
+
:body => post_body,
|
182
|
+
:auth_names => auth_names,
|
183
|
+
:return_type => return_type
|
184
|
+
)
|
185
|
+
|
186
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
187
|
+
if @api_client.config.debugging
|
188
|
+
@api_client.config.logger.debug "API called: AccountApi#account_kid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
189
|
+
end
|
190
|
+
return data, status_code, headers
|
191
|
+
end
|
192
|
+
|
193
|
+
# Set my kid mode status
|
194
|
+
# Set the kid mode status of the logged in user. - <https://lishogi.org/account/kid>
|
195
|
+
# @param v [Boolean] Kid mode status
|
196
|
+
# @param [Hash] opts the optional parameters
|
197
|
+
# @return [Ok]
|
198
|
+
def account_kid_post(v, opts = {})
|
199
|
+
data, _status_code, _headers = account_kid_post_with_http_info(v, opts)
|
200
|
+
data
|
201
|
+
end
|
202
|
+
|
203
|
+
# Set my kid mode status
|
204
|
+
# Set the kid mode status of the logged in user. - <https://lishogi.org/account/kid>
|
205
|
+
# @param v [Boolean] Kid mode status
|
206
|
+
# @param [Hash] opts the optional parameters
|
207
|
+
# @return [Array<(Ok, Integer, Hash)>] Ok data, response status code and response headers
|
208
|
+
def account_kid_post_with_http_info(v, opts = {})
|
209
|
+
if @api_client.config.debugging
|
210
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account_kid_post ...'
|
211
|
+
end
|
212
|
+
# verify the required parameter 'v' is set
|
213
|
+
if @api_client.config.client_side_validation && v.nil?
|
214
|
+
fail ArgumentError, "Missing the required parameter 'v' when calling AccountApi.account_kid_post"
|
215
|
+
end
|
216
|
+
# resource path
|
217
|
+
local_var_path = '/api/account/kid'
|
218
|
+
|
219
|
+
# query parameters
|
220
|
+
query_params = opts[:query_params] || {}
|
221
|
+
query_params[:'v'] = v
|
222
|
+
|
223
|
+
# header parameters
|
224
|
+
header_params = opts[:header_params] || {}
|
225
|
+
# HTTP header 'Accept' (if needed)
|
226
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
227
|
+
|
228
|
+
# form parameters
|
229
|
+
form_params = opts[:form_params] || {}
|
230
|
+
|
231
|
+
# http body (model)
|
232
|
+
post_body = opts[:debug_body]
|
233
|
+
|
234
|
+
# return_type
|
235
|
+
return_type = opts[:debug_return_type] || 'Ok'
|
236
|
+
|
237
|
+
# auth_names
|
238
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
239
|
+
|
240
|
+
new_options = opts.merge(
|
241
|
+
:operation => :"AccountApi.account_kid_post",
|
242
|
+
:header_params => header_params,
|
243
|
+
:query_params => query_params,
|
244
|
+
:form_params => form_params,
|
245
|
+
:body => post_body,
|
246
|
+
:auth_names => auth_names,
|
247
|
+
:return_type => return_type
|
248
|
+
)
|
249
|
+
|
250
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
251
|
+
if @api_client.config.debugging
|
252
|
+
@api_client.config.logger.debug "API called: AccountApi#account_kid_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
253
|
+
end
|
254
|
+
return data, status_code, headers
|
255
|
+
end
|
256
|
+
|
257
|
+
# Get my profile
|
258
|
+
# Public information about the logged in user.
|
259
|
+
# @param [Hash] opts the optional parameters
|
260
|
+
# @return [UserExtended]
|
261
|
+
def account_me(opts = {})
|
262
|
+
data, _status_code, _headers = account_me_with_http_info(opts)
|
263
|
+
data
|
264
|
+
end
|
265
|
+
|
266
|
+
# Get my profile
|
267
|
+
# Public information about the logged in user.
|
268
|
+
# @param [Hash] opts the optional parameters
|
269
|
+
# @return [Array<(UserExtended, Integer, Hash)>] UserExtended data, response status code and response headers
|
270
|
+
def account_me_with_http_info(opts = {})
|
271
|
+
if @api_client.config.debugging
|
272
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account_me ...'
|
273
|
+
end
|
274
|
+
# resource path
|
275
|
+
local_var_path = '/api/account'
|
276
|
+
|
277
|
+
# query parameters
|
278
|
+
query_params = opts[:query_params] || {}
|
279
|
+
|
280
|
+
# header parameters
|
281
|
+
header_params = opts[:header_params] || {}
|
282
|
+
# HTTP header 'Accept' (if needed)
|
283
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
284
|
+
|
285
|
+
# form parameters
|
286
|
+
form_params = opts[:form_params] || {}
|
287
|
+
|
288
|
+
# http body (model)
|
289
|
+
post_body = opts[:debug_body]
|
290
|
+
|
291
|
+
# return_type
|
292
|
+
return_type = opts[:debug_return_type] || 'UserExtended'
|
293
|
+
|
294
|
+
# auth_names
|
295
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
296
|
+
|
297
|
+
new_options = opts.merge(
|
298
|
+
:operation => :"AccountApi.account_me",
|
299
|
+
:header_params => header_params,
|
300
|
+
:query_params => query_params,
|
301
|
+
:form_params => form_params,
|
302
|
+
:body => post_body,
|
303
|
+
:auth_names => auth_names,
|
304
|
+
:return_type => return_type
|
305
|
+
)
|
306
|
+
|
307
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
308
|
+
if @api_client.config.debugging
|
309
|
+
@api_client.config.logger.debug "API called: AccountApi#account_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
310
|
+
end
|
311
|
+
return data, status_code, headers
|
312
|
+
end
|
313
|
+
end
|
314
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
=begin
|
2
|
+
#Lishogi.org API reference
|
3
|
+
|
4
|
+
## Introduction Welcome to the reference for the Lishogi API! Lishogi is free/libre, open-source shogi server forked from lichess powered by volunteers and donations. Currently this page is a work in progress, certain information here might be wrong and incorrect! Expect it to be done during 2022. - Get help in the [Lishogi Discord channel](https://discord.gg/YFtpMGg3rR) - [Contribute to this documentation on Github](https://github.com/WandererXII/lishogi/blob/master/public/doc/lishogi-api.yaml) - Check out [Lishogi widgets to embed in your website](https://lishogi.org/developers) ## Endpoint All requests go to `https://lishogi.org` (unless otherwise specified). ## Rate limiting All requests are rate limited using various strategies, to ensure the API remains responsive for everyone. Only make one request at a time. If you receive an HTTP response with a [429 status](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#429), please wait a full minute before resuming API usage. ## Streaming with ND-JSON Some API endpoints stream their responses as [Newline Delimited JSON a.k.a. **nd-json**](http://ndjson.org/), with one JSON object per line. Here's a [JavaScript utility function (for lichess)](https://gist.github.com/ornicar/a097406810939cf7be1df8ea30e94f3e) to help reading NDJSON streamed responses.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
Contact: contact@lishogi.org
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.10.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Lishogi
|
16
|
+
class AnalysisApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get cloud evaluation of a position.
|
23
|
+
# Get the cached evaluation of a position, if available. Opening positions have more chances of being available. There are about 500 thousand positions in the database. Up to 5 variations may be available. Variants are supported.
|
24
|
+
# @param sfen [String] SFEN of the position
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [Float] :multi_pv Number of variations (default to 1)
|
27
|
+
# @option opts [VariantKey] :variant Variant (default to 'standard')
|
28
|
+
# @return [nil]
|
29
|
+
def api_cloud_eval(sfen, opts = {})
|
30
|
+
api_cloud_eval_with_http_info(sfen, opts)
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get cloud evaluation of a position.
|
35
|
+
# Get the cached evaluation of a position, if available. Opening positions have more chances of being available. There are about 500 thousand positions in the database. Up to 5 variations may be available. Variants are supported.
|
36
|
+
# @param sfen [String] SFEN of the position
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [Float] :multi_pv Number of variations (default to 1)
|
39
|
+
# @option opts [VariantKey] :variant Variant (default to 'standard')
|
40
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
41
|
+
def api_cloud_eval_with_http_info(sfen, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: AnalysisApi.api_cloud_eval ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'sfen' is set
|
46
|
+
if @api_client.config.client_side_validation && sfen.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'sfen' when calling AnalysisApi.api_cloud_eval"
|
48
|
+
end
|
49
|
+
# resource path
|
50
|
+
local_var_path = '/api/cloud-eval'
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = opts[:query_params] || {}
|
54
|
+
query_params[:'sfen'] = sfen
|
55
|
+
query_params[:'multiPv'] = opts[:'multi_pv'] if !opts[:'multi_pv'].nil?
|
56
|
+
query_params[:'variant'] = opts[:'variant'] if !opts[:'variant'].nil?
|
57
|
+
|
58
|
+
# header parameters
|
59
|
+
header_params = opts[:header_params] || {}
|
60
|
+
# HTTP header 'Accept' (if needed)
|
61
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
62
|
+
|
63
|
+
# form parameters
|
64
|
+
form_params = opts[:form_params] || {}
|
65
|
+
|
66
|
+
# http body (model)
|
67
|
+
post_body = opts[:debug_body]
|
68
|
+
|
69
|
+
# return_type
|
70
|
+
return_type = opts[:debug_return_type]
|
71
|
+
|
72
|
+
# auth_names
|
73
|
+
auth_names = opts[:debug_auth_names] || []
|
74
|
+
|
75
|
+
new_options = opts.merge(
|
76
|
+
:operation => :"AnalysisApi.api_cloud_eval",
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type
|
83
|
+
)
|
84
|
+
|
85
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: AnalysisApi#api_cloud_eval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|