Rename EmptyTag to NoExtension

This commit is contained in:
Nicholas Rempel 2021-11-26 13:51:11 -08:00 committed by masalachai
parent 80c0040cd9
commit aa54c14972
4 changed files with 15 additions and 7 deletions

View File

@ -5,6 +5,8 @@ use std::fmt::Display;
use epp_client_macros::ElementName; use epp_client_macros::ElementName;
use serde::{ser::SerializeStruct, Deserialize, Serialize, Serializer}; use serde::{ser::SerializeStruct, Deserialize, Serialize, Serializer};
use crate::request::EppExtension;
const EPP_XMLNS: &str = "urn:ietf:params:xml:ns:epp-1.0"; 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 /// 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)] #[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
#[element_name(name = "empty")] #[element_name(name = "empty")]
/// An empty placeholder tag. To be refactored to something more compliant later. /// 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 Document that is used either as an EPP XML request or
/// an EPP XML response /// an EPP XML response

View File

@ -2,7 +2,7 @@
use epp_client_macros::*; 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::rgp::EPP_DOMAIN_RGP_EXT_XMLNS;
use crate::domain::update::{DomainChangeInfo, DomainUpdateRequest, DomainUpdateRequestData}; use crate::domain::update::{DomainChangeInfo, DomainUpdateRequest, DomainUpdateRequestData};
use crate::domain::EPP_DOMAIN_XMLNS; 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 /// Type that represents the <epp> tag for the EPP XML rgp restore request response
pub type EppDomainRgpRestoreRequestResponse = pub type EppDomainRgpRestoreRequestResponse =
EppObject<CommandResponseWithExtension<EmptyTag, RgpRequestResponse>>; EppObject<CommandResponseWithExtension<NoExtension, RgpRequestResponse>>;
// Request // Request

View File

@ -6,7 +6,8 @@ use std::fmt::Debug;
use std::time::SystemTime; use std::time::SystemTime;
use crate::{ use crate::{
common::{ElementName, EmptyTag, EppObject, Extension, StringValue}, common::NoExtension,
common::{ElementName, EppObject, Extension, StringValue},
response::{CommandResponseStatus, CommandResponseWithExtension}, response::{CommandResponseStatus, CommandResponseWithExtension},
xml::EppXml, xml::EppXml,
}; };
@ -57,7 +58,7 @@ pub trait EppExtension: ElementName + DeserializeOwned + Serialize + Sized + Deb
/// Type corresponding to the &lt;command&gt; tag in an EPP XML request /// Type corresponding to the &lt;command&gt; tag in an EPP XML request
/// without an &lt;extension&gt; tag /// without an &lt;extension&gt; tag
pub type Command<T> = CommandWithExtension<T, EmptyTag>; pub type Command<T> = CommandWithExtension<T, NoExtension>;
#[derive(Deserialize, Debug, PartialEq, ElementName)] #[derive(Deserialize, Debug, PartialEq, ElementName)]
#[element_name(name = "command")] #[element_name(name = "command")]

View File

@ -4,10 +4,11 @@ use epp_client_macros::*;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::Debug; 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 &lt;response&gt; tag in an EPP response without an &lt;extension&gt; section /// Type corresponding to the &lt;response&gt; tag in an EPP response without an &lt;extension&gt; section
pub type CommandResponse<T> = CommandResponseWithExtension<T, EmptyTag>; pub type CommandResponse<T> = CommandResponseWithExtension<T, NoExtension>;
/// A generic EPP Response to an EPP command with a result section, a status code and a message /// A generic EPP Response to an EPP command with a result section, a status code and a message
pub type EppCommandResponse = EppObject<CommandResponseStatus>; pub type EppCommandResponse = EppObject<CommandResponseStatus>;