Remove type aliases for ContactStatus
This commit is contained in:
parent
95e21eb9ea
commit
93f8e0e8c8
|
@ -79,11 +79,6 @@ pub struct Services {
|
||||||
pub svc_ext: Option<ServiceExtension>,
|
pub svc_ext: Option<ServiceExtension>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The <status> attribute on EPP XML for domain transactions
|
|
||||||
pub type DomainStatus = ContactStatus;
|
|
||||||
/// The <status> attribute on EPP XML for host transactions
|
|
||||||
pub type HostStatus = ContactStatus;
|
|
||||||
|
|
||||||
/// The <hostAddr> types domain or host transactions
|
/// The <hostAddr> types domain or host transactions
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct HostAddr {
|
pub struct HostAddr {
|
||||||
|
@ -121,7 +116,7 @@ impl HostAddr {
|
||||||
|
|
||||||
/// The <status> type on contact transactions
|
/// The <status> type on contact transactions
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
pub struct ContactStatus {
|
pub struct ObjectStatus {
|
||||||
/// The status name, represented by the 's' attr on <status> tags
|
/// The status name, represented by the 's' attr on <status> tags
|
||||||
#[serde(rename = "s")]
|
#[serde(rename = "s")]
|
||||||
pub status: String,
|
pub status: String,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Types for EPP contact info request
|
//! Types for EPP contact info request
|
||||||
|
|
||||||
use super::XMLNS;
|
use super::XMLNS;
|
||||||
use crate::common::{ContactAuthInfo, ContactStatus, NoExtension, Phone, PostalInfo, StringValue};
|
use crate::common::{ContactAuthInfo, NoExtension, ObjectStatus, Phone, PostalInfo, StringValue};
|
||||||
use crate::request::{Command, Transaction};
|
use crate::request::{Command, Transaction};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ pub struct ContactInfoData {
|
||||||
pub roid: StringValue,
|
pub roid: StringValue,
|
||||||
/// The list of contact statuses
|
/// The list of contact statuses
|
||||||
#[serde(rename = "status")]
|
#[serde(rename = "status")]
|
||||||
pub statuses: Vec<ContactStatus>,
|
pub statuses: Vec<ObjectStatus>,
|
||||||
/// The postal info for the contact
|
/// The postal info for the contact
|
||||||
#[serde(rename = "postalInfo")]
|
#[serde(rename = "postalInfo")]
|
||||||
pub postal_info: PostalInfo,
|
pub postal_info: PostalInfo,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Types for EPP contact create request
|
//! Types for EPP contact create request
|
||||||
|
|
||||||
use super::XMLNS;
|
use super::XMLNS;
|
||||||
use crate::common::{ContactAuthInfo, ContactStatus, NoExtension, Phone, PostalInfo, StringValue};
|
use crate::common::{ContactAuthInfo, NoExtension, ObjectStatus, Phone, PostalInfo, StringValue};
|
||||||
use crate::request::{Command, Transaction};
|
use crate::request::{Command, Transaction};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
@ -50,12 +50,12 @@ impl ContactUpdate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the data for the <add> tag for the contact update request
|
/// Sets the data for the <add> tag for the contact update request
|
||||||
pub fn add(&mut self, statuses: Vec<ContactStatus>) {
|
pub fn add(&mut self, statuses: Vec<ObjectStatus>) {
|
||||||
self.contact.add_statuses = Some(StatusList { status: statuses });
|
self.contact.add_statuses = Some(StatusList { status: statuses });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the data for the <rem> tag for the contact update request
|
/// Sets the data for the <rem> tag for the contact update request
|
||||||
pub fn remove(&mut self, statuses: Vec<ContactStatus>) {
|
pub fn remove(&mut self, statuses: Vec<ObjectStatus>) {
|
||||||
self.contact.remove_statuses = Some(StatusList { status: statuses });
|
self.contact.remove_statuses = Some(StatusList { status: statuses });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ pub struct ContactChangeInfo {
|
||||||
#[derive(Serialize, Debug)]
|
#[derive(Serialize, Debug)]
|
||||||
pub struct StatusList {
|
pub struct StatusList {
|
||||||
#[serde(rename = "contact:status", alias = "status")]
|
#[serde(rename = "contact:status", alias = "status")]
|
||||||
status: Vec<ContactStatus>,
|
status: Vec<ObjectStatus>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Type for elements under the contact <update> tag
|
/// Type for elements under the contact <update> tag
|
||||||
|
@ -108,7 +108,7 @@ pub struct ContactUpdate {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::ContactUpdate;
|
use super::ContactUpdate;
|
||||||
use crate::common::{Address, ContactStatus, NoExtension, Phone, PostalInfo};
|
use crate::common::{Address, NoExtension, ObjectStatus, Phone, PostalInfo};
|
||||||
use crate::request::Transaction;
|
use crate::request::Transaction;
|
||||||
use crate::tests::{get_xml, CLTRID, SUCCESS_MSG, SVTRID};
|
use crate::tests::{get_xml, CLTRID, SUCCESS_MSG, SVTRID};
|
||||||
|
|
||||||
|
@ -124,11 +124,11 @@ mod tests {
|
||||||
let voice = Phone::new("+33.47237942");
|
let voice = Phone::new("+33.47237942");
|
||||||
|
|
||||||
object.set_info("newemail@eppdev.net", postal_info, voice, "eppdev-387323");
|
object.set_info("newemail@eppdev.net", postal_info, voice, "eppdev-387323");
|
||||||
let add_statuses = vec![ContactStatus {
|
let add_statuses = vec![ObjectStatus {
|
||||||
status: "clientTransferProhibited".to_string(),
|
status: "clientTransferProhibited".to_string(),
|
||||||
}];
|
}];
|
||||||
object.add(add_statuses);
|
object.add(add_statuses);
|
||||||
let remove_statuses = vec![ContactStatus {
|
let remove_statuses = vec![ObjectStatus {
|
||||||
status: "clientDeleteProhibited".to_string(),
|
status: "clientDeleteProhibited".to_string(),
|
||||||
}];
|
}];
|
||||||
object.remove(remove_statuses);
|
object.remove(remove_statuses);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Types for EPP domain info request
|
//! Types for EPP domain info request
|
||||||
|
|
||||||
use super::{DomainAuthInfo, DomainContact, HostAttr, XMLNS};
|
use super::{DomainAuthInfo, DomainContact, HostAttr, XMLNS};
|
||||||
use crate::common::{DomainStatus, NoExtension, StringValue};
|
use crate::common::{NoExtension, ObjectStatus, StringValue};
|
||||||
use crate::request::{Command, Transaction};
|
use crate::request::{Command, Transaction};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ pub struct DomainInfoResponseData {
|
||||||
pub roid: StringValue,
|
pub roid: StringValue,
|
||||||
/// The list of domain statuses
|
/// The list of domain statuses
|
||||||
#[serde(rename = "status")]
|
#[serde(rename = "status")]
|
||||||
pub statuses: Option<Vec<DomainStatus>>,
|
pub statuses: Option<Vec<ObjectStatus>>,
|
||||||
/// The domain registrant
|
/// The domain registrant
|
||||||
pub registrant: Option<StringValue>,
|
pub registrant: Option<StringValue>,
|
||||||
/// The list of domain contacts
|
/// The list of domain contacts
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//!
|
//!
|
||||||
use super::{DomainAuthInfo, DomainContact, HostList, XMLNS};
|
use super::{DomainAuthInfo, DomainContact, HostList, XMLNS};
|
||||||
use crate::{
|
use crate::{
|
||||||
common::{DomainStatus, NoExtension, StringValue},
|
common::{NoExtension, ObjectStatus, StringValue},
|
||||||
request::{Command, Transaction},
|
request::{Command, Transaction},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ pub struct DomainAddRemove {
|
||||||
pub contacts: Option<Vec<DomainContact>>,
|
pub contacts: Option<Vec<DomainContact>>,
|
||||||
/// The list of statuses to add to or remove from the domain
|
/// The list of statuses to add to or remove from the domain
|
||||||
#[serde(rename = "domain:status", alias = "status")]
|
#[serde(rename = "domain:status", alias = "status")]
|
||||||
pub statuses: Option<Vec<DomainStatus>>,
|
pub statuses: Option<Vec<ObjectStatus>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Type for elements under the <update> tag for domain update
|
/// Type for elements under the <update> tag for domain update
|
||||||
|
@ -102,7 +102,7 @@ pub struct DomainUpdate {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{DomainAddRemove, DomainAuthInfo, DomainChangeInfo, DomainContact, DomainUpdate};
|
use super::{DomainAddRemove, DomainAuthInfo, DomainChangeInfo, DomainContact, DomainUpdate};
|
||||||
use crate::common::{DomainStatus, NoExtension};
|
use crate::common::{NoExtension, ObjectStatus};
|
||||||
use crate::request::Transaction;
|
use crate::request::Transaction;
|
||||||
use crate::tests::{get_xml, CLTRID, SUCCESS_MSG, SVTRID};
|
use crate::tests::{get_xml, CLTRID, SUCCESS_MSG, SVTRID};
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ mod tests {
|
||||||
let add = DomainAddRemove {
|
let add = DomainAddRemove {
|
||||||
ns: None,
|
ns: None,
|
||||||
contacts: None,
|
contacts: None,
|
||||||
statuses: Some(vec![DomainStatus {
|
statuses: Some(vec![ObjectStatus {
|
||||||
status: "clientDeleteProhibited".to_string(),
|
status: "clientDeleteProhibited".to_string(),
|
||||||
}]),
|
}]),
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Types for EPP host info request
|
//! Types for EPP host info request
|
||||||
|
|
||||||
use super::XMLNS;
|
use super::XMLNS;
|
||||||
use crate::common::{HostAddr, HostStatus, NoExtension, StringValue};
|
use crate::common::{HostAddr, NoExtension, ObjectStatus, StringValue};
|
||||||
use crate::request::{Command, Transaction};
|
use crate::request::{Command, Transaction};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ pub struct HostInfoResponseData {
|
||||||
pub roid: StringValue,
|
pub roid: StringValue,
|
||||||
/// The list of host statuses
|
/// The list of host statuses
|
||||||
#[serde(rename = "status")]
|
#[serde(rename = "status")]
|
||||||
pub statuses: Vec<HostStatus>,
|
pub statuses: Vec<ObjectStatus>,
|
||||||
/// The list of host IP addresses
|
/// The list of host IP addresses
|
||||||
#[serde(rename = "addr")]
|
#[serde(rename = "addr")]
|
||||||
pub addresses: Vec<HostAddr>,
|
pub addresses: Vec<HostAddr>,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Types for EPP host update request
|
//! Types for EPP host update request
|
||||||
|
|
||||||
use super::XMLNS;
|
use super::XMLNS;
|
||||||
use crate::common::{HostAddr, HostStatus, NoExtension, StringValue};
|
use crate::common::{HostAddr, NoExtension, ObjectStatus, StringValue};
|
||||||
use crate::request::{Command, Transaction};
|
use crate::request::{Command, Transaction};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ pub struct HostAddRemove {
|
||||||
pub addresses: Option<Vec<HostAddr>>,
|
pub addresses: Option<Vec<HostAddr>>,
|
||||||
/// The statuses to be added to or removed from the host
|
/// The statuses to be added to or removed from the host
|
||||||
#[serde(rename = "host:status", alias = "status")]
|
#[serde(rename = "host:status", alias = "status")]
|
||||||
pub statuses: Option<Vec<HostStatus>>,
|
pub statuses: Option<Vec<ObjectStatus>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Type for data under the host <update> tag
|
/// Type for data under the host <update> tag
|
||||||
|
@ -91,7 +91,7 @@ pub struct HostUpdate {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{HostAddRemove, HostChangeInfo, HostUpdate};
|
use super::{HostAddRemove, HostChangeInfo, HostUpdate};
|
||||||
use crate::common::{HostAddr, HostStatus, NoExtension};
|
use crate::common::{HostAddr, NoExtension, ObjectStatus};
|
||||||
use crate::request::Transaction;
|
use crate::request::Transaction;
|
||||||
use crate::tests::{get_xml, CLTRID, SUCCESS_MSG, SVTRID};
|
use crate::tests::{get_xml, CLTRID, SUCCESS_MSG, SVTRID};
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ mod tests {
|
||||||
|
|
||||||
let remove = HostAddRemove {
|
let remove = HostAddRemove {
|
||||||
addresses: None,
|
addresses: None,
|
||||||
statuses: Some(vec![HostStatus {
|
statuses: Some(vec![ObjectStatus {
|
||||||
status: "clientDeleteProhibited".to_string(),
|
status: "clientDeleteProhibited".to_string(),
|
||||||
}]),
|
}]),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue