delopay 0.20.0

Official Rust SDK for the DeloPay payments API
Documentation
//! Shop label models: the merchant's own tags for grouping shops, for
//! example by industry, brand or region.

use serde::Deserialize;
use serde_json::Value;

/// A label of the merchant and the shops that carry it.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ShopLabelResponse {
    /// The label's ID.
    pub label_id: String,
    /// The label's name.
    pub name: String,
    /// The shops carrying this label that the caller may see, in no
    /// particular order. A shop-scoped caller sees at most its own shop.
    #[serde(default)]
    pub profile_ids: Vec<String>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// One label, as a shop carries it.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ShopLabelSummary {
    /// The label's ID.
    pub label_id: String,
    /// The label's name.
    pub name: String,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// The labels one shop carries.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ShopLabelsResponse {
    /// The shop.
    pub profile_id: String,
    /// The shop's labels, ordered by name.
    #[serde(default)]
    pub labels: Vec<ShopLabelSummary>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// Outcome of deleting a shop label.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ShopLabelDeleteResponse {
    /// The deleted label's ID.
    pub label_id: String,
    /// Always `true`: the label is gone and no shop carries it any more. The
    /// shops themselves are unchanged.
    pub deleted: bool,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}