From 7e0a51bebb3089e8736e13f5215a00005fdee48c Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 22 Feb 2022 18:41:26 +0100 Subject: [PATCH] Use DateTime types where possible --- Cargo.toml | 2 +- src/contact/create.rs | 10 +++++++--- src/contact/info.rs | 21 ++++++++++++++------- src/domain/create.rs | 18 +++++++++++------- src/domain/info.rs | 19 +++++++++++-------- src/domain/renew.rs | 12 +++++++----- src/domain/transfer.rs | 34 ++++++++++++++++++++++------------ src/hello.rs | 10 ++++++++-- src/host/create.rs | 10 +++++++--- src/host/info.rs | 21 ++++++++++++++------- src/message/poll.rs | 29 ++++++++++++++--------------- src/response.rs | 6 ++++-- 12 files changed, 120 insertions(+), 72 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5cf6429..60862c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ default = ["tokio-rustls"] [dependencies] async-trait = "0.1.52" celes = "2.1" -chrono = "0.4" +chrono = { version = "0.4", features = ["serde"] } quick-xml = { version = "0.22", features = [ "serialize" ] } serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.0", features = [ "full" ] } diff --git a/src/contact/create.rs b/src/contact/create.rs index b794069..9722b9b 100644 --- a/src/contact/create.rs +++ b/src/contact/create.rs @@ -1,9 +1,11 @@ //! Types for EPP contact create request +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + use super::{ContactAuthInfo, Phone, PostalInfo, XMLNS}; use crate::common::{NoExtension, StringValue}; use crate::request::{Command, Transaction}; -use serde::{Deserialize, Serialize}; impl<'a> Transaction for ContactCreate<'a> {} @@ -84,7 +86,7 @@ pub struct ContactCreateData { pub id: StringValue<'static>, #[serde(rename = "crDate")] /// The contact creation date - pub created_at: StringValue<'static>, + pub created_at: DateTime, } /// Type that represents the <resData> tag for contact create response @@ -97,6 +99,8 @@ pub struct ContactCreateResponse { #[cfg(test)] mod tests { + use chrono::{TimeZone, Utc}; + use super::{ContactCreate, Phone, PostalInfo}; use crate::common::NoExtension; use crate::contact::Address; @@ -146,7 +150,7 @@ mod tests { assert_eq!(results.create_data.id, "eppdev-contact-4".into()); assert_eq!( results.create_data.created_at, - "2021-07-25T16:05:32.0Z".into() + Utc.ymd(2021, 7, 25).and_hms(16, 5, 32) ); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); diff --git a/src/contact/info.rs b/src/contact/info.rs index 2b90abc..c63e503 100644 --- a/src/contact/info.rs +++ b/src/contact/info.rs @@ -1,9 +1,11 @@ //! Types for EPP contact info request +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + use super::{ContactAuthInfo, Phone, PostalInfo, XMLNS}; use crate::common::{NoExtension, ObjectStatus, StringValue}; use crate::request::{Command, Transaction}; -use serde::{Deserialize, Serialize}; impl<'a> Transaction for ContactInfo<'a> {} @@ -77,16 +79,16 @@ pub struct ContactInfoData<'a> { pub creator_id: StringValue<'a>, /// The creation date #[serde(rename = "crDate")] - pub created_at: StringValue<'a>, + pub created_at: DateTime, /// The epp user who last updated the contact #[serde(rename = "upID")] pub updater_id: Option>, /// The last update date #[serde(rename = "upDate")] - pub updated_at: Option>, + pub updated_at: Option>, /// The contact transfer date #[serde(rename = "trDate")] - pub transferred_at: Option>, + pub transferred_at: Option>, /// The contact auth info #[serde(rename = "authInfo")] pub auth_info: Option>, @@ -102,6 +104,8 @@ pub struct ContactInfoResponse { #[cfg(test)] mod tests { + use chrono::{TimeZone, Utc}; + use super::ContactInfo; use crate::common::NoExtension; use crate::request::Transaction; @@ -166,14 +170,17 @@ mod tests { assert_eq!(result.info_data.email, "contact@eppdev.net".into()); assert_eq!(result.info_data.client_id, "eppdev".into()); assert_eq!(result.info_data.creator_id, "SYSTEM".into()); - assert_eq!(result.info_data.created_at, "2021-07-23T13:09:09.0Z".into()); + assert_eq!( + result.info_data.created_at, + Utc.ymd(2021, 7, 23).and_hms(13, 9, 9) + ); assert_eq!( *(result.info_data.updater_id.as_ref().unwrap()), "SYSTEM".into() ); assert_eq!( - *(result.info_data.updated_at.as_ref().unwrap()), - "2021-07-23T13:09:09.0Z".into() + result.info_data.updated_at, + Some(Utc.ymd(2021, 7, 23).and_hms(13, 9, 9)) ); assert_eq!((*auth_info).password, "eppdev-387323".into()); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); diff --git a/src/domain/create.rs b/src/domain/create.rs index 6897a9c..0ad07e3 100644 --- a/src/domain/create.rs +++ b/src/domain/create.rs @@ -1,11 +1,12 @@ //! Types for EPP domain create request +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + use super::{DomainAuthInfo, DomainContact, HostList, Period, XMLNS}; use crate::common::{NoExtension, StringValue}; use crate::request::{Command, Transaction}; -use serde::{Deserialize, Serialize}; - impl<'a> Transaction for DomainCreate<'a> {} impl<'a> Command for DomainCreate<'a> { @@ -87,10 +88,10 @@ pub struct DomainCreateResponseData { pub name: StringValue<'static>, /// The creation date #[serde(rename = "crDate")] - pub created_at: StringValue<'static>, + pub created_at: DateTime, /// The expiry date #[serde(rename = "exDate")] - pub expiring_at: Option>, + pub expiring_at: Option>, } /// Type that represents the <resData> tag for domain create response @@ -103,13 +104,16 @@ pub struct DomainCreateResponse { #[cfg(test)] mod tests { + use std::net::IpAddr; + + use chrono::{TimeZone, Utc}; + use super::{DomainContact, DomainCreate, HostList, Period}; use crate::common::NoExtension; use crate::domain::{HostAttr, HostAttrList, HostObjList}; use crate::request::Transaction; use crate::response::ResultCode; use crate::tests::{get_xml, CLTRID, SUCCESS_MSG, SVTRID}; - use std::net::IpAddr; #[test] fn command() { @@ -244,11 +248,11 @@ mod tests { assert_eq!(result.create_data.name, "eppdev-2.com".into()); assert_eq!( result.create_data.created_at, - "2021-07-25T18:11:35.0Z".into() + Utc.ymd(2021, 7, 25).and_hms(18, 11, 35) ); assert_eq!( *result.create_data.expiring_at.as_ref().unwrap(), - "2022-07-25T18:11:34.0Z".into() + Utc.ymd(2022, 7, 25).and_hms(18, 11, 34) ); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); diff --git a/src/domain/info.rs b/src/domain/info.rs index f2ce4d5..25b92f8 100644 --- a/src/domain/info.rs +++ b/src/domain/info.rs @@ -1,9 +1,11 @@ //! Types for EPP domain info request +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + use super::{DomainAuthInfo, DomainContact, HostAttr, XMLNS}; use crate::common::{NoExtension, ObjectStatus, StringValue}; use crate::request::{Command, Transaction}; -use serde::{Deserialize, Serialize}; impl<'a> Transaction for DomainInfo<'a> {} @@ -102,19 +104,19 @@ pub struct DomainInfoResponseData { pub creator_id: Option>, /// The domain creation date #[serde(rename = "crDate")] - pub created_at: Option>, + pub created_at: Option>, /// The domain expiry date #[serde(rename = "exDate")] - pub expiring_at: Option>, + pub expiring_at: Option>, /// The epp user who last updated the domain #[serde(rename = "upID")] pub updater_id: Option>, /// The domain last updated date #[serde(rename = "upDate")] - pub updated_at: Option>, + pub updated_at: Option>, /// The domain transfer date #[serde(rename = "trDate")] - pub transferred_at: Option>, + pub transferred_at: Option>, /// The domain auth info #[serde(rename = "authInfo")] pub auth_info: Option>, @@ -135,6 +137,7 @@ mod tests { use crate::request::Transaction; use crate::response::ResultCode; use crate::tests::{get_xml, CLTRID, SUCCESS_MSG, SVTRID}; + use chrono::{TimeZone, Utc}; #[test] fn command() { @@ -188,7 +191,7 @@ mod tests { ); assert_eq!( *result.info_data.created_at.as_ref().unwrap(), - "2021-07-23T15:31:20.0Z".into() + Utc.ymd(2021, 7, 23).and_hms(15, 31, 20) ); assert_eq!( *result.info_data.updater_id.as_ref().unwrap(), @@ -196,11 +199,11 @@ mod tests { ); assert_eq!( *result.info_data.updated_at.as_ref().unwrap(), - "2021-07-23T15:31:21.0Z".into() + Utc.ymd(2021, 7, 23).and_hms(15, 31, 21) ); assert_eq!( *result.info_data.expiring_at.as_ref().unwrap(), - "2023-07-23T15:31:20.0Z".into() + Utc.ymd(2023, 7, 23).and_hms(15, 31, 20) ); assert_eq!((*auth_info).password, "epP4uthd#v".into()); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); diff --git a/src/domain/renew.rs b/src/domain/renew.rs index 0c6c280..107ec63 100644 --- a/src/domain/renew.rs +++ b/src/domain/renew.rs @@ -1,10 +1,11 @@ //! Types for EPP domain renew request +use chrono::{DateTime, NaiveDate, Utc}; +use serde::{Deserialize, Serialize}; + use super::{Period, XMLNS}; use crate::common::{NoExtension, StringValue}; use crate::request::{Command, Transaction}; -use chrono::NaiveDate; -use serde::{Deserialize, Serialize}; impl<'a> Transaction for DomainRenew<'a> {} @@ -63,7 +64,7 @@ pub struct DomainRenewResponseData { pub name: StringValue<'static>, /// The new expiry date after renewal #[serde(rename = "exDate")] - pub expiring_at: Option>, + pub expiring_at: Option>, } /// Type that represents the <resData> tag for domain renew response @@ -81,7 +82,8 @@ mod tests { use crate::request::Transaction; use crate::response::ResultCode; use crate::tests::{get_xml, CLTRID, SUCCESS_MSG, SVTRID}; - use chrono::NaiveDate; + + use chrono::{NaiveDate, TimeZone, Utc}; #[test] fn command() { @@ -110,7 +112,7 @@ mod tests { assert_eq!(result.renew_data.name, "eppdev-1.com".into()); assert_eq!( *result.renew_data.expiring_at.as_ref().unwrap(), - "2024-07-23T15:31:20.0Z".into() + Utc.ymd(2024, 7, 23).and_hms(15, 31, 20) ); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); diff --git a/src/domain/transfer.rs b/src/domain/transfer.rs index fea9e30..a6c28eb 100644 --- a/src/domain/transfer.rs +++ b/src/domain/transfer.rs @@ -1,9 +1,11 @@ //! Types for EPP domain transfer request +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + use super::{DomainAuthInfo, Period, XMLNS}; use crate::common::{NoExtension, StringValue}; use crate::request::{Command, Transaction}; -use serde::{Deserialize, Serialize}; impl<'a> Transaction for DomainTransfer<'a> {} @@ -109,16 +111,16 @@ pub struct DomainTransferResponseData { pub requester_id: StringValue<'static>, /// The transfer rquest date #[serde(rename = "reDate")] - pub requested_at: StringValue<'static>, + pub requested_at: DateTime, /// The epp user who should acknowledge the transfer request #[serde(rename = "acID")] pub ack_id: StringValue<'static>, /// THe date by which the acknowledgment should be made #[serde(rename = "acDate")] - pub ack_by: StringValue<'static>, + pub ack_by: DateTime, /// The domain expiry date #[serde(rename = "exDate")] - pub expiring_at: Option>, + pub expiring_at: Option>, } /// Type that represents the <resData> tag for domain transfer response @@ -131,6 +133,8 @@ pub struct DomainTransferResponse { #[cfg(test)] mod tests { + use chrono::{TimeZone, Utc}; + use super::{DomainTransfer, Period}; use crate::common::NoExtension; use crate::request::Transaction; @@ -225,13 +229,16 @@ mod tests { assert_eq!(result.transfer_data.requester_id, "eppdev".into()); assert_eq!( result.transfer_data.requested_at, - "2021-07-23T15:31:21.0Z".into() + Utc.ymd(2021, 7, 23).and_hms(15, 31, 21), ); assert_eq!(result.transfer_data.ack_id, "ClientY".into()); - assert_eq!(result.transfer_data.ack_by, "2021-07-28T15:31:21.0Z".into()); assert_eq!( - *result.transfer_data.expiring_at.as_ref().unwrap(), - "2022-07-02T14:53:19.0Z".into() + result.transfer_data.ack_by, + Utc.ymd(2021, 7, 28).and_hms(15, 31, 21) + ); + assert_eq!( + result.transfer_data.expiring_at, + Some(Utc.ymd(2022, 7, 2).and_hms(14, 53, 19)), ); assert_eq!(*object.tr_ids.client_tr_id.as_ref().unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); @@ -292,13 +299,16 @@ mod tests { assert_eq!(result.transfer_data.requester_id, "eppdev".into()); assert_eq!( result.transfer_data.requested_at, - "2021-07-23T15:31:21.0Z".into() + Utc.ymd(2021, 7, 23).and_hms(15, 31, 21) ); assert_eq!(result.transfer_data.ack_id, "ClientY".into()); - assert_eq!(result.transfer_data.ack_by, "2021-07-28T15:31:21.0Z".into()); assert_eq!( - *result.transfer_data.expiring_at.as_ref().unwrap(), - "2022-07-02T14:53:19.0Z".into() + result.transfer_data.ack_by, + Utc.ymd(2021, 7, 28).and_hms(15, 31, 21) + ); + assert_eq!( + result.transfer_data.expiring_at, + Some(Utc.ymd(2022, 7, 2).and_hms(14, 53, 19)) ); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); diff --git a/src/hello.rs b/src/hello.rs index 08feda7..697a60d 100644 --- a/src/hello.rs +++ b/src/hello.rs @@ -1,5 +1,6 @@ use std::fmt::Debug; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Deserializer, Serialize}; use crate::common::{Options, ServiceExtension, Services, StringValue, EPP_XMLNS}; @@ -286,7 +287,7 @@ pub struct Greeting { pub service_id: String, /// The date from the EPP server #[serde(rename = "svDate")] - pub service_date: String, + pub service_date: DateTime, /// Data under the element #[serde(rename = "svcMenu")] pub svc_menu: ServiceMenu, @@ -305,6 +306,8 @@ impl EppXml for GreetingDocument {} #[cfg(test)] mod tests { + use chrono::{TimeZone, Utc}; + use super::{ExpiryType, GreetingDocument, HelloDocument, Relative}; use crate::tests::get_xml; use crate::xml::EppXml; @@ -323,7 +326,10 @@ mod tests { let object = GreetingDocument::deserialize(xml.as_str()).unwrap(); assert_eq!(object.data.service_id, "ISPAPI EPP Server"); - assert_eq!(object.data.service_date, "2021-07-25T14:51:17.0Z"); + assert_eq!( + object.data.service_date, + Utc.ymd(2021, 7, 25).and_hms(14, 51, 17) + ); assert_eq!(object.data.svc_menu.options.version, "1.0".into()); assert_eq!(object.data.svc_menu.options.lang, "en".into()); assert_eq!(object.data.svc_menu.services.obj_uris.len(), 4); diff --git a/src/host/create.rs b/src/host/create.rs index 4891709..7018d8a 100644 --- a/src/host/create.rs +++ b/src/host/create.rs @@ -2,10 +2,12 @@ use std::net::IpAddr; +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + use super::XMLNS; use crate::common::{serialize_host_addrs_option, NoExtension, StringValue}; use crate::request::{Command, Transaction}; -use serde::{Deserialize, Serialize}; impl<'a> Transaction for HostCreate<'a> {} @@ -59,7 +61,7 @@ pub struct HostCreateData { pub name: StringValue<'static>, /// The host creation date #[serde(rename = "crDate")] - pub created_at: StringValue<'static>, + pub created_at: DateTime, } /// Type that represents the <resData> tag for host check response @@ -72,6 +74,8 @@ pub struct HostCreateResponse { #[cfg(test)] mod tests { + use chrono::{TimeZone, Utc}; + use super::{HostCreate, IpAddr}; use crate::common::NoExtension; use crate::request::Transaction; @@ -109,7 +113,7 @@ mod tests { assert_eq!(result.create_data.name, "host2.eppdev-1.com".into()); assert_eq!( result.create_data.created_at, - "2021-07-26T05:28:55.0Z".into() + Utc.ymd(2021, 7, 26).and_hms(5, 28, 55) ); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); diff --git a/src/host/info.rs b/src/host/info.rs index 614029f..ba5bdc2 100644 --- a/src/host/info.rs +++ b/src/host/info.rs @@ -3,10 +3,12 @@ use std::net::IpAddr; use std::str::FromStr; +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + use super::XMLNS; use crate::common::{HostAddr, NoExtension, ObjectStatus, StringValue}; use crate::request::{Command, Transaction}; -use serde::{Deserialize, Serialize}; impl<'a> Transaction for HostInfo<'a> {} @@ -70,16 +72,16 @@ pub struct HostInfoResponseData { pub creator_id: StringValue<'static>, /// The host creation date #[serde(rename = "crDate")] - pub created_at: StringValue<'static>, + pub created_at: DateTime, /// The epp user that last updated the host #[serde(rename = "upID")] pub updater_id: Option>, /// The host last update date #[serde(rename = "upDate")] - pub updated_at: Option>, + pub updated_at: Option>, /// The host transfer date #[serde(rename = "trDate")] - pub transferred_at: Option>, + pub transferred_at: Option>, } fn deserialize_host_addrs<'de, D>(de: D) -> Result, D::Error> @@ -104,6 +106,8 @@ pub struct HostInfoResponse { #[cfg(test)] mod tests { + use chrono::{TimeZone, Utc}; + use super::{HostInfo, IpAddr}; use crate::common::NoExtension; use crate::request::Transaction; @@ -146,14 +150,17 @@ mod tests { ); assert_eq!(result.info_data.client_id, "eppdev".into()); assert_eq!(result.info_data.creator_id, "creator".into()); - assert_eq!(result.info_data.created_at, "2021-07-26T05:28:55.0Z".into()); + assert_eq!( + result.info_data.created_at, + Utc.ymd(2021, 7, 26).and_hms(5, 28, 55) + ); assert_eq!( *(result.info_data.updater_id.as_ref().unwrap()), "creator".into() ); assert_eq!( - *(result.info_data.updated_at.as_ref().unwrap()), - "2021-07-26T05:28:55.0Z".into() + result.info_data.updated_at, + Some(Utc.ymd(2021, 7, 26).and_hms(5, 28, 55)) ); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); diff --git a/src/message/poll.rs b/src/message/poll.rs index e07dcf4..327ee12 100644 --- a/src/message/poll.rs +++ b/src/message/poll.rs @@ -55,6 +55,8 @@ mod tests { use crate::request::Transaction; use crate::response::ResultCode; use crate::tests::{get_xml, CLTRID, SVTRID}; + + use chrono::{TimeZone, Utc}; use std::net::IpAddr; #[test] @@ -86,10 +88,7 @@ mod tests { ); assert_eq!(msg.count, 5); assert_eq!(msg.id, "12345".to_string()); - assert_eq!( - *(msg.date.as_ref().unwrap()), - "2021-07-23T19:12:43.0Z".into() - ); + assert_eq!(msg.date, Some(Utc.ymd(2021, 7, 23).and_hms(19, 12, 43))); assert_eq!( *(msg.message.as_ref().unwrap()), "Transfer requested.".into() @@ -99,12 +98,12 @@ mod tests { assert_eq!(tr.name, "eppdev-transfer.com".into()); assert_eq!(tr.transfer_status, "pending".into()); assert_eq!(tr.requester_id, "eppdev".into()); - assert_eq!(tr.requested_at, "2021-07-23T15:31:21.0Z".into()); + assert_eq!(tr.requested_at, Utc.ymd(2021, 7, 23).and_hms(15, 31, 21)); assert_eq!(tr.ack_id, "ClientY".into()); - assert_eq!(tr.ack_by, "2021-07-28T15:31:21.0Z".into()); + assert_eq!(tr.ack_by, Utc.ymd(2021, 7, 28).and_hms(15, 31, 21)); assert_eq!( - *tr.expiring_at.as_ref().unwrap(), - "2022-07-02T14:53:19.0Z".into() + tr.expiring_at, + Some(Utc.ymd(2022, 7, 2).and_hms(14, 53, 19)) ); } else { panic!("Wrong type"); @@ -132,7 +131,7 @@ mod tests { ); assert_eq!(msg.count, 4); assert_eq!(msg.id, "12345".to_string()); - assert_eq!(*(msg.date.as_ref().unwrap()), "2022-01-02T11:30:45Z".into()); + assert_eq!(msg.date, Some(Utc.ymd(2022, 1, 2).and_hms(11, 30, 45))); assert_eq!( *(msg.message.as_ref().unwrap()), "Unused objects policy".into() @@ -149,9 +148,12 @@ mod tests { .any(|a| a == &IpAddr::from([1, 1, 1, 1]))); assert_eq!(host.client_id, "1234".into()); assert_eq!(host.creator_id, "user".into()); - assert_eq!(host.created_at, "2021-12-01T22:40:48Z".into()); + assert_eq!(host.created_at, Utc.ymd(2021, 12, 1).and_hms(22, 40, 48)); assert_eq!(host.updater_id, Some("user".into())); - assert_eq!(host.updated_at, Some("2021-12-01T22:40:48Z".into())); + assert_eq!( + host.updated_at, + Some(Utc.ymd(2021, 12, 1).and_hms(22, 40, 48)) + ); } else { panic!("Wrong type"); } @@ -178,10 +180,7 @@ mod tests { assert_eq!(msg.count, 4); assert_eq!(msg.id, "12346".to_string()); - assert_eq!( - *(msg.date.as_ref().unwrap()), - "2000-06-08T22:10:00.0Z".into() - ); + assert_eq!(msg.date, Some(Utc.ymd(2000, 6, 8).and_hms(22, 10, 0))); assert_eq!( *(msg.message.as_ref().unwrap()), "Credit balance low.".into() diff --git a/src/response.rs b/src/response.rs index 4ddb01d..81219bc 100644 --- a/src/response.rs +++ b/src/response.rs @@ -1,8 +1,10 @@ //! Types for EPP responses -use serde::{de::DeserializeOwned, Deserialize}; use std::fmt::{self, Debug}; +use chrono::{DateTime, Utc}; +use serde::{de::DeserializeOwned, Deserialize}; + use crate::common::StringValue; use crate::xml::EppXml; @@ -184,7 +186,7 @@ pub struct MessageQueue { pub id: String, /// The message date #[serde(rename = "qDate")] - pub date: Option>, + pub date: Option>, /// The message text #[serde(rename = "msg")] pub message: Option>,