vrchatapi 1.23.1-nightly.7

VRChat API Client for Rust
Documentation
use crate::models;
use serde::{Deserialize, Serialize};

#[serde_with::serde_as]
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ProductListingVariant {
    #[serde(rename = "effectiveFrom", skip_serializing_if = "Option::is_none")]
    pub effective_from: Option<chrono::DateTime<chrono::FixedOffset>>,
    #[serde(rename = "listingVariantId", deserialize_with = "Option::deserialize")]
    pub listing_variant_id: Option<String>,
    #[serde(rename = "nonRefundable")]
    pub non_refundable: bool,
    #[serde(rename = "quantity")]
    pub quantity: i32,
    #[serde(rename = "sellerVariant")]
    pub seller_variant: bool,
    #[serde(rename = "unitPriceTokens")]
    pub unit_price_tokens: i32,
}

impl ProductListingVariant {
    pub fn new(
        listing_variant_id: Option<String>,
        non_refundable: bool,
        quantity: i32,
        seller_variant: bool,
        unit_price_tokens: i32,
    ) -> ProductListingVariant {
        ProductListingVariant {
            effective_from: None,
            listing_variant_id,
            non_refundable,
            quantity,
            seller_variant,
            unit_price_tokens,
        }
    }
}