diff --git a/epp-client/src/client.rs b/epp-client/src/client.rs index 6bfcbbc..d5cd239 100644 --- a/epp-client/src/client.rs +++ b/epp-client/src/client.rs @@ -58,7 +58,7 @@ use crate::login::Login; use crate::logout::Logout; use crate::registry::{epp_connect, EppConnection}; use crate::request::{generate_client_tr_id, EppExtension, EppRequest}; -use crate::response::{CommandResponseStatus, CommandResponseWithExtension}; +use crate::response::{ResponseStatus, ResponseWithExtension}; use crate::xml::EppXml; /// Instances of the EppClient type are used to transact with the registry. @@ -143,7 +143,7 @@ impl EppClient { &mut self, request: T, id: &str, - ) -> Result>::Output, E::Response>, error::Error> + ) -> Result>::Output, E::Response>, error::Error> where T: EppRequest + Debug, E: EppExtension, @@ -179,10 +179,7 @@ impl EppClient { /// Sends the EPP Logout command to log out of the EPP session pub async fn logout( &mut self, - ) -> Result< - CommandResponseWithExtension, NoExtension>, - error::Error, - > { + ) -> Result, NoExtension>, error::Error> { let client_tr_id = generate_client_tr_id(&self.credentials.0).unwrap(); let epp_logout = Logout::::new(); diff --git a/epp-client/src/request.rs b/epp-client/src/request.rs index 89eb25a..48cac38 100644 --- a/epp-client/src/request.rs +++ b/epp-client/src/request.rs @@ -8,7 +8,7 @@ use std::time::SystemTime; use crate::{ common::NoExtension, common::{ElementName, EppObject, Extension, StringValue}, - response::{CommandResponseStatus, CommandResponseWithExtension}, + response::{ResponseStatus, ResponseWithExtension}, xml::EppXml, }; use epp_client_macros::ElementName; @@ -35,15 +35,15 @@ pub trait EppRequest: Sized + Debug { fn deserialize_response( epp_xml: &str, - ) -> Result, crate::error::Error> { + ) -> Result, crate::error::Error> { let rsp = - > as EppXml>::deserialize( + > as EppXml>::deserialize( epp_xml, )?; match rsp.data.result.code { 0..=2000 => Ok(rsp.data), _ => Err(crate::error::Error::EppCommandError(EppObject::build( - CommandResponseStatus { + ResponseStatus { result: rsp.data.result, tr_ids: rsp.data.tr_ids, }, diff --git a/epp-client/src/response.rs b/epp-client/src/response.rs index 422e785..0c3ef4f 100644 --- a/epp-client/src/response.rs +++ b/epp-client/src/response.rs @@ -7,7 +7,7 @@ use std::fmt::Debug; use crate::common::{ElementName, EppObject, Extension, StringValue}; /// A generic EPP Response to an EPP command with a result section, a status code and a message -pub type EppCommandResponse = EppObject; +pub type EppCommandResponse = EppObject; /// Type corresponding to the tag an EPP response XML #[derive(Serialize, Deserialize, Debug, PartialEq)] @@ -76,7 +76,7 @@ pub struct MessageQueue { #[element_name(name = "response")] /// Type corresponding to the <response> tag in an EPP response XML /// containing an <extension> tag -pub struct CommandResponseWithExtension { +pub struct ResponseWithExtension { /// Data under the tag pub result: EppResult, /// Data under the tag @@ -96,7 +96,7 @@ pub struct CommandResponseWithExtension { #[element_name(name = "response")] /// Type corresponding to the <response> tag in an EPP response XML /// without or <resData> sections. Generally used for error handling -pub struct CommandResponseStatus { +pub struct ResponseStatus { /// Data under the tag pub result: EppResult, #[serde(rename = "trID")] @@ -104,7 +104,7 @@ pub struct CommandResponseStatus { pub tr_ids: ResponseTRID, } -impl CommandResponseWithExtension { +impl ResponseWithExtension { /// Returns the data under the corresponding <resData> from the EPP XML pub fn res_data(&self) -> Option<&T> { match &self.res_data {