diff --git a/src/types/common.rs b/src/types/common.rs index 81ab7ef..0e9cbde 100644 --- a/src/types/common.rs +++ b/src/types/common.rs @@ -131,7 +131,7 @@ pub enum PathToElement { // which follows the same structure. However, xml-struct doesn't currently // support using a nested structure to define an element's attributes, see // https://github.com/thunderbird/xml-struct-rs/issues/9 -#[derive(Clone, Debug, XmlSerialize)] +#[derive(Clone, Debug, Deserialize, XmlSerialize)] pub struct ExtendedFieldURI { /// A well-known identifier for a property set. #[xml_struct(attribute)] @@ -162,7 +162,7 @@ pub struct ExtendedFieldURI { /// A well-known MAPI property set identifier. /// /// See -#[derive(Clone, Copy, Debug, XmlSerialize)] +#[derive(Clone, Copy, Debug, Deserialize, XmlSerialize)] #[xml_struct(text)] pub enum DistinguishedPropertySet { Address, @@ -192,7 +192,7 @@ pub enum MessageDisposition { /// The type of the value of a MAPI property. /// /// See -#[derive(Clone, Copy, Debug, XmlSerialize)] +#[derive(Clone, Copy, Debug, Deserialize, XmlSerialize)] #[xml_struct(text)] pub enum PropertyType { ApplicationTime, @@ -503,6 +503,9 @@ pub struct Message { /// /// See pub categories: Option>, + + // Extended MAPI properties to set on the message. + pub extended_property: Option>, pub importance: Option, pub in_reply_to: Option, pub is_submitted: Option, @@ -541,6 +544,19 @@ pub struct Message { pub conversation_id: Option, } +/// An extended MAPI property to set on the message. +/// +/// See +#[allow(non_snake_case)] +#[derive(Clone, Debug, Deserialize, XmlSerialize)] +pub struct ExtendedProperty { + #[xml_struct(ns_prefix = "t")] + pub extended_field_URI: ExtendedFieldURI, + + #[xml_struct(ns_prefix = "t")] + pub value: String, +} + /// A list of attachments. /// /// See @@ -618,7 +634,7 @@ pub struct InternetMessageHeaders { /// A reference to a user or address which can send or receive mail. /// /// See -#[derive(Clone, Debug, Deserialize, XmlSerialize, PartialEq)] +#[derive(Clone, Debug, Default, Deserialize, XmlSerialize, PartialEq)] #[serde(rename_all = "PascalCase")] pub struct Mailbox { /// The name of this mailbox's user. diff --git a/src/types/create_item.rs b/src/types/create_item.rs index 7e037b9..ded0a8b 100644 --- a/src/types/create_item.rs +++ b/src/types/create_item.rs @@ -6,8 +6,8 @@ use serde::Deserialize; use xml_struct::XmlSerialize; use crate::{ - types::sealed::EnvelopeBodyContents, BaseFolderId, ExtendedFieldURI, Items, MessageDisposition, - Operation, OperationResponse, RealItem, ResponseClass, ResponseCode, MESSAGES_NS_URI, + types::sealed::EnvelopeBodyContents, BaseFolderId, Items, MessageDisposition, Operation, + OperationResponse, RealItem, ResponseClass, ResponseCode, MESSAGES_NS_URI, }; /// A request to create (and optionally send) one or more Exchange items. @@ -39,19 +39,6 @@ pub struct CreateItem { pub items: Vec, } -/// An extended MAPI property to set on the message. -/// -/// See -#[allow(non_snake_case)] -#[derive(Clone, Debug, XmlSerialize)] -pub struct ExtendedProperty { - #[xml_struct(ns_prefix = "t")] - pub extended_field_URI: ExtendedFieldURI, - - #[xml_struct(ns_prefix = "t")] - pub value: String, -} - impl Operation for CreateItem { type Response = CreateItemResponse; }