mirror of
https://github.com/Tribufu/TribufuRust
synced 2026-08-08 20:31:07 +00:00
63 lines
2.6 KiB
Rust
63 lines
2.6 KiB
Rust
/*
|
|
* Tribufu API
|
|
*
|
|
* API to access Tribufu services.
|
|
*
|
|
* The version of the OpenAPI document: 1.4.3
|
|
* 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 Package {
|
|
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
|
pub id: Option<String>,
|
|
#[serde(rename = "name", deserialize_with = "Option::deserialize")]
|
|
pub name: 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 = "author_id", skip_serializing_if = "Option::is_none")]
|
|
pub author_id: Option<String>,
|
|
#[serde(rename = "image_url", deserialize_with = "Option::deserialize")]
|
|
pub image_url: Option<String>,
|
|
#[serde(rename = "application_id", skip_serializing_if = "Option::is_none")]
|
|
pub application_id: Option<String>,
|
|
#[serde(rename = "category_id", skip_serializing_if = "Option::is_none")]
|
|
pub category_id: Option<String>,
|
|
#[serde(rename = "download_count", skip_serializing_if = "Option::is_none")]
|
|
pub download_count: Option<i32>,
|
|
#[serde(rename = "last_download", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
|
pub last_download: Option<Option<String>>,
|
|
#[serde(rename = "releases", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
|
pub releases: Option<Option<Vec<models::PackageRelease>>>,
|
|
#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
|
|
pub created_at: Option<String>,
|
|
#[serde(rename = "updated_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
|
pub updated_at: Option<Option<String>>,
|
|
#[serde(rename = "deleted_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
|
|
pub deleted_at: Option<Option<String>>,
|
|
}
|
|
|
|
impl Package {
|
|
pub fn new(name: Option<String>, image_url: Option<String>) -> Package {
|
|
Package {
|
|
id: None,
|
|
name,
|
|
description: None,
|
|
author_id: None,
|
|
image_url,
|
|
application_id: None,
|
|
category_id: None,
|
|
download_count: None,
|
|
last_download: None,
|
|
releases: None,
|
|
created_at: None,
|
|
updated_at: None,
|
|
deleted_at: None,
|
|
}
|
|
}
|
|
}
|
|
|