use crate::Request;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct PrintDataList {
#[serde(rename = "custom_area_print_data")]
pub custom_area_print_data: Option<CustomAreaPrintData>,
#[serde(rename = "waybill_printer_data")]
pub waybill_printer_data: Option<WaybillPrinterData>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct WaybillPrinterData {
#[serde(rename = "add_data")]
pub add_data: Option<String>,
#[serde(rename = "data")]
pub data: Option<String>,
#[serde(rename = "encrypted")]
pub encrypted: Option<bool>,
#[serde(rename = "signature")]
pub signature: Option<String>,
#[serde(rename = "template_url")]
pub template_url: Option<String>,
#[serde(rename = "ver")]
pub ver: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct PddCloudPrint {
#[serde(rename = "cloud_print_request")]
pub cloud_print_request: Option<CloudPrintRequest>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct PrinterSetting {
#[serde(rename = "need_bottom_logo")]
pub need_bottom_logo: Option<bool>,
#[serde(rename = "need_middle_logo")]
pub need_middle_logo: Option<bool>,
#[serde(rename = "need_top_logo")]
pub need_top_logo: Option<bool>,
#[serde(rename = "orientation")]
pub orientation: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct CloudPrintRequest {
#[serde(rename = "print_data_list")]
pub print_data_list: Option<Vec<PrintDataList>>,
#[serde(rename = "printer_id")]
pub printer_id: Option<String>,
#[serde(rename = "printer_setting")]
pub printer_setting: Option<PrinterSetting>,
#[serde(rename = "share_code")]
pub share_code: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct CustomAreaPrintData {
#[serde(rename = "data")]
pub data: Option<String>,
#[serde(rename = "template_url")]
pub template_url: Option<String>,
}
impl Request for PddCloudPrint {
fn get_type() -> String {
"pdd.cloud.print".to_string()
}
fn get_response_name() -> String {
"cloud_print_response".to_string()
}
}