vrchatapi 1.20.8-nightly.11

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

/// UserSubscription :
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UserSubscription {
    #[serde(rename = "active")]
    pub active: bool,
    #[serde(rename = "amount")]
    pub amount: f64,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "description")]
    pub description: String,
    #[serde(rename = "expires")]
    pub expires: String,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "isBulkGift")]
    pub is_bulk_gift: bool,
    #[serde(rename = "isGift")]
    pub is_gift: bool,
    #[serde(rename = "licenseGroups")]
    pub license_groups: Vec<String>,
    #[serde(rename = "period")]
    pub period: models::SubscriptionPeriod,
    #[serde(rename = "starts", skip_serializing_if = "Option::is_none")]
    pub starts: Option<String>,
    #[serde(rename = "status")]
    pub status: models::TransactionStatus,
    #[serde(rename = "steamItemId", skip_serializing_if = "Option::is_none")]
    pub steam_item_id: Option<String>,
    /// Which \"Store\" it came from. Right now only Stores are \"Steam\" and \"Admin\".
    #[serde(rename = "store")]
    pub store: String,
    #[serde(rename = "tier")]
    pub tier: i32,
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
}

impl UserSubscription {
    pub fn new(
        active: bool,
        amount: f64,
        created_at: String,
        description: String,
        expires: String,
        id: String,
        is_bulk_gift: bool,
        is_gift: bool,
        license_groups: Vec<String>,
        period: models::SubscriptionPeriod,
        status: models::TransactionStatus,
        store: String,
        tier: i32,
        transaction_id: String,
        updated_at: String,
    ) -> UserSubscription {
        UserSubscription {
            active,
            amount,
            created_at,
            description,
            expires,
            id,
            is_bulk_gift,
            is_gift,
            license_groups,
            period,
            starts: None,
            status,
            steam_item_id: None,
            store,
            tier,
            transaction_id,
            updated_at,
        }
    }
}