mtg_cardbase/
card.rs

1#[derive(Debug, Clone)]
2#[derive(serde::Serialize, serde::Deserialize)]
3#[cfg_attr(feature = "ts_export", derive(ts_rs::TS))]
4pub struct Card {
5    pub object: String,
6    pub id: String,
7    pub oracle_id: String,
8    pub multiverse_ids: Option<arrayvec::ArrayVec<u64, 8>>,
9    pub mtgo_id: Option<u64>,
10    pub arena_id: Option<u64>,
11    pub tcgplayer_id: Option<u64>,
12    pub cardmarket_id: Option<u64>,
13    pub name: String,
14    pub lang: String,
15    pub released_at: String,
16    pub uri: String,
17    pub scryfall_uri: String,
18    pub layout: String,
19    pub highres_image: bool,
20    pub image_status: String,
21    pub image_uris: Option<ImageUris>,
22    pub mana_cost: Option<String>,
23    pub cmc: f64,
24    pub type_line: String,
25    pub oracle_text: Option<String>,
26    pub power: Option<String>,
27    pub toughness: Option<String>,
28    pub colors: Option<arrayvec::ArrayVec<String, 5>>,
29    pub color_identity: arrayvec::ArrayVec<String, 5>,
30    pub keywords: arrayvec::ArrayVec<String, 16>,
31    pub produced_mana: Option<arrayvec::ArrayVec<String, 8>>,
32    pub loyalty: Option<String>,
33    pub legalities: Legalities,
34    pub games: arrayvec::ArrayVec<String, 8>,
35    pub reserved: bool,
36    pub game_changer: Option<bool>,
37    pub foil: bool,
38    pub nonfoil: bool,
39    pub finishes: arrayvec::ArrayVec<String, 8>,
40    pub oversized: bool,
41    pub promo: bool,
42    pub reprint: bool,
43    pub variation: bool,
44    pub set_id: String,
45    pub set: String,
46    pub set_name: String,
47    pub set_type: String,
48    pub set_uri: String,
49    pub set_search_uri: String,
50    pub scryfall_set_uri: String,
51    pub rulings_uri: String,
52    pub prints_search_uri: String,
53    pub collector_number: String,
54    pub digital: bool,
55    pub rarity: String,
56    pub card_back_id: Option<String>,
57    pub artist: String,
58    pub artist_ids: Option<arrayvec::ArrayVec<String, 8>>,
59    pub illustration_id: Option<String>,
60    pub border_color: String,
61    pub frame: String,
62    pub frame_effects: Option<arrayvec::ArrayVec<String, 8>>,
63    pub security_stamp: Option<String>,
64    pub full_art: bool,
65    pub textless: bool,
66    pub booster: bool,
67    pub story_spotlight: bool,
68    pub edhrec_rank: Option<u64>,
69    pub penny_rank: Option<u64>,
70    pub preview: Option<Preview>,
71    pub prices: Prices,
72    pub related_uris: RelatedUris,
73    pub purchase_uris: Option<PurchaseUris>,
74}
75
76#[derive(Debug, Clone)]
77#[derive(serde::Serialize, serde::Deserialize)]
78#[cfg_attr(feature = "ts_export", derive(ts_rs::TS))]
79pub struct Legalities {
80    pub standard: String,
81    pub future: String,
82    pub historic: String,
83    pub timeless: String,
84    pub gladiator: String,
85    pub pioneer: String,
86    pub modern: String,
87    pub legacy: String,
88    pub pauper: String,
89    pub vintage: String,
90    pub penny: String,
91    pub commander: String,
92    pub oathbreaker: String,
93    pub standardbrawl: String,
94    pub brawl: String,
95    pub alchemy: String,
96    pub paupercommander: String,
97    pub duel: String,
98    pub oldschool: String,
99    pub premodern: String,
100    pub predh: String,
101}
102
103#[derive(Debug, Clone)]
104#[derive(serde::Serialize, serde::Deserialize)]
105#[cfg_attr(feature = "ts_export", derive(ts_rs::TS))]
106pub struct ImageUris {
107    pub small: String,
108    pub normal: String,
109    pub large: String,
110    pub png: String,
111    pub art_crop: String,
112    pub border_crop: String,
113}
114
115#[derive(Debug, Clone)]
116#[derive(serde::Serialize, serde::Deserialize)]
117#[cfg_attr(feature = "ts_export", derive(ts_rs::TS))]
118pub struct Preview {
119    pub source: String,
120    pub source_uri: String,
121    pub previewed_at: String,
122}
123
124#[derive(Debug, Clone)]
125#[derive(serde::Serialize, serde::Deserialize)]
126#[cfg_attr(feature = "ts_export", derive(ts_rs::TS))]
127pub struct Prices {
128    pub usd: Option<String>,
129    pub usd_foil: Option<String>,
130    pub usd_etched: Option<String>,
131    pub eur: Option<String>,
132    pub eur_foil: Option<String>,
133    pub tix: Option<String>,
134}
135
136#[derive(Debug, Clone)]
137#[derive(serde::Serialize, serde::Deserialize)]
138#[cfg_attr(feature = "ts_export", derive(ts_rs::TS))]
139pub struct RelatedUris {
140    pub gatherer: Option<String>,
141    pub tcgplayer_infinite_articles: Option<String>,
142    pub tcgplayer_infinite_decks: Option<String>,
143    pub edhrec: Option<String>,
144}
145
146#[derive(Debug, Clone)]
147#[derive(serde::Serialize, serde::Deserialize)]
148#[cfg_attr(feature = "ts_export", derive(ts_rs::TS))]
149pub struct PurchaseUris {
150    pub tcgplayer: Option<String>,
151    pub cardmarket: Option<String>,
152    pub cardhoarder: Option<String>,
153}