1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use params::{Metadata, Timestamp};
use resources::{Currency, PackageDimensions};
use serde_json as json;

#[derive(Debug, Default, Deserialize, Serialize)]
pub struct Inventory {
    pub quantity: u64,
    #[serde(rename = "type")]
    pub inventory_type: String,
    pub value: Option<String>,
}

/// The resource representing a Stripe Sku.
///
/// For more details see https://stripe.com/docs/api#sku_object.
#[derive(Debug, Deserialize)]
pub struct Sku {
    pub id: String,
    pub object: String,
    pub active: bool,
    pub attributes: json::Value,
    pub created: Timestamp,
    pub currency: Currency,
    pub image: Option<String>,
    pub inventory: Inventory,
    pub livemode: bool,
    pub metadata: Metadata,
    pub package_dimensions: Option<PackageDimensions>,
    pub price: u64,
    pub product: String,
    pub updated: Timestamp,
}