diff --git a/.gitignore b/.gitignore index a81c8ee..26ca5a9 100644 --- a/.gitignore +++ b/.gitignore @@ -136,3 +136,6 @@ dmypy.json # Cython debug symbols cython_debug/ + +# VSCode/VSCodium +.vscode/ diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index b777d01..9dffd87 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,6 +1,5 @@ .flake8 .gitignore -.openapi-generator-ignore Dockerfile README.md docker-compose.yaml @@ -9,14 +8,78 @@ pyproject.toml requirements.txt setup.cfg src/openapi_server/apis/__init__.py +src/openapi_server/apis/account_registration_api.py +src/openapi_server/apis/administration_api.py +src/openapi_server/apis/api_token_validation_api.py +src/openapi_server/apis/authentication_api.py +src/openapi_server/apis/database_api.py src/openapi_server/apis/default_api.py +src/openapi_server/apis/definition_api.py +src/openapi_server/apis/information_api.py +src/openapi_server/apis/internal_api.py +src/openapi_server/apis/leaderboards_api.py +src/openapi_server/apis/match_data_api.py +src/openapi_server/apis/profile_administration_api.py +src/openapi_server/apis/ratings_api.py +src/openapi_server/apis/search_api.py +src/openapi_server/apis/statistics_api.py +src/openapi_server/apis/status_check_api.py +src/openapi_server/apis/team_administration_api.py +src/openapi_server/apis/teams_api.py +src/openapi_server/apis/tournament_administration_api.py +src/openapi_server/apis/tournaments_api.py +src/openapi_server/apis/user_administration_api.py src/openapi_server/main.py src/openapi_server/models/__init__.py -src/openapi_server/models/error.py +src/openapi_server/models/accepted.py +src/openapi_server/models/authorization_header.py +src/openapi_server/models/count_param.py src/openapi_server/models/extra_models.py +src/openapi_server/models/forbidden_error.py +src/openapi_server/models/game_id.py src/openapi_server/models/illegal_input_error.py +src/openapi_server/models/language_string.py +src/openapi_server/models/match_id.py +src/openapi_server/models/match_status.py +src/openapi_server/models/md5.py +src/openapi_server/models/no_content.py +src/openapi_server/models/not_acceptable_error.py +src/openapi_server/models/not_found_error.py +src/openapi_server/models/not_implemented_error.py +src/openapi_server/models/relic_link_id.py +src/openapi_server/models/request_timeout_error.py +src/openapi_server/models/search_param.py src/openapi_server/models/server_error.py +src/openapi_server/models/service_unavailable_error.py +src/openapi_server/models/since_param.py +src/openapi_server/models/start_param.py +src/openapi_server/models/steam_id.py +src/openapi_server/models/timeframe.py +src/openapi_server/models/too_many_requests_error.py +src/openapi_server/models/ulid.py src/openapi_server/models/unauthorized_error.py +src/openapi_server/models/unsupported_media_type_error.py +src/openapi_server/models/www_authenticate.py src/openapi_server/security_api.py tests/conftest.py +tests/test_account_registration_api.py +tests/test_administration_api.py +tests/test_api_token_validation_api.py +tests/test_authentication_api.py +tests/test_database_api.py tests/test_default_api.py +tests/test_definition_api.py +tests/test_information_api.py +tests/test_internal_api.py +tests/test_leaderboards_api.py +tests/test_match_data_api.py +tests/test_profile_administration_api.py +tests/test_ratings_api.py +tests/test_search_api.py +tests/test_statistics_api.py +tests/test_status_check_api.py +tests/test_team_administration_api.py +tests/test_teams_api.py +tests/test_tournament_administration_api.py +tests/test_tournaments_api.py +tests/test_user_administration_api.py diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c12eafe --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "yaml.schemas": { + "openapi:v3": "file:///c%3A/Users/dailyuse/dev-src/librematch-backend/openapi.yaml" + } +} \ No newline at end of file diff --git a/README.md b/README.md index 34a7253..02c5427 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 1.0.0 +- API version: 1.0.0-DRAFT - Build package: org.openapitools.codegen.languages.PythonFastAPIServerCodegen ## Requirements. diff --git a/docs/design/responses/TODO_RESPONSES.md b/docs/design/responses/TODO_RESPONSES.md new file mode 100644 index 0000000..149494f --- /dev/null +++ b/docs/design/responses/TODO_RESPONSES.md @@ -0,0 +1,34 @@ +# Responses that need to be designed + +## TODO + +- GET /application/status +- GET /dumps/{timeframe} +- GET /users/validate +- GET /games/{game_id}/definitions +- GET /games/{game_id}/info + +### Blocking + +- GET /games +- GET /games/{game_id} +- GET /games/{game_id}/matches +- GET /games/{game_id}/leaderboards +- GET /games/matches/{match_uuid} +- GET /profiles +- GET /profiles/{relic_link_id} +- GET /profiles/{relic_link_id}/matches +- GET /profiles/{relic_link_id}/ledger +- GET /leaderboards +- GET /leaderboards/{leaderboard_id} +- GET /leaderboards/{leaderboard_id}/matches + +## Done + +- GET /games/matches/{match_uuid} +- GET /profiles/search?steam_id +- GET /profiles/search?alias + +## Notes + +- do we need ranks/percentiles in ratinghistory, so people can use that to create a graph of profiles also for their ranking at a certain moment in time? (-> Coolio) diff --git a/docs/design/responses/games/_id/matches/games_game_id_matches.json b/docs/design/responses/games/_id/matches/games_game_id_matches.json new file mode 100644 index 0000000..0e3b593 --- /dev/null +++ b/docs/design/responses/games/_id/matches/games_game_id_matches.json @@ -0,0 +1,320 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/games/matches/03531e31-31fd-5041-9f70-0264e158a40e", + "rel": [ + "item" + ] + }, + "desc": "Showing 1 of 1 match.", + "offset": 0, + "limit": 25, + "size": 1, + "first": null, + "previous": null, + "next": null, + "last": null, + "parameters": { + "uuid": "03531e31-31fd-5041-9f70-0264e158a40e", + "match_id": null, + "languages": [ + "en", + "fr" + ], + "style": "compact" + }, + "value": [ + { + "match_id": 75984064, + "private": false, + "password_protected": false, + "match_uuid": "03531e31-31fd-5041-9f70-0264e158a40e", + "lobby_name": "[REMATCH] 12345", + "status": "finished", + "started_at": "2022-10-03T15:41:38.000Z", + "finished_at": "2022-10-03T15:50:38.000Z", + "duration": 540, + "settings": { + "map_name": [ + { + "value": "Chaos Pit", + "language": "en" + }, + { + "value": "Puits du Chaos", + "language": "fr" + } + ], + "map_size": [ + { + "value": "Tiny", + "language": "en" + }, + { + "value": "Petit", + "language": "fr" + } + ], + "map_visibility": [ + { + "value": "Normal", + "language": "en" + }, + { + "value": "Normale", + "language": "fr" + } + ], + "resources": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "population": 200, + "game_speed": [ + { + "value": "Normal", + "language": "en" + }, + { + "value": "Normale", + "language": "fr" + } + ], + "starting_age": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "ending_age": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "treaty_length": null, + "victory_condition": [ + { + "value": "Conquest", + "language": "en" + }, + { + "value": "Conquête", + "language": "fr" + } + ], + "lock_teams": true, + "team_together": true, + "team_positions": false, + "shared_exploration": false, + "handicap": false, + "lock_speed": true, + "allow_cheats": false, + "turbo_mode": false, + "full_tech_tree": false, + "empire_wars_mode": false, + "sudden_death_mode": false, + "regicide_mode": false, + "record_game": true + }, + "leaderboard": { + "href": "https://api.librematch.org/v1/leaderboards/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "rm_1v1", + "rel": [ + "collection" + ] + }, + "rematch": true, + "server": [ + { + "value": "India", + "language": "en" + }, + { + "value": "Inde", + "language": "fr" + } + ], + "rating_average": 2022, + "patch_version": "", + "related/links": [ + { + "Endpoints_need_support (TODO)": "same civ matchups, same opponents, same map" + } + ], + "match_size": 2, + "match_slots_used": 2, + "team_matchups": [ + [ + { + "self": { + "profile": { + "href": "https://api.librematch.org/v1/profiles/196240", + "rel": [ + "item" + ] + }, + "teams": [ + { + "href": "https://api.librematch.org/v1/teams/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "rel": [ + "item" + ] + } + ], + "verified": true, + "first_name": "", + "last_name": "", + "alias": "TheViper", + "country_code": "no", + "profile_id": 196240, + "steam_id": "", + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "stats": { + "rank": 4, + "rating_max": 2600, + "rating": 2400, + "win_rate": 67.8, + "streak": 2, + "games_count": 264, + "wins_count": 174, + "losses_count": 90, + "drops_count": 2, + "rank_level": null, + "rating_history": null, + "civ_history": null, + "map_history": null + } + }, + "match_slot": 1, + "civilization": [ + { + "value": "Chinese", + "language": "en" + }, + { + "value": "Chinois", + "language": "fr" + } + ], + "colour": [ + { + "value": "Green", + "language": "en" + }, + { + "value": "Vert", + "language": "fr" + } + ], + "result_win": true + } + ], + [ + { + "self": { + "profile": { + "href": "https://api.librematch.org/v1/profiles/1141567", + "rel": [ + "item" + ] + }, + "teams": null, + "verified": true, + "first_name": "", + "last_name": "", + "alias": "MrYo", + "country_code": "cn", + "profile_id": 1141567, + "steam_id": "", + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "stats": { + "rank": 4, + "rating_max": 2600, + "rating": 2400, + "win_rate": 67.8, + "streak": 2, + "games_count": 264, + "wins_count": 174, + "losses_count": 90, + "drops_count": 2, + "rank_level": null, + "rating_history": null, + "civ_history": null, + "map_history": null + } + }, + "match_slot": 2, + "civilization": [ + { + "value": "Byzantines", + "language": "en" + }, + { + "value": "Byzantines", + "language": "fr" + } + ], + "colour": [ + { + "value": "Yellow", + "language": "en" + }, + { + "value": "Jaune", + "language": "fr" + } + ], + "result_win": false + } + ] + ] + } + ] +} \ No newline at end of file diff --git a/docs/design/responses/games/definitions.json b/docs/design/responses/games/definitions.json new file mode 100644 index 0000000..e69de29 diff --git a/docs/design/responses/games/games.json b/docs/design/responses/games/games.json new file mode 100644 index 0000000..c498792 --- /dev/null +++ b/docs/design/responses/games/games.json @@ -0,0 +1,308 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/games", + "rel": [ + "collection" + ] + }, + "desc": "Showing X of Y profiles.", + "offset": 0, + "limit": 25, + "size": "Y", + "first": null, + "previous": null, + "next": null, + "last": null, + "parameters": {}, + "value": [ + { + "aoe1de": { + "stats": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe1de/stats", + "rel": [ + "collection" + ] + } + }, + "information": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe1de/info", + "rel": [ + "collection" + ] + }, + "long_name": "Age of Empires: Definitive Edition", + "shops": { + "steam": { + "href": "https://store.steampowered.com/app/1017900/Age_of_Empires_Definitive_Edition/" + }, + "microsoft": { + "href": "https://www.microsoft.com/store/productId/9NJWTJSVGVLJ" + } + } + }, + "definitions": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe1de/definitions", + "rel": [ + "collection" + ] + } + }, + "matches": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe1de/matches", + "rel": [ + "collection" + ] + } + }, + "leaderboards": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe1de/leaderboards", + "rel": [ + "collection" + ] + } + }, + "community_pages": { + "todo!": "todo!" + }, + "tournaments": { + "self": { + "href": "https://api.librematch.org/v1/tournaments?game=aoe1de", + "rel": [ + "collection" + ] + } + }, + "teams": { + "self": { + "href": "https://api.librematch.org/v1/teams?game=aoe1de", + "rel": [ + "collection" + ] + } + } + } + }, + { + "aoe2de": { + "stats": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe2de/stats", + "rel": [ + "collection" + ] + } + }, + "information": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe2de/info", + "rel": [ + "collection" + ] + }, + "long_name": "Age of Empires II: Definitive Edition", + "shops": { + "steam": { + "href": "https://store.steampowered.com/app/813780/Age_of_Empires_II_Definitive_Edition/" + }, + "microsoft": { + "href": "https://www.microsoft.com/store/productId/9NJDD0JGPP2Q" + } + } + }, + "definitions": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe2de/definitions", + "rel": [ + "collection" + ] + } + }, + "matches": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe2de/matches", + "rel": [ + "collection" + ] + } + }, + "leaderboards": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe2de/leaderboards", + "rel": [ + "collection" + ] + } + }, + "community_pages": { + "todo!": "todo!" + }, + "tournaments": { + "self": { + "href": "https://api.librematch.org/v1/tournaments?game=aoe2de", + "rel": [ + "collection" + ] + } + }, + "teams": { + "self": { + "href": "https://api.librematch.org/v1/teams?game=aoe2de", + "rel": [ + "collection" + ] + } + } + } + }, + { + "aoe3de": { + "stats": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe3de/stats", + "rel": [ + "collection" + ] + } + }, + "information": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe3de/info", + "rel": [ + "collection" + ] + }, + "long_name": "Age of Empires III: Definitive Edition", + "shops": { + "steam": { + "href": "https://store.steampowered.com/app/933110/Age_of_Empires_III_Definitive_Edition/" + }, + "microsoft": { + "href": "https://www.microsoft.com/store/productId/9N1HF804QXN4" + } + } + }, + "definitions": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe3de/definitions", + "rel": [ + "collection" + ] + } + }, + "matches": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe3de/matches", + "rel": [ + "collection" + ] + } + }, + "leaderboards": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe3de/leaderboards", + "rel": [ + "collection" + ] + } + }, + "community_pages": { + "todo!": "todo!" + }, + "tournaments": { + "self": { + "href": "https://api.librematch.org/v1/tournaments?game=aoe3de", + "rel": [ + "collection" + ] + } + }, + "teams": { + "self": { + "href": "https://api.librematch.org/v1/teams?game=aoe3de", + "rel": [ + "collection" + ] + } + } + } + }, + { + "aoe4": { + "stats": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe4/stats", + "rel": [ + "collection" + ] + } + }, + "information": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe4/info", + "rel": [ + "collection" + ] + }, + "long_name": "Age of Empires IV", + "shops": { + "steam": { + "href": "https://store.steampowered.com/app/1466860/Age_of_Empires_IV/" + }, + "microsoft": { + "href": "https://www.microsoft.com/store/productId/9N94NCGM1Q2N" + } + } + }, + "definitions": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe4/definitions", + "rel": [ + "collection" + ] + } + }, + "matches": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe4/matches", + "rel": [ + "collection" + ] + } + }, + "leaderboards": { + "self": { + "href": "https://api.librematch.org/v1/games/aoe4/leaderboards", + "rel": [ + "collection" + ] + } + }, + "community_pages": { + "todo!": "todo!" + }, + "tournaments": { + "self": { + "href": "https://api.librematch.org/v1/tournaments?game=aoe4", + "rel": [ + "collection" + ] + } + }, + "teams": { + "self": { + "href": "https://api.librematch.org/v1/teams?game=aoe4", + "rel": [ + "collection" + ] + } + } + } + } + ] +} \ No newline at end of file diff --git a/docs/design/responses/games/matches/game_matches_uuid_compact.json b/docs/design/responses/games/matches/game_matches_uuid_compact.json new file mode 100644 index 0000000..d68c400 --- /dev/null +++ b/docs/design/responses/games/matches/game_matches_uuid_compact.json @@ -0,0 +1,326 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/games/aoe2de/matches", + "rel": [ + "item" + ] + }, + "desc": "Showing 1 of 218 matches. Use the 'next' link for the next page.", + "offset": 0, + "limit": 25, + "size": 218, + "first": null, + "previous": null, + "next": null, + "last": null, + "parameters": { + "uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "limit": 25, + "languages": [ + "en", + "fr" + ], + "style": "compact", + "last_match": false, + "status": null, + "game": null, + "start": null, + "count": null, + "since": null + }, + "value": [ + { + "match_id": 75984064, + "private": false, + "password_protected": false, + "match_uuid": "03531e31-31fd-5041-9f70-0264e158a40e", + "lobby_name": "[REMATCH] 12345", + "status": "finished", + "started_at": "2022-10-03T15:41:38.000Z", + "finished_at": "2022-10-03T15:50:38.000Z", + "duration": 540, + "settings": { + "map_name": [ + { + "value": "Chaos Pit", + "language": "en" + }, + { + "value": "Puits du Chaos", + "language": "fr" + } + ], + "map_size": [ + { + "value": "Tiny", + "language": "en" + }, + { + "value": "Petit", + "language": "fr" + } + ], + "map_visibility": [ + { + "value": "Normal", + "language": "en" + }, + { + "value": "Normale", + "language": "fr" + } + ], + "resources": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "population": 200, + "game_speed": [ + { + "value": "Normal", + "language": "en" + }, + { + "value": "Normale", + "language": "fr" + } + ], + "starting_age": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "ending_age": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "treaty_length": null, + "victory_condition": [ + { + "value": "Conquest", + "language": "en" + }, + { + "value": "Conquête", + "language": "fr" + } + ], + "lock_teams": true, + "team_together": true, + "team_positions": false, + "shared_exploration": false, + "handicap": false, + "lock_speed": true, + "allow_cheats": false, + "turbo_mode": false, + "full_tech_tree": false, + "empire_wars_mode": false, + "sudden_death_mode": false, + "regicide_mode": false, + "record_game": true + }, + "leaderboard": { + "href": "https://api.librematch.org/v1/leaderboards/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "rm_1v1", + "rel": [ + "collection" + ] + }, + "rematch": true, + "server": [ + { + "value": "India", + "language": "en" + }, + { + "value": "Inde", + "language": "fr" + } + ], + "rating_average": 2022, + "patch_version": "", + "related/links": [ + { + "Endpoints_need_support (TODO)": "same civ matchups, same opponents, same map" + } + ], + "match_size": 2, + "match_slots_used": 2, + "team_matchups": [ + [ + { + "self": { + "profile": { + "href": "https://api.librematch.org/v1/profiles/196240", + "rel": [ + "item" + ] + }, + "teams": [ + { + "href": "https://api.librematch.org/v1/teams/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "rel": [ + "item" + ] + } + ], + "verified": true, + "first_name": "", + "last_name": "", + "alias": "TheViper", + "country_code": "no", + "profile_id": 196240, + "steam_id": "", + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "stats": { + "rank": 4, + "rating_max": 2600, + "rating": 2400, + "win_rate": 67.8, + "streak": 2, + "games_count": 264, + "wins_count": 174, + "losses_count": 90, + "drops_count": 2, + "rank_level": null, + "rating_history": null, + "civ_history": null, + "map_history": null + } + }, + "match_slot": 1, + "civilization": [ + { + "value": "Chinese", + "language": "en" + }, + { + "value": "Chinois", + "language": "fr" + } + ], + "colour": [ + { + "value": "Green", + "language": "en" + }, + { + "value": "Vert", + "language": "fr" + } + ], + "result_win": true + } + ], + [ + { + "self": { + "profile": { + "href": "https://api.librematch.org/v1/profiles/1141567", + "rel": [ + "item" + ] + }, + "teams": null, + "verified": true, + "first_name": "", + "last_name": "", + "alias": "MrYo", + "country_code": "cn", + "profile_id": 1141567, + "steam_id": "", + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "stats": { + "rank": 4, + "rating_max": 2600, + "rating": 2400, + "win_rate": 67.8, + "streak": 2, + "games_count": 264, + "wins_count": 174, + "losses_count": 90, + "drops_count": 2, + "rank_level": null, + "rating_history": null, + "civ_history": null, + "map_history": null + } + }, + "match_slot": 2, + "civilization": [ + { + "value": "Byzantines", + "language": "en" + }, + { + "value": "Byzantines", + "language": "fr" + } + ], + "colour": [ + { + "value": "Yellow", + "language": "en" + }, + { + "value": "Jaune", + "language": "fr" + } + ], + "result_win": false + } + ] + ] + } + ] +} \ No newline at end of file diff --git a/docs/design/responses/profiles/search_by_alias.json b/docs/design/responses/profiles/search_by_alias.json new file mode 100644 index 0000000..1eb544f --- /dev/null +++ b/docs/design/responses/profiles/search_by_alias.json @@ -0,0 +1,145 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/profiles/search?by_name=TheViper", + "rel": [ + "collection" + ] + }, + "desc": "Showing 25 of 218 profiles. Use the 'next' link for the next page.", + "offset": 0, + "limit": 25, + "size": 218, + "first": { + "href": "https://api.librematch.org/v1/profiles/search?by_name=TheViper", + "rel": [ + "collection" + ] + }, + "previous": null, + "next": { + "href": "https://api.librematch.org/v1/profiles/search?by_name=TheViper&offset=25", + "rel": [ + "collection" + ] + }, + "last": { + "href": "https://api.librematch.org/v1/profiles/search?alias=TheViper&offset=200", + "rel": [ + "collection" + ] + }, + "parameters": { + "alias": "TheViper", + "steam_id": null, + "exact": false + }, + "value": [ + { + "self": { + "href": "https://api.librematch.org/v1/profiles/196240" + }, + "teams": [ + { + "href": "https://api.librematch.org/v1/teams/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "rel": [ + "item" + ] + } + ], + "verified": true, + "first_name": "", + "last_name": "", + "alias": "TheViper", + "country_code": "no", + "profile_id": 196240, + "steam_id": "", + "last_matches": [ + { + "aoe2de": { + "datetime": "2022-04-19T08:36:35.000Z", + "href": "https://api.librematch.org/v1/profiles/196240/matches?single_match=3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + }, + { + "aoe4": { + "datetime": "2022-04-20T08:38:35.000Z", + "href": "https://api.librematch.org/v1/profiles/196240/matches?single_match=3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + } + ], + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "socials": [ + { + "discord": { + "server_invite": { + "href": "" + }, + "user_name": "" + } + }, + { + "twitter": { + "href": "" + } + }, + { + "youtube": { + "href": "" + } + }, + { + "twitch": { + "href": "" + } + }, + { + "fbgaming": { + "href": "" + } + }, + { + "instagram": { + "href": "" + } + }, + { + "liquipedia": { + "href": "" + } + }, + { + "esportsearnings": { + "href": "" + } + }, + { + "aoeelo": { + "href": "" + } + }, + { + "douyu": { + "href": "" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/design/responses/profiles/search_by_steam_id.json b/docs/design/responses/profiles/search_by_steam_id.json new file mode 100644 index 0000000..8def942 --- /dev/null +++ b/docs/design/responses/profiles/search_by_steam_id.json @@ -0,0 +1,132 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/profiles/search?steam_id=196243121513410", + "rel": [ + "collection" + ] + }, + "desc": "Showing 1 of 1 profile.", + "offset": 0, + "limit": 25, + "size": 1, + "first": null, + "previous": null, + "next": null, + "last": null, + "parameters": { + "alias": null, + "steam_id": 196243121513410, + "exact": false + }, + "value": [ + { + "self": { + "href": "https://api.librematch.org/v1/profiles/196240" + }, + "teams": [ + { + "href": "https://api.librematch.org/v1/teams/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "rel": [ + "item" + ] + } + ], + "verified": true, + "first_name": "", + "last_name": "", + "alias": "TheViper", + "country_code": "no", + "profile_id": 196240, + "steam_id": "", + "last_matches": [ + { + "aoe2de": { + "datetime": "2022-04-19T08:36:35.000Z", + "timestamp": 13801284901123, + "href": "https://api.librematch.org/v1/profiles/196240/matches?single_match=3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + }, + { + "aoe4": { + "datetime": "2022-04-20T08:38:35.000Z", + "timestamp": 13801284901123, + "href": "https://api.librematch.org/v1/profiles/196240/matches?single_match=3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + } + ], + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "socials": [ + { + "discord": { + "server_invite": { + "href": "" + }, + "user_name": "" + } + }, + { + "twitter": { + "href": "" + } + }, + { + "youtube": { + "href": "" + } + }, + { + "twitch": { + "href": "" + } + }, + { + "fbgaming": { + "href": "" + } + }, + { + "instagram": { + "href": "" + } + }, + { + "liquipedia": { + "href": "" + } + }, + { + "esportsearnings": { + "href": "" + } + }, + { + "aoeelo": { + "href": "" + } + }, + { + "douyu": { + "href": "" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/design/responses/templates/base/application_template.json b/docs/design/responses/templates/base/application_template.json new file mode 100644 index 0000000..e69de29 diff --git a/docs/design/responses/templates/base/base_template.json b/docs/design/responses/templates/base/base_template.json new file mode 100644 index 0000000..87b6788 --- /dev/null +++ b/docs/design/responses/templates/base/base_template.json @@ -0,0 +1,33 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/", + "rel": [ + "item", + "collection" + ] + }, + "desc": "Showing X of Y item(s).", + "offset": 0, + "limit": 25, + "size": 1, + "first": null, + "previous": null, + "next": null, + "last": null, + "parameters": { + "uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "languages": [ + "en", + "fr" + ], + "style": "compact", + "last_match": false, + "status": null, + "game": null, + "start": null, + "count": null, + "since": null + }, + "value": [] +} \ No newline at end of file diff --git a/docs/design/responses/templates/base/game_stats_template.json b/docs/design/responses/templates/base/game_stats_template.json new file mode 100644 index 0000000..4b77f22 --- /dev/null +++ b/docs/design/responses/templates/base/game_stats_template.json @@ -0,0 +1,869 @@ +[ + { + "date": "2022-01-27T22:17:09.156189", + "leaderboard_activity": { + "30d": { + "aoe2": { + "rm": 39641, + "team_rm": 64581, + "ew": 1787, + "team_ew": 2447, + "unranked": 119847 + }, + "aoe3": { + "supremacy_1v1": 2944, + "supremacy_team": 2867, + "treaty": 604, + "deathmatch": 23 + }, + "aoe4": { + "custom": 133021, + "qm_1v1": 44386, + "qm_2v2": 57611, + "qm_3v3": 53335, + "qm_4v4": 45044 + } + }, + "14d": { + "aoe2": { + "rm": 32094, + "team_rm": 53381, + "ew": 1345, + "team_ew": 1832, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 2268, + "supremacy_team": 2177, + "treaty": 485, + "deathmatch": 17 + }, + "aoe4": { + "custom": 94805, + "qm_1v1": 33354, + "qm_2v2": 43476, + "qm_3v3": 40748, + "qm_4v4": 34645 + } + }, + "7d": { + "aoe2": { + "rm": 25673, + "team_rm": 43935, + "ew": 1017, + "team_ew": 1368, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 1789, + "supremacy_team": 1705, + "treaty": 357, + "deathmatch": 14 + }, + "aoe4": { + "custom": 69179, + "qm_1v1": 26481, + "qm_2v2": 33693, + "qm_3v3": 32025, + "qm_4v4": 27495 + } + }, + "3d": { + "aoe2": { + "rm": 18647, + "team_rm": 32146, + "ew": 691, + "team_ew": 836, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 1321, + "supremacy_team": 1196, + "treaty": 243, + "deathmatch": 5 + }, + "aoe4": { + "custom": 43538, + "qm_1v1": 19310, + "qm_2v2": 23169, + "qm_3v3": 22146, + "qm_4v4": 19552 + } + }, + "1d": { + "aoe2": { + "rm": 13608, + "team_rm": 23542, + "ew": 482, + "team_ew": 537, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 980, + "supremacy_team": 846, + "treaty": 160, + "deathmatch": 4 + }, + "aoe4": { + "custom": 28552, + "qm_1v1": 14133, + "qm_2v2": 15665, + "qm_3v3": 14934, + "qm_4v4": 13864 + } + } + }, + "game_activity": { + "30d": { + "aoe2": 178042, + "aoe3": 5096, + "aoe4": 213250, + "franchise": 396388 + }, + "14d": { + "aoe2": 67225, + "aoe3": 3980, + "aoe4": 161463, + "franchise": 232668 + }, + "7d": { + "aoe2": 56454, + "aoe3": 3160, + "aoe4": 127150, + "franchise": 186764 + }, + "3d": { + "aoe2": 42960, + "aoe3": 2339, + "aoe4": 90190, + "franchise": 135489 + }, + "1d": { + "aoe2": 32726, + "aoe3": 1751, + "aoe4": 65589, + "franchise": 100066 + } + }, + "playerbase": { + "aoe2": 223757, + "aoe3": 5096, + "aoe4": 213251, + "franchise": 438077 + }, + "platforms": { + "aoe2": { + "steam": 92.36, + "relic": 7.64, + "n/a": 0.0 + }, + "aoe3": { + "steam": 93.15, + "relic": 6.85, + "n/a": 0.0 + }, + "aoe4": { + "steam": 64.95, + "relic": 35.05, + "n/a": 0.0 + }, + "franchise": { + "steam": 79.04, + "relic": 20.96, + "n/a": 0.0 + } + }, + "country": { + "aoe2": { + "US": 12.08, + "DE": 12.06, + "CN": 6.03, + "AR": 5.46, + "FR": 5.15, + "TW": 4.35, + "GB": 3.65, + "CA": 3.21, + "AU": 3.12, + "ES": 2.83, + "MX": 2.59, + "TR": 2.49, + "CL": 2.45, + "BR": 2.2, + "NL": 1.94, + "RU": 1.77, + "CH": 1.44, + "CZ": 1.32, + "IT": 1.31, + "HK": 1.22, + "SE": 1.17, + "CO": 1.15, + "BE": 1.14, + "IN": 1.08, + "AT": 0.96, + "no_country_set": 7.65 + }, + "aoe3": { + "US": 2.39, + "DE": 2.0, + "ES": 0.98, + "TR": 0.98, + "CN": 0.94, + "FR": 0.82, + "MX": 0.8, + "BR": 0.65, + "CA": 0.57, + "TW": 0.55, + "GB": 0.51, + "AU": 0.51, + "AR": 0.47, + "HK": 0.41, + "AT": 0.35, + "CH": 0.35, + "NL": 0.33, + "CO": 0.31, + "CL": 0.29, + "PE": 0.29, + "JP": 0.29, + "IT": 0.27, + "SE": 0.26, + "BE": 0.22, + "RU": 0.2, + "no_country_set": 82.28 + }, + "aoe4": { + "US": 2.76, + "DE": 2.67, + "FR": 1.27, + "CN": 0.99, + "CA": 0.61, + "AU": 0.57, + "GB": 0.55, + "CH": 0.38, + "NL": 0.31, + "ES": 0.3, + "AT": 0.28, + "TW": 0.28, + "SE": 0.23, + "BE": 0.21, + "HK": 0.2, + "BR": 0.19, + "RU": 0.18, + "IT": 0.17, + "AR": 0.15, + "JP": 0.13, + "NO": 0.12, + "CL": 0.11, + "DK": 0.11, + "TR": 0.1, + "MX": 0.09, + "no_country_set": 85.86 + }, + "franchise": { + "US": 7.39, + "DE": 7.34, + "CN": 3.5, + "FR": 3.21, + "AR": 2.85, + "TW": 2.34, + "GB": 2.11, + "CA": 1.91, + "AU": 1.85, + "ES": 1.59, + "MX": 1.36, + "TR": 1.32, + "CL": 1.3, + "BR": 1.21, + "NL": 1.13, + "RU": 0.97, + "CH": 0.9, + "IT": 0.74, + "HK": 0.72, + "CZ": 0.71, + "SE": 0.7, + "BE": 0.67, + "AT": 0.62, + "CO": 0.6, + "IN": 0.56, + "no_country_set": 46.55 + } + } + }, + { + "date": "2022-01-28T18:16:09.062004", + "leaderboard_activity": { + "30d": { + "aoe2": { + "rm": 39623, + "team_rm": 64460, + "ew": 1792, + "team_ew": 2435, + "unranked": 115266 + }, + "aoe3": { + "supremacy_1v1": 2952, + "supremacy_team": 2855, + "treaty": 599, + "deathmatch": 24 + }, + "aoe4": { + "custom": 131894, + "qm_1v1": 44070, + "qm_2v2": 57265, + "qm_3v3": 53097, + "qm_4v4": 44895 + } + }, + "14d": { + "aoe2": { + "rm": 32189, + "team_rm": 53496, + "ew": 1346, + "team_ew": 1830, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 2278, + "supremacy_team": 2177, + "treaty": 480, + "deathmatch": 18 + }, + "aoe4": { + "custom": 94605, + "qm_1v1": 33354, + "qm_2v2": 43398, + "qm_3v3": 40686, + "qm_4v4": 34602 + } + }, + "7d": { + "aoe2": { + "rm": 25680, + "team_rm": 43954, + "ew": 1019, + "team_ew": 1358, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 1807, + "supremacy_team": 1711, + "treaty": 347, + "deathmatch": 14 + }, + "aoe4": { + "custom": 69203, + "qm_1v1": 26432, + "qm_2v2": 33619, + "qm_3v3": 31852, + "qm_4v4": 27372 + } + }, + "3d": { + "aoe2": { + "rm": 18692, + "team_rm": 32053, + "ew": 697, + "team_ew": 827, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 1320, + "supremacy_team": 1183, + "treaty": 229, + "deathmatch": 6 + }, + "aoe4": { + "custom": 43121, + "qm_1v1": 19389, + "qm_2v2": 23080, + "qm_3v3": 21962, + "qm_4v4": 19545 + } + }, + "1d": { + "aoe2": { + "rm": 13631, + "team_rm": 23411, + "ew": 484, + "team_ew": 541, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 983, + "supremacy_team": 818, + "treaty": 151, + "deathmatch": 4 + }, + "aoe4": { + "custom": 28640, + "qm_1v1": 14256, + "qm_2v2": 15667, + "qm_3v3": 14705, + "qm_4v4": 13892 + } + } + }, + "game_activity": { + "30d": { + "aoe2": 174108, + "aoe3": 5086, + "aoe4": 211614, + "franchise": 390808 + }, + "14d": { + "aoe2": 67399, + "aoe3": 3987, + "aoe4": 161110, + "franchise": 232496 + }, + "7d": { + "aoe2": 56449, + "aoe3": 3185, + "aoe4": 126990, + "franchise": 186624 + }, + "3d": { + "aoe2": 42851, + "aoe3": 2326, + "aoe4": 89480, + "franchise": 134657 + }, + "1d": { + "aoe2": 32583, + "aoe3": 1706, + "aoe4": 65501, + "franchise": 99790 + } + }, + "playerbase": { + "aoe2": 223770, + "aoe3": 5086, + "aoe4": 211615, + "franchise": 436473 + }, + "platforms": { + "aoe2": { + "steam": 92.36, + "relic": 7.64, + "n/a": 0.0 + }, + "aoe3": { + "steam": 93.12, + "relic": 6.88, + "n/a": 0.0 + }, + "aoe4": { + "steam": 64.96, + "relic": 35.04, + "n/a": 0.0 + }, + "franchise": { + "steam": 79.1, + "relic": 20.9, + "n/a": 0.0 + } + }, + "country": { + "aoe2": { + "US": 12.08, + "DE": 12.05, + "CN": 6.03, + "AR": 5.46, + "FR": 5.15, + "TW": 4.36, + "GB": 3.65, + "CA": 3.21, + "AU": 3.13, + "ES": 2.83, + "MX": 2.59, + "TR": 2.49, + "CL": 2.45, + "BR": 2.19, + "NL": 1.94, + "RU": 1.77, + "CH": 1.44, + "CZ": 1.32, + "IT": 1.31, + "HK": 1.23, + "SE": 1.17, + "CO": 1.15, + "BE": 1.14, + "IN": 1.08, + "AT": 0.96, + "no_country_set": 7.65 + }, + "aoe3": { + "US": 2.4, + "DE": 1.99, + "ES": 0.98, + "TR": 0.98, + "CN": 0.94, + "FR": 0.83, + "MX": 0.81, + "BR": 0.69, + "CA": 0.61, + "TW": 0.53, + "GB": 0.51, + "AU": 0.51, + "AR": 0.45, + "HK": 0.39, + "AT": 0.35, + "CH": 0.33, + "NL": 0.31, + "JP": 0.31, + "CL": 0.29, + "CO": 0.29, + "PE": 0.28, + "IT": 0.28, + "SE": 0.26, + "BE": 0.22, + "RU": 0.2, + "no_country_set": 82.3 + }, + "aoe4": { + "US": 2.75, + "DE": 2.66, + "FR": 1.27, + "CN": 0.99, + "CA": 0.61, + "AU": 0.58, + "GB": 0.55, + "CH": 0.38, + "ES": 0.31, + "NL": 0.31, + "AT": 0.28, + "TW": 0.28, + "SE": 0.23, + "HK": 0.21, + "BE": 0.21, + "BR": 0.19, + "RU": 0.17, + "IT": 0.17, + "AR": 0.15, + "JP": 0.13, + "NO": 0.12, + "CL": 0.11, + "DK": 0.11, + "TR": 0.1, + "MX": 0.09, + "no_country_set": 85.86 + }, + "franchise": { + "US": 7.41, + "DE": 7.34, + "CN": 3.52, + "FR": 3.22, + "AR": 2.86, + "TW": 2.35, + "GB": 2.11, + "CA": 1.92, + "AU": 1.86, + "ES": 1.6, + "MX": 1.37, + "TR": 1.33, + "CL": 1.3, + "BR": 1.21, + "NL": 1.13, + "RU": 0.98, + "CH": 0.9, + "IT": 0.75, + "HK": 0.73, + "CZ": 0.71, + "SE": 0.7, + "BE": 0.67, + "AT": 0.62, + "CO": 0.61, + "IN": 0.57, + "no_country_set": 46.4 + } + } + }, + { + "date": "2022-01-29T19:24:12.630533", + "leaderboard_activity": { + "30d": { + "aoe2": { + "rm": 39880, + "team_rm": 64997, + "ew": 1806, + "team_ew": 2449, + "unranked": 108443 + }, + "aoe3": { + "supremacy_1v1": 2966, + "supremacy_team": 2862, + "treaty": 607, + "deathmatch": 23 + }, + "aoe4": { + "custom": 132012, + "qm_1v1": 44062, + "qm_2v2": 57292, + "qm_3v3": 53189, + "qm_4v4": 44995 + } + }, + "14d": { + "aoe2": { + "rm": 32385, + "team_rm": 54080, + "ew": 1352, + "team_ew": 1865, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 2297, + "supremacy_team": 2198, + "treaty": 498, + "deathmatch": 18 + }, + "aoe4": { + "custom": 95187, + "qm_1v1": 33441, + "qm_2v2": 43516, + "qm_3v3": 40903, + "qm_4v4": 34817 + } + }, + "7d": { + "aoe2": { + "rm": 25968, + "team_rm": 44760, + "ew": 1036, + "team_ew": 1383, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 1828, + "supremacy_team": 1732, + "treaty": 371, + "deathmatch": 10 + }, + "aoe4": { + "custom": 70368, + "qm_1v1": 26616, + "qm_2v2": 33874, + "qm_3v3": 32125, + "qm_4v4": 27609 + } + }, + "3d": { + "aoe2": { + "rm": 19462, + "team_rm": 34061, + "ew": 736, + "team_ew": 887, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 1369, + "supremacy_team": 1254, + "treaty": 260, + "deathmatch": 6 + }, + "aoe4": { + "custom": 46524, + "qm_1v1": 20020, + "qm_2v2": 23975, + "qm_3v3": 22658, + "qm_4v4": 20146 + } + }, + "1d": { + "aoe2": { + "rm": 14852, + "team_rm": 26361, + "ew": 531, + "team_ew": 619, + "unranked": 0 + }, + "aoe3": { + "supremacy_1v1": 1033, + "supremacy_team": 911, + "treaty": 169, + "deathmatch": 4 + }, + "aoe4": { + "custom": 33566, + "qm_1v1": 15336, + "qm_2v2": 17278, + "qm_3v3": 16217, + "qm_4v4": 14969 + } + } + }, + "game_activity": { + "30d": { + "aoe2": 168934, + "aoe3": 5110, + "aoe4": 211534, + "franchise": 385578 + }, + "14d": { + "aoe2": 68045, + "aoe3": 4035, + "aoe4": 161743, + "franchise": 233823 + }, + "7d": { + "aoe2": 57367, + "aoe3": 3248, + "aoe4": 128407, + "franchise": 189022 + }, + "3d": { + "aoe2": 45149, + "aoe3": 2463, + "aoe4": 94302, + "franchise": 141914 + }, + "1d": { + "aoe2": 35953, + "aoe3": 1843, + "aoe4": 72630, + "franchise": 110426 + } + }, + "playerbase": { + "aoe2": 224301, + "aoe3": 5110, + "aoe4": 211535, + "franchise": 436948 + }, + "platforms": { + "aoe2": { + "steam": 92.37, + "relic": 7.63, + "n/a": 0.0 + }, + "aoe3": { + "steam": 93.13, + "relic": 6.87, + "n/a": 0.0 + }, + "aoe4": { + "steam": 64.92, + "relic": 35.08, + "n/a": 0.0 + }, + "franchise": { + "steam": 79.1, + "relic": 20.9, + "n/a": 0.0 + } + }, + "country": { + "aoe2": { + "US": 12.07, + "DE": 12.06, + "CN": 6.03, + "AR": 5.46, + "FR": 5.15, + "TW": 4.35, + "GB": 3.65, + "CA": 3.2, + "AU": 3.12, + "ES": 2.83, + "MX": 2.58, + "TR": 2.49, + "CL": 2.46, + "BR": 2.2, + "NL": 1.94, + "RU": 1.77, + "CH": 1.44, + "CZ": 1.32, + "IT": 1.31, + "HK": 1.23, + "SE": 1.17, + "CO": 1.15, + "BE": 1.14, + "IN": 1.08, + "AT": 0.96, + "no_country_set": 7.64 + }, + "aoe3": { + "US": 2.41, + "DE": 2.0, + "TR": 1.0, + "CN": 0.98, + "ES": 0.98, + "FR": 0.82, + "MX": 0.8, + "BR": 0.72, + "CA": 0.59, + "TW": 0.53, + "AU": 0.51, + "GB": 0.49, + "AR": 0.43, + "HK": 0.39, + "AT": 0.35, + "CH": 0.35, + "CO": 0.33, + "NL": 0.31, + "JP": 0.31, + "CL": 0.29, + "SE": 0.25, + "PE": 0.25, + "IT": 0.25, + "BE": 0.22, + "RU": 0.2, + "no_country_set": 82.23 + }, + "aoe4": { + "US": 2.74, + "DE": 2.68, + "FR": 1.27, + "CN": 0.97, + "CA": 0.61, + "AU": 0.57, + "GB": 0.54, + "CH": 0.39, + "NL": 0.32, + "ES": 0.31, + "AT": 0.28, + "TW": 0.27, + "SE": 0.23, + "BE": 0.21, + "HK": 0.2, + "BR": 0.19, + "RU": 0.18, + "IT": 0.17, + "AR": 0.15, + "JP": 0.13, + "NO": 0.12, + "CL": 0.11, + "DK": 0.11, + "TR": 0.1, + "MX": 0.1, + "no_country_set": 85.87 + }, + "franchise": { + "US": 7.41, + "DE": 7.36, + "CN": 3.51, + "FR": 3.22, + "AR": 2.86, + "TW": 2.35, + "GB": 2.12, + "CA": 1.91, + "AU": 1.85, + "ES": 1.59, + "MX": 1.37, + "TR": 1.33, + "CL": 1.31, + "BR": 1.22, + "NL": 1.14, + "RU": 0.98, + "CH": 0.9, + "IT": 0.75, + "HK": 0.73, + "CZ": 0.71, + "SE": 0.71, + "BE": 0.68, + "AT": 0.62, + "CO": 0.61, + "IN": 0.57, + "no_country_set": 46.34 + } + } + } +] \ No newline at end of file diff --git a/docs/design/responses/templates/base/header_template.json b/docs/design/responses/templates/base/header_template.json new file mode 100644 index 0000000..d3a40a6 --- /dev/null +++ b/docs/design/responses/templates/base/header_template.json @@ -0,0 +1,25 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/", + "rel": [ + "collection" + ] + }, + "desc": "Showing X of Y profiles.", + "offset": 0, + "limit": 25, + "size": "Y", + "first": null, + "previous": null, + "next": null, + "last": null, + "parameters": { + "by_name": null, + "by_steam_id": null, + "exact": false + }, + "value": [ + {} + ] +} \ No newline at end of file diff --git a/docs/design/responses/templates/base/header_template_paginated.json b/docs/design/responses/templates/base/header_template_paginated.json new file mode 100644 index 0000000..9d78b41 --- /dev/null +++ b/docs/design/responses/templates/base/header_template_paginated.json @@ -0,0 +1,40 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/", + "rel": [ + "collection" + ] + }, + "desc": "Showing X of Y profiles.", + "offset": 0, + "limit": 25, + "size": "Y", + "first": { + "href": "https://api.librematch.org/v1/profiles/search", + "rel": [ + "collection" + ] + }, + "previous": null, + "next": { + "href": "https://api.librematch.org/v1/profiles/search?offset=25", + "rel": [ + "collection" + ] + }, + "last": { + "href": "https://api.librematch.org/v1/profiles/search?offset=200", + "rel": [ + "collection" + ] + }, + "parameters": { + "by_name": null, + "by_steam_id": null, + "exact": false + }, + "value": [ + {} + ] +} \ No newline at end of file diff --git a/docs/design/responses/templates/base/leaderboards_template.json b/docs/design/responses/templates/base/leaderboards_template.json new file mode 100644 index 0000000..98e8023 --- /dev/null +++ b/docs/design/responses/templates/base/leaderboards_template.json @@ -0,0 +1,45 @@ +{ + "self": { + "href": "https://api.librematch.org/v1/profiles/196240", + "name": "rm_1v1", + "rel": [ + "collection" + ], + "verified": true, + "person_name": "", + "alias": "TheViper", + "country_code": "no", + "steam_id": "76561197984749679", + "profile_id": 196240, + "teams": [ + { + "href": "https://api.librematch.org/v1/teams/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "GamerLegion", + "name_tag": "GL", + "rel": [ + "item" + ] + } + ] + }, + "drops": 3, + "overall_matches": 833, + "last_match": 1615410209, + "losses": 277, + "wins": 556, + "rating": { + "current": 2408, + "highest": 2510, + "lowest": 2415 + }, + "streak": { + "current": -1, + "highest": 22, + "lowest": -9 + }, + "rank": { + "current": 18, + "highest": 1, + "lowest": 2623 + } +} \ No newline at end of file diff --git a/docs/design/responses/templates/base/ledger_template.json b/docs/design/responses/templates/base/ledger_template.json new file mode 100644 index 0000000..0172a76 --- /dev/null +++ b/docs/design/responses/templates/base/ledger_template.json @@ -0,0 +1,72 @@ +{ + "self": { + "href": "https://api.librematch.org/v1/profiles/196240", + "name": "rm_1v1", + "rel": [ + "collection" + ], + "verified": true, + "first_name": "", + "last_name": "", + "alias": "TheViper", + "country_code": "no", + "steam_id": "76561197984749679", + "profile_id": 196240, + "teams": [ + { + "href": "https://api.librematch.org/v1/teams/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "GamerLegion", + "name_tag": "GL", + "rel": [ + "item" + ] + } + ] + }, + "leaderboards": [ + { + "self": { + "href": "https://api.librematch.org/v1/leaderboards/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "rm_1v1", + "rel": [ + "collection" + ] + }, + "history": [ + { + "overall_matches": 835, + "drops": 3, + "rank": 5, + "losses": 276, + "wins": 556, + "rating": 2415, + "streak": 3, + "timestamp": 1615409542, + "datetime": "2022-10-12T06:36:57.000Z" + } + ] + }, + { + "self": { + "href": "https://api.librematch.org/v1/leaderboards/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "rm_2v2", + "rel": [ + "collection" + ] + }, + "history": [ + { + "overall_matches": 835, + "drops": 3, + "rank": 5, + "losses": 276, + "wins": 556, + "rating": 2415, + "streak": 3, + "timestamp": 1615409542, + "datetime": "2022-10-12T06:23:57.000Z" + } + ] + } + ] +} \ No newline at end of file diff --git a/docs/design/responses/templates/base/matches_template.json b/docs/design/responses/templates/base/matches_template.json new file mode 100644 index 0000000..758350f --- /dev/null +++ b/docs/design/responses/templates/base/matches_template.json @@ -0,0 +1,299 @@ +{ + "match_id": 75984064, + "private": false, + "password_protected": false, + "match_uuid": "03531e31-31fd-5041-9f70-0264e158a40e", + "lobby_name": "[REMATCH] 12345", + "status": "finished", + "started_at": "2022-10-03T15:41:38.000Z", + "finished_at": "2022-10-03T15:50:38.000Z", + "duration": 540, + "settings": { + "map_name": [ + { + "value": "Chaos Pit", + "language": "en" + }, + { + "value": "Puits du Chaos", + "language": "fr" + } + ], + "map_size": [ + { + "value": "Tiny", + "language": "en" + }, + { + "value": "Petit", + "language": "fr" + } + ], + "map_visibility": [ + { + "value": "Normal", + "language": "en" + }, + { + "value": "Normale", + "language": "fr" + } + ], + "resources": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "population": 200, + "game_speed": [ + { + "value": "Normal", + "language": "en" + }, + { + "value": "Normale", + "language": "fr" + } + ], + "starting_age": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "ending_age": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "treaty_length": null, + "victory_condition": [ + { + "value": "Conquest", + "language": "en" + }, + { + "value": "Conquête", + "language": "fr" + } + ], + "lock_teams": true, + "team_together": true, + "team_positions": false, + "shared_exploration": false, + "handicap": false, + "lock_speed": true, + "allow_cheats": false, + "turbo_mode": false, + "full_tech_tree": false, + "empire_wars_mode": false, + "sudden_death_mode": false, + "regicide_mode": false, + "record_game": true + }, + "leaderboard": { + "href": "https://api.librematch.org/v1/leaderboards/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "rm_1v1", + "rel": [ + "collection" + ] + }, + "tournament": { + "href": "https://api.librematch.org/v1/tournaments/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "NAC3 Group Stage", + "rel": [ + "collection" + ] + }, + "rematch": true, + "server": [ + { + "value": "India", + "language": "en" + }, + { + "value": "Inde", + "language": "fr" + } + ], + "rating_average": 2022, + "patch_version": "", + "related/links": [ + { + "Endpoints_need_support (TODO)": "same civ matchups, same opponents, same map" + } + ], + "match_size": 2, + "match_slots_used": 2, + "team_matchups": [ + [ + { + "self": { + "profile": { + "href": "https://api.librematch.org/v1/profiles/196240", + "rel": [ + "item" + ] + }, + "teams": [ + { + "href": "https://api.librematch.org/v1/teams/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "rel": [ + "item" + ] + } + ], + "verified": true, + "first_name": "", + "last_name": "", + "alias": "TheViper", + "country_code": "no", + "profile_id": 196240, + "steam_id": "", + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "stats": { + "rank": 4, + "rating_max": 2600, + "rating": 2400, + "win_rate": 67.8, + "streak": 2, + "games_count": 264, + "wins_count": 174, + "losses_count": 90, + "drops_count": 2, + "rank_level": null, + "rating_history": null, + "civ_history": null, + "map_history": null + } + }, + "match_slot": 1, + "civilization": [ + { + "value": "Chinese", + "language": "en" + }, + { + "value": "Chinois", + "language": "fr" + } + ], + "colour": [ + { + "value": "Green", + "language": "en" + }, + { + "value": "Vert", + "language": "fr" + } + ], + "result_win": true + } + ], + [ + { + "self": { + "profile": { + "href": "https://api.librematch.org/v1/profiles/1141567", + "rel": [ + "item" + ] + }, + "teams": null, + "verified": true, + "first_name": "", + "last_name": "", + "alias": "MrYo", + "country_code": "cn", + "profile_id": 1141567, + "steam_id": "", + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "stats": { + "rank": 4, + "rating_max": 2600, + "rating": 2400, + "win_rate": 67.8, + "streak": 2, + "games_count": 264, + "wins_count": 174, + "losses_count": 90, + "drops_count": 2, + "rank_level": null, + "rating_history": null, + "civ_history": null, + "map_history": null + } + }, + "match_slot": 2, + "civilization": [ + { + "value": "Byzantines", + "language": "en" + }, + { + "value": "Byzantines", + "language": "fr" + } + ], + "colour": [ + { + "value": "Yellow", + "language": "en" + }, + { + "value": "Jaune", + "language": "fr" + } + ], + "result_win": false + } + ] + ] +} \ No newline at end of file diff --git a/docs/design/responses/templates/base/profiles_template.json b/docs/design/responses/templates/base/profiles_template.json new file mode 100644 index 0000000..c16b70b --- /dev/null +++ b/docs/design/responses/templates/base/profiles_template.json @@ -0,0 +1,167 @@ +{ + "self": { + "href": "https://api.librematch.org/v1/profiles/196240" + }, + "teams": [ + { + "href": "https://api.librematch.org/v1/teams/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "rel": [ + "item" + ] + } + ], + "verified": true, + "name": "", + "alias": "TheViper", + "country_code": "no", + "profile_id": 196240, + "steam_id": "", + "leaderboards": [ + { + "self": { + "href": "https://api.librematch.org/v1/leaderboards/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "rm_1v1", + "rel": [ + "collection" + ] + }, + "drops": 3, + "games": 833, + "last_match": 1615410209, + "losses": 277, + "wins": 556, + "rating": { + "current": 2408, + "highest": 2510, + "lowest": 2415 + }, + "streak": { + "current": -1, + "highest": 22, + "lowest": -9 + }, + "rank": { + "current": 18, + "highest": 1, + "lowest": 2623 + } + }, + { + "self": { + "href": "https://api.librematch.org/v1/leaderboards/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "rm_2v2", + "rel": [ + "collection" + ] + }, + "drops": 3, + "games": 833, + "last_match": 1615410209, + "losses": 277, + "wins": 556, + "rating": { + "current": 2408, + "highest": 2510, + "lowest": 2415 + }, + "streak": { + "current": -1, + "highest": 22, + "lowest": -9 + }, + "rank": { + "current": 18, + "highest": 1, + "lowest": 2623 + } + } + ], + "last_matches": [ + { + "aoe2de": { + "datetime": "2022-04-19T08:36:35.000Z", + "href": "https://api.librematch.org/v1/games/matches/3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + }, + { + "aoe4": { + "datetime": "2022-04-20T08:38:35.000Z", + "href": "https://api.librematch.org/v1/games/matches/3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + } + ], + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "socials": [ + { + "discord": { + "server_invite": { + "href": "" + }, + "user_name": "" + } + }, + { + "twitter": { + "href": "" + } + }, + { + "youtube": { + "href": "" + } + }, + { + "twitch": { + "href": "", + "is_live": false + } + }, + { + "fbgaming": { + "href": "", + "is_live": false + } + }, + { + "instagram": { + "href": "" + } + }, + { + "liquipedia": { + "href": "" + } + }, + { + "esportsearnings": { + "href": "" + } + }, + { + "aoeelo": { + "href": "" + } + }, + { + "douyu": { + "href": "" + } + } + ] +} \ No newline at end of file diff --git a/docs/design/responses/templates/base/teams_template.json b/docs/design/responses/templates/base/teams_template.json new file mode 100644 index 0000000..e69de29 diff --git a/docs/design/responses/templates/base/tournaments_template.json b/docs/design/responses/templates/base/tournaments_template.json new file mode 100644 index 0000000..e69de29 diff --git a/docs/design/responses/templates/base/users_template.json b/docs/design/responses/templates/base/users_template.json new file mode 100644 index 0000000..db6645d --- /dev/null +++ b/docs/design/responses/templates/base/users_template.json @@ -0,0 +1,23 @@ +{ + "settings": [ + { + "api_key": { + "self": { + "value": "", + "valid_until_timestamp": 19654984956, + "valid_until_datetime": "2022-04-20T08:38:35.000Z" + } + } + }, + { + "rate_limit": { + "activated": true, + "self": { + "unit": "minute", + "requests_per_unit": 7, + "algorithm": "Sliding window counter algorithm" + } + } + } + ] +} \ No newline at end of file diff --git a/docs/design/responses/templates/ionized_response_template.json b/docs/design/responses/templates/ionized_response_template.json new file mode 100644 index 0000000..9d78b41 --- /dev/null +++ b/docs/design/responses/templates/ionized_response_template.json @@ -0,0 +1,40 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/", + "rel": [ + "collection" + ] + }, + "desc": "Showing X of Y profiles.", + "offset": 0, + "limit": 25, + "size": "Y", + "first": { + "href": "https://api.librematch.org/v1/profiles/search", + "rel": [ + "collection" + ] + }, + "previous": null, + "next": { + "href": "https://api.librematch.org/v1/profiles/search?offset=25", + "rel": [ + "collection" + ] + }, + "last": { + "href": "https://api.librematch.org/v1/profiles/search?offset=200", + "rel": [ + "collection" + ] + }, + "parameters": { + "by_name": null, + "by_steam_id": null, + "exact": false + }, + "value": [ + {} + ] +} \ No newline at end of file diff --git a/docs/design/responses/templates/leaderboard_template.json b/docs/design/responses/templates/leaderboard_template.json new file mode 100644 index 0000000..9d6ea65 --- /dev/null +++ b/docs/design/responses/templates/leaderboard_template.json @@ -0,0 +1,33 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/leaderboards/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "rel": [ + "item", + "collection" + ] + }, + "desc": "Showing X of Y item(s).", + "offset": 0, + "limit": 25, + "size": 1, + "first": null, + "previous": null, + "next": null, + "last": null, + "parameters": { + "uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "languages": [ + "en", + "fr" + ], + "style": "compact", + "last_match": false, + "status": null, + "game": null, + "start": null, + "count": null, + "since": null + }, + "value": [] +} \ No newline at end of file diff --git a/docs/design/responses/templates/matches_compact_template.json b/docs/design/responses/templates/matches_compact_template.json new file mode 100644 index 0000000..3297d4b --- /dev/null +++ b/docs/design/responses/templates/matches_compact_template.json @@ -0,0 +1,325 @@ +{ + "contentVersion": "v1", + "self": { + "href": "https://api.librematch.org/v1/games/matches/3fa85f64-5717-4562-b3fc-2c963f66afa6", + "rel": [ + "item" + ] + }, + "desc": "Showing 1 of 1 match.", + "offset": 0, + "limit": 25, + "size": 1, + "first": null, + "previous": null, + "next": null, + "last": null, + "parameters": { + "uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "languages": [ + "en", + "fr" + ], + "style": "compact", + "last_match": false, + "status": null, + "game": null, + "start": null, + "count": null, + "since": null + }, + "value": [ + { + "match_id": 75984064, + "private": false, + "password_protected": false, + "match_uuid": "03531e31-31fd-5041-9f70-0264e158a40e", + "lobby_name": "[REMATCH] 12345", + "status": "finished", + "started_at": "2022-10-03T15:41:38.000Z", + "finished_at": "2022-10-03T15:50:38.000Z", + "duration": 540, + "settings": { + "map_name": [ + { + "value": "Chaos Pit", + "language": "en" + }, + { + "value": "Puits du Chaos", + "language": "fr" + } + ], + "map_size": [ + { + "value": "Tiny", + "language": "en" + }, + { + "value": "Petit", + "language": "fr" + } + ], + "map_visibility": [ + { + "value": "Normal", + "language": "en" + }, + { + "value": "Normale", + "language": "fr" + } + ], + "resources": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "population": 200, + "game_speed": [ + { + "value": "Normal", + "language": "en" + }, + { + "value": "Normale", + "language": "fr" + } + ], + "starting_age": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "ending_age": [ + { + "value": "Standard", + "language": "en" + }, + { + "value": "Standard", + "language": "fr" + } + ], + "treaty_length": null, + "victory_condition": [ + { + "value": "Conquest", + "language": "en" + }, + { + "value": "Conquête", + "language": "fr" + } + ], + "lock_teams": true, + "team_together": true, + "team_positions": false, + "shared_exploration": false, + "handicap": false, + "lock_speed": true, + "allow_cheats": false, + "turbo_mode": false, + "full_tech_tree": false, + "empire_wars_mode": false, + "sudden_death_mode": false, + "regicide_mode": false, + "record_game": true + }, + "leaderboard": { + "href": "https://api.librematch.org/v1/leaderboards/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "name": "rm_1v1", + "rel": [ + "collection" + ] + }, + "rematch": true, + "server": [ + { + "value": "India", + "language": "en" + }, + { + "value": "Inde", + "language": "fr" + } + ], + "rating_average": 2022, + "patch_version": "", + "related/links": [ + { + "Endpoints_need_support (TODO)": "same civ matchups, same opponents, same map" + } + ], + "match_size": 2, + "match_slots_used": 2, + "team_matchups": [ + [ + { + "self": { + "profile": { + "href": "https://api.librematch.org/v1/profiles/196240", + "rel": [ + "item" + ] + }, + "teams": [ + { + "href": "https://api.librematch.org/v1/teams/4Y89HG5TKRF7BGMMSQMRPZ6S1B", + "rel": [ + "item" + ] + } + ], + "verified": true, + "first_name": "", + "last_name": "", + "alias": "TheViper", + "country_code": "no", + "profile_id": 196240, + "steam_id": "", + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "stats": { + "rank": 4, + "rating_max": 2600, + "rating": 2400, + "win_rate": 67.8, + "streak": 2, + "games_count": 264, + "wins_count": 174, + "losses_count": 90, + "drops_count": 2, + "rank_level": null, + "rating_history": null, + "civ_history": null, + "map_history": null + } + }, + "match_slot": 1, + "civilization": [ + { + "value": "Chinese", + "language": "en" + }, + { + "value": "Chinois", + "language": "fr" + } + ], + "colour": [ + { + "value": "Green", + "language": "en" + }, + { + "value": "Vert", + "language": "fr" + } + ], + "result_win": true + } + ], + [ + { + "self": { + "profile": { + "href": "https://api.librematch.org/v1/profiles/1141567", + "rel": [ + "item" + ] + }, + "teams": null, + "verified": true, + "first_name": "", + "last_name": "", + "alias": "MrYo", + "country_code": "cn", + "profile_id": 1141567, + "steam_id": "", + "avatars": [ + { + "small": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg" + } + }, + { + "medium": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg" + } + }, + { + "full": { + "href": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg" + } + } + ], + "stats": { + "rank": 4, + "rating_max": 2600, + "rating": 2400, + "win_rate": 67.8, + "streak": 2, + "games_count": 264, + "wins_count": 174, + "losses_count": 90, + "drops_count": 2, + "rank_level": null, + "rating_history": null, + "civ_history": null, + "map_history": null + } + }, + "match_slot": 2, + "civilization": [ + { + "value": "Byzantines", + "language": "en" + }, + { + "value": "Byzantines", + "language": "fr" + } + ], + "colour": [ + { + "value": "Yellow", + "language": "en" + }, + { + "value": "Jaune", + "language": "fr" + } + ], + "result_win": false + } + ] + ] + } + ] +} \ No newline at end of file diff --git a/openapi.yaml b/openapi.yaml index bbfabef..b413c7c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -4,1474 +4,2600 @@ info: email: info@librematch.org name: Libre:Match Team url: https://librematch.org - description: "stable, reliable and feature-rich API for match information, leaderboards,\ + description: + "stable, reliable and feature-rich API for match information, leaderboards,\ \ and tournament organisation for the Age of Empires multiplayer community" license: name: GNU AGPLv3 url: https://www.gnu.org/licenses/agpl.txt - x-last-modified: 1663947772699 + x-last-modified: 1665308784 title: Libre:Match API - version: 1.0.0 + version: 1.0.0-DRAFT x-logo: url: "" + x-api-id: 01GGD7CFHGZ5TXXAMNKWF9M1B9 + x-audience: external-public servers: -- description: "" - url: https://api.librematch.org/v1 - x-last-modified: 1663947810574 + - description: Libre:Match Production Server v1 + url: https://api.librematch.org/v1 + x-last-modified: 1665308784 + - description: Libre:Match Development Server v1 + url: https://dev.librematch.org/v1 + x-last-modified: 1665308784 security: -- BasicAuth: [] -- X-Api-Key: [] + - BasicAuth: [] + - X-Api-Key: [] + - HttpAuth: [] paths: - /games: + /profiles/search: + description: Endpoint for Profile Search get: - operationId: get_game_identifier_collection + summary: Search for profiles by Steam ID and/or alias + description: | + # Profile Search + + Search for a profile by + - **SteamID64** + - **alias** + + ## Response + This returns a single profile when a SteamID64 is provided. + It will return a list of profiles when you search for an alias. + + When used with the **exact** parameter it will not return a result + if there isn't an exact match within our database for the provided + **alias**. + operationId: get_profile_information_from_search + parameters: + - $ref: "#/components/parameters/exact" + - $ref: "#/components/parameters/search_alias" + - $ref: "#/components/parameters/search_steam_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve a list of all game identifiers for games using Relic Link - API - tags: [] - summary: Endpoint for game-specific data - x-last-modified: 1663947918891 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Collections + - Search + /dumps: + description: Endpoint for database dumps + get: + summary: Retrieve a list of available database dumps + description: | + # Database Dumps + + We offer database dumps for the purpose of statistical analysis + which would otherwise cause a high load on our API. + + ## Filters + You can filter for dumps that were uploaded either + + - since a certain **Unix timestamp**/**Datetime string** + - between two **Unix timestamps**/**Datetime strings** + - the **type of information** that are present + + ## Response + This returns **paginated** results. + operationId: get_general_collection_for_dumps + parameters: + - $ref: "#/components/parameters/since_timestamp" + - $ref: "#/components/parameters/since_datetime" + - $ref: "#/components/parameters/between_timestamps" + - $ref: "#/components/parameters/between_datetimes" + - $ref: "#/components/parameters/dump_type_array" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/offset" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Statistics + - Database + - Collections + # servers: + # - description: TODO? Override base path for all operations with the /dumps path + # url: https://db.librematch.org + /dumps/{dump_id}: + get: + summary: Retrieve details about a database dump + description: | + # Database dump + + A single database dump item and details about it. + + ## Response + This contains information about a database dump, such as: + - its **URL** + - **size** + - **uploaded_date**, + - **amount of contained items** + - their **type**. + operationId: get_database_dump_item + parameters: + - $ref: "#/components/parameters/dump_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Statistics + - Database + - Items + # servers: + # - description: TODO? Override base path for all operations with the /dumps path + # url: https://db.librematch.org + /games: + summary: Endpoint for game-specific information + get: + summary: Retrieve a list of all supported games + description: | + # Games + + TODO: Parameters + + ## Response + TODO: What is being returned here? + Possible: + - general statistical data (overall unique player amount) + - how many players from which platform (steam, ms store) + - activity of players (last 1/7/14/30 days) + operationId: get_general_collection_for_games + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Collections + - Games + x-last-modified: 1665308784 /games/{game_id}/definitions: + summary: "game-specific definitions, e.g. map names, civilisation names, translations" get: operationId: get_definition_collection_for_game parameters: - - deprecated: false - description: The unique identifier (ULID) we use for games that use the Relic - Link API - explode: false - in: path - name: game_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949717971 + - $ref: "#/components/parameters/language" + - $ref: "#/components/parameters/game_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve all available definitions for a specific game using Relic - Link API - tags: [] - summary: "game-specific definitions, e.g. map names, civilisation names, translations" - x-last-modified: 1663948104836 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + summary: Retrieve all available definitions for a specific game + tags: + - Collections + - Information + - Games + x-last-modified: 1665308784 /games/{game_id}/info: get: operationId: get_info_collection_for_game parameters: - - deprecated: false - description: The unique identifier (ULID) we use for games that use the Relic - Link API - explode: false - in: path - name: game_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949717971 + - $ref: "#/components/parameters/game_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve all available information for a specific game using Relic - Link API - tags: [] - summary: "information about server maintenance times, DLC stuff, patch releases,\ + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + summary: Retrieve all available information for a specific game + tags: + - Collections + - Information + - Games + summary: + "information about server maintenance times, DLC stuff, patch releases,\ \ etc." - x-last-modified: 1663948169247 + x-last-modified: 1665308784 /games/{game_id}/matches: get: + summary: Retrieve all matches for a specific game + description: Test Use case (TODO Markdown here) implement ongoing matches over all leaderboards, array of arrays (e.g. as in teams) with a leaderboard in each array operationId: get_match_collection_for_game parameters: - - deprecated: false - description: The unique identifier (ULID) we use for games that use the Relic - Link API - explode: false - in: path - name: game_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949717971 - responses: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/status_array" + - $ref: "#/components/parameters/between_timestamps" + - $ref: "#/components/parameters/between_datetimes" + - $ref: "#/components/parameters/started_after_datetime" + - $ref: "#/components/parameters/finished_after_datetime" + - $ref: "#/components/parameters/started_after_timestamp" + - $ref: "#/components/parameters/finished_after_timestamp" + - $ref: "#/components/parameters/game_id" + - $ref: "#/components/parameters/language" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Collections + - Matches + - Games + summary: + "Match data spanning over the complete game (all leaderboards, basically\ + \ a log" + x-last-modified: 1665308784 + /games/{game_id}/stats: + get: + summary: Retrieve all stats for a specific game + operationId: get_stat_collection_for_game + parameters: + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/status_array" + - $ref: "#/components/parameters/between_timestamps" + - $ref: "#/components/parameters/between_datetimes" + - $ref: "#/components/parameters/started_after_datetime" + - $ref: "#/components/parameters/finished_after_datetime" + - $ref: "#/components/parameters/started_after_timestamp" + - $ref: "#/components/parameters/finished_after_timestamp" + - $ref: "#/components/parameters/game_id" + - $ref: "#/components/parameters/language" + responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve all matches for a specific game using Relic Link API - tags: [] - summary: "match data spanning over the complete game (all leaderboards, basically\ + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Not yet implemented + summary: + "Match data spanning over the complete game (all leaderboards, basically\ \ a log" - x-last-modified: 1663948210036 + x-last-modified: 1665308784 /tournaments: delete: description: "" operationId: remove_all_tournaments responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Remove all tournaments + tags: + - Not yet implemented get: - operationId: get_tournament_identifier_collection + operationId: get_general_collection_for_tournaments responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Retrieve all available tournaments for all games available on the Relic - Link platform - tags: [] + $ref: "#/components/responses/501" + summary: Retrieve all available tournaments for all games + tags: + - Not yet implemented patch: description: "" operationId: partial_update_tournaments responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Partial update of tournaments + tags: + - Not yet implemented post: description: "" operationId: create_new_tournament responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Create a new tournament for a game available on the Relic Link platform + $ref: "#/components/responses/501" + summary: Create a new tournament for a game + tags: + - Not yet implemented put: description: "" operationId: bulk_update_all_tournaments responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Bulk update of tournaments + tags: + - Not yet implemented summary: Endpoint for tournament information - x-last-modified: 1663948422917 + x-last-modified: 1665308784 /profiles: get: - operationId: get_profile_collection + operationId: get_general_collection_for_profiles responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve all available profiles from the Relic Link API - tags: [] + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + summary: Retrieve all available profiles + tags: + - Collections + - Profiles summary: Endpoint for player profiles on the Relic Link platform - x-last-modified: 1663948530301 + x-last-modified: 1665308784 /profiles/{relic_link_id}: get: operationId: get_details_for_profile parameters: - - deprecated: false - description: The unique identifier used by the Relic Link API for a player - on their platform - explode: false - in: path - name: relic_link_id - required: true - schema: - type: integer - style: simple - x-last-modified: 1663949613648 + - $ref: "#/components/parameters/relic_link_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve the details for a specific profile from the Relic Link API - tags: [] + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + summary: Retrieve the details for a specific profile + description: "current wins/losses on leaderboards, rankings, rating history on leaderboards for a month, 5 (or X) last_matches on each leaderboard with datetime " + tags: + - Items + - Profiles summary: Profile information for a Relic Link player_ID - x-last-modified: 1663948567394 + x-last-modified: 1665308784 /profiles/{relic_link_id}/matches: get: operationId: get_match_collection_for_profile parameters: - - deprecated: false - description: The unique identifier used by the Relic Link API for a player - on their platform - explode: false - in: path - name: relic_link_id - required: true - schema: - type: integer - style: simple - x-last-modified: 1663949613648 - responses: + - $ref: "#/components/parameters/relic_link_id" + - $ref: "#/components/parameters/game_ids" + - $ref: "#/components/parameters/languages" + - $ref: "#/components/parameters/last_match" + - $ref: "#/components/parameters/style" + - $ref: "#/components/parameters/status_array" + - $ref: "#/components/parameters/between_timestamps" + - $ref: "#/components/parameters/between_datetimes" + - $ref: "#/components/parameters/started_after_datetime" + - $ref: "#/components/parameters/finished_after_datetime" + - $ref: "#/components/parameters/started_after_timestamp" + - $ref: "#/components/parameters/finished_after_timestamp" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/offset" + responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve all matches for a specific profile from the Relic Link API - tags: [] + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + summary: Retrieve all matches for a specific profile + tags: + - Collections + - Profiles + - Matches summary: match data for a certain Relic Link profile - x-last-modified: 1663948607956 + x-last-modified: 1665308784 + /games/matches/{match_uuid}: + get: + operationId: get_details_for_match + parameters: + - $ref: "#/components/parameters/match_uuid" + # - $ref: "#/components/parameters/match_id" # TODO + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + summary: Retrieve details of a match + tags: + - Items + - Matches + - Games + summary: Information about a single match + x-last-modified: 1665308784 + /profiles/{relic_link_id}/ledger: + get: + operationId: get_ledger_collection_for_profile + parameters: + - $ref: "#/components/parameters/game_id" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/leaderboard_id" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/between_timestamps" + - $ref: "#/components/parameters/between_datetimes" + - $ref: "#/components/parameters/started_after_datetime" + - $ref: "#/components/parameters/finished_after_datetime" + - $ref: "#/components/parameters/started_after_timestamp" + - $ref: "#/components/parameters/finished_after_timestamp" + - $ref: "#/components/parameters/relic_link_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + summary: Retrieve the rating ledger for a specific profile + tags: + - Collections + - Profiles + - Ratings + summary: Rating ledger a certain Relic Link profile + x-last-modified: 1665308784 /users: delete: description: "" operationId: remove_all_users responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" summary: Remove all users from our platform + tags: + - Not yet implemented get: description: Authenticated Endpoint for Administrators or Libre:Match - operationId: get_user_collection + operationId: get_general_collection_for_users responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" summary: Retrieve all users of our platform - tags: [] + tags: + - Not yet implemented patch: description: "" operationId: partial_update_all_users responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" summary: Partially update details for all user profiles + tags: + - Not yet implemented post: description: "" operationId: create_new_user responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "201": description: Created - x-last-modified: 1665072508175 - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" summary: Create a new user for our platform + tags: + - Not yet implemented put: description: "" operationId: bulk_update_all_users responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" summary: Bulk update of all users of our platform + tags: + - Not yet implemented summary: Endpoint for users of our API - x-last-modified: 1663948638250 + x-last-modified: 1665308784 /users/{user_id}: delete: description: "" operationId: remove_user parameters: - - deprecated: false - description: The unique identifier (ULID) we use for users of our API - explode: false - in: path - name: user_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665078217885 + - $ref: "#/components/parameters/user_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" summary: Remove user from our platform if it exists + tags: + - Not yet implemented get: operationId: get_details_for_user parameters: - - deprecated: false - description: The unique identifier (ULID) we use for users of our API - explode: false - in: path - name: user_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665078217885 + - $ref: "#/components/parameters/user_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" summary: Retrieve details for a specific user profile on our platform - tags: [] + tags: + - Not yet implemented patch: description: "" operationId: partial_update_user parameters: - - deprecated: false - description: The unique identifier (ULID) we use for users of our API - explode: false - in: path - name: user_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665078217885 + - $ref: "#/components/parameters/user_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" summary: Update details for a specific user profile on our platform if it exists + tags: + - Not yet implemented put: description: "" operationId: bulk_update_all_user_details parameters: - - deprecated: false - description: The unique identifier (ULID) we use for users of our API - explode: false - in: path - name: user_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665078217885 + - $ref: "#/components/parameters/user_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Bulk update details for a specific user profile on our platform if + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + summary: + Bulk update details for a specific user profile on our platform if it exists + tags: + - Not yet implemented summary: user profile for an API user - x-last-modified: 1663948686307 + x-last-modified: 1665308784 /users/login: post: operationId: user_login responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 - tags: [] + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + tags: + - Not yet implemented summary: Login for users of our API - x-last-modified: 1663948709646 + x-last-modified: 1665308784 /users/logout: get: operationId: user_logout responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - tags: [] + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Not yet implemented summary: Logout for users of our API - x-last-modified: 1663948774846 + x-last-modified: 1665308784 /users/register: post: operationId: user_register responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - tags: [] + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + tags: + - Not yet implemented summary: Registering as a new User to our API - x-last-modified: 1663948797787 + x-last-modified: 1665308784 /users/validate: - description: "Validate API tokens, can give information about how long a token\ + summary: Validation for a user account and api tokens used for our API + description: + "Validate API tokens, can give information about how long a token\ \ is still valid and help automating updating a token" get: operationId: get_user_validation_details responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - tags: [] + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Authentication post: operationId: create_new_user_validation responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - tags: [] - summary: Validation for a user account and api tokens used for our API - x-last-modified: 1663948876606 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + tags: + - Not yet implemented + x-last-modified: 1665308784 /application: + summary: + "General information and data about the Libre:Match API, e.g. API updates,\ + \ possible upcoming maintenance and other news" get: - operationId: get_information_collection_for_application - responses: + summary: Retrieve a list of available application information + description: | + # ⚔️ Libre:Match + + ## 🙋‍♀️ Introduction + + LibreMatch is a project to create a **stable, reliable and feature-rich API** for match + information, leaderboards, and tournament organisation for the Age of + Empires multiplayer platform Relic Link. + + ## 📞 Contact + It is done **by the community for the community** - so feel free to join us on our [Discord](https://discord.gg/MvuusBxtuB) if you have any suggestions, feature requests, found a bug, or if you really just want to talk to like-minded people. + + ## 👩‍💻 News + We are currently working on desgning the API (synchronous), if you want to follow progress, you can do that [here](https://github.com/librematch/librematch-backend/pull/1) or in the forums on our [Discord](https://discord.gg/MvuusBxtuB). + + # Response + TODO: Return information such as maintenance intervals, next maintenance, + API updates, news, contacts to us, small introductory sentence, disclaimer that + we are not affiliated with Microsoft(!!!), link to api documentation, blog, etc. + operationId: get_general_collection_for_application + responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve a list of available application information - tags: [] - summary: "General information and data about Libre:Match app, e.g. API updates,\ - \ possible upcoming maintenance and other news/stuff" - x-last-modified: 1663948904071 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Not yet implemented + x-last-modified: 1665308784 /application/statistics: + summary: + "Statistics of Libre:Match itself, e.g. usage statistics, collection rate, overall\ + \ amount of users, etc." get: + summary: Retrieve a list of application stats + description: | + # ⚔️ Libre:Match Statistics + + TODO + + ## Response + - usage statistics + - collection rate + - overall amount of API users + - timings + - uptime + - amount of data collected + - etc. operationId: get_stat_collection_for_application responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve a list of only application statistics - tags: [] - summary: "Statistics of Libre:Match, e.g. usage statistics, collection rate, overall\ - \ amount of users, etc." - x-last-modified: 1663948946628 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Not yet implemented + x-last-modified: 1665308784 + /application/components: + summary: "Libre:Match managed components" + delete: + summary: Remove all components + description: | + # Removing all managed components + This doesn't remove components itself, but rather their settings. + So when components run, they won't be able to access their settings. + + ## Response + This operation responds with the status of the removal. + operationId: remove_all_components + # parameters: + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + get: + summary: Retrieve all components + description: | + # Retrieving all managed components + This endpoints' purpose is to give **Libre:Match administrators** a convenient + opportunity to change settings of certain components, while these component + are running. + + ## Response + This operation returns all managed components with their identifiers and some + general information about and status for each component. + operationId: get_general_collection_for_components + # parameters: + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + patch: + summary: Partially update all components + description: | + # Partially update all managed components + Here we can change certain settings that are common to all components. + + ## Request body + The request body specifies the set of changes to apply to the resource. + + ## Response + This contains the status of the operation, so if the changes were applied + successfully. + operationId: partial_update_all_components + # parameters: + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + post: + summary: Create a new component + description: | + # Creating a new component + TODO + + ## Request body + The body of the request message provides the details of the new resource. + + ## Response + TODO + operationId: create_new_component + # parameters: + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + put: + summary: Bulk update of all components + description: | + # Bulk updating components + TODO + + ## Request body + The body of the request message specifies the resource to be created or updated. + + ## Response + TODO + operationId: bulk_update_all_components + parameters: + - $ref: "#/components/parameters/component_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + x-last-modified: 1665308784 + /application/components/{component_id}: + summary: A Libre:Match component + delete: + summary: Remove all settings for a specific component of Libre:Match + description: TODO + operationId: remove_all_settings_for_component + parameters: + - $ref: "#/components/parameters/component_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + get: + summary: Retrieve all settings for a specific component of Libre:Match + description: TODO + operationId: get_setting_collection_for_component + parameters: + - $ref: "#/components/parameters/component_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + patch: + summary: Update a specific setting for a specific component of Libre:Match + description: TODO + operationId: partial_update_all_settings_for_component + parameters: + - $ref: "#/components/parameters/component_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + post: + summary: Create a setting for a certain Libre:Match component + description: | + THIS SHOULD ERROR! + operationId: create_new_setting_for_component + parameters: + - $ref: "#/components/parameters/component_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + put: + summary: Bulk update of settings for a specific component of Libre:Match + description: TODO + operationId: bulk_update_all_settings_for_component + parameters: + - $ref: "#/components/parameters/component_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + tags: + - Not yet implemented + x-last-modified: 1665308784 /application/status: + summary: Health check of our API get: + summary: Retrieve application status information + description: | + # Application Status + This shows the status of various internal components, e.g. Proxy, Collector and Cache, + and application specific metrics like throughput of requests, imported matches, + updated profiles, and others. operationId: get_status_collection_for_application responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "503": - description: Service Unavailable - x-last-modified: 1665057340292 - summary: Retrieve only application status - tags: [] - summary: Status updates for health checks of our API - x-last-modified: 1663948961011 + $ref: "#/components/responses/503" + tags: + - Administration + x-last-modified: 1665308784 /games/{game_id}: + summary: "Game-related Information" get: + summary: Retrieve details for a specific game + description: | + # Game related information + + TODO + + ## Response + - Name of game + - release date + - steam and microsoft store links + - links to community pages (liquipedia, aoezone, aoe reddit, community pages) + - operationId: get_details_for_game parameters: - - deprecated: false - description: The unique identifier (ULID) we use for games that use the Relic - Link API - explode: false - in: path - name: game_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949717971 + - $ref: "#/components/parameters/game_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve details for a game with a specific identifier using Relic - Link API - tags: [] - summary: "game-specific definitions, e.g. map names, civilisation names, translations" - x-last-modified: 1663950376911 - /tournaments/{game_id}: - get: - operationId: get_tournament_details_for_game - parameters: - - deprecated: false - description: The unique identifier (ULID) we use for games that use the Relic - Link API - explode: false - in: path - name: game_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949717971 - responses: - "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Retrieve all available tournaments for a specific game available on - the Relic Link platform - tags: [] - summary: game-specific tournaments - x-last-modified: 1663952888032 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Games + - Items + x-last-modified: 1665308784 /games/{game_id}/leaderboards: + summary: Collection of leaderboard data spanning over the complete game get: + summary: Retrieve identifiers of the leaderboards for a specific game + description: | + # Leaderboard identifiers + + ## Parameters + ## Response operationId: get_leaderboard_collection_for_game parameters: - - deprecated: false - description: The unique identifier (ULID) we use for games that use the Relic - Link API - explode: false - in: path - name: game_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949717971 + - $ref: "#/components/parameters/game_id" responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve all leaderboards for a specific game using Relic Link API - tags: [] - summary: Collection of leaderboard data spanning over the complete game - x-last-modified: 1665053521883 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Games + - Leaderboards + - Collections + x-last-modified: 1665308784 /leaderboards/{leaderboard_id}: get: + description: Returns the profiles on the leaderboard with thei current ranking, rating, wins, losses, winrate, rel-link->last-match (more infos) and UNIXTIME + ISO-Format operationId: get_details_for_leaderboard parameters: - - deprecated: false - description: The unique identifier (ULID) we use for leaderboards of the Relic - Link API - explode: false - in: path - name: leaderboard_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949692803 - responses: + - $ref: "#/components/parameters/profile_id" + - $ref: "#/components/parameters/search_alias" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/leaderboard_id" + responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" summary: Retrieve details for a specific leaderboard - tags: [] + tags: + - Items + - Leaderboards + - Ratings summary: game-specific leaderboards on the Relic Link platform - x-last-modified: 1665053547091 + x-last-modified: 1665308784 /leaderboards/{leaderboard_id}/stats: get: operationId: get_stat_collection_for_leaderboard parameters: - - deprecated: false - description: The unique identifier (ULID) we use for leaderboards of the Relic - Link API - explode: false - in: path - name: leaderboard_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949692803 + - $ref: "#/components/parameters/leaderboard_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + x-last-modified: 1665308784 + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Retrieve all stats on a specific leaderboard for a certain game hosted - on the Relic Link API - tags: [] + $ref: "#/components/responses/501" + summary: Retrieve all stats on a specific leaderboard for a certain game + tags: + - Not yet implemented summary: Collection of stats for a specific leaderboard - x-last-modified: 1665053642553 + x-last-modified: 1665308784 /leaderboards/{leaderboard_id}/matches: get: + description: Logfile for matches, ordered descending, first is newest, use case maybe ongoing matches per leaderboard or filter from games/X/matches operationId: get_match_collection_for_leaderboard parameters: - - deprecated: false - description: The unique identifier (ULID) we use for leaderboards of the Relic - Link API - explode: false - in: path - name: leaderboard_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949692803 - responses: + - $ref: "#/components/parameters/status_array" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/between_timestamps" + - $ref: "#/components/parameters/between_datetimes" + - $ref: "#/components/parameters/started_after_datetime" + - $ref: "#/components/parameters/finished_after_datetime" + - $ref: "#/components/parameters/started_after_timestamp" + - $ref: "#/components/parameters/finished_after_timestamp" + - $ref: "#/components/parameters/leaderboard_id" + responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve all matches on a specific leaderboard for a certain game hosted - on the Relic Link API - tags: [] + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + summary: Retrieve all matches on a specific leaderboard for a certain game + tags: + - Matches + - Collections + - Leaderboards summary: Collection of match data for a specific leaderboard - x-last-modified: 1665053682780 + x-last-modified: 1665308784 /leaderboards: get: - operationId: get_leaderboard_collection - responses: + summary: Retrieve identifiers for all leaderboards spanning over all games + description: | + # Leaderboards + + ## Response + Returns all leaderboards for all games, more thought of as a starting point to figure out which leaderboard is worth to query + operationId: get_general_collection_for_leaderboards + # filter for games TODO + responses: + default: + $ref: "#/components/responses/401" "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "401": - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 - summary: Retrieve all leaderboards hosted on the Relic Link API - tags: [] + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + tags: + - Matches + - Collections + - Leaderboards + - Ratings summary: Collection of all leaderboard data on the Relic Link platform - x-last-modified: 1665053727563 + x-last-modified: 1665308784 /tournaments/{tournament_id}: delete: description: "" operationId: remove_tournament_details parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Remove a tournament for a specific game available on the Relic Link + $ref: "#/components/responses/501" + summary: + Remove a tournament for a specific game available on the Relic Link platform + tags: + - Not yet implemented get: operationId: get_details_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Retrieve details for a tournament for a specific game available on + $ref: "#/components/responses/501" + summary: + Retrieve details for a tournament for a specific game available on the Relic Link platform - tags: [] + tags: + - Not yet implemented patch: description: "" operationId: partial_update_tournament_details parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Partially update a tournament for a specific game available on the + $ref: "#/components/responses/501" + summary: + Partially update a tournament for a specific game available on the Relic Link platform + tags: + - Not yet implemented put: description: "" operationId: update_tournament_details parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Update details for a tournament for a specific game available on the - Relic Link platform + $ref: "#/components/responses/501" + summary: Update details for a tournament for a specific game + tags: + - Not yet implemented summary: game-specific tournaments - x-last-modified: 1665054574222 + x-last-modified: 1665308784 /users/{user_id}/stats: delete: description: "" operationId: remove_all_user_stats parameters: - - deprecated: false - description: The unique identifier (ULID) we use for users of our API - explode: false - in: path - name: user_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665078217885 + - $ref: "#/components/parameters/user_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Remove all stats for a specific user profile on our platform + tags: + - Not yet implemented get: operationId: get_stat_collection_for_user parameters: - - deprecated: false - description: The unique identifier (ULID) we use for users of our API - explode: false - in: path - name: user_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665078217885 + - $ref: "#/components/parameters/user_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Retrieve all stats for a specific user profile on our platform - tags: [] + tags: + - Not yet implemented patch: description: "" operationId: partial_update_user_stats parameters: - - deprecated: false - description: The unique identifier (ULID) we use for users of our API - explode: false - in: path - name: user_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665078217885 + - $ref: "#/components/parameters/user_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Partially update stats for a specific user profile on our platform + tags: + - Not yet implemented post: description: "" operationId: create_new_user_stats parameters: - - deprecated: false - description: The unique identifier (ULID) we use for users of our API - explode: false - in: path - name: user_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665078217885 + - $ref: "#/components/parameters/user_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "415": + $ref: "#/components/responses/415" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Create a new stat for a specific user profile on our platform + tags: + - Not yet implemented put: description: "" operationId: bulk_update_all_user_stats parameters: - - deprecated: false - description: The unique identifier (ULID) we use for users of our API - explode: false - in: path - name: user_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665078217885 + - $ref: "#/components/parameters/user_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Bulk update of stats for a specific user profile on our platform + tags: + - Not yet implemented summary: user profile for an API user - x-last-modified: 1665054653031 + x-last-modified: 1665308784 /tournaments/{tournament_id}/info: get: operationId: get_info_collection_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Retrieve all information for a specific tournament for a specific game - available on the Relic Link platform - tags: [] + tags: + - Not yet implemented + summary: game-specific tournaments + x-last-modified: 1665308784 + /tournaments/{tournament_id}/stats: + get: + operationId: get_stat_collection_for_tournament + parameters: + - $ref: "#/components/parameters/tournament_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + summary: Retrieve all statistics for a specific tournament for a specific game + tags: + - Not yet implemented + summary: game-specific tournaments + x-last-modified: 1665308784 + /tournaments/{tournament_id}/matches: + get: + operationId: get_match_collection_for_tournament + parameters: + - $ref: "#/components/parameters/status" + - $ref: "#/components/parameters/game_id" + - $ref: "#/components/parameters/languages" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/between_timestamps" + - $ref: "#/components/parameters/between_datetimes" + - $ref: "#/components/parameters/started_after_datetime" + - $ref: "#/components/parameters/finished_after_datetime" + - $ref: "#/components/parameters/started_after_timestamp" + - $ref: "#/components/parameters/finished_after_timestamp" + - $ref: "#/components/parameters/tournament_id" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" + "501": + $ref: "#/components/responses/501" + summary: Retrieve all match data for a specific tournament for a specific game + tags: + - Not yet implemented summary: game-specific tournaments - x-last-modified: 1665054963238 + x-last-modified: 1665308784 /tournaments/{tournament_id}/brackets: delete: description: "" operationId: remove_all_brackets_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Remove all brackets for a specific tournament for a specific game available - on the Relic Link platform + $ref: "#/components/responses/501" + summary: Remove all brackets for a specific tournament for a specific game + tags: + - Not yet implemented get: operationId: get_bracket_collection_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Retrieve all brackets for a specific tournament for a specific game - available on the Relic Link platform - tags: [] + tags: + - Not yet implemented patch: description: "" operationId: partial_update_bracket_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Partial update all brackets for a specific tournament for a specific - game available on the Relic Link platform + $ref: "#/components/responses/501" + summary: + Partial update all brackets for a specific tournament for a specific + game + tags: + - Not yet implemented post: description: "" operationId: create_new_bracket_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Create a new bracket for a specific tournament for a specific game - available on the Relic Link platform + tags: + - Not yet implemented put: description: "" operationId: bulk_update_all_brackets_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Bulk update all brackets for a specific tournament for a specific game - available on the Relic Link platform + tags: + - Not yet implemented summary: game-specific tournaments - x-last-modified: 1665054981775 + x-last-modified: 1665308784 /tournaments/{tournament_id}/admins: delete: description: "" operationId: remove_all_admins_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Remove all admins for a specific tournament for a specific game available - on the Relic Link platform + $ref: "#/components/responses/501" + summary: Remove all admins for a specific tournament for a specific game + tags: + - Not yet implemented get: operationId: get_admin_collection_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Retrieve all admins for a specific tournament for a specific game available + $ref: "#/components/responses/501" + summary: + Retrieve all admins for a specific tournament for a specific game available on the Relic Link platform - tags: [] + tags: + - Not yet implemented patch: description: "" operationId: partial_update_all_admins_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Update details of admins for a specific tournament for a specific game - available on the Relic Link platform + tags: + - Not yet implemented post: description: "" operationId: create_new_admin_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Create a new admin for a specific tournament for a specific game available + $ref: "#/components/responses/501" + summary: + Create a new admin for a specific tournament for a specific game available on the Relic Link platform + tags: + - Not yet implemented put: description: "" operationId: bulk_update_all_admins_for_tournament parameters: - - deprecated: false - description: The unique identifier (ULID) we use for tournaments - explode: false - in: path - name: tournament_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1663949674724 + - $ref: "#/components/parameters/tournament_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Bulk update of admins for a specific tournament for a specific game - available on the Relic Link platform + tags: + - Not yet implemented summary: Endpoint for tournament admins - x-last-modified: 1665055638796 + x-last-modified: 1665308784 /teams: delete: description: "" operationId: remove_all_teams responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Remove all teams - tags: [] + tags: + - Not yet implemented get: - operationId: get_team_collection + operationId: get_general_collection_for_teams responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Retrieve all available teams - tags: [] + tags: + - Not yet implemented patch: description: "" operationId: partial_update_all_teams responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Partial update of all teams - tags: [] + tags: + - Not yet implemented post: description: "" operationId: create_new_team responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Create a new team - tags: [] + tags: + - Not yet implemented put: description: "" operationId: bulk_update_all_teams responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Bulk update of teams - tags: [] + tags: + - Not yet implemented summary: Endpoint for team information - x-last-modified: 1665138931985 + x-last-modified: 1665308784 /profiles/{relic_link_id}/settings: delete: description: "" operationId: remove_all_settings_for_profile parameters: - - deprecated: false - description: The unique identifier used by the Relic Link API for a player - on their platform - explode: false - in: path - name: relic_link_id - required: true - schema: - type: integer - style: simple - x-last-modified: 1663949613648 + - $ref: "#/components/parameters/relic_link_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Remove all settings for a specific profile from the Relic Link API - tags: [] + $ref: "#/components/responses/501" + summary: Remove all settings for a specific profile + tags: + - Not yet implemented get: operationId: get_setting_collection_for_profile parameters: - - deprecated: false - description: The unique identifier used by the Relic Link API for a player - on their platform - explode: false - in: path - name: relic_link_id - required: true - schema: - type: integer - style: simple - x-last-modified: 1663949613648 + - $ref: "#/components/parameters/relic_link_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Retrieve all settings for a specific profile from the Relic Link API - tags: [] + $ref: "#/components/responses/501" + summary: Retrieve all settings for a specific profile + tags: + - Not yet implemented patch: description: "" operationId: partial_update_all_settings_for_profile parameters: - - deprecated: false - description: The unique identifier used by the Relic Link API for a player - on their platform - explode: false - in: path - name: relic_link_id - required: true - schema: - type: integer - style: simple - x-last-modified: 1663949613648 + - $ref: "#/components/parameters/relic_link_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Update a specific setting for a specific profile from the Relic Link + $ref: "#/components/responses/501" + summary: + Update a specific setting for a specific profile from the Relic Link API - tags: [] + tags: + - Not yet implemented post: description: "" operationId: create_new_setting_for_profile parameters: - - deprecated: false - description: The unique identifier used by the Relic Link API for a player - on their platform - explode: false - in: path - name: relic_link_id - required: true - schema: - type: integer - style: simple - x-last-modified: 1663949613648 + - $ref: "#/components/parameters/relic_link_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Create a new setting for a specific profile from the Relic Link API - tags: [] + tags: + - Not yet implemented put: description: "" operationId: bulk_update_all_settings_for_profile parameters: - - deprecated: false - description: The unique identifier used by the Relic Link API for a player - on their platform - explode: false - in: path - name: relic_link_id - required: true - schema: - type: integer - style: simple - x-last-modified: 1663949613648 + - $ref: "#/components/parameters/relic_link_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "415": + $ref: "#/components/responses/415" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Bulk update of settings for a specific profile from the Relic Link + $ref: "#/components/responses/501" + summary: + Bulk update of settings for a specific profile from the Relic Link API - tags: [] + tags: + - Not yet implemented summary: Collection of settings specifically for a certain Relic Link profile - x-last-modified: 1665138974395 + x-last-modified: 1665308784 /profiles/{relic_link_id}/stats: get: operationId: get_stat_collection_for_profile parameters: - - deprecated: false - description: The unique identifier used by the Relic Link API for a player - on their platform - explode: false - in: path - name: relic_link_id - required: true - schema: - type: integer - style: simple - x-last-modified: 1663949613648 + - $ref: "#/components/parameters/relic_link_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 - summary: Retrieve all stats for a specific profile from the Relic Link API - tags: [] + $ref: "#/components/responses/501" + summary: Retrieve all stats for a specific profile + tags: + - Not yet implemented summary: Collection of statistics specifically for a certain Relic Link profile - x-last-modified: 1665138997585 + x-last-modified: 1665308784 /teams/{team_id}: get: operationId: get_details_for_team parameters: - - deprecated: false - description: The unique identifier (ULID) we use for teams that play on games - using the Relic Link API - explode: false - in: path - name: game_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665069480649 + - $ref: "#/components/parameters/team_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Retrieve details of a team - tags: [] + tags: + - Not yet implemented summary: Team information - x-last-modified: 1665139023265 + x-last-modified: 1665308784 /teams/{team_id}/matches: get: operationId: get_match_collection_for_team parameters: - - deprecated: false - description: The unique identifier (ULID) we use for teams that play on games - using the Relic Link API - explode: false - in: path - name: game_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665069480649 - responses: + - $ref: "#/components/parameters/team_id" + - $ref: "#/components/parameters/game_ids" + - $ref: "#/components/parameters/languages" + - $ref: "#/components/parameters/last_match" + - $ref: "#/components/parameters/style" + - $ref: "#/components/parameters/status_array" + - $ref: "#/components/parameters/between_timestamps" + - $ref: "#/components/parameters/between_datetimes" + - $ref: "#/components/parameters/started_after_datetime" + - $ref: "#/components/parameters/finished_after_datetime" + - $ref: "#/components/parameters/started_after_timestamp" + - $ref: "#/components/parameters/finished_after_timestamp" + - $ref: "#/components/parameters/limit" + - $ref: "#/components/parameters/offset" + - $ref: "#/components/parameters/relic_link_ids" + responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Retrieve a list of matches for a specific team - tags: [] + tags: + - Not yet implemented summary: Collection of match information for a team - x-last-modified: 1665139050992 + x-last-modified: 1665308784 /teams/{team_id}/stats: get: operationId: get_stat_collection_for_team parameters: - - deprecated: false - description: The unique identifier (ULID) we use for teams that play on games - using the Relic Link API - explode: false - in: path - name: game_id - required: true - schema: - format: ulid - type: string - style: simple - x-last-modified: 1665069480649 + - $ref: "#/components/parameters/team_id" responses: + default: + $ref: "#/components/responses/401" + "200": + description: Operation succeeded + "401": + $ref: "#/components/responses/401" + "403": + $ref: "#/components/responses/403" + "404": + $ref: "#/components/responses/404" + "406": + $ref: "#/components/responses/406" + "429": + $ref: "#/components/responses/429" "501": - description: Not Implemented - x-last-modified: 1665058119290 + $ref: "#/components/responses/501" summary: Retrieve a list of stats for a specific team - tags: [] + tags: + - Not yet implemented summary: Collection of stats for a team - x-last-modified: 1665139090952 + x-last-modified: 1665308784 components: headers: Authorization: description: Authorization header explode: false schema: - type: string + $ref: "#/components/schemas/AuthorizationHeader" style: simple X-RateLimit-Remaining: description: The number of remaining requests in the current period @@ -1480,15 +2606,15 @@ components: type: integer style: simple X-Transaction-ID: - description: "When set by the client code with an alphanumeric value, the transaction\ + description: + "When set by the client code with an alphanumeric value, the transaction\ \ ID is logged in the log files for debugging. \nWhen the client is not specifying\ \ this value, the server auto generates this value for the incoming request.\ \ \nThe main purpose is to filter various logs at once for a single transaction\ \ ID, to ease the debugging." explode: false schema: - format: uuid - type: string + $ref: "#/components/schemas/Ulid" style: simple X-RateLimit-Limit: description: The number of allowed requests in the current period @@ -1496,8 +2622,15 @@ components: schema: type: integer style: simple + X-RateLimit-Retry-After: + description: The number of seconds to wait until you can make a request again without being throttled. + explode: false + schema: + type: integer + style: simple X-RateLimit-Reset: - description: The number of seconds left in the current period until the rate + description: + The number of seconds left in the current period until the rate limit resets explode: false schema: @@ -1505,11 +2638,14 @@ components: style: simple Pragma: deprecated: false - description: Implementation-specific fields that may have various effects anywhere + description: + Implementation-specific fields that may have various effects anywhere along the request-response chain. explode: false required: false schema: + maxLength: 32 + pattern: "^example-[0-9a-z]+$" type: string style: simple If-Modified-Since: @@ -1518,27 +2654,28 @@ components: explode: false required: false schema: - format: datetime - type: number + format: date-time + type: string style: simple If-None-Match: deprecated: false - description: "Allows a 304 Not Modified to be returned if content is unchanged,\ + description: + "Allows a 304 Not Modified to be returned if content is unchanged,\ \ see HTTP ETag." explode: false required: false schema: - format: md5 - type: string + $ref: "#/components/schemas/Md5" style: simple WWW-Authenticate: deprecated: false - description: Defines the HTTP authentication methods ("challenges") that might + description: + Defines the HTTP authentication methods ("challenges") that might be used to gain access to a specific resource explode: false required: false schema: - type: string + $ref: "#/components/schemas/WwwAuthenticate" style: simple Location: deprecated: false @@ -1546,21 +2683,267 @@ components: explode: false required: false schema: + maxLength: 32 + pattern: "^example-[0-9a-z]+$" type: string style: simple parameters: + match_id: + deprecated: false + description: Match ID + explode: false + in: query + name: match_id + required: false + schema: + $ref: "#/components/schemas/MatchId" + offset: + deprecated: false + description: Offset + explode: false + in: query + name: offset + required: false + schema: + $ref: "#/components/schemas/OffsetParam" + limit: + deprecated: false + description: Limit + explode: false + in: query + name: limit + required: false + schema: + $ref: "#/components/schemas/LimitParam" + between_timestamps: + deprecated: false + description: Items in between two comma-delimited UNIX timestamps + explode: true + in: query + name: between_timestamps + required: false + schema: + $ref: "#/components/schemas/BetweenReasonableUnixTimestamps" + between_datetimes: + deprecated: false + description: Items in between two comma-delimited Datetime string + explode: true + in: query + name: between_datetimes + required: false + schema: + $ref: "#/components/schemas/BetweenDatetimeStrings" + started_after_datetime: + deprecated: false + description: Only show items that started after this Datetime string + explode: false + in: query + name: started_after_datetime + required: false + schema: + $ref: "#/components/schemas/DateTimeString" + finished_after_datetime: + deprecated: false + description: Only show items that ended after this Datetime string + explode: false + in: query + name: finished_after_datetime + required: false + schema: + $ref: "#/components/schemas/DateTimeString" + started_after_timestamp: + deprecated: false + description: Only show items that started after this Unix timestamp + explode: false + in: query + name: started_after_timestamp + required: false + schema: + $ref: "#/components/schemas/ReasonableUnixTimestamp" + finished_after_timestamp: + deprecated: false + description: Only show items that ended after this Unix timestamp + explode: false + in: query + name: finished_after_timestamp + required: false + schema: + $ref: "#/components/schemas/ReasonableUnixTimestamp" + since_timestamp: + deprecated: false + description: Only show items that were added since this Unix timestamp + explode: false + in: query + name: since_timestamp + required: false + schema: + $ref: "#/components/schemas/ReasonableUnixTimestamp" + since_datetime: + deprecated: false + description: Only show items that were added since this Datetime string + explode: false + in: query + name: since_datetime + schema: + $ref: "#/components/schemas/DateTimeString" + x-last-modified: 1665308784 + search_steam_id: + deprecated: false + description: The Steam ID to search a `profile_id` for + explode: false + in: query + name: steam_id + required: false + schema: + $ref: "#/components/schemas/SteamId" + style: form + x-last-modified: 1665308784 + search_alias: + deprecated: false + description: + First 10 characters of a search string for name to search a `profile_id` + for + explode: false + in: query + name: alias + required: false + schema: + $ref: "#/components/schemas/SearchParam" + style: form + x-last-modified: 1665308784 + exact: + deprecated: false + description: If only exact matches should be returned + explode: false + in: query + name: exact + required: false + schema: + type: boolean + x-last-modified: 1665308784 + dump_type_array: + deprecated: false + description: Dump type identifiers to filter for + explode: true + in: query + name: dump_types + required: false + schema: + $ref: "#/components/schemas/DumpTypeArray" + status_array: + deprecated: false + description: Match status identifiers to filter for + explode: true + in: query + name: status + required: false + schema: + $ref: "#/components/schemas/MatchStatusArray" + status: + deprecated: false + description: Match status identifiers to filter for + explode: false + in: query + name: status + required: false + schema: + $ref: "#/components/schemas/MatchStatus" + last_match: + deprecated: false + description: Only show exactly the last available match + explode: false + in: query + name: last_match + required: false + schema: + type: boolean + default: false + example: false + match_uuid: + deprecated: false + description: Match ID to filter for its details + explode: false + in: query + name: match_uuid + required: false + schema: + $ref: "#/components/schemas/MatchUuid" + languages: + deprecated: false + name: language + in: query + description: Languages to receive content for + explode: true + required: false + schema: + $ref: "#/components/schemas/LanguageStringArray" + language: + deprecated: false + name: language + in: query + description: "Language to receive content for" + explode: true + required: false + schema: + $ref: "#/components/schemas/LanguageString" + style: + deprecated: false + name: style + in: query + description: "Style to receive content in" + explode: false + required: false + schema: + $ref: "#/components/schemas/ResponseStyle" + relic_link_ids: + deprecated: false + description: + An array of unique identifiers used by the Relic Link API for a player on + their platform + explode: false + in: query + name: relic_link_ids + required: false + schema: + $ref: "#/components/schemas/RelicLinkIdArray" + x-last-modified: 1665308784 relic_link_id: deprecated: false - description: The unique identifier used by the Relic Link API for a player on + description: + The unique identifier used by the Relic Link API for a player on their platform explode: false in: path name: relic_link_id required: true schema: - type: integer + $ref: "#/components/schemas/RelicLinkId" + style: simple + x-last-modified: 1665308784 + profile_id: + deprecated: false + description: + The unique identifier used by the Relic Link API for a player on + their platform + explode: false + in: path + name: profile_id + required: true + schema: + $ref: "#/components/schemas/RelicLinkId" + style: simple + x-last-modified: 1665308784 + dump_id: + deprecated: false + description: The unique identifier (ULID) we use for database dumps + explode: false + in: path + name: dump_id + required: true + schema: + $ref: "#/components/schemas/Ulid" style: simple - x-last-modified: 1663949613648 + x-last-modified: 1665308784 tournament_id: deprecated: false description: The unique identifier (ULID) we use for tournaments @@ -1569,49 +2952,60 @@ components: name: tournament_id required: true schema: - format: ulid - type: string + $ref: "#/components/schemas/Ulid" style: simple - x-last-modified: 1663949674724 + x-last-modified: 1665308784 leaderboard_id: deprecated: false - description: The unique identifier (ULID) we use for leaderboards of the Relic + description: + The unique identifier (ULID) we use for leaderboards of the Relic Link API explode: false in: path name: leaderboard_id required: true schema: - format: ulid - type: string + $ref: "#/components/schemas/Ulid" style: simple - x-last-modified: 1663949692803 + x-last-modified: 1665308784 + game_ids: + deprecated: false + description: + The unique identifier we use for games that use the Relic Link + API + explode: true + required: false + in: query + name: game_ids + schema: + $ref: "#/components/schemas/GameIdArray" + x-last-modified: 1665308784 game_id: deprecated: false - description: The unique identifier (ULID) we use for games that use the Relic - Link API + description: + The unique identifier we use for games that use the Relic Link + API explode: false in: path name: game_id required: true schema: - format: ulid - type: string + $ref: "#/components/schemas/GameId" style: simple - x-last-modified: 1663949717971 + x-last-modified: 1665308784 team_id: deprecated: false - description: The unique identifier (ULID) we use for teams that play on games + description: + The unique identifier (ULID) we use for teams that play on games using the Relic Link API explode: false in: path - name: game_id + name: team_id required: true schema: - format: ulid - type: string + $ref: "#/components/schemas/Ulid" style: simple - x-last-modified: 1665069480649 + x-last-modified: 1665308784 user_id: deprecated: false description: The unique identifier (ULID) we use for users of our API @@ -1620,83 +3014,549 @@ components: name: user_id required: true schema: - format: ulid - type: string + $ref: "#/components/schemas/Ulid" + style: simple + x-last-modified: 1665308784 + component_id: + deprecated: false + description: The unique identifier (ULID) we use for internal components of Libre:Match + explode: false + in: path + name: component_id + required: true + schema: + $ref: "#/components/schemas/Ulid" style: simple - x-last-modified: 1665078217885 + x-last-modified: 1665308784 responses: "200": description: Operation succeeded - x-last-modified: 1665056670316 + x-last-modified: 1665308784 "201": description: Created - x-last-modified: 1665072508175 + x-last-modified: 1665308784 "202": + content: + application/json: + schema: + $ref: "#/components/schemas/Accepted" description: Accepted - x-last-modified: 1665057162357 + x-last-modified: 1665308784 "204": + content: + application/json: + schema: + $ref: "#/components/schemas/NoContent" description: No Content - x-last-modified: 1665056770881 + x-last-modified: 1665308784 "304": description: Not Modified - x-last-modified: 1665056864543 + x-last-modified: 1665308784 "400": content: application/json: schema: - $ref: '#/components/schemas/IllegalInputError' + $ref: "#/components/schemas/IllegalInputError" description: Bad Request - x-last-modified: 1665057215110 + x-last-modified: 1665308784 "401": content: application/json: schema: - $ref: '#/components/schemas/UnauthorizedError' - description: Unauthorized access. - x-last-modified: 1665072543221 + $ref: "#/components/schemas/UnauthorizedError" + description: Unauthorized access + x-last-modified: 1665308784 "403": + content: + application/json: + schema: + $ref: "#/components/schemas/ForbiddenError" description: Forbidden - x-last-modified: 1665056800086 + x-last-modified: 1665308784 "404": - description: Entity not found. - x-last-modified: 1665056674861 + content: + application/json: + schema: + $ref: "#/components/schemas/NotFoundError" + description: Entity not found + x-last-modified: 1665308784 + "406": + content: + application/json: + schema: + $ref: "#/components/schemas/NotAcceptableError" + description: Not acceptable + x-last-modified: 1665308784 "408": + content: + application/json: + schema: + $ref: "#/components/schemas/RequestTimeoutError" description: Request Timeout - x-last-modified: 1665057248987 + x-last-modified: 1665308784 + "415": + content: + application/json: + schema: + $ref: "#/components/schemas/UnsupportedMediaTypeError" + description: Unsupported Media Type + x-last-modified: 1665308784 "429": + content: + application/json: + schema: + $ref: "#/components/schemas/TooManyRequestsError" description: Too Many Requests - x-last-modified: 1665056827121 + x-last-modified: 1665308784 "500": content: application/json: schema: - $ref: '#/components/schemas/ServerError' + $ref: "#/components/schemas/ServerError" description: Server Error - x-last-modified: 1665056677455 + x-last-modified: 1665308784 "501": + content: + application/json: + schema: + $ref: "#/components/schemas/NotImplementedError" description: Not Implemented - x-last-modified: 1665058119290 + x-last-modified: 1665308784 "503": + content: + application/json: + schema: + $ref: "#/components/schemas/ServiceUnavailableError" description: Service Unavailable - x-last-modified: 1665057340292 + x-last-modified: 1665308784 schemas: + OffsetParam: + description: An integer between '0' and '999,999,999,999'. Serves as a start parameter. + format: int64 + maximum: 999999999999 + minimum: 0 + pattern: "^[0-9]{11}$" + type: integer + default: 0 + example: 0 + LimitParam: + description: An integer between '1' and '1,000'. Serves as a page limit. + format: int64 + maximum: 1000 + minimum: 1 + pattern: "^[0-9]{3}$" + type: integer + default: 50 + example: 25 + BetweenReasonableUnixTimestamps: + description: Two comma-delimited UNIX TimeStamps between 'Fri, 09 Oct 2020 08:27:06 +0000' and 'Sat, 09 Oct 2032 08:27:06 +0000'. + pattern: "^1[6-9]([0-9]){8}$" + type: string + format: string + example: "1702232026,1702232026" + x-last-modified: 1665308784 + ReasonableUnixTimestamp: + format: int64 + maximum: 1980923226 + minimum: 1602232026 + pattern: "^1[6-9]([0-9]){8}$" + type: integer + example: 1702232026 + description: An UNIX TimeStamp between 'Fri, 09 Oct 2020 08:27:06 +0000' and 'Sat, 09 Oct 2032 08:27:06 +0000'. + MatchUuid: + format: uuid + pattern: + "^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b\ + -[0-9a-fA-F]{12}$" + type: string + example: 03531e31-31fd-5041-9f70-0264e158a40e + description: A valid UUID that is being used to find matches. + MatchId: + format: int64 + pattern: "^[0-9]{14}$" + type: integer + example: 75984064 + description: An Integer defined as Match ID serving to identify a match. + SteamId: + format: int64 + maximum: 18 + minimum: 14 + pattern: "^7[0-9]{16}$" + type: integer + example: 76561197984749679 + description: A valid SteamID64 that is being used in the '/profiles/search' to find the Relic Link ID of a profile. + SearchParam: + format: string + maxLength: 10 + pattern: "^.{10}$" + type: string + example: TheViper + description: First 10 characters of a search string that is being used in the '/profiles/search' to find the Relic Link ID of a profile. + ResponseStyle: + enum: + - compact + - full + type: string + default: compact + example: compact + description: An enum send from the client to style the response that we send. Custom use cases, e.g. 'overlay' can be added later. + x-last-modified: 1665308784 + LanguageStringArray: + type: array + items: + $ref: "#/components/schemas/LanguageString" + default: + - en + example: + - en + - fr + description: An array of languages helping the client to chose the languages they want to receive certain parts of their response in. + LanguageString: + format: string + enum: + - en + - de + - el + - es + - es-MX + - fr + - hi + - it + - ja + - ko + - ms + - nl + - pt + - ru + - tr + - vi + - zh + - zh-TW + maxLength: 5 + minLength: 2 + pattern: "^([a-z]{2}){1}\b(-[A-Z]{2}){0,1}$" + type: string + default: en + example: en + description: An enum of Language strings being used in a language array. + AuthorizationHeader: + additionalProperties: false + properties: + self: + format: string + maxLength: 33 + type: string + required: + - self + type: object + x-last-modified: 1665308784 + WwwAuthenticate: + additionalProperties: false + properties: + self: + format: string + maxLength: 33 + type: string + required: + - self + type: object + x-last-modified: 1665308784 + Md5: + format: string + maxLength: 33 + maximum: 33 + pattern: "^[a-fA-F0-9]{32}$" + type: string + x-last-modified: 1665308784 + BetweenDatetimeStrings: + description: Two comma-delimited Datetime strings + format: string + maxLength: 50 + pattern: '^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?Z?$' + type: string + example: "2022-04-19T08:00:00.000Z,2022-04-19T10:00:00.000Z" + x-last-modified: 1665308784 + DateTimeString: + description: A Datetime string + format: string + maxLength: 25 + pattern: '^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?Z?$' + type: string + example: "2022-09-19T15:22:08.452Z" + x-last-modified: 1665308784 + RelicLinkIdArray: + description: Array of Relic Link IDs + type: array + items: + $ref: "#/components/schemas/RelicLinkId" + example: + - 196240 + - 185043 + x-last-modified: 1665308784 + RelicLinkId: + description: A Relic Link ID + format: int64 + maximum: 999999999 + minimum: 0 + type: integer + example: 196240 + x-last-modified: 1665308784 + MatchStatusArray: + description: Array of match statuses + items: + $ref: "#/components/schemas/MatchStatus" + type: array + default: finished + example: + - ongoing + - finished + x-last-modified: 1665308784 + DumpTypeArray: + description: Dump content types + items: + $ref: "#/components/schemas/DumpType" + type: array + default: + - leaderboards + - matches + - ratings + example: + - matches + - ratings + x-last-modified: 1665308784 + DumpType: + description: Dump content type + enum: + - leaderboards + - matches + - ratings + type: string + default: leaderboards + example: leaderboards + x-last-modified: 1665308784 + MatchStatus: + description: Match statuses + enum: + - drafting + - ongoing + - finished + type: string + default: finished + example: ongoing + x-last-modified: 1665308784 + GameIdArray: + description: Array of supported games by Relic Link API + items: + $ref: "#/components/schemas/GameId" + type: array + example: + - aoe2de + - aoe4 + x-last-modified: 1665308784 + GameId: + description: Supported games by Relic Link API + enum: + - aoe1de + - aoe2de + - aoe3de + - aoe4 + type: string + example: aoe2de + x-last-modified: 1665308784 + Ulid: + format: ulid + maxLength: 26 + maximum: 26 + minimum: 26 + pattern: "^[0-7][0-9A-HJKMNP-TV-Z]{25}$" + type: string + example: 4Y89HG5TKRF7BGMMSQMRPZ6S1B + x-last-modified: 1665308784 + UnsupportedMediaTypeError: + additionalProperties: false + properties: + message: + title: message + type: string + code: + maximum: 415 + minimum: 415 + title: code + type: integer + required: + - code + - message + title: UnsupportedMediaTypeError + type: object + x-last-modified: 1665308784 + ServiceUnavailableError: + additionalProperties: false + properties: + message: + type: string + code: + maximum: 503 + minimum: 503 + type: integer + required: + - code + - message + type: object + x-last-modified: 1665308784 + NotImplementedError: + additionalProperties: false + properties: + message: + title: message + type: string + code: + maximum: 501 + minimum: 501 + title: code + type: integer + required: + - code + - message + title: NotImplementedError + type: object + x-last-modified: 1665308784 + TooManyRequestsError: + additionalProperties: false + properties: + message: + title: message + type: string + code: + maximum: 429 + minimum: 429 + title: code + type: integer + required: + - code + - message + title: TooManyRequestsError + type: object + x-last-modified: 1665308784 + RequestTimeoutError: + additionalProperties: false + properties: + message: + type: string + code: + maximum: 408 + minimum: 408 + type: integer + required: + - code + - message + type: object + x-last-modified: 1665308784 + NotAcceptableError: + additionalProperties: false + properties: + message: + title: message + type: string + code: + maximum: 406 + minimum: 406 + title: code + type: integer + required: + - code + - message + title: NotAcceptableError + type: object + x-last-modified: 1665308784 + NotFoundError: + additionalProperties: false + properties: + message: + title: message + type: string + code: + maximum: 404 + minimum: 404 + title: code + type: integer + required: + - code + - message + title: NotFoundError + type: object + x-last-modified: 1665308784 + ForbiddenError: + additionalProperties: false + properties: + message: + title: message + type: string + code: + maximum: 403 + minimum: 403 + title: code + type: integer + required: + - code + - message + title: ForbiddenError + type: object + x-last-modified: 1665308784 + Accepted: + additionalProperties: false + properties: + message: + type: string + code: + maximum: 202 + minimum: 202 + type: integer + required: + - code + - message + type: object + x-last-modified: 1665308784 + NoContent: + additionalProperties: false + properties: + message: + maxLength: 32 + pattern: "^example-[0-9a-z]+$" + title: No Content + type: string + code: + maximum: 204 + minimum: 204 + type: integer + required: + - code + - message + type: object + x-last-modified: 1665308784 IllegalInputError: + additionalProperties: false properties: message: + maxLength: 32 + pattern: "^example-[0-9a-z]+$" + title: Bad Request type: string code: maximum: 400 minimum: 400 type: integer required: - - code - - message + - code + - message type: object - x-last-modified: 1665056674054 + x-last-modified: 1665308784 UnauthorizedError: + additionalProperties: false properties: message: - title: message + maxLength: 32 + pattern: "^example-[0-9a-z]+$" + title: Unauthorized access type: string code: maximum: 401 @@ -1704,12 +3564,13 @@ components: title: code type: integer required: - - code - - message + - code + - message title: UnauthorizedError type: object - x-last-modified: 1665056676293 + x-last-modified: 1665308784 ServerError: + additionalProperties: false properties: message: type: string @@ -1718,38 +3579,29 @@ components: minimum: 500 type: integer required: - - code - - message - type: object - x-last-modified: 1665056677454 - Error: - example: - code: 400 - message: wrong input - properties: - message: - description: The error message indicating what the issue is - type: string - code: - description: The http status code - maximum: 600 - minimum: 100 - type: integer - required: - - code - - message + - code + - message type: object - x-last-modified: 1665057919920 + x-last-modified: 1665308784 securitySchemes: + BasicAuth: + description: "Example: \n> Authorization: " + in: header + name: BasicAuth + type: apiKey + x-last-modified: 1665308784 X-Api-Key: description: "Example: \n> X-Api-Key: ZGVtbzpwQDU1dzByZA==" in: header name: X-Api-Key type: apiKey - x-last-modified: 1663947718456 + x-last-modified: 1665308784 JWTAuth: bearerFormat: JWT description: "Example: \n> Authorization: Bearer " scheme: bearer type: http - x-last-modified: 1665071628782 + x-last-modified: 1665308784 + HttpAuth: + type: http + scheme: basic diff --git a/setup.cfg b/setup.cfg index d72b1d6..a6b3ae8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = openapi_server -version = 1.0.0 +version = 1.0.0-DRAFT description = stable, reliable and feature-rich API for match information, leaderboards, and tournament organisation for the Age of Empires multiplayer community long_description = file: README.md keywords = OpenAPI Libre:Match API diff --git a/src/openapi_server/apis/account_registration_api.py b/src/openapi_server/apis/account_registration_api.py new file mode 100644 index 0000000..885841b --- /dev/null +++ b/src/openapi_server/apis/account_registration_api.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.post( + "/users", + responses={ + 200: {"description": "Operation succeeded"}, + 201: {"description": "Created"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Authentication","Account Registration","User Administration"], + summary="Create a new user for our platform", + response_model_by_alias=True, +) +async def create_new_user( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/users/register", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Account Registration"], + response_model_by_alias=True, +) +async def user_register( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/administration_api.py b/src/openapi_server/apis/administration_api.py new file mode 100644 index 0000000..d66648e --- /dev/null +++ b/src/openapi_server/apis/administration_api.py @@ -0,0 +1,786 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.relic_link_id import RelicLinkId +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.put( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Bulk update of admins for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def bulk_update_all_admins_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.put( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Bulk update all brackets for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def bulk_update_all_brackets_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.put( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration"], + summary="Bulk update of settings for a specific profile from the Relic Link API", + response_model_by_alias=True, +) +async def bulk_update_all_settings_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.put( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Team Administration"], + summary="Bulk update of teams", + response_model_by_alias=True, +) +async def bulk_update_all_teams( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.put( + "/users/{user_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration"], + summary="Bulk update of stats for a specific user profile on our platform", + response_model_by_alias=True, +) +async def bulk_update_all_user_stats( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Create a new admin for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def create_new_admin_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Create a new bracket for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def create_new_bracket_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration"], + summary="Create a new setting for a specific profile from the Relic Link API", + response_model_by_alias=True, +) +async def create_new_setting_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Team Administration"], + summary="Create a new team", + response_model_by_alias=True, +) +async def create_new_team( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/users/{user_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration"], + summary="Create a new stat for a specific user profile on our platform", + response_model_by_alias=True, +) +async def create_new_user_stats( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.get( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Retrieve all admins for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def get_admin_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/application", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Internal","Administration"], + summary="Retrieve a list of available application information", + response_model_by_alias=True, +) +async def get_information_collection_for_application( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/profiles", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration"], + summary="Retrieve all available profiles", + response_model_by_alias=True, +) +async def get_profile_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration","Information"], + summary="Retrieve all settings for a specific profile", + response_model_by_alias=True, +) +async def get_setting_collection_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/application/statistics", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Internal","Administration"], + summary="Retrieve a list of only application statistics", + response_model_by_alias=True, +) +async def get_stat_collection_for_application( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/application/status", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 503: {"description": "Service Unavailable"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Internal","Administration","Status Check"], + summary="Retrieve only application status", + response_model_by_alias=True, +) +async def get_status_collection_for_application( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.patch( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Update details of admins for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def partial_update_all_admins_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.patch( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration"], + summary="Update a specific setting for a specific profile from the Relic Link API", + response_model_by_alias=True, +) +async def partial_update_all_settings_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.patch( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Team Administration"], + summary="Partial update of all teams", + response_model_by_alias=True, +) +async def partial_update_all_teams( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.patch( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Partial update all brackets for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def partial_update_bracket_for_tournament( + tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments", regex=r"^[0-7][0-9A-HJKMNP-TV-Z]{25}$", max_length=26), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.patch( + "/tournaments/{tournament_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration"], + summary="Partially update a tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def partial_update_tournament_details( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.patch( + "/users/{user_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration"], + summary="Partially update stats for a specific user profile on our platform", + response_model_by_alias=True, +) +async def partial_update_user_stats( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Remove all admins for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def remove_all_admins_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration"], + summary="Remove all settings for a specific profile", + response_model_by_alias=True, +) +async def remove_all_settings_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/tournaments/{tournament_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration"], + summary="Remove a tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def remove_tournament_details( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.put( + "/tournaments/{tournament_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration"], + summary="Update details for a tournament for a specific game", + response_model_by_alias=True, +) +async def update_tournament_details( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... diff --git a/src/openapi_server/apis/api_token_validation_api.py b/src/openapi_server/apis/api_token_validation_api.py new file mode 100644 index 0000000..f68973f --- /dev/null +++ b/src/openapi_server/apis/api_token_validation_api.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.post( + "/users/validate", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Authentication","API Token Validation"], + response_model_by_alias=True, +) +async def create_new_user_validation( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/users/validate", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Authentication","API Token Validation"], + response_model_by_alias=True, +) +async def get_user_validation_details( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/authentication_api.py b/src/openapi_server/apis/authentication_api.py new file mode 100644 index 0000000..a376b6c --- /dev/null +++ b/src/openapi_server/apis/authentication_api.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.post( + "/users", + responses={ + 200: {"description": "Operation succeeded"}, + 201: {"description": "Created"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Authentication","Account Registration","User Administration"], + summary="Create a new user for our platform", + response_model_by_alias=True, +) +async def create_new_user( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/users/validate", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Authentication","API Token Validation"], + response_model_by_alias=True, +) +async def create_new_user_validation( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/users/validate", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Authentication","API Token Validation"], + response_model_by_alias=True, +) +async def get_user_validation_details( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.post( + "/users/login", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Authentication"], + response_model_by_alias=True, +) +async def user_login( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/users/logout", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Authentication"], + response_model_by_alias=True, +) +async def user_logout( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/database_api.py b/src/openapi_server/apis/database_api.py new file mode 100644 index 0000000..49dc757 --- /dev/null +++ b/src/openapi_server/apis/database_api.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.timeframe import Timeframe +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/dumps/{timeframe}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Database","Statistics"], + response_model_by_alias=True, +) +async def get_database_dump_collection( + timeframe: Timeframe = Path(None, description="The timeframe from which to download a database dump"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """Download a database dump from a given timeframe""" + ... diff --git a/src/openapi_server/apis/default_api.py b/src/openapi_server/apis/default_api.py index 05eae8a..14436e1 100644 --- a/src/openapi_server/apis/default_api.py +++ b/src/openapi_server/apis/default_api.py @@ -17,1299 +17,37 @@ ) from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.game_id import GameId +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.too_many_requests_error import TooManyRequestsError from openapi_server.models.unauthorized_error import UnauthorizedError -from openapi_server.security_api import get_token_X-Api-Key +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key router = APIRouter() -@router.put( - "/tournaments/{tournament_id}/admins", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Bulk update of admins for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def bulk_update_all_admins_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.put( - "/tournaments/{tournament_id}/brackets", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Bulk update all brackets for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def bulk_update_all_brackets_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.put( - "/profiles/{relic_link_id}/settings", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Bulk update of settings for a specific profile from the Relic Link API", - response_model_by_alias=True, -) -async def bulk_update_all_settings_for_profile( - relic_link_id: int = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.put( - "/teams", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Bulk update of teams", - response_model_by_alias=True, -) -async def bulk_update_all_teams( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.put( - "/tournaments", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Bulk update of tournaments", - response_model_by_alias=True, -) -async def bulk_update_all_tournaments( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.put( - "/users/{user_id}", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Bulk update details for a specific user profile on our platform if it exists", - response_model_by_alias=True, -) -async def bulk_update_all_user_details( - user_id: str = Path(None, description="The unique identifier (ULID) we use for users of our API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.put( - "/users/{user_id}/stats", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Bulk update of stats for a specific user profile on our platform", - response_model_by_alias=True, -) -async def bulk_update_all_user_stats( - user_id: str = Path(None, description="The unique identifier (ULID) we use for users of our API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.put( - "/users", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Bulk update of all users of our platform", - response_model_by_alias=True, -) -async def bulk_update_all_users( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.post( - "/tournaments/{tournament_id}/admins", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Create a new admin for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def create_new_admin_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.post( - "/tournaments/{tournament_id}/brackets", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Create a new bracket for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def create_new_bracket_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.post( - "/profiles/{relic_link_id}/settings", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Create a new setting for a specific profile from the Relic Link API", - response_model_by_alias=True, -) -async def create_new_setting_for_profile( - relic_link_id: int = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.post( - "/teams", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Create a new team", - response_model_by_alias=True, -) -async def create_new_team( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.post( - "/tournaments", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Create a new tournament for a game available on the Relic Link platform", - response_model_by_alias=True, -) -async def create_new_tournament( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.post( - "/users", - responses={ - 200: {"description": "Operation succeeded"}, - 201: {"description": "Created"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Create a new user for our platform", - response_model_by_alias=True, -) -async def create_new_user( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.post( - "/users/{user_id}/stats", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Create a new stat for a specific user profile on our platform", - response_model_by_alias=True, -) -async def create_new_user_stats( - user_id: str = Path(None, description="The unique identifier (ULID) we use for users of our API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.post( - "/users/validate", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - response_model_by_alias=True, -) -async def create_new_user_validation( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/tournaments/{tournament_id}/admins", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all admins for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def get_admin_collection_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/tournaments/{tournament_id}/brackets", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all brackets for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def get_bracket_collection_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/games/{game_id}/definitions", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve all available definitions for a specific game using Relic Link API", - response_model_by_alias=True, -) -async def get_definition_collection_for_game( - game_id: str = Path(None, description="The unique identifier (ULID) we use for games that use the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - @router.get( "/games/{game_id}", responses={ 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, }, tags=["default"], - summary="Retrieve details for a game with a specific identifier using Relic Link API", + summary="Retrieve details for a game with a specific identifiers", response_model_by_alias=True, ) async def get_details_for_game( - game_id: str = Path(None, description="The unique identifier (ULID) we use for games that use the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/leaderboards/{leaderboard_id}", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve details for a specific leaderboard", - response_model_by_alias=True, -) -async def get_details_for_leaderboard( - leaderboard_id: str = Path(None, description="The unique identifier (ULID) we use for leaderboards of the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key + game_id: GameId = Path(None, description="The unique identifier we use for games that use the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth ), -) -> None: - ... - - -@router.get( - "/profiles/{relic_link_id}", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve the details for a specific profile from the Relic Link API", - response_model_by_alias=True, -) -async def get_details_for_profile( - relic_link_id: int = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/teams/{team_id}", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve details of a team", - response_model_by_alias=True, -) -async def get_details_for_team( - game_id: str = Path(None, description="The unique identifier (ULID) we use for teams that play on games using the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/tournaments/{tournament_id}", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve details for a tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def get_details_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/users/{user_id}", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve details for a specific user profile on our platform", - response_model_by_alias=True, -) -async def get_details_for_user( - user_id: str = Path(None, description="The unique identifier (ULID) we use for users of our API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/games", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve a list of all game identifiers for games using Relic Link API", - response_model_by_alias=True, -) -async def get_game_identifier_collection( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/games/{game_id}/info", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve all available information for a specific game using Relic Link API", - response_model_by_alias=True, -) -async def get_info_collection_for_game( - game_id: str = Path(None, description="The unique identifier (ULID) we use for games that use the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/tournaments/{tournament_id}/info", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all information for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def get_info_collection_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/application", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve a list of available application information", - response_model_by_alias=True, -) -async def get_information_collection_for_application( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/leaderboards", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve all leaderboards hosted on the Relic Link API", - response_model_by_alias=True, -) -async def get_leaderboard_collection( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/games/{game_id}/leaderboards", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve all leaderboards for a specific game using Relic Link API", - response_model_by_alias=True, -) -async def get_leaderboard_collection_for_game( - game_id: str = Path(None, description="The unique identifier (ULID) we use for games that use the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/games/{game_id}/matches", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve all matches for a specific game using Relic Link API", - response_model_by_alias=True, -) -async def get_match_collection_for_game( - game_id: str = Path(None, description="The unique identifier (ULID) we use for games that use the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/leaderboards/{leaderboard_id}/matches", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve all matches on a specific leaderboard for a certain game hosted on the Relic Link API", - response_model_by_alias=True, -) -async def get_match_collection_for_leaderboard( - leaderboard_id: str = Path(None, description="The unique identifier (ULID) we use for leaderboards of the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/profiles/{relic_link_id}/matches", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve all matches for a specific profile from the Relic Link API", - response_model_by_alias=True, -) -async def get_match_collection_for_profile( - relic_link_id: int = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/teams/{team_id}/matches", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve a list of matches for a specific team", - response_model_by_alias=True, -) -async def get_match_collection_for_team( - game_id: str = Path(None, description="The unique identifier (ULID) we use for teams that play on games using the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/profiles", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve all available profiles from the Relic Link API", - response_model_by_alias=True, -) -async def get_profile_collection( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/profiles/{relic_link_id}/settings", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all settings for a specific profile from the Relic Link API", - response_model_by_alias=True, -) -async def get_setting_collection_for_profile( - relic_link_id: int = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/application/statistics", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve a list of only application statistics", - response_model_by_alias=True, -) -async def get_stat_collection_for_application( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/leaderboards/{leaderboard_id}/stats", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all stats on a specific leaderboard for a certain game hosted on the Relic Link API", - response_model_by_alias=True, -) -async def get_stat_collection_for_leaderboard( - leaderboard_id: str = Path(None, description="The unique identifier (ULID) we use for leaderboards of the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/profiles/{relic_link_id}/stats", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all stats for a specific profile from the Relic Link API", - response_model_by_alias=True, -) -async def get_stat_collection_for_profile( - relic_link_id: int = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/teams/{team_id}/stats", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve a list of stats for a specific team", - response_model_by_alias=True, -) -async def get_stat_collection_for_team( - game_id: str = Path(None, description="The unique identifier (ULID) we use for teams that play on games using the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/users/{user_id}/stats", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all stats for a specific user profile on our platform", - response_model_by_alias=True, -) -async def get_stat_collection_for_user( - user_id: str = Path(None, description="The unique identifier (ULID) we use for users of our API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/application/status", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - 503: {"description": "Service Unavailable"}, - }, - tags=["default"], - summary="Retrieve only application status", - response_model_by_alias=True, -) -async def get_status_collection_for_application( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/teams", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all available teams", - response_model_by_alias=True, -) -async def get_team_collection( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/tournaments/{game_id}", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all available tournaments for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def get_tournament_details_for_game( - game_id: str = Path(None, description="The unique identifier (ULID) we use for games that use the Relic Link API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/tournaments", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Retrieve all available tournaments for all games available on the Relic Link platform", - response_model_by_alias=True, -) -async def get_tournament_identifier_collection( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/users", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Retrieve all users of our platform", - response_model_by_alias=True, -) -async def get_user_collection( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """Authenticated Endpoint for Administrators or Libre:Match""" - ... - - -@router.get( - "/users/validate", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - response_model_by_alias=True, -) -async def get_user_validation_details( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.patch( - "/tournaments/{tournament_id}/admins", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Update details of admins for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def partial_update_all_admins_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.patch( - "/profiles/{relic_link_id}/settings", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Update a specific setting for a specific profile from the Relic Link API", - response_model_by_alias=True, -) -async def partial_update_all_settings_for_profile( - relic_link_id: int = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.patch( - "/teams", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Partial update of all teams", - response_model_by_alias=True, -) -async def partial_update_all_teams( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.patch( - "/users", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Partially update details for all user profiles", - response_model_by_alias=True, -) -async def partial_update_all_users( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.patch( - "/tournaments/{tournament_id}/brackets", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Partial update all brackets for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def partial_update_bracket_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.patch( - "/tournaments/{tournament_id}", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Partially update a tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def partial_update_tournament_details( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.patch( - "/tournaments", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Partial update of tournaments", - response_model_by_alias=True, -) -async def partial_update_tournaments( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.patch( - "/users/{user_id}", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Update details for a specific user profile on our platform if it exists", - response_model_by_alias=True, -) -async def partial_update_user( - user_id: str = Path(None, description="The unique identifier (ULID) we use for users of our API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.patch( - "/users/{user_id}/stats", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Partially update stats for a specific user profile on our platform", - response_model_by_alias=True, -) -async def partial_update_user_stats( - user_id: str = Path(None, description="The unique identifier (ULID) we use for users of our API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.delete( - "/tournaments/{tournament_id}/admins", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Remove all admins for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def remove_all_admins_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.delete( - "/tournaments/{tournament_id}/brackets", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Remove all brackets for a specific tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def remove_all_brackets_for_tournament( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.delete( - "/profiles/{relic_link_id}/settings", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Remove all settings for a specific profile from the Relic Link API", - response_model_by_alias=True, -) -async def remove_all_settings_for_profile( - relic_link_id: int = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.delete( - "/teams", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Remove all teams", - response_model_by_alias=True, -) -async def remove_all_teams( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.delete( - "/tournaments", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Remove all tournaments", - response_model_by_alias=True, -) -async def remove_all_tournaments( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.delete( - "/users/{user_id}/stats", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Remove all stats for a specific user profile on our platform", - response_model_by_alias=True, -) -async def remove_all_user_stats( - user_id: str = Path(None, description="The unique identifier (ULID) we use for users of our API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.delete( - "/users", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Remove all users from our platform", - response_model_by_alias=True, -) -async def remove_all_users( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.delete( - "/tournaments/{tournament_id}", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Remove a tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def remove_tournament_details( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.delete( - "/users/{user_id}", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - summary="Remove user from our platform if it exists", - response_model_by_alias=True, -) -async def remove_user( - user_id: str = Path(None, description="The unique identifier (ULID) we use for users of our API"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.put( - "/tournaments/{tournament_id}", - responses={ - 501: {"description": "Not Implemented"}, - }, - tags=["default"], - summary="Update details for a tournament for a specific game available on the Relic Link platform", - response_model_by_alias=True, -) -async def update_tournament_details( - tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments"), - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - """""" - ... - - -@router.post( - "/users/login", - responses={ - 200: {"description": "Operation succeeded"}, - }, - tags=["default"], - response_model_by_alias=True, -) -async def user_login( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.get( - "/users/logout", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - response_model_by_alias=True, -) -async def user_logout( - token_X-Api-Key: TokenModel = Security( - get_token_X-Api-Key - ), -) -> None: - ... - - -@router.post( - "/users/register", - responses={ - 200: {"description": "Operation succeeded"}, - 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, - }, - tags=["default"], - response_model_by_alias=True, -) -async def user_register( token_X-Api-Key: TokenModel = Security( get_token_X-Api-Key ), diff --git a/src/openapi_server/apis/definition_api.py b/src/openapi_server/apis/definition_api.py new file mode 100644 index 0000000..b9ce3b1 --- /dev/null +++ b/src/openapi_server/apis/definition_api.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.game_id import GameId +from openapi_server.models.language_string import LanguageString +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/games/{game_id}/definitions", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Definition"], + summary="Retrieve all available definitions for a specific game", + response_model_by_alias=True, +) +async def get_definition_collection_for_game( + game_id: GameId = Path(None, description="The unique identifier we use for games that use the Relic Link API"), + language: LanguageString = Query(None, description="The language to query definitions for that are being used by the API (Default: 'en')"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/information_api.py b/src/openapi_server/apis/information_api.py new file mode 100644 index 0000000..7499d6e --- /dev/null +++ b/src/openapi_server/apis/information_api.py @@ -0,0 +1,330 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.game_id import GameId +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.relic_link_id import RelicLinkId +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Tournaments","Tournament Administration"], + summary="Retrieve all brackets for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_bracket_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/profiles/{relic_link_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information"], + summary="Retrieve the details for a specific profile", + response_model_by_alias=True, +) +async def get_details_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information"], + summary="Retrieve details for a tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def get_details_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/users/{user_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","User Administration"], + summary="Retrieve details for a specific user profile on our platform", + response_model_by_alias=True, +) +async def get_details_for_user( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/games", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information"], + summary="Retrieve a list of all game identifiers for games", + response_model_by_alias=True, +) +async def get_game_identifier_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/games/{game_id}/info", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access."}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information"], + summary="Retrieve all available information for a specific game", + response_model_by_alias=True, +) +async def get_info_collection_for_game( + game_id: GameId = Path(None, description="The unique identifier we use for games that use the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/info", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Tournaments","Tournament Administration"], + summary="Retrieve all information for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_info_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/leaderboards", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Leaderboards","Information"], + summary="Retrieve all leaderboards", + response_model_by_alias=True, +) +async def get_leaderboard_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration","Information"], + summary="Retrieve all settings for a specific profile", + response_model_by_alias=True, +) +async def get_setting_collection_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Teams","Team Administration"], + summary="Retrieve all available teams", + response_model_by_alias=True, +) +async def get_team_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Tournament Administration"], + summary="Retrieve all available tournaments for all games available on the Relic Link platform", + response_model_by_alias=True, +) +async def get_tournament_identifier_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/internal_api.py b/src/openapi_server/apis/internal_api.py new file mode 100644 index 0000000..6599c3d --- /dev/null +++ b/src/openapi_server/apis/internal_api.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/application", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Internal","Administration"], + summary="Retrieve a list of available application information", + response_model_by_alias=True, +) +async def get_information_collection_for_application( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/application/statistics", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Internal","Administration"], + summary="Retrieve a list of only application statistics", + response_model_by_alias=True, +) +async def get_stat_collection_for_application( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/application/status", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 503: {"description": "Service Unavailable"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Internal","Administration","Status Check"], + summary="Retrieve only application status", + response_model_by_alias=True, +) +async def get_status_collection_for_application( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/leaderboards_api.py b/src/openapi_server/apis/leaderboards_api.py new file mode 100644 index 0000000..3669d09 --- /dev/null +++ b/src/openapi_server/apis/leaderboards_api.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.count_param import CountParam +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.game_id import GameId +from openapi_server.models.match_status import MatchStatus +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.relic_link_id import RelicLinkId +from openapi_server.models.search_param import SearchParam +from openapi_server.models.since_param import SinceParam +from openapi_server.models.start_param import StartParam +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/leaderboards/{leaderboard_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Leaderboards"], + summary="Retrieve details for a specific leaderboard", + response_model_by_alias=True, +) +async def get_details_for_leaderboard( + leaderboard_id: Ulid = Path(None, description="The unique identifier (ULID) we use for leaderboards of the Relic Link API"), + profile_id: RelicLinkId = Query(None, description="Search for a profile ID in a leaderboard"), + search: SearchParam = Query(None, description="Search for a name in a leaderboard"), + start: StartParam = Query(None, description="Starting rank"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/leaderboards", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Leaderboards","Information"], + summary="Retrieve all leaderboards", + response_model_by_alias=True, +) +async def get_leaderboard_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/games/{game_id}/leaderboards", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Leaderboards"], + summary="Retrieve all leaderboards for a specific game", + response_model_by_alias=True, +) +async def get_leaderboard_collection_for_game( + game_id: GameId = Path(None, description="The unique identifier we use for games that use the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/leaderboards/{leaderboard_id}/matches", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Leaderboards","Match data"], + summary="Retrieve all matches on a specific leaderboard for a certain game", + response_model_by_alias=True, +) +async def get_match_collection_for_leaderboard( + leaderboard_id: Ulid = Path(None, description="The unique identifier (ULID) we use for leaderboards of the Relic Link API"), + status: MatchStatus = Query(None, description="Match status identifiers to filter for"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/leaderboards/{leaderboard_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Leaderboards","Statistics"], + summary="Retrieve all stats on a specific leaderboard for a certain game", + response_model_by_alias=True, +) +async def get_stat_collection_for_leaderboard( + leaderboard_id: Ulid = Path(None, description="The unique identifier (ULID) we use for leaderboards of the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/match_data_api.py b/src/openapi_server/apis/match_data_api.py new file mode 100644 index 0000000..b69d926 --- /dev/null +++ b/src/openapi_server/apis/match_data_api.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.count_param import CountParam +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.game_id import GameId +from openapi_server.models.match_id import MatchId +from openapi_server.models.match_status import MatchStatus +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.relic_link_id import RelicLinkId +from openapi_server.models.since_param import SinceParam +from openapi_server.models.start_param import StartParam +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/profiles/{relic_link_id}/ledger", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Match data","Ratings"], + summary="Retrieve the rating ledger for a specific profile", + response_model_by_alias=True, +) +async def get_ledger_collection_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + game: GameId = Query(None, description="Game identifier to query for"), + start: StartParam = Query(None, description="Starting match"), + leaderboard_id: Ulid = Query(None, description="Leaderboard identifier"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/games/{game_id}/matches", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Match data"], + summary="Retrieve all matches for a specific game", + response_model_by_alias=True, +) +async def get_match_collection_for_game( + game_id: GameId = Path(None, description="The unique identifier we use for games that use the Relic Link API"), + single_match: MatchId = Query(None, description="Match ID to filter for its details"), + status: MatchStatus = Query(None, description="Match status identifiers to filter for"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/leaderboards/{leaderboard_id}/matches", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Leaderboards","Match data"], + summary="Retrieve all matches on a specific leaderboard for a certain game", + response_model_by_alias=True, +) +async def get_match_collection_for_leaderboard( + leaderboard_id: Ulid = Path(None, description="The unique identifier (ULID) we use for leaderboards of the Relic Link API"), + status: MatchStatus = Query(None, description="Match status identifiers to filter for"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/profiles/{relic_link_id}/matches", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Match data"], + summary="Retrieve all matches for a specific profile", + response_model_by_alias=True, +) +async def get_match_collection_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + last_match: bool = Query(None, description="Only show exactly the last available match"), + status: MatchStatus = Query(None, description="Match status identifiers to filter for"), + game: GameId = Query(None, description="Game identifier to query for"), + start: StartParam = Query(None, description="Starting match"), + count: CountParam = Query(None, description="Number of entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/teams/{team_id}/matches", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Match data"], + summary="Retrieve a list of matches for a specific team", + response_model_by_alias=True, +) +async def get_match_collection_for_team( + team_id: Ulid = Path(None, description="The unique identifier (ULID) we use for teams that play on games using the Relic Link API"), + status: MatchStatus = Query(None, description="Match status identifiers to filter for"), + game: GameId = Query(None, description="Game identifier to query for"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/matches", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Match data","Tournaments","Tournament Administration"], + summary="Retrieve all match data for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_match_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + status: MatchStatus = Query(None, description="Match status identifiers to filter for"), + game: GameId = Query(None, description="Game identifier to query for"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/profile_administration_api.py b/src/openapi_server/apis/profile_administration_api.py new file mode 100644 index 0000000..2fbbbc8 --- /dev/null +++ b/src/openapi_server/apis/profile_administration_api.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.relic_link_id import RelicLinkId +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.put( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration"], + summary="Bulk update of settings for a specific profile from the Relic Link API", + response_model_by_alias=True, +) +async def bulk_update_all_settings_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration"], + summary="Create a new setting for a specific profile from the Relic Link API", + response_model_by_alias=True, +) +async def create_new_setting_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.get( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration","Information"], + summary="Retrieve all settings for a specific profile", + response_model_by_alias=True, +) +async def get_setting_collection_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.patch( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration"], + summary="Update a specific setting for a specific profile from the Relic Link API", + response_model_by_alias=True, +) +async def partial_update_all_settings_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/profiles/{relic_link_id}/settings", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Profile Administration","Administration"], + summary="Remove all settings for a specific profile", + response_model_by_alias=True, +) +async def remove_all_settings_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... diff --git a/src/openapi_server/apis/ratings_api.py b/src/openapi_server/apis/ratings_api.py new file mode 100644 index 0000000..d548da8 --- /dev/null +++ b/src/openapi_server/apis/ratings_api.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.count_param import CountParam +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.game_id import GameId +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.relic_link_id import RelicLinkId +from openapi_server.models.since_param import SinceParam +from openapi_server.models.start_param import StartParam +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/profiles/{relic_link_id}/ledger", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Match data","Ratings"], + summary="Retrieve the rating ledger for a specific profile", + response_model_by_alias=True, +) +async def get_ledger_collection_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + game: GameId = Query(None, description="Game identifier to query for"), + start: StartParam = Query(None, description="Starting match"), + leaderboard_id: Ulid = Query(None, description="Leaderboard identifier"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/search_api.py b/src/openapi_server/apis/search_api.py new file mode 100644 index 0000000..5930f1a --- /dev/null +++ b/src/openapi_server/apis/search_api.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.search_param import SearchParam +from openapi_server.models.steam_id import SteamId +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/profiles/search", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Search"], + response_model_by_alias=True, +) +async def get_profile_information_from_search( + by_name: SearchParam = Query(None, description="First 10 characters of a search string for name to search a `profile_id` for"), + by_steam_id: SteamId = Query(None, description="The Steam ID to search a `profile_id` for"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """Search for a profile by Steam ID or name, returns a single `profile_id` usable with other endpoints""" + ... diff --git a/src/openapi_server/apis/statistics_api.py b/src/openapi_server/apis/statistics_api.py new file mode 100644 index 0000000..d36030c --- /dev/null +++ b/src/openapi_server/apis/statistics_api.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.relic_link_id import RelicLinkId +from openapi_server.models.timeframe import Timeframe +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/dumps/{timeframe}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Database","Statistics"], + response_model_by_alias=True, +) +async def get_database_dump_collection( + timeframe: Timeframe = Path(None, description="The timeframe from which to download a database dump"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """Download a database dump from a given timeframe""" + ... + + +@router.get( + "/leaderboards/{leaderboard_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Leaderboards","Statistics"], + summary="Retrieve all stats on a specific leaderboard for a certain game", + response_model_by_alias=True, +) +async def get_stat_collection_for_leaderboard( + leaderboard_id: Ulid = Path(None, description="The unique identifier (ULID) we use for leaderboards of the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/profiles/{relic_link_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Statistics"], + summary="Retrieve all stats for a specific profile", + response_model_by_alias=True, +) +async def get_stat_collection_for_profile( + relic_link_id: RelicLinkId = Path(None, description="The unique identifier used by the Relic Link API for a player on their platform"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/teams/{team_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Statistics","Teams","Team Administration"], + summary="Retrieve a list of stats for a specific team", + response_model_by_alias=True, +) +async def get_stat_collection_for_team( + team_id: Ulid = Path(None, description="The unique identifier (ULID) we use for teams that play on games using the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Statistics","Tournaments","Tournament Administration"], + summary="Retrieve all statistics for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_stat_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/users/{user_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Statistics"], + summary="Retrieve all stats for a specific user profile on our platform", + response_model_by_alias=True, +) +async def get_stat_collection_for_user( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/status_check_api.py b/src/openapi_server/apis/status_check_api.py new file mode 100644 index 0000000..38ebab7 --- /dev/null +++ b/src/openapi_server/apis/status_check_api.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/application/status", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 503: {"description": "Service Unavailable"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Internal","Administration","Status Check"], + summary="Retrieve only application status", + response_model_by_alias=True, +) +async def get_status_collection_for_application( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/team_administration_api.py b/src/openapi_server/apis/team_administration_api.py new file mode 100644 index 0000000..ffb8a10 --- /dev/null +++ b/src/openapi_server/apis/team_administration_api.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.put( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Team Administration"], + summary="Bulk update of teams", + response_model_by_alias=True, +) +async def bulk_update_all_teams( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Team Administration"], + summary="Create a new team", + response_model_by_alias=True, +) +async def create_new_team( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.get( + "/teams/{team_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Teams","Team Administration"], + summary="Retrieve details of a team", + response_model_by_alias=True, +) +async def get_details_for_team( + team_id: Ulid = Path(None, description="The unique identifier (ULID) we use for teams that play on games using the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/teams/{team_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Statistics","Teams","Team Administration"], + summary="Retrieve a list of stats for a specific team", + response_model_by_alias=True, +) +async def get_stat_collection_for_team( + team_id: Ulid = Path(None, description="The unique identifier (ULID) we use for teams that play on games using the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Teams","Team Administration"], + summary="Retrieve all available teams", + response_model_by_alias=True, +) +async def get_team_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.patch( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Team Administration"], + summary="Partial update of all teams", + response_model_by_alias=True, +) +async def partial_update_all_teams( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Teams","Team Administration"], + summary="Remove all teams", + response_model_by_alias=True, +) +async def remove_all_teams( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... diff --git a/src/openapi_server/apis/teams_api.py b/src/openapi_server/apis/teams_api.py new file mode 100644 index 0000000..bcc85d2 --- /dev/null +++ b/src/openapi_server/apis/teams_api.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/teams/{team_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Teams","Team Administration"], + summary="Retrieve details of a team", + response_model_by_alias=True, +) +async def get_details_for_team( + team_id: Ulid = Path(None, description="The unique identifier (ULID) we use for teams that play on games using the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/teams/{team_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Statistics","Teams","Team Administration"], + summary="Retrieve a list of stats for a specific team", + response_model_by_alias=True, +) +async def get_stat_collection_for_team( + team_id: Ulid = Path(None, description="The unique identifier (ULID) we use for teams that play on games using the Relic Link API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Teams","Team Administration"], + summary="Retrieve all available teams", + response_model_by_alias=True, +) +async def get_team_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.delete( + "/teams", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Teams","Team Administration"], + summary="Remove all teams", + response_model_by_alias=True, +) +async def remove_all_teams( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... diff --git a/src/openapi_server/apis/tournament_administration_api.py b/src/openapi_server/apis/tournament_administration_api.py new file mode 100644 index 0000000..7b99d3b --- /dev/null +++ b/src/openapi_server/apis/tournament_administration_api.py @@ -0,0 +1,558 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.count_param import CountParam +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.game_id import GameId +from openapi_server.models.match_status import MatchStatus +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.since_param import SinceParam +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.put( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Bulk update of admins for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def bulk_update_all_admins_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.put( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Bulk update all brackets for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def bulk_update_all_brackets_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.put( + "/tournaments", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Tournament Administration"], + summary="Bulk update of tournaments", + response_model_by_alias=True, +) +async def bulk_update_all_tournaments( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Create a new admin for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def create_new_admin_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Create a new bracket for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def create_new_bracket_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/tournaments", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Tournament Administration"], + summary="Create a new tournament for a game available on the Relic Link platform", + response_model_by_alias=True, +) +async def create_new_tournament( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.get( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Retrieve all admins for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def get_admin_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Tournaments","Tournament Administration"], + summary="Retrieve all brackets for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_bracket_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/info", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Tournaments","Tournament Administration"], + summary="Retrieve all information for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_info_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/matches", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Match data","Tournaments","Tournament Administration"], + summary="Retrieve all match data for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_match_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + status: MatchStatus = Query(None, description="Match status identifiers to filter for"), + game: GameId = Query(None, description="Game identifier to query for"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Statistics","Tournaments","Tournament Administration"], + summary="Retrieve all statistics for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_stat_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Tournament Administration"], + summary="Retrieve all available tournaments for all games available on the Relic Link platform", + response_model_by_alias=True, +) +async def get_tournament_identifier_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.patch( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Update details of admins for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def partial_update_all_admins_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.patch( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Partial update all brackets for a specific tournament for a specific game available on the Relic Link platform", + response_model_by_alias=True, +) +async def partial_update_bracket_for_tournament( + tournament_id: str = Path(None, description="The unique identifier (ULID) we use for tournaments", regex=r"^[0-7][0-9A-HJKMNP-TV-Z]{25}$", max_length=26), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.patch( + "/tournaments", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Tournament Administration"], + summary="Partial update of tournaments", + response_model_by_alias=True, +) +async def partial_update_tournaments( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/tournaments/{tournament_id}/admins", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Administration","Tournament Administration"], + summary="Remove all admins for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def remove_all_admins_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Tournament Administration"], + summary="Remove all brackets for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def remove_all_brackets_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/tournaments", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Tournament Administration"], + summary="Remove all tournaments", + response_model_by_alias=True, +) +async def remove_all_tournaments( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... diff --git a/src/openapi_server/apis/tournaments_api.py b/src/openapi_server/apis/tournaments_api.py new file mode 100644 index 0000000..6f1ac5f --- /dev/null +++ b/src/openapi_server/apis/tournaments_api.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.count_param import CountParam +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.game_id import GameId +from openapi_server.models.match_status import MatchStatus +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.since_param import SinceParam +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.get( + "/tournaments/{tournament_id}/brackets", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Tournaments","Tournament Administration"], + summary="Retrieve all brackets for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_bracket_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/info", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","Tournaments","Tournament Administration"], + summary="Retrieve all information for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_info_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/matches", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Match data","Tournaments","Tournament Administration"], + summary="Retrieve all match data for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_match_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + status: MatchStatus = Query(None, description="Match status identifiers to filter for"), + game: GameId = Query(None, description="Game identifier to query for"), + count: CountParam = Query(None, description="Number of leaderboard entries to get"), + since: SinceParam = Query(None, description="Only show matches starting after this Unix timestamp"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/tournaments/{tournament_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Statistics","Tournaments","Tournament Administration"], + summary="Retrieve all statistics for a specific tournament for a specific game", + response_model_by_alias=True, +) +async def get_stat_collection_for_tournament( + tournament_id: Ulid = Path(None, description="The unique identifier (ULID) we use for tournaments"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... diff --git a/src/openapi_server/apis/user_administration_api.py b/src/openapi_server/apis/user_administration_api.py new file mode 100644 index 0000000..4b61fc9 --- /dev/null +++ b/src/openapi_server/apis/user_administration_api.py @@ -0,0 +1,311 @@ +# coding: utf-8 + +from typing import Dict, List # noqa: F401 + +from fastapi import ( # noqa: F401 + APIRouter, + Body, + Cookie, + Depends, + Form, + Header, + Path, + Query, + Response, + Security, + status, +) + +from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError +from openapi_server.models.not_acceptable_error import NotAcceptableError +from openapi_server.models.not_found_error import NotFoundError +from openapi_server.models.not_implemented_error import NotImplementedError +from openapi_server.models.too_many_requests_error import TooManyRequestsError +from openapi_server.models.ulid import Ulid +from openapi_server.models.unauthorized_error import UnauthorizedError +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError +from openapi_server.security_api import get_token_BasicAuth, get_token_X-Api-Key + +router = APIRouter() + + +@router.put( + "/users/{user_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["User Administration"], + summary="Bulk update details for a specific user profile on our platform if it exists", + response_model_by_alias=True, +) +async def bulk_update_all_user_details( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.put( + "/users", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["User Administration"], + summary="Bulk update of all users of our platform", + response_model_by_alias=True, +) +async def bulk_update_all_users( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.post( + "/users", + responses={ + 200: {"description": "Operation succeeded"}, + 201: {"description": "Created"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Authentication","Account Registration","User Administration"], + summary="Create a new user for our platform", + response_model_by_alias=True, +) +async def create_new_user( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.get( + "/users/{user_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["Information","User Administration"], + summary="Retrieve details for a specific user profile on our platform", + response_model_by_alias=True, +) +async def get_details_for_user( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + ... + + +@router.get( + "/users", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["User Administration"], + summary="Retrieve all users of our platform", + response_model_by_alias=True, +) +async def get_user_collection( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """Authenticated Endpoint for Administrators or Libre:Match""" + ... + + +@router.patch( + "/users", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["User Administration"], + summary="Partially update details for all user profiles", + response_model_by_alias=True, +) +async def partial_update_all_users( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.patch( + "/users/{user_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 415: {"model": UnsupportedMediaTypeError, "description": "Unsupported Media Type"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["User Administration"], + summary="Update details for a specific user profile on our platform if it exists", + response_model_by_alias=True, +) +async def partial_update_user( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/users/{user_id}/stats", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 501: {"model": NotImplementedError, "description": "Not Implemented"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["User Administration"], + summary="Remove all stats for a specific user profile on our platform", + response_model_by_alias=True, +) +async def remove_all_user_stats( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/users", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["User Administration"], + summary="Remove all users from our platform", + response_model_by_alias=True, +) +async def remove_all_users( + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... + + +@router.delete( + "/users/{user_id}", + responses={ + 200: {"description": "Operation succeeded"}, + 401: {"model": UnauthorizedError, "description": "Unauthorized access"}, + 403: {"model": ForbiddenError, "description": "Forbidden"}, + 404: {"model": NotFoundError, "description": "Entity not found"}, + 406: {"model": NotAcceptableError, "description": "Not acceptable"}, + 429: {"model": TooManyRequestsError, "description": "Too Many Requests"}, + 200: {"model": UnauthorizedError, "description": "Unauthorized access"}, + }, + tags=["User Administration"], + summary="Remove user from our platform if it exists", + response_model_by_alias=True, +) +async def remove_user( + user_id: Ulid = Path(None, description="The unique identifier (ULID) we use for users of our API"), + token_BasicAuth: TokenModel = Security( + get_token_BasicAuth + ), + token_X-Api-Key: TokenModel = Security( + get_token_X-Api-Key + ), +) -> None: + """""" + ... diff --git a/src/openapi_server/main.py b/src/openapi_server/main.py index 4ec718a..b9b3f8e 100644 --- a/src/openapi_server/main.py +++ b/src/openapi_server/main.py @@ -5,7 +5,7 @@ stable, reliable and feature-rich API for match information, leaderboards, and tournament organisation for the Age of Empires multiplayer community - The version of the OpenAPI document: 1.0.0 + The version of the OpenAPI document: 1.0.0-DRAFT Contact: info@librematch.org Generated by: https://openapi-generator.tech """ @@ -13,12 +13,52 @@ from fastapi import FastAPI +from openapi_server.apis.api_token_validation_api import router as APITokenValidationApiRouter +from openapi_server.apis.account_registration_api import router as AccountRegistrationApiRouter +from openapi_server.apis.administration_api import router as AdministrationApiRouter +from openapi_server.apis.authentication_api import router as AuthenticationApiRouter +from openapi_server.apis.database_api import router as DatabaseApiRouter +from openapi_server.apis.definition_api import router as DefinitionApiRouter +from openapi_server.apis.information_api import router as InformationApiRouter +from openapi_server.apis.internal_api import router as InternalApiRouter +from openapi_server.apis.leaderboards_api import router as LeaderboardsApiRouter +from openapi_server.apis.match_data_api import router as MatchDataApiRouter +from openapi_server.apis.profile_administration_api import router as ProfileAdministrationApiRouter +from openapi_server.apis.ratings_api import router as RatingsApiRouter +from openapi_server.apis.search_api import router as SearchApiRouter +from openapi_server.apis.statistics_api import router as StatisticsApiRouter +from openapi_server.apis.status_check_api import router as StatusCheckApiRouter +from openapi_server.apis.team_administration_api import router as TeamAdministrationApiRouter +from openapi_server.apis.teams_api import router as TeamsApiRouter +from openapi_server.apis.tournament_administration_api import router as TournamentAdministrationApiRouter +from openapi_server.apis.tournaments_api import router as TournamentsApiRouter +from openapi_server.apis.user_administration_api import router as UserAdministrationApiRouter from openapi_server.apis.default_api import router as DefaultApiRouter app = FastAPI( title="Libre:Match API", description="stable, reliable and feature-rich API for match information, leaderboards, and tournament organisation for the Age of Empires multiplayer community", - version="1.0.0", + version="1.0.0-DRAFT", ) +app.include_router(APITokenValidationApiRouter) +app.include_router(AccountRegistrationApiRouter) +app.include_router(AdministrationApiRouter) +app.include_router(AuthenticationApiRouter) +app.include_router(DatabaseApiRouter) +app.include_router(DefinitionApiRouter) +app.include_router(InformationApiRouter) +app.include_router(InternalApiRouter) +app.include_router(LeaderboardsApiRouter) +app.include_router(MatchDataApiRouter) +app.include_router(ProfileAdministrationApiRouter) +app.include_router(RatingsApiRouter) +app.include_router(SearchApiRouter) +app.include_router(StatisticsApiRouter) +app.include_router(StatusCheckApiRouter) +app.include_router(TeamAdministrationApiRouter) +app.include_router(TeamsApiRouter) +app.include_router(TournamentAdministrationApiRouter) +app.include_router(TournamentsApiRouter) +app.include_router(UserAdministrationApiRouter) app.include_router(DefaultApiRouter) diff --git a/src/openapi_server/models/error.py b/src/openapi_server/models/accepted.py similarity index 72% rename from src/openapi_server/models/error.py rename to src/openapi_server/models/accepted.py index e6f1953..4a2ec1d 100644 --- a/src/openapi_server/models/error.py +++ b/src/openapi_server/models/accepted.py @@ -9,15 +9,15 @@ from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 -class Error(BaseModel): +class Accepted(BaseModel): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. - Error - a model defined in OpenAPI + Accepted - a model defined in OpenAPI - message: The message of this Error. - code: The code of this Error. + message: The message of this Accepted. + code: The code of this Accepted. """ message: str = Field(alias="message") @@ -25,12 +25,12 @@ class Error(BaseModel): @validator("code") def code_max(cls, value): - assert value <= 600 + assert value <= 202 return value @validator("code") def code_min(cls, value): - assert value >= 100 + assert value >= 202 return value -Error.update_forward_refs() +Accepted.update_forward_refs() diff --git a/src/openapi_server/models/authorization_header.py b/src/openapi_server/models/authorization_header.py new file mode 100644 index 0000000..c9cbc77 --- /dev/null +++ b/src/openapi_server/models/authorization_header.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class AuthorizationHeader(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + AuthorizationHeader - a model defined in OpenAPI + + _self: The _self of this AuthorizationHeader. + """ + + _self: str = Field(alias="self") + + @validator("_self") + def _self_max_length(cls, value): + assert len(value) <= 33 + return value + +AuthorizationHeader.update_forward_refs() diff --git a/src/openapi_server/models/count_param.py b/src/openapi_server/models/count_param.py new file mode 100644 index 0000000..7342349 --- /dev/null +++ b/src/openapi_server/models/count_param.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class CountParam(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + CountParam - a model defined in OpenAPI + + _self: The _self of this CountParam. + """ + + _self: int = Field(alias="self") + + @validator("_self") + def _self_max(cls, value): + assert value <= 10000 + return value + + @validator("_self") + def _self_min(cls, value): + assert value >= 1 + return value + +CountParam.update_forward_refs() diff --git a/src/openapi_server/models/forbidden_error.py b/src/openapi_server/models/forbidden_error.py new file mode 100644 index 0000000..f0fb8de --- /dev/null +++ b/src/openapi_server/models/forbidden_error.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class ForbiddenError(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + ForbiddenError - a model defined in OpenAPI + + message: The message of this ForbiddenError. + code: The code of this ForbiddenError. + """ + + message: str = Field(alias="message") + code: int = Field(alias="code") + + @validator("code") + def code_max(cls, value): + assert value <= 403 + return value + + @validator("code") + def code_min(cls, value): + assert value >= 403 + return value + +ForbiddenError.update_forward_refs() diff --git a/src/openapi_server/models/game_id.py b/src/openapi_server/models/game_id.py new file mode 100644 index 0000000..1ae3121 --- /dev/null +++ b/src/openapi_server/models/game_id.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class GameId(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + GameId - a model defined in OpenAPI + + _self: The _self of this GameId. + """ + + _self: str = Field(alias="self") + +GameId.update_forward_refs() diff --git a/src/openapi_server/models/illegal_input_error.py b/src/openapi_server/models/illegal_input_error.py index 8dbf4b1..be63249 100644 --- a/src/openapi_server/models/illegal_input_error.py +++ b/src/openapi_server/models/illegal_input_error.py @@ -23,6 +23,16 @@ class IllegalInputError(BaseModel): message: str = Field(alias="message") code: int = Field(alias="code") + @validator("message") + def message_max_length(cls, value): + assert len(value) <= 32 + return value + + @validator("message") + def message_pattern(cls, value): + assert value is not None and re.match(r"^example-[0-9a-z]+$", value) + return value + @validator("code") def code_max(cls, value): assert value <= 400 diff --git a/src/openapi_server/models/language_string.py b/src/openapi_server/models/language_string.py new file mode 100644 index 0000000..82f73ea --- /dev/null +++ b/src/openapi_server/models/language_string.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class LanguageString(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + LanguageString - a model defined in OpenAPI + + _self: The _self of this LanguageString. + """ + + _self: str = Field(alias="self") + + @validator("_self") + def _self_min_length(cls, value): + assert len(value) >= 2 + return value + + @validator("_self") + def _self_max_length(cls, value): + assert len(value) <= 5 + return value + + @validator("_self") + def _self_pattern(cls, value): + assert value is not None and re.match(r"^([a-z]{2}){1}(-[A-Z]{2}){0,1}$", value) + return value + +LanguageString.update_forward_refs() diff --git a/src/openapi_server/models/match_id.py b/src/openapi_server/models/match_id.py new file mode 100644 index 0000000..eed0af4 --- /dev/null +++ b/src/openapi_server/models/match_id.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class MatchId(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + MatchId - a model defined in OpenAPI + + _self: The _self of this MatchId. + """ + + _self: str = Field(alias="self") + + @validator("_self") + def _self_pattern(cls, value): + assert value is not None and re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", value) + return value + +MatchId.update_forward_refs() diff --git a/src/openapi_server/models/match_status.py b/src/openapi_server/models/match_status.py new file mode 100644 index 0000000..c55eb57 --- /dev/null +++ b/src/openapi_server/models/match_status.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class MatchStatus(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + MatchStatus - a model defined in OpenAPI + + _self: The _self of this MatchStatus. + """ + + _self: str = Field(alias="self") + +MatchStatus.update_forward_refs() diff --git a/src/openapi_server/models/md5.py b/src/openapi_server/models/md5.py new file mode 100644 index 0000000..46c8bcb --- /dev/null +++ b/src/openapi_server/models/md5.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class Md5(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + Md5 - a model defined in OpenAPI + + checksum: The checksum of this Md5. + """ + + checksum: str = Field(alias="checksum") + + @validator("checksum") + def checksum_max_length(cls, value): + assert len(value) <= 33 + return value + + @validator("checksum") + def checksum_pattern(cls, value): + assert value is not None and re.match(r"^[a-fA-F0-9]{32}$", value) + return value + +Md5.update_forward_refs() diff --git a/src/openapi_server/models/no_content.py b/src/openapi_server/models/no_content.py new file mode 100644 index 0000000..dab925d --- /dev/null +++ b/src/openapi_server/models/no_content.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class NoContent(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + NoContent - a model defined in OpenAPI + + message: The message of this NoContent. + code: The code of this NoContent. + """ + + message: str = Field(alias="message") + code: int = Field(alias="code") + + @validator("message") + def message_max_length(cls, value): + assert len(value) <= 32 + return value + + @validator("message") + def message_pattern(cls, value): + assert value is not None and re.match(r"^example-[0-9a-z]+$", value) + return value + + @validator("code") + def code_max(cls, value): + assert value <= 204 + return value + + @validator("code") + def code_min(cls, value): + assert value >= 204 + return value + +NoContent.update_forward_refs() diff --git a/src/openapi_server/models/not_acceptable_error.py b/src/openapi_server/models/not_acceptable_error.py new file mode 100644 index 0000000..c0e8916 --- /dev/null +++ b/src/openapi_server/models/not_acceptable_error.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class NotAcceptableError(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + NotAcceptableError - a model defined in OpenAPI + + message: The message of this NotAcceptableError. + code: The code of this NotAcceptableError. + """ + + message: str = Field(alias="message") + code: int = Field(alias="code") + + @validator("code") + def code_max(cls, value): + assert value <= 406 + return value + + @validator("code") + def code_min(cls, value): + assert value >= 406 + return value + +NotAcceptableError.update_forward_refs() diff --git a/src/openapi_server/models/not_found_error.py b/src/openapi_server/models/not_found_error.py new file mode 100644 index 0000000..c246be4 --- /dev/null +++ b/src/openapi_server/models/not_found_error.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class NotFoundError(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + NotFoundError - a model defined in OpenAPI + + message: The message of this NotFoundError. + code: The code of this NotFoundError. + """ + + message: str = Field(alias="message") + code: int = Field(alias="code") + + @validator("code") + def code_max(cls, value): + assert value <= 404 + return value + + @validator("code") + def code_min(cls, value): + assert value >= 404 + return value + +NotFoundError.update_forward_refs() diff --git a/src/openapi_server/models/not_implemented_error.py b/src/openapi_server/models/not_implemented_error.py new file mode 100644 index 0000000..5a13ecc --- /dev/null +++ b/src/openapi_server/models/not_implemented_error.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class NotImplementedError(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + NotImplementedError - a model defined in OpenAPI + + message: The message of this NotImplementedError. + code: The code of this NotImplementedError. + """ + + message: str = Field(alias="message") + code: int = Field(alias="code") + + @validator("code") + def code_max(cls, value): + assert value <= 501 + return value + + @validator("code") + def code_min(cls, value): + assert value >= 501 + return value + +NotImplementedError.update_forward_refs() diff --git a/src/openapi_server/models/relic_link_id.py b/src/openapi_server/models/relic_link_id.py new file mode 100644 index 0000000..b40164e --- /dev/null +++ b/src/openapi_server/models/relic_link_id.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class RelicLinkId(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + RelicLinkId - a model defined in OpenAPI + + id: The id of this RelicLinkId. + """ + + id: int = Field(alias="id") + + @validator("id") + def id_max(cls, value): + assert value <= 999999999 + return value + + @validator("id") + def id_min(cls, value): + assert value >= 0 + return value + +RelicLinkId.update_forward_refs() diff --git a/src/openapi_server/models/request_timeout_error.py b/src/openapi_server/models/request_timeout_error.py new file mode 100644 index 0000000..bf7e446 --- /dev/null +++ b/src/openapi_server/models/request_timeout_error.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class RequestTimeoutError(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + RequestTimeoutError - a model defined in OpenAPI + + message: The message of this RequestTimeoutError. + code: The code of this RequestTimeoutError. + """ + + message: str = Field(alias="message") + code: int = Field(alias="code") + + @validator("code") + def code_max(cls, value): + assert value <= 408 + return value + + @validator("code") + def code_min(cls, value): + assert value >= 408 + return value + +RequestTimeoutError.update_forward_refs() diff --git a/src/openapi_server/models/search_param.py b/src/openapi_server/models/search_param.py new file mode 100644 index 0000000..9d32bb7 --- /dev/null +++ b/src/openapi_server/models/search_param.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class SearchParam(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + SearchParam - a model defined in OpenAPI + + _self: The _self of this SearchParam. + """ + + _self: str = Field(alias="self") + + @validator("_self") + def _self_max_length(cls, value): + assert len(value) <= 10 + return value + + @validator("_self") + def _self_pattern(cls, value): + assert value is not None and re.match(r"^.{10}$", value) + return value + +SearchParam.update_forward_refs() diff --git a/src/openapi_server/models/service_unavailable_error.py b/src/openapi_server/models/service_unavailable_error.py new file mode 100644 index 0000000..2f6a8d7 --- /dev/null +++ b/src/openapi_server/models/service_unavailable_error.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class ServiceUnavailableError(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + ServiceUnavailableError - a model defined in OpenAPI + + message: The message of this ServiceUnavailableError. + code: The code of this ServiceUnavailableError. + """ + + message: str = Field(alias="message") + code: int = Field(alias="code") + + @validator("code") + def code_max(cls, value): + assert value <= 503 + return value + + @validator("code") + def code_min(cls, value): + assert value >= 503 + return value + +ServiceUnavailableError.update_forward_refs() diff --git a/src/openapi_server/models/since_param.py b/src/openapi_server/models/since_param.py new file mode 100644 index 0000000..c635d3d --- /dev/null +++ b/src/openapi_server/models/since_param.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class SinceParam(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + SinceParam - a model defined in OpenAPI + + _self: The _self of this SinceParam. + """ + + _self: int = Field(alias="self") + + @validator("_self") + def _self_max(cls, value): + assert value <= 1980923226 + return value + + @validator("_self") + def _self_min(cls, value): + assert value >= 1602232026 + return value + +SinceParam.update_forward_refs() diff --git a/src/openapi_server/models/start_param.py b/src/openapi_server/models/start_param.py new file mode 100644 index 0000000..5c81562 --- /dev/null +++ b/src/openapi_server/models/start_param.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class StartParam(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + StartParam - a model defined in OpenAPI + + _self: The _self of this StartParam. + """ + + _self: int = Field(alias="self") + + @validator("_self") + def _self_max(cls, value): + assert value <= 999999999 + return value + + @validator("_self") + def _self_min(cls, value): + assert value >= 1 + return value + +StartParam.update_forward_refs() diff --git a/src/openapi_server/models/steam_id.py b/src/openapi_server/models/steam_id.py new file mode 100644 index 0000000..df30097 --- /dev/null +++ b/src/openapi_server/models/steam_id.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class SteamId(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + SteamId - a model defined in OpenAPI + + _self: The _self of this SteamId. + """ + + _self: int = Field(alias="self") + + @validator("_self") + def _self_max(cls, value): + assert value <= 18 + return value + + @validator("_self") + def _self_min(cls, value): + assert value >= 14 + return value + +SteamId.update_forward_refs() diff --git a/src/openapi_server/models/timeframe.py b/src/openapi_server/models/timeframe.py new file mode 100644 index 0000000..76059a0 --- /dev/null +++ b/src/openapi_server/models/timeframe.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class Timeframe(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + Timeframe - a model defined in OpenAPI + + _self: The _self of this Timeframe. + """ + + _self: str = Field(alias="self") + + @validator("_self") + def _self_max_length(cls, value): + assert len(value) <= 15 + return value + + @validator("_self") + def _self_pattern(cls, value): + assert value is not None and re.match(r"^\d\d\d\d-(0?[1-9]|1[0-2])-(0?[1-9]|[12][0-9]|3[01]) (00|[0-9]|1[0-9]|2[0-3]):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9])$", value) + return value + +Timeframe.update_forward_refs() diff --git a/src/openapi_server/models/too_many_requests_error.py b/src/openapi_server/models/too_many_requests_error.py new file mode 100644 index 0000000..9db1fff --- /dev/null +++ b/src/openapi_server/models/too_many_requests_error.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class TooManyRequestsError(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + TooManyRequestsError - a model defined in OpenAPI + + message: The message of this TooManyRequestsError. + code: The code of this TooManyRequestsError. + """ + + message: str = Field(alias="message") + code: int = Field(alias="code") + + @validator("code") + def code_max(cls, value): + assert value <= 429 + return value + + @validator("code") + def code_min(cls, value): + assert value >= 429 + return value + +TooManyRequestsError.update_forward_refs() diff --git a/src/openapi_server/models/ulid.py b/src/openapi_server/models/ulid.py new file mode 100644 index 0000000..e94af79 --- /dev/null +++ b/src/openapi_server/models/ulid.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class Ulid(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + Ulid - a model defined in OpenAPI + + ulid: The ulid of this Ulid. + """ + + ulid: str = Field(alias="ulid") + + @validator("ulid") + def ulid_max_length(cls, value): + assert len(value) <= 26 + return value + + @validator("ulid") + def ulid_pattern(cls, value): + assert value is not None and re.match(r"^[0-7][0-9A-HJKMNP-TV-Z]{25}$", value) + return value + +Ulid.update_forward_refs() diff --git a/src/openapi_server/models/unauthorized_error.py b/src/openapi_server/models/unauthorized_error.py index 21e7255..b564548 100644 --- a/src/openapi_server/models/unauthorized_error.py +++ b/src/openapi_server/models/unauthorized_error.py @@ -23,6 +23,16 @@ class UnauthorizedError(BaseModel): message: str = Field(alias="message") code: int = Field(alias="code") + @validator("message") + def message_max_length(cls, value): + assert len(value) <= 32 + return value + + @validator("message") + def message_pattern(cls, value): + assert value is not None and re.match(r"^example-[0-9a-z]+$", value) + return value + @validator("code") def code_max(cls, value): assert value <= 401 diff --git a/src/openapi_server/models/unsupported_media_type_error.py b/src/openapi_server/models/unsupported_media_type_error.py new file mode 100644 index 0000000..a6f4f51 --- /dev/null +++ b/src/openapi_server/models/unsupported_media_type_error.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class UnsupportedMediaTypeError(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + UnsupportedMediaTypeError - a model defined in OpenAPI + + message: The message of this UnsupportedMediaTypeError. + code: The code of this UnsupportedMediaTypeError. + """ + + message: str = Field(alias="message") + code: int = Field(alias="code") + + @validator("code") + def code_max(cls, value): + assert value <= 415 + return value + + @validator("code") + def code_min(cls, value): + assert value >= 415 + return value + +UnsupportedMediaTypeError.update_forward_refs() diff --git a/src/openapi_server/models/www_authenticate.py b/src/openapi_server/models/www_authenticate.py new file mode 100644 index 0000000..8d3bc46 --- /dev/null +++ b/src/openapi_server/models/www_authenticate.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +from __future__ import annotations +from datetime import date, datetime # noqa: F401 + +import re # noqa: F401 +from typing import Any, Dict, List, Optional # noqa: F401 + +from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator # noqa: F401 + + +class WwwAuthenticate(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + + WwwAuthenticate - a model defined in OpenAPI + + _self: The _self of this WwwAuthenticate. + """ + + _self: str = Field(alias="self") + + @validator("_self") + def _self_max_length(cls, value): + assert len(value) <= 33 + return value + +WwwAuthenticate.update_forward_refs() diff --git a/src/openapi_server/security_api.py b/src/openapi_server/security_api.py index dd153f5..076fd25 100644 --- a/src/openapi_server/security_api.py +++ b/src/openapi_server/security_api.py @@ -19,6 +19,25 @@ from openapi_server.models.extra_models import TokenModel +def get_token_BasicAuth( + token_api_key_header: str = Security( + APIKeyHeader(name="BasicAuth", auto_error=False) + ), +) -> TokenModel: + """ + Check and retrieve authentication information from api_key. + + :param token_api_key_header API key provided by Authorization[BasicAuth] header + + + :type token_api_key_header: str + :return: Information attached to provided api_key or None if api_key is invalid or does not allow access to called API + :rtype: TokenModel | None + """ + + ... + + bearer_auth = HTTPBearer() diff --git a/tests/test_account_registration_api.py b/tests/test_account_registration_api.py new file mode 100644 index 0000000..08760d1 --- /dev/null +++ b/tests/test_account_registration_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError # noqa: F401 + + +def test_create_new_user(client: TestClient): + """Test case for create_new_user + + Create a new user for our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/users", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_user_register(client: TestClient): + """Test case for user_register + + + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/users/register", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_administration_api.py b/tests/test_administration_api.py new file mode 100644 index 0000000..d524e27 --- /dev/null +++ b/tests/test_administration_api.py @@ -0,0 +1,535 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.relic_link_id import RelicLinkId # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError # noqa: F401 + + +def test_bulk_update_all_admins_for_tournament(client: TestClient): + """Test case for bulk_update_all_admins_for_tournament + + Bulk update of admins for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_bulk_update_all_brackets_for_tournament(client: TestClient): + """Test case for bulk_update_all_brackets_for_tournament + + Bulk update all brackets for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/tournaments/{tournament_id}/brackets".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_bulk_update_all_settings_for_profile(client: TestClient): + """Test case for bulk_update_all_settings_for_profile + + Bulk update of settings for a specific profile from the Relic Link API + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_bulk_update_all_teams(client: TestClient): + """Test case for bulk_update_all_teams + + Bulk update of teams + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_bulk_update_all_user_stats(client: TestClient): + """Test case for bulk_update_all_user_stats + + Bulk update of stats for a specific user profile on our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/users/{user_id}/stats".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_admin_for_tournament(client: TestClient): + """Test case for create_new_admin_for_tournament + + Create a new admin for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_bracket_for_tournament(client: TestClient): + """Test case for create_new_bracket_for_tournament + + Create a new bracket for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/tournaments/{tournament_id}/brackets".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_setting_for_profile(client: TestClient): + """Test case for create_new_setting_for_profile + + Create a new setting for a specific profile from the Relic Link API + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_team(client: TestClient): + """Test case for create_new_team + + Create a new team + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_user_stats(client: TestClient): + """Test case for create_new_user_stats + + Create a new stat for a specific user profile on our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/users/{user_id}/stats".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_admin_collection_for_tournament(client: TestClient): + """Test case for get_admin_collection_for_tournament + + Retrieve all admins for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_information_collection_for_application(client: TestClient): + """Test case for get_information_collection_for_application + + Retrieve a list of available application information + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/application", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_profile_collection(client: TestClient): + """Test case for get_profile_collection + + Retrieve all available profiles + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_setting_collection_for_profile(client: TestClient): + """Test case for get_setting_collection_for_profile + + Retrieve all settings for a specific profile + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_application(client: TestClient): + """Test case for get_stat_collection_for_application + + Retrieve a list of only application statistics + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/application/statistics", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_status_collection_for_application(client: TestClient): + """Test case for get_status_collection_for_application + + Retrieve only application status + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/application/status", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_all_admins_for_tournament(client: TestClient): + """Test case for partial_update_all_admins_for_tournament + + Update details of admins for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_all_settings_for_profile(client: TestClient): + """Test case for partial_update_all_settings_for_profile + + Update a specific setting for a specific profile from the Relic Link API + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_all_teams(client: TestClient): + """Test case for partial_update_all_teams + + Partial update of all teams + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_bracket_for_tournament(client: TestClient): + """Test case for partial_update_bracket_for_tournament + + Partial update all brackets for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/tournaments/{tournament_id}/brackets".format(tournament_id='tournament_id_example'), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_tournament_details(client: TestClient): + """Test case for partial_update_tournament_details + + Partially update a tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/tournaments/{tournament_id}".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_user_stats(client: TestClient): + """Test case for partial_update_user_stats + + Partially update stats for a specific user profile on our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/users/{user_id}/stats".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_admins_for_tournament(client: TestClient): + """Test case for remove_all_admins_for_tournament + + Remove all admins for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_settings_for_profile(client: TestClient): + """Test case for remove_all_settings_for_profile + + Remove all settings for a specific profile + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_tournament_details(client: TestClient): + """Test case for remove_tournament_details + + Remove a tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/tournaments/{tournament_id}".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_update_tournament_details(client: TestClient): + """Test case for update_tournament_details + + Update details for a tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/tournaments/{tournament_id}".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_api_token_validation_api.py b/tests/test_api_token_validation_api.py new file mode 100644 index 0000000..e9edcd9 --- /dev/null +++ b/tests/test_api_token_validation_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError # noqa: F401 + + +def test_create_new_user_validation(client: TestClient): + """Test case for create_new_user_validation + + + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/users/validate", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_user_validation_details(client: TestClient): + """Test case for get_user_validation_details + + + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/users/validate", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_authentication_api.py b/tests/test_authentication_api.py new file mode 100644 index 0000000..f663af5 --- /dev/null +++ b/tests/test_authentication_api.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError # noqa: F401 + + +def test_create_new_user(client: TestClient): + """Test case for create_new_user + + Create a new user for our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/users", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_user_validation(client: TestClient): + """Test case for create_new_user_validation + + + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/users/validate", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_user_validation_details(client: TestClient): + """Test case for get_user_validation_details + + + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/users/validate", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_user_login(client: TestClient): + """Test case for user_login + + + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/users/login", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_user_logout(client: TestClient): + """Test case for user_logout + + + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/users/logout", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_database_api.py b/tests/test_database_api.py new file mode 100644 index 0000000..a40054d --- /dev/null +++ b/tests/test_database_api.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.timeframe import Timeframe # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_database_dump_collection(client: TestClient): + """Test case for get_database_dump_collection + + + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/dumps/{timeframe}".format(timeframe={'key': openapi_server.Timeframe()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_default_api.py b/tests/test_default_api.py index cfcce25..242dceb 100644 --- a/tests/test_default_api.py +++ b/tests/test_default_api.py @@ -3,1332 +3,27 @@ from fastapi.testclient import TestClient +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.game_id import GameId # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 -def test_bulk_update_all_admins_for_tournament(client: TestClient): - """Test case for bulk_update_all_admins_for_tournament - - Bulk update of admins for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PUT", - "/tournaments/{tournament_id}/admins".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_bulk_update_all_brackets_for_tournament(client: TestClient): - """Test case for bulk_update_all_brackets_for_tournament - - Bulk update all brackets for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PUT", - "/tournaments/{tournament_id}/brackets".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_bulk_update_all_settings_for_profile(client: TestClient): - """Test case for bulk_update_all_settings_for_profile - - Bulk update of settings for a specific profile from the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PUT", - "/profiles/{relic_link_id}/settings".format(relic_link_id=56), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_bulk_update_all_teams(client: TestClient): - """Test case for bulk_update_all_teams - - Bulk update of teams - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PUT", - "/teams", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_bulk_update_all_tournaments(client: TestClient): - """Test case for bulk_update_all_tournaments - - Bulk update of tournaments - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PUT", - "/tournaments", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_bulk_update_all_user_details(client: TestClient): - """Test case for bulk_update_all_user_details - - Bulk update details for a specific user profile on our platform if it exists - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PUT", - "/users/{user_id}".format(user_id='user_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_bulk_update_all_user_stats(client: TestClient): - """Test case for bulk_update_all_user_stats - - Bulk update of stats for a specific user profile on our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PUT", - "/users/{user_id}/stats".format(user_id='user_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_bulk_update_all_users(client: TestClient): - """Test case for bulk_update_all_users - - Bulk update of all users of our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PUT", - "/users", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_create_new_admin_for_tournament(client: TestClient): - """Test case for create_new_admin_for_tournament - - Create a new admin for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/tournaments/{tournament_id}/admins".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_create_new_bracket_for_tournament(client: TestClient): - """Test case for create_new_bracket_for_tournament - - Create a new bracket for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/tournaments/{tournament_id}/brackets".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_create_new_setting_for_profile(client: TestClient): - """Test case for create_new_setting_for_profile - - Create a new setting for a specific profile from the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/profiles/{relic_link_id}/settings".format(relic_link_id=56), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_create_new_team(client: TestClient): - """Test case for create_new_team - - Create a new team - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/teams", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_create_new_tournament(client: TestClient): - """Test case for create_new_tournament - - Create a new tournament for a game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/tournaments", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_create_new_user(client: TestClient): - """Test case for create_new_user - - Create a new user for our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/users", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_create_new_user_stats(client: TestClient): - """Test case for create_new_user_stats - - Create a new stat for a specific user profile on our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/users/{user_id}/stats".format(user_id='user_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_create_new_user_validation(client: TestClient): - """Test case for create_new_user_validation - - - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/users/validate", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_admin_collection_for_tournament(client: TestClient): - """Test case for get_admin_collection_for_tournament - - Retrieve all admins for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/tournaments/{tournament_id}/admins".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_bracket_collection_for_tournament(client: TestClient): - """Test case for get_bracket_collection_for_tournament - - Retrieve all brackets for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/tournaments/{tournament_id}/brackets".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_definition_collection_for_game(client: TestClient): - """Test case for get_definition_collection_for_game - - Retrieve all available definitions for a specific game using Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/games/{game_id}/definitions".format(game_id='game_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_details_for_game(client: TestClient): - """Test case for get_details_for_game - - Retrieve details for a game with a specific identifier using Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/games/{game_id}".format(game_id='game_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_details_for_leaderboard(client: TestClient): - """Test case for get_details_for_leaderboard - - Retrieve details for a specific leaderboard - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/leaderboards/{leaderboard_id}".format(leaderboard_id='leaderboard_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_details_for_profile(client: TestClient): - """Test case for get_details_for_profile - - Retrieve the details for a specific profile from the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/profiles/{relic_link_id}".format(relic_link_id=56), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_details_for_team(client: TestClient): - """Test case for get_details_for_team - - Retrieve details of a team - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/teams/{team_id}".format(game_id='game_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_details_for_tournament(client: TestClient): - """Test case for get_details_for_tournament - - Retrieve details for a tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/tournaments/{tournament_id}".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_details_for_user(client: TestClient): - """Test case for get_details_for_user - - Retrieve details for a specific user profile on our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/users/{user_id}".format(user_id='user_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_game_identifier_collection(client: TestClient): - """Test case for get_game_identifier_collection - - Retrieve a list of all game identifiers for games using Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/games", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_info_collection_for_game(client: TestClient): - """Test case for get_info_collection_for_game - - Retrieve all available information for a specific game using Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/games/{game_id}/info".format(game_id='game_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_info_collection_for_tournament(client: TestClient): - """Test case for get_info_collection_for_tournament - - Retrieve all information for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/tournaments/{tournament_id}/info".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_information_collection_for_application(client: TestClient): - """Test case for get_information_collection_for_application - - Retrieve a list of available application information - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/application", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_leaderboard_collection(client: TestClient): - """Test case for get_leaderboard_collection - - Retrieve all leaderboards hosted on the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/leaderboards", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_leaderboard_collection_for_game(client: TestClient): - """Test case for get_leaderboard_collection_for_game - - Retrieve all leaderboards for a specific game using Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/games/{game_id}/leaderboards".format(game_id='game_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_match_collection_for_game(client: TestClient): - """Test case for get_match_collection_for_game - - Retrieve all matches for a specific game using Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/games/{game_id}/matches".format(game_id='game_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_match_collection_for_leaderboard(client: TestClient): - """Test case for get_match_collection_for_leaderboard - - Retrieve all matches on a specific leaderboard for a certain game hosted on the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/leaderboards/{leaderboard_id}/matches".format(leaderboard_id='leaderboard_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_match_collection_for_profile(client: TestClient): - """Test case for get_match_collection_for_profile - - Retrieve all matches for a specific profile from the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/profiles/{relic_link_id}/matches".format(relic_link_id=56), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_match_collection_for_team(client: TestClient): - """Test case for get_match_collection_for_team - - Retrieve a list of matches for a specific team - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/teams/{team_id}/matches".format(game_id='game_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_profile_collection(client: TestClient): - """Test case for get_profile_collection - - Retrieve all available profiles from the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/profiles", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_setting_collection_for_profile(client: TestClient): - """Test case for get_setting_collection_for_profile - - Retrieve all settings for a specific profile from the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/profiles/{relic_link_id}/settings".format(relic_link_id=56), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_stat_collection_for_application(client: TestClient): - """Test case for get_stat_collection_for_application - - Retrieve a list of only application statistics - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/application/statistics", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_stat_collection_for_leaderboard(client: TestClient): - """Test case for get_stat_collection_for_leaderboard - - Retrieve all stats on a specific leaderboard for a certain game hosted on the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/leaderboards/{leaderboard_id}/stats".format(leaderboard_id='leaderboard_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_stat_collection_for_profile(client: TestClient): - """Test case for get_stat_collection_for_profile - - Retrieve all stats for a specific profile from the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/profiles/{relic_link_id}/stats".format(relic_link_id=56), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_stat_collection_for_team(client: TestClient): - """Test case for get_stat_collection_for_team - - Retrieve a list of stats for a specific team - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/teams/{team_id}/stats".format(game_id='game_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_stat_collection_for_user(client: TestClient): - """Test case for get_stat_collection_for_user - - Retrieve all stats for a specific user profile on our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/users/{user_id}/stats".format(user_id='user_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_status_collection_for_application(client: TestClient): - """Test case for get_status_collection_for_application - - Retrieve only application status - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/application/status", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_team_collection(client: TestClient): - """Test case for get_team_collection - - Retrieve all available teams - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/teams", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_tournament_details_for_game(client: TestClient): - """Test case for get_tournament_details_for_game - - Retrieve all available tournaments for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/tournaments/{game_id}".format(game_id='game_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_tournament_identifier_collection(client: TestClient): - """Test case for get_tournament_identifier_collection - - Retrieve all available tournaments for all games available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/tournaments", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_user_collection(client: TestClient): - """Test case for get_user_collection - - Retrieve all users of our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/users", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_get_user_validation_details(client: TestClient): - """Test case for get_user_validation_details - - - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "GET", - "/users/validate", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_partial_update_all_admins_for_tournament(client: TestClient): - """Test case for partial_update_all_admins_for_tournament - - Update details of admins for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PATCH", - "/tournaments/{tournament_id}/admins".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_partial_update_all_settings_for_profile(client: TestClient): - """Test case for partial_update_all_settings_for_profile - - Update a specific setting for a specific profile from the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PATCH", - "/profiles/{relic_link_id}/settings".format(relic_link_id=56), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_partial_update_all_teams(client: TestClient): - """Test case for partial_update_all_teams - - Partial update of all teams - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PATCH", - "/teams", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_partial_update_all_users(client: TestClient): - """Test case for partial_update_all_users - - Partially update details for all user profiles - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PATCH", - "/users", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_partial_update_bracket_for_tournament(client: TestClient): - """Test case for partial_update_bracket_for_tournament - - Partial update all brackets for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PATCH", - "/tournaments/{tournament_id}/brackets".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_partial_update_tournament_details(client: TestClient): - """Test case for partial_update_tournament_details - - Partially update a tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PATCH", - "/tournaments/{tournament_id}".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_partial_update_tournaments(client: TestClient): - """Test case for partial_update_tournaments - - Partial update of tournaments - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PATCH", - "/tournaments", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_partial_update_user(client: TestClient): - """Test case for partial_update_user - - Update details for a specific user profile on our platform if it exists - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PATCH", - "/users/{user_id}".format(user_id='user_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_partial_update_user_stats(client: TestClient): - """Test case for partial_update_user_stats - - Partially update stats for a specific user profile on our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PATCH", - "/users/{user_id}/stats".format(user_id='user_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_remove_all_admins_for_tournament(client: TestClient): - """Test case for remove_all_admins_for_tournament - - Remove all admins for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "DELETE", - "/tournaments/{tournament_id}/admins".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_remove_all_brackets_for_tournament(client: TestClient): - """Test case for remove_all_brackets_for_tournament - - Remove all brackets for a specific tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "DELETE", - "/tournaments/{tournament_id}/brackets".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_remove_all_settings_for_profile(client: TestClient): - """Test case for remove_all_settings_for_profile - - Remove all settings for a specific profile from the Relic Link API - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "DELETE", - "/profiles/{relic_link_id}/settings".format(relic_link_id=56), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_remove_all_teams(client: TestClient): - """Test case for remove_all_teams - - Remove all teams - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "DELETE", - "/teams", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_remove_all_tournaments(client: TestClient): - """Test case for remove_all_tournaments - - Remove all tournaments - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "DELETE", - "/tournaments", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_remove_all_user_stats(client: TestClient): - """Test case for remove_all_user_stats - - Remove all stats for a specific user profile on our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "DELETE", - "/users/{user_id}/stats".format(user_id='user_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_remove_all_users(client: TestClient): - """Test case for remove_all_users - - Remove all users from our platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "DELETE", - "/users", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_remove_tournament_details(client: TestClient): - """Test case for remove_tournament_details - - Remove a tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "DELETE", - "/tournaments/{tournament_id}".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_remove_user(client: TestClient): - """Test case for remove_user - - Remove user from our platform if it exists - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "DELETE", - "/users/{user_id}".format(user_id='user_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_update_tournament_details(client: TestClient): - """Test case for update_tournament_details - - Update details for a tournament for a specific game available on the Relic Link platform - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "PUT", - "/tournaments/{tournament_id}".format(tournament_id='tournament_id_example'), - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_user_login(client: TestClient): - """Test case for user_login - - - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/users/login", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_user_logout(client: TestClient): - """Test case for user_logout +def test_get_details_for_game(client: TestClient): + """Test case for get_details_for_game - + Retrieve details for a game with a specific identifiers """ headers = { + "BasicAuth": "special-key", "X-Api-Key": "special-key", } response = client.request( "GET", - "/users/logout", - headers=headers, - ) - - # uncomment below to assert the status code of the HTTP response - #assert response.status_code == 200 - - -def test_user_register(client: TestClient): - """Test case for user_register - - - """ - - headers = { - "X-Api-Key": "special-key", - } - response = client.request( - "POST", - "/users/register", + "/games/{game_id}".format(game_id={'key': openapi_server.GameId()}), headers=headers, ) diff --git a/tests/test_definition_api.py b/tests/test_definition_api.py new file mode 100644 index 0000000..e6d8045 --- /dev/null +++ b/tests/test_definition_api.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.game_id import GameId # noqa: F401 +from openapi_server.models.language_string import LanguageString # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_definition_collection_for_game(client: TestClient): + """Test case for get_definition_collection_for_game + + Retrieve all available definitions for a specific game + """ + params = [("language", {'key': openapi_server.LanguageString()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/games/{game_id}/definitions".format(game_id={'key': openapi_server.GameId()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_information_api.py b/tests/test_information_api.py new file mode 100644 index 0000000..485a479 --- /dev/null +++ b/tests/test_information_api.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.game_id import GameId # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.relic_link_id import RelicLinkId # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_bracket_collection_for_tournament(client: TestClient): + """Test case for get_bracket_collection_for_tournament + + Retrieve all brackets for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/brackets".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_details_for_profile(client: TestClient): + """Test case for get_details_for_profile + + Retrieve the details for a specific profile + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles/{relic_link_id}".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_details_for_tournament(client: TestClient): + """Test case for get_details_for_tournament + + Retrieve details for a tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_details_for_user(client: TestClient): + """Test case for get_details_for_user + + Retrieve details for a specific user profile on our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/users/{user_id}".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_game_identifier_collection(client: TestClient): + """Test case for get_game_identifier_collection + + Retrieve a list of all game identifiers for games + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/games", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_info_collection_for_game(client: TestClient): + """Test case for get_info_collection_for_game + + Retrieve all available information for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/games/{game_id}/info".format(game_id={'key': openapi_server.GameId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_info_collection_for_tournament(client: TestClient): + """Test case for get_info_collection_for_tournament + + Retrieve all information for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/info".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_leaderboard_collection(client: TestClient): + """Test case for get_leaderboard_collection + + Retrieve all leaderboards + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/leaderboards", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_setting_collection_for_profile(client: TestClient): + """Test case for get_setting_collection_for_profile + + Retrieve all settings for a specific profile + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_team_collection(client: TestClient): + """Test case for get_team_collection + + Retrieve all available teams + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_tournament_identifier_collection(client: TestClient): + """Test case for get_tournament_identifier_collection + + Retrieve all available tournaments for all games available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_internal_api.py b/tests/test_internal_api.py new file mode 100644 index 0000000..6b26c3a --- /dev/null +++ b/tests/test_internal_api.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_information_collection_for_application(client: TestClient): + """Test case for get_information_collection_for_application + + Retrieve a list of available application information + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/application", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_application(client: TestClient): + """Test case for get_stat_collection_for_application + + Retrieve a list of only application statistics + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/application/statistics", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_status_collection_for_application(client: TestClient): + """Test case for get_status_collection_for_application + + Retrieve only application status + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/application/status", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_leaderboards_api.py b/tests/test_leaderboards_api.py new file mode 100644 index 0000000..607b1a5 --- /dev/null +++ b/tests/test_leaderboards_api.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.count_param import CountParam # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.game_id import GameId # noqa: F401 +from openapi_server.models.match_status import MatchStatus # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.relic_link_id import RelicLinkId # noqa: F401 +from openapi_server.models.search_param import SearchParam # noqa: F401 +from openapi_server.models.since_param import SinceParam # noqa: F401 +from openapi_server.models.start_param import StartParam # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_details_for_leaderboard(client: TestClient): + """Test case for get_details_for_leaderboard + + Retrieve details for a specific leaderboard + """ + params = [("profile_id", {'key': openapi_server.RelicLinkId()}), ("search", {'key': openapi_server.SearchParam()}), ("start", {'key': openapi_server.StartParam()}), ("count", {'key': openapi_server.CountParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/leaderboards/{leaderboard_id}".format(leaderboard_id={'key': openapi_server.Ulid()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_leaderboard_collection(client: TestClient): + """Test case for get_leaderboard_collection + + Retrieve all leaderboards + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/leaderboards", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_leaderboard_collection_for_game(client: TestClient): + """Test case for get_leaderboard_collection_for_game + + Retrieve all leaderboards for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/games/{game_id}/leaderboards".format(game_id={'key': openapi_server.GameId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_match_collection_for_leaderboard(client: TestClient): + """Test case for get_match_collection_for_leaderboard + + Retrieve all matches on a specific leaderboard for a certain game + """ + params = [("status", {'key': openapi_server.MatchStatus()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/leaderboards/{leaderboard_id}/matches".format(leaderboard_id={'key': openapi_server.Ulid()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_leaderboard(client: TestClient): + """Test case for get_stat_collection_for_leaderboard + + Retrieve all stats on a specific leaderboard for a certain game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/leaderboards/{leaderboard_id}/stats".format(leaderboard_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_match_data_api.py b/tests/test_match_data_api.py new file mode 100644 index 0000000..ae39b83 --- /dev/null +++ b/tests/test_match_data_api.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.count_param import CountParam # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.game_id import GameId # noqa: F401 +from openapi_server.models.match_id import MatchId # noqa: F401 +from openapi_server.models.match_status import MatchStatus # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.relic_link_id import RelicLinkId # noqa: F401 +from openapi_server.models.since_param import SinceParam # noqa: F401 +from openapi_server.models.start_param import StartParam # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_ledger_collection_for_profile(client: TestClient): + """Test case for get_ledger_collection_for_profile + + Retrieve the rating ledger for a specific profile + """ + params = [("game", {'key': openapi_server.GameId()}), ("start", {'key': openapi_server.StartParam()}), ("leaderboard_id", {'key': openapi_server.Ulid()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles/{relic_link_id}/ledger".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_match_collection_for_game(client: TestClient): + """Test case for get_match_collection_for_game + + Retrieve all matches for a specific game + """ + params = [("single_match", {'key': openapi_server.MatchId()}), ("status", {'key': openapi_server.MatchStatus()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/games/{game_id}/matches".format(game_id={'key': openapi_server.GameId()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_match_collection_for_leaderboard(client: TestClient): + """Test case for get_match_collection_for_leaderboard + + Retrieve all matches on a specific leaderboard for a certain game + """ + params = [("status", {'key': openapi_server.MatchStatus()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/leaderboards/{leaderboard_id}/matches".format(leaderboard_id={'key': openapi_server.Ulid()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_match_collection_for_profile(client: TestClient): + """Test case for get_match_collection_for_profile + + Retrieve all matches for a specific profile + """ + params = [("last_match", True), ("status", {'key': openapi_server.MatchStatus()}), ("game", {'key': openapi_server.GameId()}), ("start", {'key': openapi_server.StartParam()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles/{relic_link_id}/matches".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_match_collection_for_team(client: TestClient): + """Test case for get_match_collection_for_team + + Retrieve a list of matches for a specific team + """ + params = [("status", {'key': openapi_server.MatchStatus()}), ("game", {'key': openapi_server.GameId()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/teams/{team_id}/matches".format(team_id={'key': openapi_server.Ulid()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_match_collection_for_tournament(client: TestClient): + """Test case for get_match_collection_for_tournament + + Retrieve all match data for a specific tournament for a specific game + """ + params = [("status", {'key': openapi_server.MatchStatus()}), ("game", {'key': openapi_server.GameId()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/matches".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_profile_administration_api.py b/tests/test_profile_administration_api.py new file mode 100644 index 0000000..fc5bf6d --- /dev/null +++ b/tests/test_profile_administration_api.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.relic_link_id import RelicLinkId # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError # noqa: F401 + + +def test_bulk_update_all_settings_for_profile(client: TestClient): + """Test case for bulk_update_all_settings_for_profile + + Bulk update of settings for a specific profile from the Relic Link API + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_setting_for_profile(client: TestClient): + """Test case for create_new_setting_for_profile + + Create a new setting for a specific profile from the Relic Link API + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_setting_collection_for_profile(client: TestClient): + """Test case for get_setting_collection_for_profile + + Retrieve all settings for a specific profile + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_all_settings_for_profile(client: TestClient): + """Test case for partial_update_all_settings_for_profile + + Update a specific setting for a specific profile from the Relic Link API + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_settings_for_profile(client: TestClient): + """Test case for remove_all_settings_for_profile + + Remove all settings for a specific profile + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/profiles/{relic_link_id}/settings".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_ratings_api.py b/tests/test_ratings_api.py new file mode 100644 index 0000000..def5bab --- /dev/null +++ b/tests/test_ratings_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.count_param import CountParam # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.game_id import GameId # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.relic_link_id import RelicLinkId # noqa: F401 +from openapi_server.models.since_param import SinceParam # noqa: F401 +from openapi_server.models.start_param import StartParam # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_ledger_collection_for_profile(client: TestClient): + """Test case for get_ledger_collection_for_profile + + Retrieve the rating ledger for a specific profile + """ + params = [("game", {'key': openapi_server.GameId()}), ("start", {'key': openapi_server.StartParam()}), ("leaderboard_id", {'key': openapi_server.Ulid()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles/{relic_link_id}/ledger".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_search_api.py b/tests/test_search_api.py new file mode 100644 index 0000000..0583208 --- /dev/null +++ b/tests/test_search_api.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.search_param import SearchParam # noqa: F401 +from openapi_server.models.steam_id import SteamId # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_profile_information_from_search(client: TestClient): + """Test case for get_profile_information_from_search + + + """ + params = [("by_name", {'key': openapi_server.SearchParam()}), ("by_steam_id", {'key': openapi_server.SteamId()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles/search", + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_statistics_api.py b/tests/test_statistics_api.py new file mode 100644 index 0000000..707b675 --- /dev/null +++ b/tests/test_statistics_api.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.relic_link_id import RelicLinkId # noqa: F401 +from openapi_server.models.timeframe import Timeframe # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_database_dump_collection(client: TestClient): + """Test case for get_database_dump_collection + + + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/dumps/{timeframe}".format(timeframe={'key': openapi_server.Timeframe()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_leaderboard(client: TestClient): + """Test case for get_stat_collection_for_leaderboard + + Retrieve all stats on a specific leaderboard for a certain game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/leaderboards/{leaderboard_id}/stats".format(leaderboard_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_profile(client: TestClient): + """Test case for get_stat_collection_for_profile + + Retrieve all stats for a specific profile + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/profiles/{relic_link_id}/stats".format(relic_link_id={'key': openapi_server.RelicLinkId()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_team(client: TestClient): + """Test case for get_stat_collection_for_team + + Retrieve a list of stats for a specific team + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/teams/{team_id}/stats".format(team_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_tournament(client: TestClient): + """Test case for get_stat_collection_for_tournament + + Retrieve all statistics for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/stats".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_user(client: TestClient): + """Test case for get_stat_collection_for_user + + Retrieve all stats for a specific user profile on our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/users/{user_id}/stats".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_status_check_api.py b/tests/test_status_check_api.py new file mode 100644 index 0000000..3f2fe25 --- /dev/null +++ b/tests/test_status_check_api.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_status_collection_for_application(client: TestClient): + """Test case for get_status_collection_for_application + + Retrieve only application status + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/application/status", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_team_administration_api.py b/tests/test_team_administration_api.py new file mode 100644 index 0000000..0ba07b1 --- /dev/null +++ b/tests/test_team_administration_api.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError # noqa: F401 + + +def test_bulk_update_all_teams(client: TestClient): + """Test case for bulk_update_all_teams + + Bulk update of teams + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_team(client: TestClient): + """Test case for create_new_team + + Create a new team + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_details_for_team(client: TestClient): + """Test case for get_details_for_team + + Retrieve details of a team + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/teams/{team_id}".format(team_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_team(client: TestClient): + """Test case for get_stat_collection_for_team + + Retrieve a list of stats for a specific team + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/teams/{team_id}/stats".format(team_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_team_collection(client: TestClient): + """Test case for get_team_collection + + Retrieve all available teams + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_all_teams(client: TestClient): + """Test case for partial_update_all_teams + + Partial update of all teams + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_teams(client: TestClient): + """Test case for remove_all_teams + + Remove all teams + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_teams_api.py b/tests/test_teams_api.py new file mode 100644 index 0000000..69a40d6 --- /dev/null +++ b/tests/test_teams_api.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_details_for_team(client: TestClient): + """Test case for get_details_for_team + + Retrieve details of a team + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/teams/{team_id}".format(team_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_team(client: TestClient): + """Test case for get_stat_collection_for_team + + Retrieve a list of stats for a specific team + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/teams/{team_id}/stats".format(team_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_team_collection(client: TestClient): + """Test case for get_team_collection + + Retrieve all available teams + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_teams(client: TestClient): + """Test case for remove_all_teams + + Remove all teams + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/teams", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_tournament_administration_api.py b/tests/test_tournament_administration_api.py new file mode 100644 index 0000000..a64f942 --- /dev/null +++ b/tests/test_tournament_administration_api.py @@ -0,0 +1,379 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.count_param import CountParam # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.game_id import GameId # noqa: F401 +from openapi_server.models.match_status import MatchStatus # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.since_param import SinceParam # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError # noqa: F401 + + +def test_bulk_update_all_admins_for_tournament(client: TestClient): + """Test case for bulk_update_all_admins_for_tournament + + Bulk update of admins for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_bulk_update_all_brackets_for_tournament(client: TestClient): + """Test case for bulk_update_all_brackets_for_tournament + + Bulk update all brackets for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/tournaments/{tournament_id}/brackets".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_bulk_update_all_tournaments(client: TestClient): + """Test case for bulk_update_all_tournaments + + Bulk update of tournaments + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/tournaments", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_admin_for_tournament(client: TestClient): + """Test case for create_new_admin_for_tournament + + Create a new admin for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_bracket_for_tournament(client: TestClient): + """Test case for create_new_bracket_for_tournament + + Create a new bracket for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/tournaments/{tournament_id}/brackets".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_tournament(client: TestClient): + """Test case for create_new_tournament + + Create a new tournament for a game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/tournaments", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_admin_collection_for_tournament(client: TestClient): + """Test case for get_admin_collection_for_tournament + + Retrieve all admins for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_bracket_collection_for_tournament(client: TestClient): + """Test case for get_bracket_collection_for_tournament + + Retrieve all brackets for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/brackets".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_info_collection_for_tournament(client: TestClient): + """Test case for get_info_collection_for_tournament + + Retrieve all information for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/info".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_match_collection_for_tournament(client: TestClient): + """Test case for get_match_collection_for_tournament + + Retrieve all match data for a specific tournament for a specific game + """ + params = [("status", {'key': openapi_server.MatchStatus()}), ("game", {'key': openapi_server.GameId()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/matches".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_tournament(client: TestClient): + """Test case for get_stat_collection_for_tournament + + Retrieve all statistics for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/stats".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_tournament_identifier_collection(client: TestClient): + """Test case for get_tournament_identifier_collection + + Retrieve all available tournaments for all games available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_all_admins_for_tournament(client: TestClient): + """Test case for partial_update_all_admins_for_tournament + + Update details of admins for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_bracket_for_tournament(client: TestClient): + """Test case for partial_update_bracket_for_tournament + + Partial update all brackets for a specific tournament for a specific game available on the Relic Link platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/tournaments/{tournament_id}/brackets".format(tournament_id='tournament_id_example'), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_tournaments(client: TestClient): + """Test case for partial_update_tournaments + + Partial update of tournaments + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/tournaments", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_admins_for_tournament(client: TestClient): + """Test case for remove_all_admins_for_tournament + + Remove all admins for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/tournaments/{tournament_id}/admins".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_brackets_for_tournament(client: TestClient): + """Test case for remove_all_brackets_for_tournament + + Remove all brackets for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/tournaments/{tournament_id}/brackets".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_tournaments(client: TestClient): + """Test case for remove_all_tournaments + + Remove all tournaments + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/tournaments", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_tournaments_api.py b/tests/test_tournaments_api.py new file mode 100644 index 0000000..a13799e --- /dev/null +++ b/tests/test_tournaments_api.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.count_param import CountParam # noqa: F401 +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.game_id import GameId # noqa: F401 +from openapi_server.models.match_status import MatchStatus # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.since_param import SinceParam # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 + + +def test_get_bracket_collection_for_tournament(client: TestClient): + """Test case for get_bracket_collection_for_tournament + + Retrieve all brackets for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/brackets".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_info_collection_for_tournament(client: TestClient): + """Test case for get_info_collection_for_tournament + + Retrieve all information for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/info".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_match_collection_for_tournament(client: TestClient): + """Test case for get_match_collection_for_tournament + + Retrieve all match data for a specific tournament for a specific game + """ + params = [("status", {'key': openapi_server.MatchStatus()}), ("game", {'key': openapi_server.GameId()}), ("count", {'key': openapi_server.CountParam()}), ("since", {'key': openapi_server.SinceParam()})] + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/matches".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + params=params, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_stat_collection_for_tournament(client: TestClient): + """Test case for get_stat_collection_for_tournament + + Retrieve all statistics for a specific tournament for a specific game + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/tournaments/{tournament_id}/stats".format(tournament_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + diff --git a/tests/test_user_administration_api.py b/tests/test_user_administration_api.py new file mode 100644 index 0000000..d23450a --- /dev/null +++ b/tests/test_user_administration_api.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +from fastapi.testclient import TestClient + + +from openapi_server.models.forbidden_error import ForbiddenError # noqa: F401 +from openapi_server.models.not_acceptable_error import NotAcceptableError # noqa: F401 +from openapi_server.models.not_found_error import NotFoundError # noqa: F401 +from openapi_server.models.not_implemented_error import NotImplementedError # noqa: F401 +from openapi_server.models.too_many_requests_error import TooManyRequestsError # noqa: F401 +from openapi_server.models.ulid import Ulid # noqa: F401 +from openapi_server.models.unauthorized_error import UnauthorizedError # noqa: F401 +from openapi_server.models.unsupported_media_type_error import UnsupportedMediaTypeError # noqa: F401 + + +def test_bulk_update_all_user_details(client: TestClient): + """Test case for bulk_update_all_user_details + + Bulk update details for a specific user profile on our platform if it exists + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/users/{user_id}".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_bulk_update_all_users(client: TestClient): + """Test case for bulk_update_all_users + + Bulk update of all users of our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PUT", + "/users", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_create_new_user(client: TestClient): + """Test case for create_new_user + + Create a new user for our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "POST", + "/users", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_details_for_user(client: TestClient): + """Test case for get_details_for_user + + Retrieve details for a specific user profile on our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/users/{user_id}".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_get_user_collection(client: TestClient): + """Test case for get_user_collection + + Retrieve all users of our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "GET", + "/users", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_all_users(client: TestClient): + """Test case for partial_update_all_users + + Partially update details for all user profiles + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/users", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_partial_update_user(client: TestClient): + """Test case for partial_update_user + + Update details for a specific user profile on our platform if it exists + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "PATCH", + "/users/{user_id}".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_user_stats(client: TestClient): + """Test case for remove_all_user_stats + + Remove all stats for a specific user profile on our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/users/{user_id}/stats".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_all_users(client: TestClient): + """Test case for remove_all_users + + Remove all users from our platform + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/users", + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 + + +def test_remove_user(client: TestClient): + """Test case for remove_user + + Remove user from our platform if it exists + """ + + headers = { + "BasicAuth": "special-key", + "X-Api-Key": "special-key", + } + response = client.request( + "DELETE", + "/users/{user_id}".format(user_id={'key': openapi_server.Ulid()}), + headers=headers, + ) + + # uncomment below to assert the status code of the HTTP response + #assert response.status_code == 200 +