forked from Roflin/gamenight
Rewrite to a API trait.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -114,3 +114,4 @@ impl From<&str> for ContentType {
|
||||
pub mod default_api;
|
||||
|
||||
pub mod configuration;
|
||||
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user