diff --git a/epp-client/src/common.rs b/epp-client/src/common.rs index ff484ca..98ec623 100644 --- a/epp-client/src/common.rs +++ b/epp-client/src/common.rs @@ -5,6 +5,8 @@ use std::fmt::Display; use epp_client_macros::ElementName; use serde::{ser::SerializeStruct, Deserialize, Serialize, Serializer}; +use crate::request::EppExtension; + const EPP_XMLNS: &str = "urn:ietf:params:xml:ns:epp-1.0"; /// Wraps String for easier serialization to and from values that are inner text @@ -38,7 +40,11 @@ pub trait ElementName { #[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)] #[element_name(name = "empty")] /// An empty placeholder tag. To be refactored to something more compliant later. -pub struct EmptyTag; +pub struct NoExtension; + +impl EppExtension for NoExtension { + type Response = NoExtension; +} /// An EPP XML Document that is used either as an EPP XML request or /// an EPP XML response diff --git a/epp-client/src/domain/rgp/request.rs b/epp-client/src/domain/rgp/request.rs index c8a7760..a5327e8 100644 --- a/epp-client/src/domain/rgp/request.rs +++ b/epp-client/src/domain/rgp/request.rs @@ -2,7 +2,7 @@ use epp_client_macros::*; -use crate::common::{ElementName, EmptyTag, EppObject, Extension}; +use crate::common::{ElementName, EppObject, Extension, NoExtension}; use crate::domain::rgp::EPP_DOMAIN_RGP_EXT_XMLNS; use crate::domain::update::{DomainChangeInfo, DomainUpdateRequest, DomainUpdateRequestData}; use crate::domain::EPP_DOMAIN_XMLNS; @@ -95,7 +95,7 @@ impl EppDomainRgpRestoreRequest { /// Type that represents the <epp> tag for the EPP XML rgp restore request response pub type EppDomainRgpRestoreRequestResponse = - EppObject>; + EppObject>; // Request diff --git a/epp-client/src/request.rs b/epp-client/src/request.rs index 900905c..89eb25a 100644 --- a/epp-client/src/request.rs +++ b/epp-client/src/request.rs @@ -6,7 +6,8 @@ use std::fmt::Debug; use std::time::SystemTime; use crate::{ - common::{ElementName, EmptyTag, EppObject, Extension, StringValue}, + common::NoExtension, + common::{ElementName, EppObject, Extension, StringValue}, response::{CommandResponseStatus, CommandResponseWithExtension}, xml::EppXml, }; @@ -57,7 +58,7 @@ pub trait EppExtension: ElementName + DeserializeOwned + Serialize + Sized + Deb /// Type corresponding to the <command> tag in an EPP XML request /// without an <extension> tag -pub type Command = CommandWithExtension; +pub type Command = CommandWithExtension; #[derive(Deserialize, Debug, PartialEq, ElementName)] #[element_name(name = "command")] diff --git a/epp-client/src/response.rs b/epp-client/src/response.rs index be28bbf..61da68d 100644 --- a/epp-client/src/response.rs +++ b/epp-client/src/response.rs @@ -4,10 +4,11 @@ use epp_client_macros::*; use serde::{Deserialize, Serialize}; use std::fmt::Debug; -use crate::common::{ElementName, EmptyTag, EppObject, Extension, StringValue}; +use crate::common::NoExtension; +use crate::common::{ElementName, EppObject, Extension, StringValue}; /// Type corresponding to the <response> tag in an EPP response without an <extension> section -pub type CommandResponse = CommandResponseWithExtension; +pub type CommandResponse = CommandResponseWithExtension; /// A generic EPP Response to an EPP command with a result section, a status code and a message pub type EppCommandResponse = EppObject;