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:
84
src/models/application.rs
Normal file
84
src/models/application.rs
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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 Application {
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<String>,
|
||||
#[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub name: 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<models::ApplicationType>,
|
||||
#[serde(rename = "organization_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub organization_id: Option<Option<String>>,
|
||||
#[serde(rename = "icon_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub icon_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 = "capsule_image_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub capsule_image_url: Option<Option<String>>,
|
||||
#[serde(rename = "library_image_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub library_image_url: Option<Option<String>>,
|
||||
#[serde(rename = "parent_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub parent_id: Option<Option<String>>,
|
||||
#[serde(rename = "slug", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub slug: Option<Option<String>>,
|
||||
#[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
|
||||
pub visibility: Option<i32>,
|
||||
#[serde(rename = "password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub password: Option<Option<String>>,
|
||||
#[serde(rename = "primary", skip_serializing_if = "Option::is_none")]
|
||||
pub primary: Option<i32>,
|
||||
#[serde(rename = "user_count", skip_serializing_if = "Option::is_none")]
|
||||
pub user_count: Option<i32>,
|
||||
#[serde(rename = "achievement_count", skip_serializing_if = "Option::is_none")]
|
||||
pub achievement_count: Option<i32>,
|
||||
#[serde(rename = "badge_count", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
||||
pub badge_count: Option<Option<i32>>,
|
||||
#[serde(rename = "download_count", skip_serializing_if = "Option::is_none")]
|
||||
pub download_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 Application {
|
||||
pub fn new() -> Application {
|
||||
Application {
|
||||
id: None,
|
||||
name: None,
|
||||
description: None,
|
||||
r#type: None,
|
||||
organization_id: None,
|
||||
icon_url: None,
|
||||
banner_url: None,
|
||||
capsule_image_url: None,
|
||||
library_image_url: None,
|
||||
parent_id: None,
|
||||
slug: None,
|
||||
visibility: None,
|
||||
password: None,
|
||||
primary: None,
|
||||
user_count: None,
|
||||
achievement_count: None,
|
||||
badge_count: None,
|
||||
download_count: None,
|
||||
created: None,
|
||||
updated: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user