mirror of
https://github.com/tribufu/sdk-rust
synced 2026-02-04 17:33: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:
72
src/models/group.rs
Normal file
72
src/models/group.rs
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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 Group {
|
||||
#[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 = "tag", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub tag: Option<Option<String>>,
|
||||
#[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<Option<String>>,
|
||||
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
|
||||
pub r#type: Option<i32>,
|
||||
#[serde(rename = "privacy", skip_serializing_if = "Option::is_none")]
|
||||
pub privacy: Option<i32>,
|
||||
#[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
|
||||
pub owner_id: Option<String>,
|
||||
#[serde(rename = "verified", skip_serializing_if = "Option::is_none")]
|
||||
pub verified: Option<bool>,
|
||||
#[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 = "member_count", skip_serializing_if = "Option::is_none")]
|
||||
pub member_count: Option<i32>,
|
||||
#[serde(rename = "follower_count", skip_serializing_if = "Option::is_none")]
|
||||
pub follower_count: Option<i32>,
|
||||
#[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 Group {
|
||||
pub fn new() -> Group {
|
||||
Group {
|
||||
id: None,
|
||||
uuid: None,
|
||||
name: None,
|
||||
tag: None,
|
||||
description: None,
|
||||
r#type: None,
|
||||
privacy: None,
|
||||
owner_id: None,
|
||||
verified: None,
|
||||
photo_url: None,
|
||||
banner_url: None,
|
||||
member_count: None,
|
||||
follower_count: None,
|
||||
view_count: None,
|
||||
created: None,
|
||||
updated: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user