use bytes::Bytes; use chrono::{DateTime, Utc}; use serde::Deserialize; /// Information about a file attachment. #[derive(Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct FileInfo { #[serde(rename = "type")] pub file_type: Option, pub content_type: Option, pub name: Option, pub created_date: Option>, pub modified_date: Option>, pub owner: Option, pub notes: Option, pub file_href: Option, } /// The content of a downloaded file. #[derive(Debug, Clone)] pub struct FileResponse { pub content_type: Option, pub file_name: Option, pub data: Bytes, } /// Request to upload a file. #[derive(Debug, Clone)] pub struct SaveFileRequest { pub record_id: i32, pub field_id: i32, pub notes: Option, pub modified_date: Option>, pub file_name: String, pub file_data: Vec, pub content_type: String, } /// Response from creating a file, containing the new file ID. #[derive(Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CreatedWithIdResponse { pub id: i32, }