Skip to content

Commit

Permalink
Added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCAB0 committed Apr 2, 2024
1 parent 51a4f44 commit db1d21c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
21 changes: 18 additions & 3 deletions src/model/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub extra_conditions: Option<String>,
/// See [`Brand`](crate::model::filter::brand::Brand)
#[serde(skip_serializing_if = "Option::is_none")]
pub brand_id: Option<i32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub size_id: Option<i32>,
/// See [`ArticleStatus`](crate::model::filter::ArticleStatus)
#[serde(skip_serializing_if = "Option::is_none")]
pub status_id: Option<i32>,
/// Status of the item in French 🇫🇷
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_fr: Option<String>,
Expand All @@ -78,25 +85,33 @@ pub struct AdvancedItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub color2: Option<String>,
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<i32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub city: Option<String>,

//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<String>,
/// Related ['Brand'](crate::model::filter::brand::Brand) IDs
pub related_catalog_ids: Vec<i32>,

// 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
Expand All @@ -106,7 +121,7 @@ pub struct AdvancedItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub user_updated_at_ts: Option<String>,

// Asets
// Assets
pub photos: Vec<Photo>,
pub url: String,
pub user: AdvancedUser,
Expand Down
7 changes: 4 additions & 3 deletions src/model/user.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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,
Expand All @@ -41,7 +42,7 @@ pub struct AdvancedUser {
pub last_loged_on_ts: Option<String>,
/// 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<i32>,
Expand Down

0 comments on commit db1d21c

Please sign in to comment.