Bug 1930718 - Vendor in latest changes from ews-rs. r=heather
Differential Revision: https://phabricator.services.mozilla.com/D228700 --HG-- extra : amend_source : 7224016f1172484b105979abd69e6527390cf697
This commit is contained in:
Родитель
3671aa939c
Коммит
4f36777c9b
|
@ -96,9 +96,9 @@ git = "https://github.com/servo/unicode-bidi"
|
|||
rev = "ca612daf1c08c53abe07327cb3e6ef6e0a760f0c"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source."git+https://github.com/thunderbird/ews-rs.git?rev=ac08a7b5b24a01457551c4e38f6f158c4d3401d9"]
|
||||
[source."git+https://github.com/thunderbird/ews-rs.git?rev=89a9614b77a834d89fa4f8f3f6c54c0db3bd3975"]
|
||||
git = "https://github.com/thunderbird/ews-rs.git"
|
||||
rev = "ac08a7b5b24a01457551c4e38f6f158c4d3401d9"
|
||||
rev = "89a9614b77a834d89fa4f8f3f6c54c0db3bd3975"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source."git+https://github.com/thunderbird/xml-struct-rs.git?rev=87723b90425d474fd29095d8b710baefd7c9b13a"]
|
||||
|
|
|
@ -1614,7 +1614,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ews"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/thunderbird/ews-rs.git?rev=ac08a7b5b24a01457551c4e38f6f158c4d3401d9#ac08a7b5b24a01457551c4e38f6f158c4d3401d9"
|
||||
source = "git+https://github.com/thunderbird/ews-rs.git?rev=89a9614b77a834d89fa4f8f3f6c54c0db3bd3975#89a9614b77a834d89fa4f8f3f6c54c0db3bd3975"
|
||||
dependencies = [
|
||||
"log",
|
||||
"quick-xml",
|
||||
|
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
|||
[dependencies]
|
||||
base64 = "0.21.3"
|
||||
cstr = "0.2"
|
||||
ews = { git = "https://github.com/thunderbird/ews-rs.git", rev = "ac08a7b5b24a01457551c4e38f6f158c4d3401d9", version = "0.1.0" }
|
||||
ews = { git = "https://github.com/thunderbird/ews-rs.git", rev = "89a9614b77a834d89fa4f8f3f6c54c0db3bd3975", version = "0.1.0" }
|
||||
fxhash = "0.2.1"
|
||||
log = "0.4.21"
|
||||
mail-parser = "0.9.3"
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{".github/workflows/ci.yaml":"86a41c10a1b90620bb4548c8f18d082e906c2274e8f1d951568e4c070b10d8cb","Cargo.toml":"ea5a29dc84fb226255c22e0aa2bafb83353d671970f2990c19226a61e52a1d05","LICENSE":"3f3d9e0024b1921b067d6f7f88deb4a60cbe7a78e76c64e3f1d7fc3b779b9d04","README.md":"eebefef86e483df98c6b1104101348293fbacbd16639f15044ca37d2949b68f1","src/lib.rs":"20e850b188c53ad1c5d533a4a7d797fd88a18b0aa1ca1486b8cd839ca94749b6","src/types.rs":"35bb883e35da36fa1497e6918acf6b36714bfc5572867c15723804b599dfe615","src/types/common.rs":"3dbab1a6205e501db4712b18368baee3a38e9b33f56632512b0bae74cbcc8039","src/types/create_item.rs":"b2fa2de4663c37788fc938f1c555272e4711ee1d7c0cb779491d64a227d8c1c2","src/types/get_folder.rs":"3550825ab75158352e16428db2b93a3c465a02a1253b9f101413d69785712e18","src/types/get_item.rs":"4125ef01686ccf0a687dc83d6b4b496d70e028f6ae16744821da1023d9818cf0","src/types/operations.rs":"c8a3c559522d31b91ac289f6d4d725a8de15a04dd20bd90ac14d6996fcfbd58e","src/types/soap.rs":"8ac6861b732d203ca9f8776be8bf124d68b4b0b2802d231631588c4bc7cfb7cb","src/types/soap/de.rs":"6fb603f521a73984e5707988379e562018b179df54647cff89d8ab03c406cff2","src/types/sync_folder_hierarchy.rs":"517d75735a163a1e799b6f0259042f3130fbb51e3f7a26cbe3d1e20c351a5322","src/types/sync_folder_items.rs":"063b63e2628ecc1e91d5be37a9407c1de509d4f32ebb161e6c5da40a73d6b1f9","src/types/update_item.rs":"43a097d8ab46f5882b819f71efcfb0d76bc23a4778f28701a7768272f045ffdd"},"package":null}
|
||||
{"files":{".github/workflows/ci.yaml":"86a41c10a1b90620bb4548c8f18d082e906c2274e8f1d951568e4c070b10d8cb","Cargo.toml":"ea5a29dc84fb226255c22e0aa2bafb83353d671970f2990c19226a61e52a1d05","LICENSE":"3f3d9e0024b1921b067d6f7f88deb4a60cbe7a78e76c64e3f1d7fc3b779b9d04","README.md":"eebefef86e483df98c6b1104101348293fbacbd16639f15044ca37d2949b68f1","src/lib.rs":"20e850b188c53ad1c5d533a4a7d797fd88a18b0aa1ca1486b8cd839ca94749b6","src/types.rs":"42845d2f0773b08fa2d22f41e1c2a740fa93510c374cc5516ce72d266cc5a1ee","src/types/common.rs":"4f751865e6fc57586f59e4cd80c0e0475d8037b400b1f495c845ba9404a5694d","src/types/create_item.rs":"b2fa2de4663c37788fc938f1c555272e4711ee1d7c0cb779491d64a227d8c1c2","src/types/delete_item.rs":"8fe5129d8c2c98d8979f1a0e8d1a4164d7bc9e2991b7316873108dadc25b52c0","src/types/get_folder.rs":"3550825ab75158352e16428db2b93a3c465a02a1253b9f101413d69785712e18","src/types/get_item.rs":"4125ef01686ccf0a687dc83d6b4b496d70e028f6ae16744821da1023d9818cf0","src/types/operations.rs":"05eca55bed87eb77b66de140c742f14defaba6702b75ec2886f0767d543537d2","src/types/soap.rs":"2b4a130a314c75e5c308b17cad64ff43975c33b0cf38a9bec653df249dcf503c","src/types/soap/de.rs":"6fb603f521a73984e5707988379e562018b179df54647cff89d8ab03c406cff2","src/types/sync_folder_hierarchy.rs":"517d75735a163a1e799b6f0259042f3130fbb51e3f7a26cbe3d1e20c351a5322","src/types/sync_folder_items.rs":"063b63e2628ecc1e91d5be37a9407c1de509d4f32ebb161e6c5da40a73d6b1f9","src/types/update_item.rs":"43a097d8ab46f5882b819f71efcfb0d76bc23a4778f28701a7768272f045ffdd"},"package":null}
|
|
@ -10,6 +10,7 @@ pub use operations::*;
|
|||
pub mod soap;
|
||||
|
||||
pub mod create_item;
|
||||
pub mod delete_item;
|
||||
pub mod get_folder;
|
||||
pub mod get_item;
|
||||
pub mod sync_folder_hierarchy;
|
||||
|
|
|
@ -1018,7 +1018,7 @@ mod tests {
|
|||
|
||||
// Ensure the first recipient correctly has a name and address.
|
||||
assert_eq!(
|
||||
recipients.get(0).expect("no recipient at index 0"),
|
||||
recipients.first().expect("no recipient at index 0"),
|
||||
&Recipient {
|
||||
mailbox: Mailbox {
|
||||
name: Some("Alice Test".into()),
|
||||
|
|
|
@ -0,0 +1,129 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use serde::Deserialize;
|
||||
use xml_struct::XmlSerialize;
|
||||
|
||||
use crate::types::sealed::EnvelopeBodyContents;
|
||||
use crate::{
|
||||
BaseItemId, Operation, OperationResponse, ResponseClass, ResponseCode, MESSAGES_NS_URI,
|
||||
};
|
||||
|
||||
/// The manner in which the item or items are deleted.
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem#deletetype-attribute>
|
||||
#[derive(Debug, XmlSerialize)]
|
||||
#[xml_struct(text)]
|
||||
pub enum DeleteType {
|
||||
HardDelete,
|
||||
SoftDelete,
|
||||
MoveToDeletedItems,
|
||||
}
|
||||
|
||||
/// Whether to send meeting cancellations when deleting a calendar item.
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem#sendmeetingcancellations-attribute>
|
||||
#[derive(Debug, XmlSerialize)]
|
||||
#[xml_struct(text)]
|
||||
pub enum SendMeetingCancellations {
|
||||
SendToNone,
|
||||
SendOnlyToAll,
|
||||
SendToAllAndSaveCopy,
|
||||
}
|
||||
|
||||
/// Which tasks should be impacted when deleting a task item.
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem#affectedtaskoccurrences-attribute>
|
||||
#[derive(Debug, XmlSerialize)]
|
||||
#[xml_struct(text)]
|
||||
pub enum AffectedTaskOccurrences {
|
||||
AllOccurrences,
|
||||
SpecifiedOccurrenceOnly,
|
||||
}
|
||||
|
||||
/// A request to delete one or more Exchange items.
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem>
|
||||
#[derive(Debug, XmlSerialize)]
|
||||
#[xml_struct(default_ns = MESSAGES_NS_URI)]
|
||||
pub struct DeleteItem {
|
||||
/// The method the EWS server will use to perform the deletion.
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem#deletetype-attribute>
|
||||
#[xml_struct(attribute)]
|
||||
pub delete_type: DeleteType,
|
||||
|
||||
/// The action the EWS server will take when deleting a calendar item.
|
||||
///
|
||||
/// Required when deleting calendar items, otherwise it has no effect.
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem#sendmeetingcancellations-attribute>
|
||||
#[xml_struct(attribute)]
|
||||
pub send_meeting_cancellations: Option<SendMeetingCancellations>,
|
||||
|
||||
/// The task item(s) to delete.
|
||||
///
|
||||
/// Required when deleting task items, otherwise it has no effect.
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem#affectedtaskoccurrences-attribute>
|
||||
#[xml_struct(attribute)]
|
||||
pub affected_task_occurrences: Option<AffectedTaskOccurrences>,
|
||||
|
||||
/// Whether to suppress read receipts for the deleted item(s).
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem#attributes>
|
||||
#[xml_struct(attribute)]
|
||||
pub suppress_read_receipts: Option<bool>,
|
||||
|
||||
/// A list of items to delete.
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/itemids>
|
||||
pub item_ids: Vec<BaseItemId>,
|
||||
}
|
||||
|
||||
impl Operation for DeleteItem {
|
||||
type Response = DeleteItemResponse;
|
||||
}
|
||||
|
||||
impl EnvelopeBodyContents for DeleteItem {
|
||||
fn name() -> &'static str {
|
||||
"DeleteItem"
|
||||
}
|
||||
}
|
||||
|
||||
/// A response to a [`DeleteItem`] request.
|
||||
///
|
||||
/// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitemresponse>
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct DeleteItemResponse {
|
||||
pub response_messages: ResponseMessages,
|
||||
}
|
||||
|
||||
impl OperationResponse for DeleteItemResponse {}
|
||||
|
||||
impl EnvelopeBodyContents for DeleteItemResponse {
|
||||
fn name() -> &'static str {
|
||||
"DeleteItemResponse"
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct ResponseMessages {
|
||||
pub delete_item_response_message: Vec<DeleteItemResponseMessage>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct DeleteItemResponseMessage {
|
||||
/// The status of the corresponding request, i.e. whether it succeeded or
|
||||
/// resulted in an error.
|
||||
#[serde(rename = "@ResponseClass")]
|
||||
pub response_class: ResponseClass,
|
||||
|
||||
pub response_code: Option<ResponseCode>,
|
||||
|
||||
pub message_text: Option<String>,
|
||||
}
|
|
@ -19,6 +19,14 @@ pub trait Operation: XmlSerialize + sealed::EnvelopeBodyContents + std::fmt::Deb
|
|||
/// The structure returned by EWS in response to requests containing this
|
||||
/// operation.
|
||||
type Response: OperationResponse;
|
||||
|
||||
/// Gets the name of the operation.
|
||||
///
|
||||
/// This is the same as the local part of the name of the XML element used
|
||||
/// to represent this option.
|
||||
fn name() -> &'static str {
|
||||
<Self as sealed::EnvelopeBodyContents>::name()
|
||||
}
|
||||
}
|
||||
|
||||
/// A marker trait for EWS operation responses.
|
||||
|
|
|
@ -8,7 +8,8 @@ use quick_xml::{
|
|||
};
|
||||
|
||||
use crate::{
|
||||
Error, MessageXml, Operation, OperationResponse, ResponseCode, SOAP_NS_URI, TYPES_NS_URI,
|
||||
types::sealed, Error, MessageXml, Operation, OperationResponse, ResponseCode, SOAP_NS_URI,
|
||||
TYPES_NS_URI,
|
||||
};
|
||||
|
||||
mod de;
|
||||
|
@ -48,7 +49,8 @@ where
|
|||
writer.write_event(Event::Start(BytesStart::new(SOAP_BODY)))?;
|
||||
|
||||
// Write the operation itself.
|
||||
self.body.serialize_as_element(&mut writer, B::name())?;
|
||||
self.body
|
||||
.serialize_as_element(&mut writer, <B as sealed::EnvelopeBodyContents>::name())?;
|
||||
|
||||
writer.write_event(Event::End(BytesEnd::new(SOAP_BODY)))?;
|
||||
writer.write_event(Event::End(BytesEnd::new(SOAP_ENVELOPE)))?;
|
||||
|
|
Загрузка…
Ссылка в новой задаче