sellapp-sdk 0.1.1

Official Rust SDK for the SellApp API: manage products, orders, subscriptions, and customers.
// This file is auto-generated by oagen. Do not edit.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(remote = "Self")]
pub struct SdkReplaceWalletSettingsRequestApplicationJson {
    pub enabled: bool,
    pub minimum_top_up_cents: Option<i64>,
    pub maximum_top_up_cents: Option<i64>,
    pub expiration_days: Option<i64>,
    /// Effective top-up gateway groups. CUSTOM_PAYMENT_METHOD enables all usable custom methods; customers choose an individual method in the portal. With no saved restriction, every currently configurable group is returned, including custom methods. An empty array disables all methods. Custom top-ups charge and credit the exact USD deposit amount, plus any wallet bonus, without custom-method discounts or fees.
    pub payment_methods: Vec<String>,
    /// Fields returned by a newer API version that are not yet known to this SDK.
    #[serde(default, flatten)]
    pub additional_properties: std::collections::HashMap<String, serde_json::Value>,
}
impl Serialize for SdkReplaceWalletSettingsRequestApplicationJson {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        Self::serialize(self, serializer)
    }
}
impl<'de> Deserialize<'de> for SdkReplaceWalletSettingsRequestApplicationJson {
    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        let mut value = serde_json::Value::deserialize(deserializer)?;
        crate::runtime_schema::model(
            &value,
            "SdkReplaceWalletSettingsRequestApplicationJson",
            false,
        )
        .map_err(serde::de::Error::custom)?;
        crate::runtime_schema::retain_model_fields(
            &mut value,
            "SdkReplaceWalletSettingsRequestApplicationJson",
        );
        Self::deserialize(value).map_err(serde::de::Error::custom)
    }
}
impl SdkReplaceWalletSettingsRequestApplicationJson {
    /// Validate the serialized request, including schema constraints and compatibility rules.
    pub fn validate_request(&self) -> Result<(), crate::error::Error> {
        let value = serde_json::to_value(self)
            .map_err(|e| crate::error::Error::Serialization(e.to_string()))?;
        crate::runtime_schema::model(
            &value,
            "SdkReplaceWalletSettingsRequestApplicationJson",
            true,
        )
    }
}