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
//! Region models: custom named country groups scoped to a shop, plus the
//! built-in global groups.
use serde::Deserialize;
use serde_json::Value;
/// A custom region (named country group) scoped to a shop.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct RegionResponse {
/// Region ID (the API field is `id`, not `region_id`).
pub id: String,
/// Shop (business profile) the region is scoped to.
pub profile_id: String,
/// Display name of the region.
pub region_name: String,
/// Short, unique code for the region, e.g. `"NORDICS"`.
pub region_code: String,
/// Whether the region is active.
pub is_active: bool,
/// ISO 8601 creation timestamp.
pub created_at: String,
/// ISO 8601 last-modification timestamp.
pub modified_at: String,
/// Free-form description.
#[serde(default)]
pub description: Option<String>,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// The country membership of a region.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct RegionCountriesResponse {
/// The region these countries belong to.
pub region_id: String,
/// ISO 3166-1 alpha-2 country codes, e.g. `["SE", "NO", "DK"]`.
#[serde(default)]
pub countries: Vec<String>,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// A built-in (global) region group such as EU / EEA / SEPA / LATAM / APAC.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct BuiltInRegionGroupResponse {
/// Group code, e.g. `"EU"`.
pub code: String,
/// Human-readable group name.
pub name: String,
/// ISO 3166-1 alpha-2 country codes in the group.
#[serde(default)]
pub countries: Vec<String>,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}