scrapebadger 0.2.0

Async Rust SDK and CLI for the ScrapeBadger web-scraping API (Amazon, Google, Twitter/X, Reddit, Vinted, Web Scraping).
Documentation
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
// @generated by `cargo run -p xtask -- gen` from specs/vinted.json — do not edit by hand.
#![allow(clippy::all)]
#![allow(
    dead_code,
    unused_imports,
    unused_variables,
    non_snake_case,
    rustdoc::all
)]

use crate::core::{Client, Error, Method, QueryParams, Result};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;

/// Handle for the `vinted` platform. Obtain via [`crate::ScrapeBadger::vinted`].
#[derive(Clone)]
pub struct Vinted {
    client: Client,
}

impl Vinted {
    pub(crate) fn new(client: Client) -> Self {
        Self { client }
    }

    /// Access the underlying transport client.
    pub fn client(&self) -> &Client {
        &self.client
    }

    /// Search Brands
    ///
    /// Search for Vinted brand IDs by name.
    /// `GET /v1/vinted/brands`
    pub async fn search_brands(&self, params: SearchBrandsParams) -> Result<SearchBrandsResponse> {
        let path = "/v1/vinted/brands".to_string();
        let mut q = QueryParams::new();
        q.opt("keyword", params.keyword.as_ref());
        q.opt("market", params.market.as_ref());
        let query = q.into_pairs();
        let body = None;
        self.client.send(Method::GET, &path, &query, body).await
    }

    /// List Colors
    ///
    /// List all available color filters for Vinted search.
    /// `GET /v1/vinted/colors`
    pub async fn list_colors(&self, params: ListColorsParams) -> Result<ListColorsResponse> {
        let path = "/v1/vinted/colors".to_string();
        let mut q = QueryParams::new();
        q.opt("market", params.market.as_ref());
        let query = q.into_pairs();
        let body = None;
        self.client.send(Method::GET, &path, &query, body).await
    }

    /// Get Item Details
    ///
    /// Get detailed information about a Vinted item.
    /// `GET /v1/vinted/items/{item_id}`
    pub async fn get_item_detail(
        &self,
        item_id: impl AsRef<str>,
        params: GetItemDetailParams,
    ) -> Result<GetItemDetailResponse> {
        let path = format!("/v1/vinted/items/{item_id}", item_id = item_id.as_ref());
        let mut q = QueryParams::new();
        q.opt("market", params.market.as_ref());
        let query = q.into_pairs();
        let body = None;
        self.client.send(Method::GET, &path, &query, body).await
    }

    /// List Markets
    ///
    /// List all supported Vinted markets with their domains and country codes.
    /// `GET /v1/vinted/markets`
    pub async fn list_markets(&self, params: ListMarketsParams) -> Result<ListMarketsResponse> {
        let path = "/v1/vinted/markets".to_string();
        let query: Vec<(String, String)> = Vec::new();
        let body = None;
        self.client.send(Method::GET, &path, &query, body).await
    }

    /// Search Items
    ///
    /// Search Vinted catalog items with filters.
    /// `GET /v1/vinted/search`
    pub async fn search_items(&self, params: SearchItemsParams) -> Result<SearchItemsResponse> {
        let path = "/v1/vinted/search".to_string();
        let mut q = QueryParams::new();
        q.opt("query", params.query.as_ref());
        q.opt("market", params.market.as_ref());
        q.opt("page", params.page.as_ref());
        q.opt("per_page", params.per_page.as_ref());
        q.opt("price_from", params.price_from.as_ref());
        q.opt("price_to", params.price_to.as_ref());
        q.opt("brand_ids", params.brand_ids.as_ref());
        q.opt("color_ids", params.color_ids.as_ref());
        q.opt("status_ids", params.status_ids.as_ref());
        q.opt("order", params.order.as_ref());
        let query = q.into_pairs();
        let body = None;
        self.client.send(Method::GET, &path, &query, body).await
    }

    /// List Conditions
    ///
    /// List all available item condition statuses for Vinted search.
    /// `GET /v1/vinted/statuses`
    pub async fn list_statuses(&self, params: ListStatusesParams) -> Result<ListStatusesResponse> {
        let path = "/v1/vinted/statuses".to_string();
        let mut q = QueryParams::new();
        q.opt("market", params.market.as_ref());
        let query = q.into_pairs();
        let body = None;
        self.client.send(Method::GET, &path, &query, body).await
    }

    /// Get User Profile
    ///
    /// Get detailed profile information for a Vinted user.
    /// `GET /v1/vinted/users/{user_id}`
    pub async fn get_user_profile(
        &self,
        user_id: impl AsRef<str>,
        params: GetUserProfileParams,
    ) -> Result<GetUserProfileResponse> {
        let path = format!("/v1/vinted/users/{user_id}", user_id = user_id.as_ref());
        let mut q = QueryParams::new();
        q.opt("market", params.market.as_ref());
        let query = q.into_pairs();
        let body = None;
        self.client.send(Method::GET, &path, &query, body).await
    }

    /// Get User Items
    ///
    /// List all active items from a specific Vinted user.
    /// `GET /v1/vinted/users/{user_id}/items`
    pub async fn get_user_items(
        &self,
        user_id: impl AsRef<str>,
        params: GetUserItemsParams,
    ) -> Result<GetUserItemsResponse> {
        let path = format!(
            "/v1/vinted/users/{user_id}/items",
            user_id = user_id.as_ref()
        );
        let mut q = QueryParams::new();
        q.opt("market", params.market.as_ref());
        q.opt("page", params.page.as_ref());
        q.opt("per_page", params.per_page.as_ref());
        let query = q.into_pairs();
        let body = None;
        self.client.send(Method::GET, &path, &query, body).await
    }
}

// ===== Models =====

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct GetItemDetailResponse {
    /// Brand name.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub brand_title: Option<String>,
    /// Primary color.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub color1: Option<String>,
    /// Secondary color.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub color2: Option<String>,
    /// ISO 8601 timestamp when the item was listed.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub created_at: Option<String>,
    /// ISO 4217 currency code.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub currency: Option<String>,
    /// Full item description text.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub description: Option<String>,
    /// Number of favourites.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub favourite_count: Option<i64>,
    /// Item ID.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub id: Option<i64>,
    /// Array of photo objects.
    pub photos: Vec<VintedPhoto>,
    /// Price in local currency.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub price: Option<String>,
    /// Size label.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub size_title: Option<String>,
    /// Item condition (e.g. "New with tags", "Good").
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub status: Option<String>,
    /// Item title.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub title: Option<String>,
    /// ISO 8601 timestamp of the last update.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub updated_at: Option<String>,
    /// Full URL to the Vinted listing.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub url: Option<String>,
    /// Seller information.
    pub user: Option<VintedUserSummary>,
    /// Number of views.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub view_count: Option<i64>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct GetUserItemsResponse {
    /// Current page number.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub current_page: Option<i64>,
    pub items: Vec<VintedItemSummary>,
    /// Number of items per page.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub per_page: Option<i64>,
    /// Total number of items listed by this user.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub total_entries: Option<i64>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct GetUserProfileResponse {
    /// User's city (if public).
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub city: Option<String>,
    /// User's country.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub country_title: Option<String>,
    /// ISO 8601 timestamp when the account was created.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub created_at: Option<String>,
    /// Total number of feedback ratings received.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub feedback_count: Option<i64>,
    /// Reputation score between 0 and 1.
    #[serde(default, deserialize_with = "crate::core::flex::opt_f64")]
    pub feedback_reputation: Option<f64>,
    /// Number of followers.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub followers_count: Option<i64>,
    /// Number of users followed.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub following_count: Option<i64>,
    /// Number of items the user has sold.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub given_item_count: Option<i64>,
    /// User ID.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub id: Option<i64>,
    /// Number of items currently listed.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub item_count: Option<i64>,
    /// ISO 8601 timestamp of last login.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub last_loged_on: Option<String>,
    /// Username.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub login: Option<String>,
    /// Profile photo.
    pub photo: Option<GetUserProfileResponsePhoto>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

/// Profile photo.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct GetUserProfileResponsePhoto {
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub height: Option<i64>,
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub url: Option<String>,
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub width: Option<i64>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct ListColorsResponse {
    pub colors: Vec<ListColorsResponseColorsItem>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct ListColorsResponseColorsItem {
    /// Hex color code (e.g. "#000000").
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub hex: Option<String>,
    /// Color ID.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub id: Option<i64>,
    /// Localized color name.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub title: Option<String>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct ListMarketsResponse {
    pub markets: Vec<ListMarketsResponseMarketsItem>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct ListMarketsResponseMarketsItem {
    /// Market code (e.g. "fr", "de").
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub code: Option<String>,
    /// ISO 4217 currency code.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub currency: Option<String>,
    /// Vinted domain for this market.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub domain: Option<String>,
    /// Country name.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub title: Option<String>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct ListStatusesResponse {
    pub statuses: Vec<ListStatusesResponseStatusesItem>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct ListStatusesResponseStatusesItem {
    /// Status ID.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub id: Option<i64>,
    /// Localized condition label.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub title: Option<String>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct SearchBrandsResponse {
    pub brands: Vec<SearchBrandsResponseBrandsItem>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct SearchBrandsResponseBrandsItem {
    /// Number of users following this brand.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub favourite_count: Option<i64>,
    /// Brand ID.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub id: Option<i64>,
    /// Number of items listed under this brand.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub item_count: Option<i64>,
    /// URL-friendly brand name.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub slug: Option<String>,
    /// Brand name.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub title: Option<String>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

/// Allowed values for a fixed-value query parameter.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub enum SearchItemsOrder {
    /// `relevance`
    #[serde(rename = "relevance")]
    Relevance,
    /// `price_low_to_high`
    #[serde(rename = "price_low_to_high")]
    PriceLowToHigh,
    /// `price_high_to_low`
    #[serde(rename = "price_high_to_low")]
    PriceHighToLow,
    /// `newest_first`
    #[serde(rename = "newest_first")]
    NewestFirst,
}

impl std::fmt::Display for SearchItemsOrder {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(match self {
            SearchItemsOrder::Relevance => "relevance",
            SearchItemsOrder::PriceLowToHigh => "price_low_to_high",
            SearchItemsOrder::PriceHighToLow => "price_high_to_low",
            SearchItemsOrder::NewestFirst => "newest_first",
        })
    }
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct SearchItemsResponse {
    /// Current page number.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub current_page: Option<i64>,
    pub items: Vec<VintedItemSummary>,
    /// Number of items per page.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub per_page: Option<i64>,
    /// Total number of matching items across all pages.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub total_entries: Option<i64>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct VintedItemSummary {
    /// Brand name.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub brand_title: Option<String>,
    /// ISO 4217 currency code (e.g. "EUR").
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub currency: Option<String>,
    /// Number of users who favourited this item.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub favourite_count: Option<i64>,
    /// Item ID.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub id: Option<i64>,
    pub photo: Option<VintedPhoto>,
    /// Price in local currency (e.g. "15.00").
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub price: Option<String>,
    /// Size label.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub size_title: Option<String>,
    /// Item title.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub title: Option<String>,
    /// Full URL to the Vinted listing.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub url: Option<String>,
    pub user: Option<VintedUserSummary>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct VintedPhoto {
    /// Height in pixels.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub height: Option<i64>,
    /// Photo URL.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub url: Option<String>,
    /// Width in pixels.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub width: Option<i64>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct VintedUserSummary {
    /// Reputation score between 0 and 1.
    #[serde(default, deserialize_with = "crate::core::flex::opt_f64")]
    pub feedback_reputation: Option<f64>,
    /// User ID.
    #[serde(default, deserialize_with = "crate::core::flex::opt_i64")]
    pub id: Option<i64>,
    /// Username.
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub login: Option<String>,
    pub photo: Option<VintedUserSummaryPhoto>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default)]
pub struct VintedUserSummaryPhoto {
    #[serde(default, deserialize_with = "crate::core::flex::opt_string")]
    pub url: Option<String>,
    /// Fields present in the response but not in the spec.
    #[serde(flatten)]
    pub extra: HashMap<String, Value>,
}

/// Parameters for [`SearchBrandsParams`]. All fields optional; required ones are noted per method.
#[derive(Debug, Clone, Default, Serialize)]
pub struct SearchBrandsParams {
    /// Brand name to search for. Partial matches are supported.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub keyword: Option<String>,
    /// Vinted market to search brands in.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub market: Option<String>,
}

/// Parameters for [`ListColorsParams`]. All fields optional; required ones are noted per method.
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListColorsParams {
    /// Vinted market. Color names are localized to the market language.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub market: Option<String>,
}

/// Parameters for [`GetItemDetailParams`]. All fields optional; required ones are noted per method.
#[derive(Debug, Clone, Default, Serialize)]
pub struct GetItemDetailParams {
    /// Vinted market where the item is listed (e.g. fr, de, uk).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub market: Option<String>,
}

/// Parameters for [`ListMarketsParams`]. All fields optional; required ones are noted per method.
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListMarketsParams {}

/// Parameters for [`SearchItemsParams`]. All fields optional; required ones are noted per method.
#[derive(Debug, Clone, Default, Serialize)]
pub struct SearchItemsParams {
    /// Search query string. Matches against item titles and descriptions.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub query: Option<String>,
    /// Vinted market to search (e.g. fr, de, uk, it, es, pl, us).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub market: Option<String>,
    /// Page number for paginated results.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub page: Option<i64>,
    /// Number of items per page.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub per_page: Option<i64>,
    /// Minimum price filter in the market's local currency.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub price_from: Option<f64>,
    /// Maximum price filter in the market's local currency.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub price_to: Option<f64>,
    /// Comma-separated list of brand IDs to filter by.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub brand_ids: Option<String>,
    /// Comma-separated list of color IDs to filter by.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub color_ids: Option<String>,
    /// Comma-separated list of condition status IDs to filter by.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status_ids: Option<String>,
    /// Sort order for results.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub order: Option<SearchItemsOrder>,
}

/// Parameters for [`ListStatusesParams`]. All fields optional; required ones are noted per method.
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListStatusesParams {
    /// Vinted market. Status names are localized to the market language.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub market: Option<String>,
}

/// Parameters for [`GetUserProfileParams`]. All fields optional; required ones are noted per method.
#[derive(Debug, Clone, Default, Serialize)]
pub struct GetUserProfileParams {
    /// Vinted market where the user is registered (e.g. fr, de, uk).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub market: Option<String>,
}

/// Parameters for [`GetUserItemsParams`]. All fields optional; required ones are noted per method.
#[derive(Debug, Clone, Default, Serialize)]
pub struct GetUserItemsParams {
    /// Vinted market where the user is registered (e.g. fr, de, uk).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub market: Option<String>,
    /// Page number for paginated results.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub page: Option<i64>,
    /// Number of items per page.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub per_page: Option<i64>,
}