Added owning games and not willing to travel with them.

This commit is contained in:
2025-12-30 21:18:16 +01:00
parent ff88029a4b
commit 0c256846f6
45 changed files with 595 additions and 92 deletions

View File

@@ -16,6 +16,7 @@ docs/GetGamenightRequestBody.md
docs/Location.md
docs/LocationId.md
docs/Login.md
docs/OwnGameRequestBody.md
docs/Participants.md
docs/Registration.md
docs/RenameGameRequestBody.md
@@ -41,6 +42,7 @@ 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/participants.rs
src/models/registration.rs
src/models/rename_game_request_body.rs

View File

@@ -1 +1 @@
7.17.0
7.18.0

View File

@@ -2,7 +2,7 @@
name = "gamenight-api-client-rs"
version = "0.1.0"
authors = ["dennis@brentj.es"]
description = "Api specifaction for a Gamenight server"
description = "Api specification for a Gamenight server"
license = "MIT"
edition = "2021"

View File

@@ -1,6 +1,6 @@
# Rust API client for gamenight-api-client-rs
Api specifaction for a Gamenight server
Api specification for a Gamenight server
For more information, please visit [https://brentj.es](https://brentj.es)
@@ -10,7 +10,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
- API version: 1.0
- Package version: 0.1.0
- Generator version: 7.17.0
- Generator version: 7.18.0
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
## Installation
@@ -67,6 +67,7 @@ Class | Method | HTTP request | Description
- [Location](docs/Location.md)
- [LocationId](docs/LocationId.md)
- [Login](docs/Login.md)
- [OwnGameRequestBody](docs/OwnGameRequestBody.md)
- [Participants](docs/Participants.md)
- [Registration](docs/Registration.md)
- [RenameGameRequestBody](docs/RenameGameRequestBody.md)

View File

@@ -116,7 +116,7 @@ Name | Type | Description | Required | Notes
## game_post
> game_post(add_game_request_body)
> models::GameId game_post(add_game_request_body)
### Parameters
@@ -128,7 +128,7 @@ Name | Type | Description | Required | Notes
### Return type
(empty response body)
[**models::GameId**](GameId.md)
### Authorization
@@ -419,7 +419,7 @@ This endpoint does not need any parameter.
## own_post
> own_post(game_id)
> own_post(own_game_request_body)
### Parameters
@@ -427,7 +427,7 @@ This endpoint does not need any parameter.
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**game_id** | Option<[**GameId**](GameId.md)> | | |
**own_game_request_body** | Option<[**OwnGameRequestBody**](OwnGameRequestBody.md)> | | |
### Return type

View File

@@ -0,0 +1,12 @@
# OwnGameRequestBody
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**game_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

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es
@@ -330,7 +330,7 @@ pub async fn game_get(configuration: &configuration::Configuration, game_id: Opt
}
}
pub async fn game_post(configuration: &configuration::Configuration, add_game_request_body: Option<models::AddGameRequestBody>) -> Result<(), Error<GamePostError>> {
pub async fn game_post(configuration: &configuration::Configuration, add_game_request_body: Option<models::AddGameRequestBody>) -> Result<models::GameId, Error<GamePostError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_add_game_request_body = add_game_request_body;
@@ -349,9 +349,20 @@ pub async fn game_post(configuration: &configuration::Configuration, add_game_re
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
Ok(())
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GameId`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GameId`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GamePostError> = serde_json::from_str(&content).ok();
@@ -716,9 +727,9 @@ pub async fn locations_get(configuration: &configuration::Configuration, ) -> Re
}
}
pub async fn own_post(configuration: &configuration::Configuration, game_id: Option<models::GameId>) -> Result<(), Error<OwnPostError>> {
pub async fn own_post(configuration: &configuration::Configuration, own_game_request_body: Option<models::OwnGameRequestBody>) -> Result<(), Error<OwnPostError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_body_game_id = game_id;
let p_body_own_game_request_body = own_game_request_body;
let uri_str = format!("{}/own", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
@@ -729,7 +740,7 @@ pub async fn own_post(configuration: &configuration::Configuration, game_id: Opt
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_game_id);
req_builder = req_builder.json(&p_body_own_game_request_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -24,6 +24,8 @@ 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 participants;
pub use self::participants::Participants;
pub mod registration;

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 OwnGameRequestBody {
#[serde(rename = "game_id")]
pub game_id: String,
#[serde(rename = "location_id", skip_serializing_if = "Option::is_none")]
pub location_id: Option<String>,
}
impl OwnGameRequestBody {
pub fn new(game_id: String) -> OwnGameRequestBody {
OwnGameRequestBody {
game_id,
location_id: None,
}
}
}

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es

View File

@@ -1,7 +1,7 @@
/*
* Gamenight
*
* Api specifaction for a Gamenight server
* Api specification for a Gamenight server
*
* The version of the OpenAPI document: 1.0
* Contact: dennis@brentj.es