From db1d21c60e10d92e35568e25cadc49c8225928a8 Mon Sep 17 00:00:00 2001 From: Alvaro Date: Tue, 2 Apr 2024 20:48:20 +0200 Subject: [PATCH] Added docs --- src/model/item.rs | 21 ++++++++++++++++++--- src/model/user.rs | 7 ++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/model/item.rs b/src/model/item.rs index a710151..a9ff4e2 100644 --- a/src/model/item.rs +++ b/src/model/item.rs @@ -44,24 +44,31 @@ impl fmt::Display for Item { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Hash, Eq)] #[cfg_attr(feature = "redis", derive(FromRedisValue, ToRedisArgs,))] pub struct AdvancedItem { - // Products filter info + /// Vinted item ID pub id: i64, + /// Item title pub title: String, + /// Item description pub description: String, + /// See [`Size`](crate::model::filter::size::Size) #[serde(rename = "size")] pub size_title: String, + /// See [`Brand`](crate::model::filter::brand::Brand) #[serde(rename = "brand")] pub brand_title: String, #[serde(skip_serializing_if = "Option::is_none")] pub composition: Option, #[serde(skip_serializing_if = "Option::is_none")] pub extra_conditions: Option, + /// See [`Brand`](crate::model::filter::brand::Brand) #[serde(skip_serializing_if = "Option::is_none")] pub brand_id: Option, #[serde(skip_serializing_if = "Option::is_none")] pub size_id: Option, + /// See [`ArticleStatus`](crate::model::filter::ArticleStatus) #[serde(skip_serializing_if = "Option::is_none")] pub status_id: Option, + /// Status of the item in French 🇫🇷 #[serde(rename = "status")] #[serde(skip_serializing_if = "Option::is_none")] pub status_fr: Option, @@ -78,7 +85,7 @@ pub struct AdvancedItem { #[serde(skip_serializing_if = "Option::is_none")] pub color2: Option, pub package_size_id: i32, - //Location + /// See [`Country`](crate::model::filter::country::Country) pub country_id: i32, #[serde(skip_serializing_if = "Option::is_none")] pub city_id: Option, @@ -86,17 +93,25 @@ pub struct AdvancedItem { pub city: Option, //Stats + /// Number of bids on the item pub active_bid_count: i32, + /// Number of times the item was added to favourites pub favourite_count: i32, + /// Number of times the item was viewed pub view_count: i32, + /// Moderation status of the item (Vinted internal use only) pub moderation_status: i32, #[serde(skip_serializing_if = "Option::is_none")] pub last_push_up_at: Option, + /// Related ['Brand'](crate::model::filter::brand::Brand) IDs pub related_catalog_ids: Vec, // Pricing + /// Original price of the item pub original_price_numeric: String, + /// Currency the item was posted with. See [`Currency`](crate::model::filter::Currency) for valid currencies on Vinted pub currency: String, + /// Current valid price of the item pub price_numeric: String, // Order by stats @@ -106,7 +121,7 @@ pub struct AdvancedItem { #[serde(skip_serializing_if = "Option::is_none")] pub user_updated_at_ts: Option, - // Asets + // Assets pub photos: Vec, pub url: String, pub user: AdvancedUser, diff --git a/src/model/user.rs b/src/model/user.rs index 35ab0d4..5d80f3b 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -1,14 +1,14 @@ -use std::fmt; - use crate::model::{Deserialize, Serialize}; #[cfg(feature = "redis")] use crate::model::{FromRedisValue, ToRedisArgs}; +use std::fmt; use super::{payment_method::PayInMethod, photo::Photo}; #[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, Hash)] #[cfg_attr(feature = "redis", derive(FromRedisValue, ToRedisArgs,))] pub struct User { + /// Vinted user ID pub id: i64, // Username pub login: String, @@ -19,6 +19,7 @@ pub struct User { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Hash, Eq)] #[cfg_attr(feature = "redis", derive(FromRedisValue, ToRedisArgs,))] pub struct AdvancedUser { + /// Vinted user ID pub id: i64, /// Username pub login: String, @@ -41,7 +42,7 @@ pub struct AdvancedUser { pub last_loged_on_ts: Option, /// If the user wants to expose his location pub expose_location: bool, - /// See [`Country`](crate::model::Country) + /// See [`Country`](crate::model::filter::country::Country) pub country_id: i32, #[serde(skip_serializing_if = "Option::is_none")] pub city_id: Option,