diff --git a/epp-client/src/connection/client.rs b/epp-client/src/connection/client.rs index 72ea0f2..052b17d 100644 --- a/epp-client/src/connection/client.rs +++ b/epp-client/src/connection/client.rs @@ -54,7 +54,7 @@ use crate::common::{EppObject, NoExtension}; use crate::config::EppClientConfig; use crate::connection::registry::{epp_connect, EppConnection}; use crate::error; -use crate::hello::{EppGreeting, EppHello}; +use crate::hello::{Greeting, Hello}; use crate::login::Login; use crate::logout::Logout; use crate::request::{generate_client_tr_id, EppExtension, EppRequest}; @@ -129,13 +129,13 @@ impl EppClient { } /// Executes an EPP Hello call and returns the response as an `EppGreeting` - pub async fn hello(&mut self) -> Result> { - let hello = EppHello::new(); + pub async fn hello(&mut self) -> Result> { + let hello = Hello::new(); let hello_xml = hello.serialize()?; let response = self.connection.transact(&hello_xml).await?; - Ok(EppGreeting::deserialize(&response)?) + Ok(Greeting::deserialize(&response)?) } pub async fn transact( @@ -171,8 +171,8 @@ impl EppClient { } /// Returns the greeting received on establishment of the connection as an `EppGreeting` - pub fn greeting(&self) -> Result { - EppGreeting::deserialize(&self.connection.greeting) + pub fn greeting(&self) -> Result { + Greeting::deserialize(&self.connection.greeting) } /// Sends the EPP Logout command to log out of the EPP session diff --git a/epp-client/src/hello.rs b/epp-client/src/hello.rs index 426bc41..a1ef43d 100644 --- a/epp-client/src/hello.rs +++ b/epp-client/src/hello.rs @@ -6,30 +6,30 @@ use serde::{Deserialize, Deserializer, Serialize}; use crate::common::{ElementName, EppObject, Options, ServiceExtension, Services, StringValue}; /// The EPP Hello request -pub type EppHello = EppObject; +pub type Hello = EppObject; -impl EppHello { +impl Hello { /// Creates a new Epp Hello request - pub fn new() -> EppHello { - EppObject::build(Hello {}) + pub fn new() -> Hello { + EppObject::build(HelloRequest {}) } } -impl Default for EppHello { +impl Default for Hello { fn default() -> Self { Self::new() } } /// The EPP Greeting that is received on a successful connection and in response to an EPP hello -pub type EppGreeting = EppObject; +pub type Greeting = EppObject; // Request #[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)] #[element_name(name = "hello")] /// Type corresponding to the tag in an EPP XML hello request -pub struct Hello; +pub struct HelloRequest; // Response @@ -284,7 +284,7 @@ pub struct Dcp { #[serde(rename_all = "lowercase")] #[element_name(name = "greeting")] /// Type corresponding to the tag in the EPP greeting XML -pub struct Greeting { +pub struct GreetingResponse { /// The service ID #[serde(rename = "svID")] pub service_id: String, diff --git a/epp-client/src/tests/de.rs b/epp-client/src/tests/de.rs index 5d2e222..58bf7ee 100644 --- a/epp-client/src/tests/de.rs +++ b/epp-client/src/tests/de.rs @@ -21,8 +21,8 @@ mod response { use crate::domain::transfer::DomainTransferReject; use crate::domain::transfer::DomainTransferRequest; use crate::domain::update::DomainUpdate; - use crate::hello::EppGreeting; use crate::hello::ExpiryType; + use crate::hello::Greeting; use crate::hello::Relative; use crate::host::check::HostCheck; use crate::host::create::HostCreate; @@ -43,7 +43,7 @@ mod response { #[test] fn greeting() { let xml = get_xml("response/greeting.xml").unwrap(); - let object = EppGreeting::deserialize(xml.as_str()).unwrap(); + let object = Greeting::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"); diff --git a/epp-client/src/tests/se.rs b/epp-client/src/tests/se.rs index 928a2ef..f3d1082 100644 --- a/epp-client/src/tests/se.rs +++ b/epp-client/src/tests/se.rs @@ -31,7 +31,7 @@ mod request { use crate::domain::update::DomainAddRemove; use crate::domain::update::DomainChangeInfo; use crate::domain::update::DomainUpdate; - use crate::hello::EppHello; + use crate::hello::Hello; use crate::host::check::HostCheck; use crate::host::create::HostCreate; use crate::host::delete::HostDelete; @@ -51,7 +51,7 @@ mod request { #[test] fn hello() { let xml = get_xml("request/hello.xml").unwrap(); - let object = EppHello::new(); + let object = Hello::new(); let serialized = object.serialize().unwrap(); assert_eq!(xml, serialized);