delopay 0.20.0

Official Rust SDK for the DeloPay payments API
Documentation
//! 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>,
}