Rewrite to a API trait.

This commit is contained in:
2026-01-11 14:12:54 +01:00
parent ea9f05b048
commit 88f8cf76ef
45 changed files with 1384 additions and 1030 deletions
File diff suppressed because it is too large Load Diff
+1
View File
@@ -114,3 +114,4 @@ impl From<&str> for ContentType {
pub mod default_api;
pub mod configuration;
-1
View File
@@ -5,7 +5,6 @@ extern crate serde_repr;
extern crate serde;
extern crate serde_json;
extern crate url;
extern crate reqwest;
pub mod apis;
pub mod models;
@@ -17,6 +17,8 @@ pub struct Gamenight {
pub id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "location_id", skip_serializing_if = "Option::is_none")]
pub location_id: Option<String>,
#[serde(rename = "datetime")]
pub datetime: String,
#[serde(rename = "owner_id")]
@@ -28,6 +30,7 @@ impl Gamenight {
Gamenight {
id,
name,
location_id: None,
datetime,
owner_id,
}
@@ -26,6 +26,8 @@ pub mod login;
pub use self::login::Login;
pub mod own_game_request_body;
pub use self::own_game_request_body::OwnGameRequestBody;
pub mod owned_game;
pub use self::owned_game::OwnedGame;
pub mod participants;
pub use self::participants::Participants;
pub mod registration;
@@ -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 OwnedGame {
#[serde(rename = "game_id")]
pub game_id: String,
#[serde(rename = "location_id", skip_serializing_if = "Option::is_none")]
pub location_id: Option<String>,
}
impl OwnedGame {
pub fn new(game_id: String) -> OwnedGame {
OwnedGame {
game_id,
location_id: None,
}
}
}