Converted the Api to a Restful api.

This commit is contained in:
2026-01-22 22:51:03 +01:00
parent 79ba1e1b44
commit 9d3c5afb07
50 changed files with 2194 additions and 1939 deletions

View File

@@ -5,22 +5,20 @@ README.md
docs/AddGameRequestBody.md
docs/AddGamenightRequestBody.md
docs/AddLocationRequestBody.md
docs/AuthorizeLocationRequestBody.md
docs/DefaultApi.md
docs/EditGameRequestBody.md
docs/Failure.md
docs/Game.md
docs/GameId.md
docs/Gamenight.md
docs/GamenightId.md
docs/GetGamenightRequestBody.md
docs/Location.md
docs/LocationId.md
docs/Login.md
docs/OwnGameRequestBody.md
docs/OwnGame.md
docs/OwnedGame.md
docs/Participants.md
docs/Registration.md
docs/RenameGameRequestBody.md
docs/Token.md
docs/User.md
docs/UserId.md
@@ -32,22 +30,20 @@ src/lib.rs
src/models/add_game_request_body.rs
src/models/add_gamenight_request_body.rs
src/models/add_location_request_body.rs
src/models/authorize_location_request_body.rs
src/models/edit_game_request_body.rs
src/models/failure.rs
src/models/game.rs
src/models/game_id.rs
src/models/gamenight.rs
src/models/gamenight_id.rs
src/models/get_gamenight_request_body.rs
src/models/location.rs
src/models/location_id.rs
src/models/login.rs
src/models/mod.rs
src/models/own_game_request_body.rs
src/models/own_game.rs
src/models/owned_game.rs
src/models/participants.rs
src/models/registration.rs
src/models/rename_game_request_body.rs
src/models/token.rs
src/models/user.rs
src/models/user_id.rs

View File

@@ -27,30 +27,31 @@ All URIs are relative to *http://localhost:8080*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**authorized_location_user_ids_get**](docs/DefaultApi.md#authorized_location_user_ids_get) | **GET** /authorized_location_user_ids |
*DefaultApi* | [**disown_post**](docs/DefaultApi.md#disown_post) | **POST** /disown |
*DefaultApi* | [**game_delete**](docs/DefaultApi.md#game_delete) | **DELETE** /game |
*DefaultApi* | [**game_get**](docs/DefaultApi.md#game_get) | **GET** /game |
*DefaultApi* | [**game_post**](docs/DefaultApi.md#game_post) | **POST** /game |
*DefaultApi* | [**games_get**](docs/DefaultApi.md#games_get) | **GET** /games |
*DefaultApi* | [**get_gamenight**](docs/DefaultApi.md#get_gamenight) | **GET** /gamenight |
*DefaultApi* | [**delete_game**](docs/DefaultApi.md#delete_game) | **DELETE** /game/{gameId} | Delete this game.
*DefaultApi* | [**delete_game_owner**](docs/DefaultApi.md#delete_game_owner) | **DELETE** /game/{gameId}/owner/{userId} | no longer own this game
*DefaultApi* | [**delete_gamenight_participant**](docs/DefaultApi.md#delete_gamenight_participant) | **DELETE** /gamenight/{gamenightId}/participant/{userId} | deletes a gamenight participant
*DefaultApi* | [**delete_location_authorized_user**](docs/DefaultApi.md#delete_location_authorized_user) | **DELETE** /location/{locationId}/authorized_user/{userId} | remove an authorized user from a location
*DefaultApi* | [**get_game**](docs/DefaultApi.md#get_game) | **GET** /game/{gameId} | Get this specific game
*DefaultApi* | [**get_gamenight**](docs/DefaultApi.md#get_gamenight) | **GET** /gamenight/{gamenightId} | get the specified gamenight
*DefaultApi* | [**get_gamenight_participants**](docs/DefaultApi.md#get_gamenight_participants) | **GET** /gamenight/{gamenightId}/participants | Get all participants for a gamenight
*DefaultApi* | [**get_gamenights**](docs/DefaultApi.md#get_gamenights) | **GET** /gamenights | Get a all gamenights
*DefaultApi* | [**get_token**](docs/DefaultApi.md#get_token) | **GET** /token |
*DefaultApi* | [**join_post**](docs/DefaultApi.md#join_post) | **POST** /join |
*DefaultApi* | [**leave_post**](docs/DefaultApi.md#leave_post) | **POST** /leave |
*DefaultApi* | [**location_authorize_post**](docs/DefaultApi.md#location_authorize_post) | **POST** /location_authorize |
*DefaultApi* | [**location_get**](docs/DefaultApi.md#location_get) | **GET** /location |
*DefaultApi* | [**location_post**](docs/DefaultApi.md#location_post) | **POST** /location |
*DefaultApi* | [**locations_get**](docs/DefaultApi.md#locations_get) | **GET** /locations |
*DefaultApi* | [**own_post**](docs/DefaultApi.md#own_post) | **POST** /own |
*DefaultApi* | [**owned_games_get**](docs/DefaultApi.md#owned_games_get) | **GET** /owned_games |
*DefaultApi* | [**participants_get**](docs/DefaultApi.md#participants_get) | **GET** /participants | Get all participants for a gamenight
*DefaultApi* | [**post_gamenight**](docs/DefaultApi.md#post_gamenight) | **POST** /gamenight |
*DefaultApi* | [**post_register**](docs/DefaultApi.md#post_register) | **POST** /user |
*DefaultApi* | [**post_token**](docs/DefaultApi.md#post_token) | **POST** /token |
*DefaultApi* | [**rename_game_post**](docs/DefaultApi.md#rename_game_post) | **POST** /rename_game |
*DefaultApi* | [**user_get**](docs/DefaultApi.md#user_get) | **GET** /user |
*DefaultApi* | [**users_get**](docs/DefaultApi.md#users_get) | **GET** /users |
*DefaultApi* | [**get_games**](docs/DefaultApi.md#get_games) | **GET** /games | get all games
*DefaultApi* | [**get_location**](docs/DefaultApi.md#get_location) | **GET** /location/{locationId} | gets this location
*DefaultApi* | [**get_location_authorized_users**](docs/DefaultApi.md#get_location_authorized_users) | **GET** /location/{locationId}/authorized_users/ | gets this locations authorized users
*DefaultApi* | [**get_locations**](docs/DefaultApi.md#get_locations) | **GET** /locations | get all locations
*DefaultApi* | [**get_user**](docs/DefaultApi.md#get_user) | **GET** /user/{userId} |
*DefaultApi* | [**get_user_owned_games**](docs/DefaultApi.md#get_user_owned_games) | **GET** /user/{userId}/owned_games | Get owned games of user
*DefaultApi* | [**get_users**](docs/DefaultApi.md#get_users) | **GET** /users | Get all users
*DefaultApi* | [**post_game_owners**](docs/DefaultApi.md#post_game_owners) | **POST** /game/{gameId}/owners | Own this game
*DefaultApi* | [**post_gamenight_participants**](docs/DefaultApi.md#post_gamenight_participants) | **POST** /gamenight/{gamenightId}/participants | Add a participant
*DefaultApi* | [**post_gamenights**](docs/DefaultApi.md#post_gamenights) | **POST** /gamenights | Gets the gamenight
*DefaultApi* | [**post_games**](docs/DefaultApi.md#post_games) | **POST** /games | add a game
*DefaultApi* | [**post_location_authorized_users**](docs/DefaultApi.md#post_location_authorized_users) | **POST** /location/{locationId}/authorized_users/ | Authorize a user
*DefaultApi* | [**post_locations**](docs/DefaultApi.md#post_locations) | **POST** /locations | add a location
*DefaultApi* | [**post_refresh_token**](docs/DefaultApi.md#post_refresh_token) | **POST** /refresh_token | Refresh a user token
*DefaultApi* | [**post_token**](docs/DefaultApi.md#post_token) | **POST** /token | Login a user.
*DefaultApi* | [**post_users**](docs/DefaultApi.md#post_users) | **POST** /users | Registers a user into gamenight.
*DefaultApi* | [**put_game**](docs/DefaultApi.md#put_game) | **PUT** /game/{gameId} | Changes this game resource
## Documentation For Models
@@ -58,21 +59,19 @@ Class | Method | HTTP request | Description
- [AddGameRequestBody](docs/AddGameRequestBody.md)
- [AddGamenightRequestBody](docs/AddGamenightRequestBody.md)
- [AddLocationRequestBody](docs/AddLocationRequestBody.md)
- [AuthorizeLocationRequestBody](docs/AuthorizeLocationRequestBody.md)
- [EditGameRequestBody](docs/EditGameRequestBody.md)
- [Failure](docs/Failure.md)
- [Game](docs/Game.md)
- [GameId](docs/GameId.md)
- [Gamenight](docs/Gamenight.md)
- [GamenightId](docs/GamenightId.md)
- [GetGamenightRequestBody](docs/GetGamenightRequestBody.md)
- [Location](docs/Location.md)
- [LocationId](docs/LocationId.md)
- [Login](docs/Login.md)
- [OwnGameRequestBody](docs/OwnGameRequestBody.md)
- [OwnGame](docs/OwnGame.md)
- [OwnedGame](docs/OwnedGame.md)
- [Participants](docs/Participants.md)
- [Registration](docs/Registration.md)
- [RenameGameRequestBody](docs/RenameGameRequestBody.md)
- [Token](docs/Token.md)
- [User](docs/User.md)
- [UserId](docs/UserId.md)

View File

@@ -4,72 +4,45 @@ All URIs are relative to *http://localhost:8080*
Method | HTTP request | Description
------------- | ------------- | -------------
[**authorized_location_user_ids_get**](DefaultApi.md#authorized_location_user_ids_get) | **GET** /authorized_location_user_ids |
[**disown_post**](DefaultApi.md#disown_post) | **POST** /disown |
[**game_delete**](DefaultApi.md#game_delete) | **DELETE** /game |
[**game_get**](DefaultApi.md#game_get) | **GET** /game |
[**game_post**](DefaultApi.md#game_post) | **POST** /game |
[**games_get**](DefaultApi.md#games_get) | **GET** /games |
[**get_gamenight**](DefaultApi.md#get_gamenight) | **GET** /gamenight |
[**delete_game**](DefaultApi.md#delete_game) | **DELETE** /game/{gameId} | Delete this game.
[**delete_game_owner**](DefaultApi.md#delete_game_owner) | **DELETE** /game/{gameId}/owner/{userId} | no longer own this game
[**delete_gamenight_participant**](DefaultApi.md#delete_gamenight_participant) | **DELETE** /gamenight/{gamenightId}/participant/{userId} | deletes a gamenight participant
[**delete_location_authorized_user**](DefaultApi.md#delete_location_authorized_user) | **DELETE** /location/{locationId}/authorized_user/{userId} | remove an authorized user from a location
[**get_game**](DefaultApi.md#get_game) | **GET** /game/{gameId} | Get this specific game
[**get_gamenight**](DefaultApi.md#get_gamenight) | **GET** /gamenight/{gamenightId} | get the specified gamenight
[**get_gamenight_participants**](DefaultApi.md#get_gamenight_participants) | **GET** /gamenight/{gamenightId}/participants | Get all participants for a gamenight
[**get_gamenights**](DefaultApi.md#get_gamenights) | **GET** /gamenights | Get a all gamenights
[**get_token**](DefaultApi.md#get_token) | **GET** /token |
[**join_post**](DefaultApi.md#join_post) | **POST** /join |
[**leave_post**](DefaultApi.md#leave_post) | **POST** /leave |
[**location_authorize_post**](DefaultApi.md#location_authorize_post) | **POST** /location_authorize |
[**location_get**](DefaultApi.md#location_get) | **GET** /location |
[**location_post**](DefaultApi.md#location_post) | **POST** /location |
[**locations_get**](DefaultApi.md#locations_get) | **GET** /locations |
[**own_post**](DefaultApi.md#own_post) | **POST** /own |
[**owned_games_get**](DefaultApi.md#owned_games_get) | **GET** /owned_games |
[**participants_get**](DefaultApi.md#participants_get) | **GET** /participants | Get all participants for a gamenight
[**post_gamenight**](DefaultApi.md#post_gamenight) | **POST** /gamenight |
[**post_register**](DefaultApi.md#post_register) | **POST** /user |
[**post_token**](DefaultApi.md#post_token) | **POST** /token |
[**rename_game_post**](DefaultApi.md#rename_game_post) | **POST** /rename_game |
[**user_get**](DefaultApi.md#user_get) | **GET** /user |
[**users_get**](DefaultApi.md#users_get) | **GET** /users |
[**get_games**](DefaultApi.md#get_games) | **GET** /games | get all games
[**get_location**](DefaultApi.md#get_location) | **GET** /location/{locationId} | gets this location
[**get_location_authorized_users**](DefaultApi.md#get_location_authorized_users) | **GET** /location/{locationId}/authorized_users/ | gets this locations authorized users
[**get_locations**](DefaultApi.md#get_locations) | **GET** /locations | get all locations
[**get_user**](DefaultApi.md#get_user) | **GET** /user/{userId} |
[**get_user_owned_games**](DefaultApi.md#get_user_owned_games) | **GET** /user/{userId}/owned_games | Get owned games of user
[**get_users**](DefaultApi.md#get_users) | **GET** /users | Get all users
[**post_game_owners**](DefaultApi.md#post_game_owners) | **POST** /game/{gameId}/owners | Own this game
[**post_gamenight_participants**](DefaultApi.md#post_gamenight_participants) | **POST** /gamenight/{gamenightId}/participants | Add a participant
[**post_gamenights**](DefaultApi.md#post_gamenights) | **POST** /gamenights | Gets the gamenight
[**post_games**](DefaultApi.md#post_games) | **POST** /games | add a game
[**post_location_authorized_users**](DefaultApi.md#post_location_authorized_users) | **POST** /location/{locationId}/authorized_users/ | Authorize a user
[**post_locations**](DefaultApi.md#post_locations) | **POST** /locations | add a location
[**post_refresh_token**](DefaultApi.md#post_refresh_token) | **POST** /refresh_token | Refresh a user token
[**post_token**](DefaultApi.md#post_token) | **POST** /token | Login a user.
[**post_users**](DefaultApi.md#post_users) | **POST** /users | Registers a user into gamenight.
[**put_game**](DefaultApi.md#put_game) | **PUT** /game/{gameId} | Changes this game resource
## authorized_location_user_ids_get
> Vec<models::UserId> authorized_location_user_ids_get(location_id)
## delete_game
> delete_game(game_id)
Delete this game.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**location_id** | Option<[**LocationId**](LocationId.md)> | | |
### Return type
[**Vec<models::UserId>**](UserId.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## disown_post
> disown_post(game_id)
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**game_id** | Option<[**GameId**](GameId.md)> | | |
**game_id** | **String** | Uuid of game to delete. | [required] |
### Return type
@@ -81,23 +54,24 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## game_delete
> game_delete(game_id)
## delete_game_owner
> delete_game_owner(game_id, user_id)
no longer own this game
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**game_id** | Option<[**GameId**](GameId.md)> | | |
**game_id** | **String** | Uuid of game that user no longer owns. | [required] |
**user_id** | **String** | Uuid of user that no longer owns. | [required] |
### Return type
@@ -109,23 +83,81 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## game_get
> models::Game game_get(game_id)
## delete_gamenight_participant
> delete_gamenight_participant(gamenight_id, user_id)
deletes a gamenight participant
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**game_id** | Option<[**GameId**](GameId.md)> | | |
**gamenight_id** | **String** | Uuid of gamenight to delete participant for | [required] |
**user_id** | **String** | Uuid of the of the participant to remove | [required] |
### Return type
(empty response body)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## delete_location_authorized_user
> delete_location_authorized_user(location_id, user_id)
remove an authorized user from a location
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**location_id** | **String** | Uuid of location to deauthorize for. | [required] |
**user_id** | **String** | Uuid of user ot deauthorize. | [required] |
### Return type
(empty response body)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_game
> models::Game get_game(game_id)
Get this specific game
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**game_id** | **String** | Uuid of game to get. | [required] |
### Return type
@@ -137,59 +169,6 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## game_post
> models::GameId game_post(add_game_request_body)
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**add_game_request_body** | Option<[**AddGameRequestBody**](AddGameRequestBody.md)> | | |
### Return type
[**models::GameId**](GameId.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## games_get
> Vec<models::Game> games_get()
### Parameters
This endpoint does not need any parameter.
### Return type
[**Vec<models::Game>**](Game.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
@@ -198,15 +177,15 @@ This endpoint does not need any parameter.
## get_gamenight
> models::Gamenight get_gamenight(get_gamenight_request_body)
> models::Gamenight get_gamenight(gamenight_id)
get the specified gamenight
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**get_gamenight_request_body** | Option<[**GetGamenightRequestBody**](GetGamenightRequestBody.md)> | | |
**gamenight_id** | **String** | Uuid of gamenight to get. | [required] |
### Return type
@@ -218,7 +197,37 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_gamenight_participants
> models::Participants get_gamenight_participants(gamenight_id)
Get all participants for a gamenight
Retrieve the participants of a single gamenight by id.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**gamenight_id** | **String** | Uuid of gamenight to get participants for. | [required] |
### Return type
[**models::Participants**](Participants.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -251,51 +260,18 @@ This endpoint does not need any parameter.
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_token
## get_games
> models::Token get_token(login)
Submit your credentials to get a JWT-token to use with the rest of the api.
> Vec<models::Game> get_games()
get all games
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**login** | Option<[**Login**](Login.md)> | | |
This endpoint does not need any parameter.
### Return type
[**models::Token**](Token.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## join_post
> join_post(gamenight_id)
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**gamenight_id** | Option<[**GamenightId**](GamenightId.md)> | | |
### Return type
(empty response body)
[**Vec<models::Game>**](Game.md)
### Authorization
@@ -303,79 +279,23 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## leave_post
> leave_post(gamenight_id)
## get_location
> models::Location get_location(location_id)
gets this location
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**gamenight_id** | Option<[**GamenightId**](GamenightId.md)> | | |
### Return type
(empty response body)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## location_authorize_post
> location_authorize_post(authorize_location_request_body)
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**authorize_location_request_body** | Option<[**AuthorizeLocationRequestBody**](AuthorizeLocationRequestBody.md)> | | |
### Return type
(empty response body)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## location_get
> models::Location location_get(location_id)
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**location_id** | Option<[**LocationId**](LocationId.md)> | | |
**location_id** | **String** | Uuid of location to get. | [required] |
### Return type
@@ -387,27 +307,27 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## location_post
> models::LocationId location_post(add_location_request_body)
## get_location_authorized_users
> Vec<models::UserId> get_location_authorized_users(location_id)
gets this locations authorized users
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**add_location_request_body** | Option<[**AddLocationRequestBody**](AddLocationRequestBody.md)> | | |
**location_id** | **String** | Uuid of location to get authorized users for. | [required] |
### Return type
[**models::LocationId**](LocationId.md)
[**Vec<models::UserId>**](UserId.md)
### Authorization
@@ -415,16 +335,16 @@ Name | Type | Description | Required | Notes
### HTTP request headers
- **Content-Type**: application/json
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## locations_get
> Vec<models::Location> locations_get()
## get_locations
> Vec<models::Location> get_locations()
get all locations
### Parameters
@@ -446,17 +366,101 @@ This endpoint does not need any parameter.
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## own_post
## get_user
> own_post(own_game_request_body)
> models::User get_user(user_id)
Get a user from primary id
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**own_game_request_body** | Option<[**OwnGameRequestBody**](OwnGameRequestBody.md)> | | |
**user_id** | **String** | Uuid of user to get | [required] |
### Return type
[**models::User**](User.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_user_owned_games
> Vec<models::OwnedGame> get_user_owned_games(user_id)
Get owned games of user
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**user_id** | **String** | Uuid of user to get owned games for. | [required] |
### Return type
[**Vec<models::OwnedGame>**](OwnedGame.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_users
> Vec<models::User> get_users()
Get all users
### Parameters
This endpoint does not need any parameter.
### Return type
[**Vec<models::User>**](User.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_game_owners
> post_game_owners(game_id, own_game)
Own this game
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**game_id** | **String** | Uuid of game to own. | [required] |
**own_game** | Option<[**OwnGame**](OwnGame.md)> | | |
### Return type
@@ -474,21 +478,22 @@ Name | Type | Description | Required | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## owned_games_get
> Vec<models::OwnedGame> owned_games_get(user_id)
## post_gamenight_participants
> post_gamenight_participants(gamenight_id, user_id)
Add a participant
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**gamenight_id** | **String** | Uuid of gamenight to add participants for. | [required] |
**user_id** | Option<[**UserId**](UserId.md)> | | |
### Return type
[**Vec<models::OwnedGame>**](OwnedGame.md)
(empty response body)
### Authorization
@@ -502,40 +507,10 @@ Name | Type | Description | Required | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## participants_get
> models::Participants participants_get(gamenight_id)
Get all participants for a gamenight
Retrieve the participants of a single gamenight by id.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**gamenight_id** | Option<[**GamenightId**](GamenightId.md)> | | |
### Return type
[**models::Participants**](Participants.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_gamenight
> post_gamenight(add_gamenight_request_body)
## post_gamenights
> post_gamenights(add_gamenight_request_body)
Gets the gamenight
Add a gamenight by providing a name and a date, only available when providing an JWT token.
@@ -562,10 +537,152 @@ Name | Type | Description | Required | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_register
## post_games
> post_register(registration)
> models::GameId post_games(add_game_request_body)
add a game
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**add_game_request_body** | Option<[**AddGameRequestBody**](AddGameRequestBody.md)> | | |
### Return type
[**models::GameId**](GameId.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_location_authorized_users
> post_location_authorized_users(location_id, user_id)
Authorize a user
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**location_id** | **String** | Uuid location to authorize for. | [required] |
**user_id** | Option<[**UserId**](UserId.md)> | | |
### Return type
(empty response body)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_locations
> models::LocationId post_locations(add_location_request_body)
add a location
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**add_location_request_body** | Option<[**AddLocationRequestBody**](AddLocationRequestBody.md)> | | |
### Return type
[**models::LocationId**](LocationId.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_refresh_token
> models::Token post_refresh_token()
Refresh a user token
Refresh your JWT-token without logging in again.
### Parameters
This endpoint does not need any parameter.
### Return type
[**models::Token**](Token.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_token
> models::Token post_token(login)
Login a user.
Submit your credentials to get a JWT-token to use with the rest of the api.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**login** | Option<[**Login**](Login.md)> | | |
### Return type
[**models::Token**](Token.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_users
> post_users(registration)
Registers a user into gamenight.
Create a new user given a registration token and user information, username and email must be unique, and password and password_repeat must match.
@@ -592,44 +709,18 @@ Name | Type | Description | Required | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_token
> models::Token post_token()
Refresh your JWT-token without logging in again.
### Parameters
This endpoint does not need any parameter.
### Return type
[**models::Token**](Token.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## rename_game_post
> rename_game_post(rename_game_request_body)
## put_game
> put_game(game_id, edit_game_request_body)
Changes this game resource
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**rename_game_request_body** | Option<[**RenameGameRequestBody**](RenameGameRequestBody.md)> | | |
**game_id** | **String** | Uuid of game to change. | [required] |
**edit_game_request_body** | Option<[**EditGameRequestBody**](EditGameRequestBody.md)> | | |
### Return type
@@ -646,58 +737,3 @@ Name | Type | Description | Required | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## user_get
> models::User user_get(user_id)
Get a user from primary id
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**user_id** | Option<[**UserId**](UserId.md)> | | |
### Return type
[**models::User**](User.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## users_get
> Vec<models::User> users_get()
### Parameters
This endpoint does not need any parameter.
### Return type
[**Vec<models::User>**](User.md)
### Authorization
[JWT-Auth](../README.md#JWT-Auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# EditGameRequestBody
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |
**name** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# OwnGame
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**user_id** | **String** | |
**location_id** | Option<**String**> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**user_id** | **String** | |
**game_id** | **String** | |
**location_id** | Option<**String**> | | [optional]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
/*
* Gamenight
*
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EditGameRequestBody {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
pub name: String,
}
impl EditGameRequestBody {
pub fn new(id: String, name: String) -> EditGameRequestBody {
EditGameRequestBody {
id,
name,
}
}
}

View File

@@ -4,8 +4,8 @@ pub mod add_gamenight_request_body;
pub use self::add_gamenight_request_body::AddGamenightRequestBody;
pub mod add_location_request_body;
pub use self::add_location_request_body::AddLocationRequestBody;
pub mod authorize_location_request_body;
pub use self::authorize_location_request_body::AuthorizeLocationRequestBody;
pub mod edit_game_request_body;
pub use self::edit_game_request_body::EditGameRequestBody;
pub mod failure;
pub use self::failure::Failure;
pub mod game;
@@ -16,24 +16,20 @@ pub mod gamenight;
pub use self::gamenight::Gamenight;
pub mod gamenight_id;
pub use self::gamenight_id::GamenightId;
pub mod get_gamenight_request_body;
pub use self::get_gamenight_request_body::GetGamenightRequestBody;
pub mod location;
pub use self::location::Location;
pub mod location_id;
pub use self::location_id::LocationId;
pub mod login;
pub use self::login::Login;
pub mod own_game_request_body;
pub use self::own_game_request_body::OwnGameRequestBody;
pub mod own_game;
pub use self::own_game::OwnGame;
pub mod owned_game;
pub use self::owned_game::OwnedGame;
pub mod participants;
pub use self::participants::Participants;
pub mod registration;
pub use self::registration::Registration;
pub mod rename_game_request_body;
pub use self::rename_game_request_body::RenameGameRequestBody;
pub mod token;
pub use self::token::Token;
pub mod user;

View File

@@ -0,0 +1,30 @@
/*
* Gamenight
*
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OwnGame {
#[serde(rename = "user_id")]
pub user_id: String,
#[serde(rename = "location_id", skip_serializing_if = "Option::is_none")]
pub location_id: Option<String>,
}
impl OwnGame {
pub fn new(user_id: String) -> OwnGame {
OwnGame {
user_id,
location_id: None,
}
}
}

View File

@@ -13,6 +13,8 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OwnedGame {
#[serde(rename = "user_id")]
pub user_id: String,
#[serde(rename = "game_id")]
pub game_id: String,
#[serde(rename = "location_id", skip_serializing_if = "Option::is_none")]
@@ -20,8 +22,9 @@ pub struct OwnedGame {
}
impl OwnedGame {
pub fn new(game_id: String) -> OwnedGame {
pub fn new(user_id: String, game_id: String) -> OwnedGame {
OwnedGame {
user_id,
game_id,
location_id: None,
}