use crate::Request;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct PddWaybillUpdate {
#[serde(rename = "param_waybill_cloud_print_update_request")]
pub param_waybill_cloud_print_update_request: Option<ParamWaybillCloudPrintUpdateRequest>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct PackageInfo {
#[serde(rename = "items")]
pub items: Option<Vec<Items>>,
#[serde(rename = "volume")]
pub volume: Option<i32>,
#[serde(rename = "weight")]
pub weight: Option<i32>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct Recipient {
#[serde(rename = "address")]
pub address: Option<Address>,
#[serde(rename = "mobile")]
pub mobile: Option<String>,
#[serde(rename = "name")]
pub name: Option<String>,
#[serde(rename = "phone")]
pub phone: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct ParamWaybillCloudPrintUpdateRequest {
#[serde(rename = "object_id")]
pub object_id: Option<String>,
#[serde(rename = "package_info")]
pub package_info: Option<PackageInfo>,
#[serde(rename = "recipient")]
pub recipient: Option<Recipient>,
#[serde(rename = "sender")]
pub sender: Option<Sender>,
#[serde(rename = "template_url")]
pub template_url: Option<String>,
#[serde(rename = "waybill_code")]
pub waybill_code: Option<String>,
#[serde(rename = "wp_code")]
pub wp_code: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct Address {
#[serde(rename = "city")]
pub city: Option<String>,
#[serde(rename = "country")]
pub country: Option<String>,
#[serde(rename = "detail")]
pub detail: Option<String>,
#[serde(rename = "district")]
pub district: Option<String>,
#[serde(rename = "province")]
pub province: Option<String>,
#[serde(rename = "town")]
pub town: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct Sender {
#[serde(rename = "mobile")]
pub mobile: Option<String>,
#[serde(rename = "name")]
pub name: Option<String>,
#[serde(rename = "phone")]
pub phone: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct Items {
#[serde(rename = "count")]
pub count: Option<i32>,
#[serde(rename = "name")]
pub name: Option<String>,
}
impl Request for PddWaybillUpdate {
fn get_type() -> String {
"pdd.waybill.update".to_string()
}
fn get_response_name() -> String {
"pdd_waybill_update_response".to_string()
}
}