From 50c21a70378b157ac6e5ff1a45628afb3fc3e2f8 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 6 Dec 2021 16:25:11 +0100 Subject: [PATCH] Rename EppRequest to Transaction --- epp-client/src/client.rs | 6 +++--- epp-client/src/contact/check.rs | 4 ++-- epp-client/src/contact/create.rs | 4 ++-- epp-client/src/contact/delete.rs | 4 ++-- epp-client/src/contact/info.rs | 4 ++-- epp-client/src/contact/update.rs | 4 ++-- epp-client/src/domain/check.rs | 4 ++-- epp-client/src/domain/create.rs | 4 ++-- epp-client/src/domain/delete.rs | 4 ++-- epp-client/src/domain/info.rs | 4 ++-- epp-client/src/domain/renew.rs | 4 ++-- epp-client/src/domain/transfer.rs | 12 ++++++------ epp-client/src/domain/update.rs | 4 ++-- epp-client/src/host/check.rs | 4 ++-- epp-client/src/host/create.rs | 4 ++-- epp-client/src/host/delete.rs | 4 ++-- epp-client/src/host/info.rs | 4 ++-- epp-client/src/host/update.rs | 4 ++-- epp-client/src/login.rs | 4 ++-- epp-client/src/logout.rs | 4 ++-- epp-client/src/message/ack.rs | 4 ++-- epp-client/src/message/poll.rs | 4 ++-- epp-client/src/request.rs | 2 +- epp-client/src/tests/de.rs | 2 +- epp-client/src/tests/se.rs | 2 +- 25 files changed, 52 insertions(+), 52 deletions(-) diff --git a/epp-client/src/client.rs b/epp-client/src/client.rs index 5bf2175..481bd03 100644 --- a/epp-client/src/client.rs +++ b/epp-client/src/client.rs @@ -49,7 +49,7 @@ use crate::config::EppClientConfig; use crate::error; use crate::hello::{Greeting, GreetingDocument, HelloDocument}; use crate::registry::{epp_connect, EppConnection}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use crate::response::Response; use crate::xml::EppXml; @@ -91,9 +91,9 @@ impl EppClient { &mut self, request: T, id: &str, - ) -> Result>::Output, E::Response>, error::Error> + ) -> Result>::Output, E::Response>, error::Error> where - T: EppRequest + Debug, + T: Transaction + Debug, E: EppExtension, { let epp_xml = request.serialize_request(id)?; diff --git a/epp-client/src/contact/check.rs b/epp-client/src/contact/check.rs index 8f2fed7..7747bde 100644 --- a/epp-client/src/contact/check.rs +++ b/epp-client/src/contact/check.rs @@ -5,7 +5,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -14,7 +14,7 @@ pub struct ContactCheck { extension: Option, } -impl EppRequest for ContactCheck { +impl Transaction for ContactCheck { type Input = ContactCheckRequest; type Output = ContactCheckResponse; diff --git a/epp-client/src/contact/create.rs b/epp-client/src/contact/create.rs index 6f13d1a..96e7340 100644 --- a/epp-client/src/contact/create.rs +++ b/epp-client/src/contact/create.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ContactAuthInfo, ElementName, NoExtension, Phone, PostalInfo, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -13,7 +13,7 @@ pub struct ContactCreate { extension: Option, } -impl EppRequest for ContactCreate { +impl Transaction for ContactCreate { type Input = ContactCreateRequest; type Output = ContactCreateResponse; diff --git a/epp-client/src/contact/delete.rs b/epp-client/src/contact/delete.rs index ea98ff3..fd93e29 100644 --- a/epp-client/src/contact/delete.rs +++ b/epp-client/src/contact/delete.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use crate::response::ResponseStatus; use serde::{Deserialize, Serialize}; @@ -14,7 +14,7 @@ pub struct ContactDelete { extension: Option, } -impl EppRequest for ContactDelete { +impl Transaction for ContactDelete { type Input = ContactDeleteRequest; type Output = ResponseStatus; diff --git a/epp-client/src/contact/info.rs b/epp-client/src/contact/info.rs index e904c36..d846163 100644 --- a/epp-client/src/contact/info.rs +++ b/epp-client/src/contact/info.rs @@ -6,7 +6,7 @@ use super::XMLNS; use crate::common::{ ContactAuthInfo, ContactStatus, ElementName, NoExtension, Phone, PostalInfo, StringValue, }; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -15,7 +15,7 @@ pub struct ContactInfo { extension: Option, } -impl EppRequest for ContactInfo { +impl Transaction for ContactInfo { type Input = ContactInfoRequest; type Output = ContactInfoResponse; diff --git a/epp-client/src/contact/update.rs b/epp-client/src/contact/update.rs index 755be4d..15d1341 100644 --- a/epp-client/src/contact/update.rs +++ b/epp-client/src/contact/update.rs @@ -6,7 +6,7 @@ use super::XMLNS; use crate::common::{ ContactAuthInfo, ContactStatus, ElementName, NoExtension, Phone, PostalInfo, StringValue, }; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use crate::response::ResponseStatus; use serde::{Deserialize, Serialize}; @@ -16,7 +16,7 @@ pub struct ContactUpdate { extension: Option, } -impl EppRequest for ContactUpdate { +impl Transaction for ContactUpdate { type Input = ContactUpdateRequest; type Output = ResponseStatus; diff --git a/epp-client/src/domain/check.rs b/epp-client/src/domain/check.rs index 42011cc..6fbada2 100644 --- a/epp-client/src/domain/check.rs +++ b/epp-client/src/domain/check.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -13,7 +13,7 @@ pub struct DomainCheck { extension: Option, } -impl EppRequest for DomainCheck { +impl Transaction for DomainCheck { type Input = DomainCheckRequest; type Output = DomainCheckResponse; diff --git a/epp-client/src/domain/create.rs b/epp-client/src/domain/create.rs index c78b2c9..f2a2c90 100644 --- a/epp-client/src/domain/create.rs +++ b/epp-client/src/domain/create.rs @@ -6,7 +6,7 @@ use super::XMLNS; use crate::common::{ DomainAuthInfo, DomainContact, ElementName, HostList, NoExtension, Period, StringValue, }; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -15,7 +15,7 @@ pub struct DomainCreate { extension: Option, } -impl EppRequest for DomainCreate { +impl Transaction for DomainCreate { type Input = DomainCreateRequest; type Output = DomainCreateResponse; diff --git a/epp-client/src/domain/delete.rs b/epp-client/src/domain/delete.rs index 2d4b8a1..d2d03c1 100644 --- a/epp-client/src/domain/delete.rs +++ b/epp-client/src/domain/delete.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use crate::response::ResponseStatus; use serde::{Deserialize, Serialize}; @@ -14,7 +14,7 @@ pub struct DomainDelete { extension: Option, } -impl EppRequest for DomainDelete { +impl Transaction for DomainDelete { type Input = DomainDeleteRequest; type Output = ResponseStatus; diff --git a/epp-client/src/domain/info.rs b/epp-client/src/domain/info.rs index f8e9898..7136672 100644 --- a/epp-client/src/domain/info.rs +++ b/epp-client/src/domain/info.rs @@ -6,7 +6,7 @@ use super::XMLNS; use crate::common::{ DomainAuthInfo, DomainContact, DomainStatus, ElementName, HostAttr, NoExtension, StringValue, }; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -15,7 +15,7 @@ pub struct DomainInfo { extension: Option, } -impl EppRequest for DomainInfo { +impl Transaction for DomainInfo { type Input = DomainInfoRequest; type Output = DomainInfoResponse; diff --git a/epp-client/src/domain/renew.rs b/epp-client/src/domain/renew.rs index e5a82bd..02aaa26 100644 --- a/epp-client/src/domain/renew.rs +++ b/epp-client/src/domain/renew.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, NoExtension, Period, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use chrono::NaiveDate; use serde::{Deserialize, Serialize}; @@ -14,7 +14,7 @@ pub struct DomainRenew { extension: Option, } -impl EppRequest for DomainRenew { +impl Transaction for DomainRenew { type Input = DomainRenewRequest; type Output = DomainRenewResponse; diff --git a/epp-client/src/domain/transfer.rs b/epp-client/src/domain/transfer.rs index 5a173b5..faf6f97 100644 --- a/epp-client/src/domain/transfer.rs +++ b/epp-client/src/domain/transfer.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{DomainAuthInfo, ElementName, NoExtension, Period, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -13,7 +13,7 @@ pub struct DomainTransferRequest { extension: Option, } -impl EppRequest for DomainTransferRequest { +impl Transaction for DomainTransferRequest { type Input = DomainTransferReq; type Output = DomainTransferResponse; @@ -28,7 +28,7 @@ pub struct DomainTransferApprove { extension: Option, } -impl EppRequest for DomainTransferApprove { +impl Transaction for DomainTransferApprove { type Input = DomainTransferReq; type Output = DomainTransferResponse; @@ -43,7 +43,7 @@ pub struct DomainTransferReject { extension: Option, } -impl EppRequest for DomainTransferReject { +impl Transaction for DomainTransferReject { type Input = DomainTransferReq; type Output = DomainTransferResponse; @@ -58,7 +58,7 @@ pub struct DomainTransferCancel { extension: Option, } -impl EppRequest for DomainTransferCancel { +impl Transaction for DomainTransferCancel { type Input = DomainTransferReq; type Output = DomainTransferResponse; @@ -73,7 +73,7 @@ pub struct DomainTransferQuery { extension: Option, } -impl EppRequest for DomainTransferQuery { +impl Transaction for DomainTransferQuery { type Input = DomainTransferReq; type Output = DomainTransferResponse; diff --git a/epp-client/src/domain/update.rs b/epp-client/src/domain/update.rs index f359cce..8271c04 100644 --- a/epp-client/src/domain/update.rs +++ b/epp-client/src/domain/update.rs @@ -7,7 +7,7 @@ use crate::{ DomainAuthInfo, DomainContact, DomainStatus, ElementName, HostList, NoExtension, StringValue, }, - request::{EppExtension, EppRequest}, + request::{EppExtension, Transaction}, }; use super::XMLNS; @@ -21,7 +21,7 @@ pub struct DomainUpdate { extension: Option, } -impl EppRequest for DomainUpdate { +impl Transaction for DomainUpdate { type Input = DomainUpdateRequest; type Output = ResponseStatus; diff --git a/epp-client/src/host/check.rs b/epp-client/src/host/check.rs index 727ee5e..d9bfc0f 100644 --- a/epp-client/src/host/check.rs +++ b/epp-client/src/host/check.rs @@ -6,7 +6,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -15,7 +15,7 @@ pub struct HostCheck { extension: Option, } -impl EppRequest for HostCheck { +impl Transaction for HostCheck { type Input = HostCheckRequest; type Output = HostCheckResponse; diff --git a/epp-client/src/host/create.rs b/epp-client/src/host/create.rs index 922fc1f..85fde99 100644 --- a/epp-client/src/host/create.rs +++ b/epp-client/src/host/create.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, HostAddr, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -13,7 +13,7 @@ pub struct HostCreate { extension: Option, } -impl EppRequest for HostCreate { +impl Transaction for HostCreate { type Input = HostCreateRequest; type Output = HostCreateResponse; diff --git a/epp-client/src/host/delete.rs b/epp-client/src/host/delete.rs index 6be530a..63f8490 100644 --- a/epp-client/src/host/delete.rs +++ b/epp-client/src/host/delete.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use crate::response::ResponseStatus; use serde::{Deserialize, Serialize}; @@ -14,7 +14,7 @@ pub struct HostDelete { extension: Option, } -impl EppRequest for HostDelete { +impl Transaction for HostDelete { type Input = HostDeleteRequest; type Output = ResponseStatus; diff --git a/epp-client/src/host/info.rs b/epp-client/src/host/info.rs index 07dddc8..5c21b2b 100644 --- a/epp-client/src/host/info.rs +++ b/epp-client/src/host/info.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, HostAddr, HostStatus, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -13,7 +13,7 @@ pub struct HostInfo { extension: Option, } -impl EppRequest for HostInfo { +impl Transaction for HostInfo { type Input = HostInfoRequest; type Output = HostInfoResponse; diff --git a/epp-client/src/host/update.rs b/epp-client/src/host/update.rs index 6837573..09ba555 100644 --- a/epp-client/src/host/update.rs +++ b/epp-client/src/host/update.rs @@ -4,7 +4,7 @@ use epp_client_macros::*; use super::XMLNS; use crate::common::{ElementName, HostAddr, HostStatus, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use crate::response::ResponseStatus; use serde::{Deserialize, Serialize}; @@ -14,7 +14,7 @@ pub struct HostUpdate { extension: Option, } -impl EppRequest for HostUpdate { +impl Transaction for HostUpdate { type Input = HostUpdateRequest; type Output = ResponseStatus; diff --git a/epp-client/src/login.rs b/epp-client/src/login.rs index aefd1c9..6caad5b 100644 --- a/epp-client/src/login.rs +++ b/epp-client/src/login.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use crate::{ common::{ElementName, NoExtension, Options, ServiceExtension, Services, StringValue}, contact, domain, host, - request::{EppExtension, EppRequest, EPP_LANG, EPP_VERSION}, + request::{EppExtension, Transaction, EPP_LANG, EPP_VERSION}, response::ResponseStatus, }; @@ -16,7 +16,7 @@ pub struct Login { extension: Option, } -impl EppRequest for Login { +impl Transaction for Login { type Input = LoginRequest; type Output = ResponseStatus; diff --git a/epp-client/src/logout.rs b/epp-client/src/logout.rs index ae507b5..b10d835 100644 --- a/epp-client/src/logout.rs +++ b/epp-client/src/logout.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use crate::{ common::{ElementName, NoExtension}, - request::{EppExtension, EppRequest}, + request::{EppExtension, Transaction}, response::ResponseStatus, }; @@ -15,7 +15,7 @@ pub struct Logout { extension: Option, } -impl EppRequest for Logout { +impl Transaction for Logout { type Input = LogoutRequest; type Output = ResponseStatus; diff --git a/epp-client/src/message/ack.rs b/epp-client/src/message/ack.rs index 568c2b4..ba4ed0e 100644 --- a/epp-client/src/message/ack.rs +++ b/epp-client/src/message/ack.rs @@ -3,7 +3,7 @@ use epp_client_macros::*; use crate::common::{ElementName, NoExtension}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -12,7 +12,7 @@ pub struct MessageAck { extension: Option, } -impl EppRequest for MessageAck { +impl Transaction for MessageAck { type Input = MessageAckRequest; type Output = String; diff --git a/epp-client/src/message/poll.rs b/epp-client/src/message/poll.rs index feb4bf8..7f98613 100644 --- a/epp-client/src/message/poll.rs +++ b/epp-client/src/message/poll.rs @@ -3,7 +3,7 @@ use epp_client_macros::*; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::request::{EppExtension, EppRequest}; +use crate::request::{EppExtension, Transaction}; use serde::{Deserialize, Serialize}; #[derive(Debug)] @@ -12,7 +12,7 @@ pub struct MessagePoll { extension: Option, } -impl EppRequest for MessagePoll { +impl Transaction for MessagePoll { type Input = MessagePollRequest; type Output = MessagePollResponse; diff --git a/epp-client/src/request.rs b/epp-client/src/request.rs index f431ecd..e88044a 100644 --- a/epp-client/src/request.rs +++ b/epp-client/src/request.rs @@ -14,7 +14,7 @@ pub const EPP_VERSION: &str = "1.0"; pub const EPP_LANG: &str = "en"; /// Trait to set correct value for xml tags when tags are being generated from generic types -pub trait EppRequest: Sized + Debug { +pub trait Transaction: Sized + Debug { type Input: ElementName + Serialize + Sized + Debug; type Output: DeserializeOwned + Debug; diff --git a/epp-client/src/tests/de.rs b/epp-client/src/tests/de.rs index 8e9fb35..456bdf0 100644 --- a/epp-client/src/tests/de.rs +++ b/epp-client/src/tests/de.rs @@ -34,7 +34,7 @@ mod response { use crate::logout::Logout; use crate::message::ack::MessageAck; use crate::message::poll::MessagePoll; - use crate::request::EppRequest; + use crate::request::Transaction; use crate::response::ResultDocument; use crate::xml::EppXml; diff --git a/epp-client/src/tests/se.rs b/epp-client/src/tests/se.rs index 0f958e6..3bb60eb 100644 --- a/epp-client/src/tests/se.rs +++ b/epp-client/src/tests/se.rs @@ -45,7 +45,7 @@ mod request { use crate::logout::Logout; use crate::message::ack::MessageAck; use crate::message::poll::MessagePoll; - use crate::request::EppRequest; + use crate::request::Transaction; use crate::xml::EppXml; use chrono::{DateTime, NaiveDate}; use std::str::FromStr;