minehut 2.0.0

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

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
/// Represents a Minehut product response from the API. It 
/// contains most information about a product. Due to the response
/// body from the API, many fields are optional.
pub struct Product {
    /// The sku, no idea what this is.
    pub sku: String,
    /// Credits to buy the product.
    pub price: usize,
    /// Sale price to buy product, can be different from price and may not exist.
    pub sale_price: Option<usize>,
    /// Title of the product.
    pub title: String,
    /// Shorter title of the product, may not exist.
    pub short_title: Option<String>,
    /// Description of the product.
    pub description: String,
    /// Short description of the product, may not exist.
    pub short_description: Option<String>,
    /// Category of the product.
    pub category: String,
    /// Type of the product, might not exist.
    #[serde(rename = "type")]
    pub product_type: Option<String>,
    /// Tags of the product, usually does not exist.
    pub tags: Option<Vec<ProductTag>>,
    /// Whether product is visible.
    pub visible: bool,
    /// Other details of the product.
    pub details: ProductDetails,
    /// When the product was last updates.
    pub updated_at: String,
    /// When the product was created.
    pub created_at: String,
    /// Status of the product.
    pub status: String,
    /// When product was released, if it was.
    pub release_date: Option<String>,
    /// If it is unpublished, may not exist.
    pub unpublished: Option<bool>,
    /// On wishlist, does not make sense.
    pub on_wishlist: bool, 
    /// Is owned. Still does not make sense.
    pub is_owned: bool 
}


#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
/// Represents more details for Product struct such as supported
/// languages, contributors and links.
pub struct ProductDetails {
    /// Promotional discount option.
    #[serde(rename = "promotionalDiscountOptIn")]
    pub promo_disc_opt_in: Option<bool>,
    /// All supported languages.
    pub supported_languages: Vec<String>,
    /// Contributors.
    pub contributors: Vec<String>,
    /// Wether product is managed.
    pub managed: bool,
    /// Product related links.
    pub links: Vec<ProductLinks>,
    /// ID of the publisher.
    pub publisher_id: String,
    /// Name of the publisher.
    pub publisher_name: String,
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
/// Links for the ProductDetails struct seen in ProductDetails. It
/// contains information about the link URL.
pub struct ProductLinks {
    #[serde(rename = "_id")]
    _id: String,
    /// Link text.
    pub link_text: String, 
    // Attached URL.
    pub link_url: String
}

#[derive(Debug, Deserialize)]
/// Tags used in Product struct, only contains a tag string.
pub struct ProductTag {
    _id: String,
    /// Tag name.
    pub tag: String
}