mirror of
https://github.com/Tribufu/TribufuRust
synced 2026-08-09 04:41:07 +00:00
Generate api client with openapi-generator (#3)
* Generate api client with openapi-generator * Add wrapper struct * Add basic example
This commit is contained in:
parent
e701f20c1a
commit
23af141e2d
69 changed files with 6886 additions and 880 deletions
78
src/models/profile.rs
Normal file
78
src/models/profile.rs
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* Tribufu API
|
||||
*
|
||||
* REST API to access Tribufu services.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.1.0
|
||||
* Contact: contact@tribufu.com
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
use crate::models;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Profile {
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<String>,
|
||||
#[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
|
||||
pub uuid: Option<uuid::Uuid>,
|
||||
#[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<Option<String>>,
|
||||
#[serde(rename = "display_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub display_name: Option<Option<String>>,
|
||||
#[serde(rename = "verified", skip_serializing_if = "Option::is_none")]
|
||||
pub verified: Option<bool>,
|
||||
#[serde(rename = "level", skip_serializing_if = "Option::is_none")]
|
||||
pub level: Option<i32>,
|
||||
#[serde(rename = "experience", skip_serializing_if = "Option::is_none")]
|
||||
pub experience: Option<f64>,
|
||||
#[serde(rename = "public_birthday", skip_serializing_if = "Option::is_none")]
|
||||
pub public_birthday: Option<bool>,
|
||||
#[serde(rename = "birthday", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub birthday: Option<Option<String>>,
|
||||
#[serde(rename = "points", skip_serializing_if = "Option::is_none")]
|
||||
pub points: Option<f64>,
|
||||
#[serde(rename = "location", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub location: Option<Option<String>>,
|
||||
#[serde(rename = "photo_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub photo_url: Option<Option<String>>,
|
||||
#[serde(rename = "banner_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub banner_url: Option<Option<String>>,
|
||||
#[serde(rename = "last_online", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub last_online: Option<Option<String>>,
|
||||
#[serde(rename = "biography", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub biography: Option<Option<String>>,
|
||||
#[serde(rename = "view_count", skip_serializing_if = "Option::is_none")]
|
||||
pub view_count: Option<i32>,
|
||||
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
|
||||
pub created: Option<String>,
|
||||
#[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub updated: Option<Option<String>>,
|
||||
}
|
||||
|
||||
impl Profile {
|
||||
pub fn new() -> Profile {
|
||||
Profile {
|
||||
id: None,
|
||||
uuid: None,
|
||||
name: None,
|
||||
display_name: None,
|
||||
verified: None,
|
||||
level: None,
|
||||
experience: None,
|
||||
public_birthday: None,
|
||||
birthday: None,
|
||||
points: None,
|
||||
location: None,
|
||||
photo_url: None,
|
||||
banner_url: None,
|
||||
last_online: None,
|
||||
biography: None,
|
||||
view_count: None,
|
||||
created: None,
|
||||
updated: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue