From 844f84dbef0653f7f558bc54efb82be3b7b6f062 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 27 Feb 2023 14:40:30 +0100 Subject: [PATCH] Align response type names with XML --- src/contact/create.rs | 4 ++-- src/contact/info.rs | 4 ++-- src/domain/create.rs | 4 ++-- src/domain/info.rs | 4 ++-- src/domain/renew.rs | 4 ++-- src/domain/transfer.rs | 4 ++-- src/host/create.rs | 4 ++-- src/host/info.rs | 4 ++-- src/message/poll.rs | 8 ++++---- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/contact/create.rs b/src/contact/create.rs index be398cf..973400a 100644 --- a/src/contact/create.rs +++ b/src/contact/create.rs @@ -10,7 +10,7 @@ use crate::request::{Command, Transaction}; impl<'a> Transaction for ContactCreate<'a> {} impl<'a> Command for ContactCreate<'a> { - type Response = ContactCreateData; + type Response = CreateData; const COMMAND: &'static str = "create"; } @@ -73,7 +73,7 @@ impl<'a> ContactCreate<'a> { /// Type that represents the <creData> tag for contact create response #[derive(Debug, FromXml)] #[xml(rename = "creData", ns(XMLNS))] -pub struct ContactCreateData { +pub struct CreateData { /// The contact id pub id: String, #[xml(rename = "crDate")] diff --git a/src/contact/info.rs b/src/contact/info.rs index 0e97abb..d71eba9 100644 --- a/src/contact/info.rs +++ b/src/contact/info.rs @@ -10,7 +10,7 @@ use crate::request::{Command, Transaction}; impl<'a> Transaction for ContactInfo<'a> {} impl<'a> Command for ContactInfo<'a> { - type Response = ContactInfoData; + type Response = InfoData; const COMMAND: &'static str = "info"; } @@ -50,7 +50,7 @@ impl<'a> ContactInfo<'a> { /// Type that represents the <infData> tag for contact check response #[derive(Debug, FromXml)] #[xml(rename = "infData", ns(XMLNS))] -pub struct ContactInfoData { +pub struct InfoData { /// The contact id pub id: String, /// The contact ROID diff --git a/src/domain/create.rs b/src/domain/create.rs index a181374..63f18e5 100644 --- a/src/domain/create.rs +++ b/src/domain/create.rs @@ -10,7 +10,7 @@ use crate::request::{Command, Transaction}; impl<'a> Transaction for DomainCreate<'a> {} impl<'a> Command for DomainCreate<'a> { - type Response = DomainCreateResponse; + type Response = CreateData; const COMMAND: &'static str = "create"; } @@ -72,7 +72,7 @@ impl<'a> DomainCreate<'a> { /// Type that represents the <chkData> tag for domain create response #[derive(Debug, FromXml)] #[xml(rename = "creData", ns(XMLNS))] -pub struct DomainCreateResponse { +pub struct CreateData { /// The domain name pub name: String, /// The creation date diff --git a/src/domain/info.rs b/src/domain/info.rs index da4f4c9..f7912c6 100644 --- a/src/domain/info.rs +++ b/src/domain/info.rs @@ -10,7 +10,7 @@ use crate::request::{Command, Transaction}; impl<'a> Transaction for DomainInfo<'a> {} impl<'a> Command for DomainInfo<'a> { - type Response = DomainInfoResponse; + type Response = InfoData; const COMMAND: &'static str = "info"; } @@ -75,7 +75,7 @@ pub struct DomainNsList { /// Type that represents the <infData> tag for domain info response #[derive(Debug, FromXml)] #[xml(rename = "infData", ns(XMLNS))] -pub struct DomainInfoResponse { +pub struct InfoData { /// The domain name pub name: String, /// The domain ROID diff --git a/src/domain/renew.rs b/src/domain/renew.rs index 334e68b..965226f 100644 --- a/src/domain/renew.rs +++ b/src/domain/renew.rs @@ -10,7 +10,7 @@ use crate::request::{Command, Transaction}; impl<'a> Transaction for DomainRenew<'a> {} impl<'a> Command for DomainRenew<'a> { - type Response = DomainRenewResponse; + type Response = RenewData; const COMMAND: &'static str = "renew"; } @@ -55,7 +55,7 @@ pub struct DomainRenew<'a> { /// Type that represents the <renData> tag for domain renew response #[derive(Debug, FromXml)] #[xml(rename = "renData", ns(XMLNS))] -pub struct DomainRenewResponse { +pub struct RenewData { /// The name of the domain pub name: String, /// The new expiry date after renewal diff --git a/src/domain/transfer.rs b/src/domain/transfer.rs index 8357c3d..c1efd73 100644 --- a/src/domain/transfer.rs +++ b/src/domain/transfer.rs @@ -10,7 +10,7 @@ use crate::request::{Command, Transaction}; impl<'a> Transaction for DomainTransfer<'a> {} impl<'a> Command for DomainTransfer<'a> { - type Response = DomainTransferResponseData; + type Response = TransferData; const COMMAND: &'static str = "transfer"; } @@ -96,7 +96,7 @@ pub struct DomainTransfer<'a> { /// Type that represents the <trnData> tag for domain transfer response #[derive(Debug, FromXml)] #[xml(rename = "trnData", ns(XMLNS))] -pub struct DomainTransferResponseData { +pub struct TransferData { /// The domain name pub name: String, /// The domain transfer status diff --git a/src/host/create.rs b/src/host/create.rs index 0c5f11f..cbd0062 100644 --- a/src/host/create.rs +++ b/src/host/create.rs @@ -12,7 +12,7 @@ use crate::request::{Command, Transaction}; impl<'a> Transaction for HostCreate<'a> {} impl<'a> Command for HostCreate<'a> { - type Response = HostCreateData; + type Response = CreateData; const COMMAND: &'static str = "create"; } @@ -50,7 +50,7 @@ pub struct HostCreate<'a> { /// Type that represents the <creData> tag for host create response #[derive(Debug, FromXml)] #[xml(rename = "creData", ns(XMLNS))] -pub struct HostCreateData { +pub struct CreateData { /// The host name pub name: String, /// The host creation date diff --git a/src/host/info.rs b/src/host/info.rs index fbaf743..867dd11 100644 --- a/src/host/info.rs +++ b/src/host/info.rs @@ -13,7 +13,7 @@ use crate::request::{Command, Transaction}; impl<'a> Transaction for HostInfo<'a> {} impl<'a> Command for HostInfo<'a> { - type Response = HostInfoResponseData; + type Response = InfoData; const COMMAND: &'static str = "info"; } @@ -49,7 +49,7 @@ pub struct HostInfo<'a> { /// Type that represents the <infData> tag for host info response #[derive(Debug, FromXml)] #[xml(rename = "infData", ns(XMLNS))] -pub struct HostInfoResponseData { +pub struct InfoData { /// The host name pub name: String, /// The host ROID diff --git a/src/message/poll.rs b/src/message/poll.rs index 3ec2a07..11f92b6 100644 --- a/src/message/poll.rs +++ b/src/message/poll.rs @@ -1,9 +1,9 @@ use instant_xml::{FromXml, ToXml}; use crate::common::{NoExtension, EPP_XMLNS}; -use crate::domain::transfer::DomainTransferResponseData; +use crate::domain::transfer::TransferData; use crate::extensions::low_balance::LowBalance; -use crate::host::info::HostInfoResponseData; +use crate::host::info::InfoData; use crate::request::{Command, Transaction}; impl<'a> Transaction for MessagePoll<'a> {} @@ -38,9 +38,9 @@ impl Default for MessagePoll<'static> { #[xml(forward)] pub enum MessagePollResponse { /// Data under the <domain:trnData> tag - DomainTransfer(DomainTransferResponseData), + DomainTransfer(TransferData), /// Data under the <host:infData> tag - HostInfo(HostInfoResponseData), + HostInfo(InfoData), /// Data under the <lowbalance> tag LowBalance(LowBalance), }