diff --git a/epp-client/src/connection/client.rs b/epp-client/src/connection/client.rs index 9aa34bc..60d3200 100644 --- a/epp-client/src/connection/client.rs +++ b/epp-client/src/connection/client.rs @@ -51,12 +51,12 @@ use std::{error::Error, fmt::Debug}; use crate::config::EppClientConfig; use crate::connection::registry::{epp_connect, EppConnection}; -use crate::epp::request::{generate_client_tr_id, EppHello, EppLogin, EppLogout}; -use crate::epp::response::{ - EppCommandResponse, EppCommandResponseError, EppGreeting, EppLoginResponse, EppLogoutResponse, -}; use crate::epp::xml::EppXml; use crate::error; +use crate::request::{generate_client_tr_id, EppHello, EppLogin, EppLogout}; +use crate::response::{ + EppCommandResponse, EppCommandResponseError, EppGreeting, EppLoginResponse, EppLogoutResponse, +}; /// Instances of the EppClient type are used to transact with the registry. /// Once initialized, the EppClient instance can serialize EPP requests to XML and send them /// to the registry and deserialize the XML responses from the registry to local types diff --git a/epp-client/src/contact/check.rs b/epp-client/src/contact/check.rs index 17f42aa..00b3e18 100644 --- a/epp-client/src/contact/check.rs +++ b/epp-client/src/contact/check.rs @@ -2,8 +2,8 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; +use crate::request::Command; +use crate::response::CommandResponse; use crate::epp::xml::EPP_CONTACT_XMLNS; use serde::{Deserialize, Serialize}; diff --git a/epp-client/src/contact/create.rs b/epp-client/src/contact/create.rs index 46dd93e..235de3d 100644 --- a/epp-client/src/contact/create.rs +++ b/epp-client/src/contact/create.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ContactAuthInfo, ElementName, EppObject, Phone, PostalInfo, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; use crate::epp::xml::EPP_CONTACT_XMLNS; +use crate::request::Command; +use crate::response::CommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for contact <create> command diff --git a/epp-client/src/contact/delete.rs b/epp-client/src/contact/delete.rs index 1bca940..4d7c4a0 100644 --- a/epp-client/src/contact/delete.rs +++ b/epp-client/src/contact/delete.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::EppCommandResponse; use crate::epp::xml::EPP_CONTACT_XMLNS; +use crate::request::Command; +use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; /// Type for the <epp> request for contact <delete> command diff --git a/epp-client/src/contact/info.rs b/epp-client/src/contact/info.rs index 2801d5e..af3566f 100644 --- a/epp-client/src/contact/info.rs +++ b/epp-client/src/contact/info.rs @@ -5,9 +5,9 @@ use epp_client_macros::*; use crate::common::{ ContactAuthInfo, ContactStatus, ElementName, EppObject, Phone, PostalInfo, StringValue, }; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; use crate::epp::xml::EPP_CONTACT_XMLNS; +use crate::request::Command; +use crate::response::CommandResponse; use serde::{Deserialize, Serialize}; /// Type for the <epp> request for contact <info> command diff --git a/epp-client/src/contact/update.rs b/epp-client/src/contact/update.rs index 922436c..4d11ec2 100644 --- a/epp-client/src/contact/update.rs +++ b/epp-client/src/contact/update.rs @@ -6,10 +6,10 @@ use crate::common::{ ContactAuthInfo, ContactStatus, ElementName, EppObject, Phone, PostalInfo, StringValue, }; use crate::contact::info::EppContactInfoResponse; -use crate::epp::request::Command; -use crate::epp::response::EppCommandResponse; use crate::epp::xml::EPP_CONTACT_XMLNS; use crate::error; +use crate::request::Command; +use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for contact <update> command diff --git a/epp-client/src/domain/check.rs b/epp-client/src/domain/check.rs index f133eae..4cc3ff4 100644 --- a/epp-client/src/domain/check.rs +++ b/epp-client/src/domain/check.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; use crate::epp::xml::EPP_DOMAIN_XMLNS; +use crate::request::Command; +use crate::response::CommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for domain <check> command diff --git a/epp-client/src/domain/create.rs b/epp-client/src/domain/create.rs index f04f0b4..8ede09c 100644 --- a/epp-client/src/domain/create.rs +++ b/epp-client/src/domain/create.rs @@ -6,9 +6,9 @@ use crate::common::{ DomainAuthInfo, DomainContact, ElementName, EppObject, HostAttr, HostAttrList, HostList, HostObjList, Period, StringValue, }; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; use crate::epp::xml::EPP_DOMAIN_XMLNS; +use crate::request::Command; +use crate::response::CommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for domain <create> command diff --git a/epp-client/src/domain/delete.rs b/epp-client/src/domain/delete.rs index 63ecad2..5547198 100644 --- a/epp-client/src/domain/delete.rs +++ b/epp-client/src/domain/delete.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::EppCommandResponse; use crate::epp::xml::EPP_DOMAIN_XMLNS; +use crate::request::Command; +use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for domain <delete> command diff --git a/epp-client/src/domain/info.rs b/epp-client/src/domain/info.rs index d02369d..72dd591 100644 --- a/epp-client/src/domain/info.rs +++ b/epp-client/src/domain/info.rs @@ -6,9 +6,9 @@ use crate::common::{ DomainAuthInfo, DomainContact, DomainStatus, ElementName, EppObject, HostAttr, StringValue, }; use crate::domain::rgp::request::RgpRequestResponse; -use crate::epp::request::Command; -use crate::epp::response::CommandResponseWithExtension; use crate::epp::xml::EPP_DOMAIN_XMLNS; +use crate::request::Command; +use crate::response::CommandResponseWithExtension; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for domain <info> command diff --git a/epp-client/src/domain/renew.rs b/epp-client/src/domain/renew.rs index b5b471b..4717e05 100644 --- a/epp-client/src/domain/renew.rs +++ b/epp-client/src/domain/renew.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, Period, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; use crate::epp::xml::EPP_DOMAIN_XMLNS; +use crate::request::Command; +use crate::response::CommandResponse; use chrono::NaiveDate; use serde::{Deserialize, Serialize}; diff --git a/epp-client/src/domain/rgp/report.rs b/epp-client/src/domain/rgp/report.rs index 9c45657..7f11522 100644 --- a/epp-client/src/domain/rgp/report.rs +++ b/epp-client/src/domain/rgp/report.rs @@ -4,9 +4,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, Extension, StringValue}; use crate::domain::update::{DomainChangeInfo, DomainUpdateRequest, DomainUpdateRequestData}; -use crate::epp::request::CommandWithExtension; -use crate::epp::response::EppCommandResponse; use crate::epp::xml::{EPP_DOMAIN_RGP_EXT_XMLNS, EPP_DOMAIN_XMLNS}; +use crate::request::CommandWithExtension; +use crate::response::EppCommandResponse; use chrono::{DateTime, SecondsFormat, Utc}; use serde::{Deserialize, Serialize}; diff --git a/epp-client/src/domain/rgp/request.rs b/epp-client/src/domain/rgp/request.rs index 16f2160..efafda4 100644 --- a/epp-client/src/domain/rgp/request.rs +++ b/epp-client/src/domain/rgp/request.rs @@ -4,9 +4,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EmptyTag, EppObject, Extension}; use crate::domain::update::{DomainChangeInfo, DomainUpdateRequest, DomainUpdateRequestData}; -use crate::epp::request::CommandWithExtension; -use crate::epp::response::CommandResponseWithExtension; use crate::epp::xml::{EPP_DOMAIN_RGP_EXT_XMLNS, EPP_DOMAIN_XMLNS}; +use crate::request::CommandWithExtension; +use crate::response::CommandResponseWithExtension; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for a domain rgp restore request command diff --git a/epp-client/src/domain/transfer.rs b/epp-client/src/domain/transfer.rs index 8ee489c..b7c6610 100644 --- a/epp-client/src/domain/transfer.rs +++ b/epp-client/src/domain/transfer.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{DomainAuthInfo, ElementName, EppObject, Period, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::{CommandResponse, EppCommandResponse}; use crate::epp::xml::EPP_DOMAIN_XMLNS; +use crate::request::Command; +use crate::response::{CommandResponse, EppCommandResponse}; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for transfer request for domain diff --git a/epp-client/src/domain/update.rs b/epp-client/src/domain/update.rs index 089bd4c..eb79af3 100644 --- a/epp-client/src/domain/update.rs +++ b/epp-client/src/domain/update.rs @@ -6,9 +6,9 @@ use crate::common::{ DomainAuthInfo, DomainContact, DomainStatus, ElementName, EppObject, HostList, StringValue, }; -use crate::epp::request::Command; -use crate::epp::response::EppCommandResponse; use crate::epp::xml::EPP_DOMAIN_XMLNS; +use crate::request::Command; +use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for domain <update> command diff --git a/epp-client/src/epp.rs b/epp-client/src/epp.rs index 697e997..eae5a0b 100644 --- a/epp-client/src/epp.rs +++ b/epp-client/src/epp.rs @@ -1,7 +1,5 @@ //! Types for EPP requests and responses -pub mod request; -pub mod response; pub mod xml; pub use crate::connection::client::default_client_tr_id_fn as generate_client_tr_id; diff --git a/epp-client/src/error.rs b/epp-client/src/error.rs index 8f4d5b3..c0e4179 100644 --- a/epp-client/src/error.rs +++ b/epp-client/src/error.rs @@ -1,6 +1,6 @@ //! Error types to wrap internal errors and make EPP errors easier to read -use crate::epp::response::EppCommandResponseError; +use crate::response::EppCommandResponseError; use std::fmt::Display; /// Error enum holding the possible error types diff --git a/epp-client/src/host/check.rs b/epp-client/src/host/check.rs index 1ba5ae7..a1b4fa7 100644 --- a/epp-client/src/host/check.rs +++ b/epp-client/src/host/check.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; use crate::epp::xml::EPP_HOST_XMLNS; +use crate::request::Command; +use crate::response::CommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for host <check> command diff --git a/epp-client/src/host/create.rs b/epp-client/src/host/create.rs index 01a223b..40c41bb 100644 --- a/epp-client/src/host/create.rs +++ b/epp-client/src/host/create.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, HostAddr, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; use crate::epp::xml::EPP_HOST_XMLNS; +use crate::request::Command; +use crate::response::CommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for host <create> command diff --git a/epp-client/src/host/delete.rs b/epp-client/src/host/delete.rs index ada94f6..0cfbb0e 100644 --- a/epp-client/src/host/delete.rs +++ b/epp-client/src/host/delete.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::EppCommandResponse; use crate::epp::xml::EPP_HOST_XMLNS; +use crate::request::Command; +use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for host <delete> command diff --git a/epp-client/src/host/info.rs b/epp-client/src/host/info.rs index 06a296c..90da0af 100644 --- a/epp-client/src/host/info.rs +++ b/epp-client/src/host/info.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, HostAddr, HostStatus, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; use crate::epp::xml::EPP_HOST_XMLNS; +use crate::request::Command; +use crate::response::CommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for host <info> command diff --git a/epp-client/src/host/update.rs b/epp-client/src/host/update.rs index 36b7cff..18b46a6 100644 --- a/epp-client/src/host/update.rs +++ b/epp-client/src/host/update.rs @@ -3,9 +3,9 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, HostAddr, HostStatus, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::EppCommandResponse; use crate::epp::xml::EPP_HOST_XMLNS; +use crate::request::Command; +use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for host <update> command diff --git a/epp-client/src/lib.rs b/epp-client/src/lib.rs index 9b2893e..af4f1ff 100644 --- a/epp-client/src/lib.rs +++ b/epp-client/src/lib.rs @@ -109,6 +109,8 @@ pub mod epp; pub mod error; pub mod host; pub mod message; +pub mod request; +pub mod response; pub use connection::client::EppClient; #[cfg(test)] diff --git a/epp-client/src/message/ack.rs b/epp-client/src/message/ack.rs index 499168c..11835f9 100644 --- a/epp-client/src/message/ack.rs +++ b/epp-client/src/message/ack.rs @@ -3,8 +3,8 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject}; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; +use crate::request::Command; +use crate::response::CommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for registry command diff --git a/epp-client/src/message/poll.rs b/epp-client/src/message/poll.rs index 501dd5d..4f91f7d 100644 --- a/epp-client/src/message/poll.rs +++ b/epp-client/src/message/poll.rs @@ -3,8 +3,8 @@ use epp_client_macros::*; use crate::common::{ElementName, EppObject, StringValue}; -use crate::epp::request::Command; -use crate::epp::response::CommandResponse; +use crate::request::Command; +use crate::response::CommandResponse; use serde::{Deserialize, Serialize}; /// Type that represents the <epp> request for registry command diff --git a/epp-client/src/epp/request.rs b/epp-client/src/request.rs similarity index 100% rename from epp-client/src/epp/request.rs rename to epp-client/src/request.rs diff --git a/epp-client/src/epp/response.rs b/epp-client/src/response.rs similarity index 100% rename from epp-client/src/epp/response.rs rename to epp-client/src/response.rs diff --git a/epp-client/src/tests/de.rs b/epp-client/src/tests/de.rs index 30d037e..0c31606 100644 --- a/epp-client/src/tests/de.rs +++ b/epp-client/src/tests/de.rs @@ -20,11 +20,6 @@ mod response { use crate::domain::transfer::EppDomainTransferRejectResponse; use crate::domain::transfer::EppDomainTransferRequestResponse; use crate::domain::update::EppDomainUpdateResponse; - use crate::epp::response::ExpiryType; - use crate::epp::response::Relative; - use crate::epp::response::{ - EppCommandResponseError, EppGreeting, EppLoginResponse, EppLogoutResponse, - }; use crate::epp::xml::EppXml; use crate::host::check::EppHostCheckResponse; use crate::host::create::EppHostCreateResponse; @@ -33,6 +28,11 @@ mod response { use crate::host::update::EppHostUpdateResponse; use crate::message::ack::EppMessageAckResponse; use crate::message::poll::EppMessagePollResponse; + use crate::response::ExpiryType; + use crate::response::Relative; + use crate::response::{ + EppCommandResponseError, EppGreeting, EppLoginResponse, EppLogoutResponse, + }; const SVTRID: &str = "RO-6879-1627224678242975"; const SUCCESS_MSG: &str = "Command completed successfully"; diff --git a/epp-client/src/tests/se.rs b/epp-client/src/tests/se.rs index a62062d..01592c9 100644 --- a/epp-client/src/tests/se.rs +++ b/epp-client/src/tests/se.rs @@ -27,7 +27,6 @@ mod request { use crate::domain::update::DomainAddRemove; use crate::domain::update::DomainChangeInfo; use crate::domain::update::EppDomainUpdate; - use crate::epp::request::{EppHello, EppLogin, EppLogout}; use crate::epp::xml::EppXml; use crate::host::check::EppHostCheck; use crate::host::create::EppHostCreate; @@ -38,6 +37,7 @@ mod request { use crate::host::update::HostChangeInfo; use crate::message::ack::EppMessageAck; use crate::message::poll::EppMessagePoll; + use crate::request::{EppHello, EppLogin, EppLogout}; use chrono::{DateTime, NaiveDate}; use std::str::FromStr;