minehut 1.0.1

Simple Rust wrapper for the Minehut API
Documentation
use serde::Deserialize;

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
/// Represents Minehut products
pub struct Product {
    pub sku: String, // don't know whether this is an ID
    pub price: usize,
    pub sale_price: Option<usize>,
    pub title: String,
    pub short_title: Option<String>,
    pub description: String,
    pub short_description: Option<String>,
    pub category: String,
    #[serde(rename = "type")]
    pub product_type: Option<String>,
    pub tags: Option<Vec<ProductTag>>,
    pub visible: bool,
    pub details: ProductDetails,
    pub updated_at: String,
    pub created_at: String,
    pub status: String,
    pub release_date: Option<String>,
    pub unpublished: Option<bool>,
    pub on_wishlist: bool, // huh? 
    pub is_owned: bool  // huh?
}


#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
/// Represents more details for Product struct
pub struct ProductDetails {
    #[serde(rename = "promotionalDiscountOptIn")]
    pub promo_disc_opt_in: Option<bool>,
    pub supported_languages: Vec<String>,
    pub contributors: Vec<String>,
    pub managed: bool,
    pub links: Vec<ProductLinks>,
    pub publisher_id: String,
    pub publisher_name: String,
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
/// Links for the ProductDetails struct
pub struct ProductLinks {
    #[serde(rename = "_id")]
    _id: String,
    pub link_text: String,
    pub link_url: String
}

#[derive(Debug, Deserialize)]
/// Tags used in Product struct
pub struct ProductTag {
    _id: String,
    pub tag: String
}