Align response type names with XML

This commit is contained in:
Dirkjan Ochtman 2023-02-27 14:40:30 +01:00
parent 6b2b9d1a7f
commit 844f84dbef
9 changed files with 20 additions and 20 deletions

View File

@ -10,7 +10,7 @@ use crate::request::{Command, Transaction};
impl<'a> Transaction<NoExtension> 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 &lt;creData&gt; 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")]

View File

@ -10,7 +10,7 @@ use crate::request::{Command, Transaction};
impl<'a> Transaction<NoExtension> 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 &lt;infData&gt; 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

View File

@ -10,7 +10,7 @@ use crate::request::{Command, Transaction};
impl<'a> Transaction<NoExtension> 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 &lt;chkData&gt; 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

View File

@ -10,7 +10,7 @@ use crate::request::{Command, Transaction};
impl<'a> Transaction<NoExtension> 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 &lt;infData&gt; 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

View File

@ -10,7 +10,7 @@ use crate::request::{Command, Transaction};
impl<'a> Transaction<NoExtension> 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 &lt;renData&gt; 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

View File

@ -10,7 +10,7 @@ use crate::request::{Command, Transaction};
impl<'a> Transaction<NoExtension> 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 &lt;trnData&gt; 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

View File

@ -12,7 +12,7 @@ use crate::request::{Command, Transaction};
impl<'a> Transaction<NoExtension> 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 &lt;creData&gt; 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

View File

@ -13,7 +13,7 @@ use crate::request::{Command, Transaction};
impl<'a> Transaction<NoExtension> 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 &lt;infData&gt; 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

View File

@ -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<NoExtension> for MessagePoll<'a> {}
@ -38,9 +38,9 @@ impl Default for MessagePoll<'static> {
#[xml(forward)]
pub enum MessagePollResponse {
/// Data under the &lt;domain:trnData&gt; tag
DomainTransfer(DomainTransferResponseData),
DomainTransfer(TransferData),
/// Data under the &lt;host:infData&gt; tag
HostInfo(HostInfoResponseData),
HostInfo(InfoData),
/// Data under the &lt;lowbalance&gt; tag
LowBalance(LowBalance),
}