fixed comments for rustdoc

This commit is contained in:
Ritesh Chitlangi 2021-07-27 03:27:18 +08:00
parent 402b0da353
commit 1b4cf39c69
45 changed files with 295 additions and 285 deletions

View File

@ -1,9 +1,9 @@
//! Macros for the EPP Client Library for the Extensible Provisioning Protocol (EPP). //! # Macros for the epp-client Library.
//! //!
//! ## Description //! ## Description
//! //!
//! epp-client is a client library for Internet domain registration and management for domain registrars. //! `epp-client` is a client library for Internet domain registration and management for domain registrars.
//! This macro crate contains a fe macros to simplify serialization of generic types used in some places //! This macro crate contains a few macros to simplify serialization of generic types used in some places
//! in the `epp-client` library //! in the `epp-client` library
//! //!

View File

@ -79,7 +79,7 @@ async fn connect(registry: &'static str) -> Result<EppClient, Box<dyn Error>> {
Ok(client) Ok(client)
} }
/// Instances of the EppClient type are used to transact with the registry /// Instances of the EppClient type are used to transact with the registry.
/// Once initialized, the EppClient instance can serialize EPP requests to XML and send them /// Once initialized, the EppClient instance can serialize EPP requests to XML and send them
/// to the registry and deserialize the XML responses from the registry to local types /// to the registry and deserialize the XML responses from the registry to local types
pub struct EppClient { pub struct EppClient {
@ -133,7 +133,7 @@ impl EppClient {
Ok(client) Ok(client)
} }
/// Executes an EPP Hello call and return the response as an `EppGreeting` /// Executes an EPP Hello call and returns the response as an `EppGreeting`
pub async fn hello(&mut self) -> Result<EppGreeting, Box<dyn Error>> { pub async fn hello(&mut self) -> Result<EppGreeting, Box<dyn Error>> {
let hello = EppHello::new(); let hello = EppHello::new();
let hello_xml = hello.serialize()?; let hello_xml = hello.serialize()?;
@ -162,7 +162,7 @@ impl EppClient {
} }
/// Accepts raw EPP XML and returns the raw EPP XML response to it. /// Accepts raw EPP XML and returns the raw EPP XML response to it.
/// Not recommended to use directly but sometimes can be useful for debugging /// Not recommended for direct use but sometimes can be useful for debugging
pub async fn transact_xml(&mut self, xml: &str) -> Result<String, Box<dyn Error>> { pub async fn transact_xml(&mut self, xml: &str) -> Result<String, Box<dyn Error>> {
self.connection.transact(&xml).await self.connection.transact(&xml).await
} }
@ -172,7 +172,7 @@ impl EppClient {
return String::from(&self.connection.greeting) return String::from(&self.connection.greeting)
} }
/// Returns the greeting received on establishment of the connection as an `EppGreeting` instance /// Returns the greeting received on establishment of the connection as an `EppGreeting`
pub fn greeting(&self) -> Result<EppGreeting, error::Error> { pub fn greeting(&self) -> Result<EppGreeting, error::Error> {
EppGreeting::deserialize(&self.connection.greeting) EppGreeting::deserialize(&self.connection.greeting)
} }

View File

@ -51,12 +51,12 @@ pub trait ElementName {
#[derive(Deserialize, Debug, PartialEq)] #[derive(Deserialize, Debug, PartialEq)]
#[serde(rename = "epp")] #[serde(rename = "epp")]
pub struct EppObject<T: ElementName> { pub struct EppObject<T: ElementName> {
/// XML namespace for the <epp> tag /// XML namespace for the &lt;epp&gt; tag
pub xmlns: String, pub xmlns: String,
/// Schema namespace for the <epp> tag /// Schema namespace for the &lt;epp&gt; tag
#[serde(rename = "xmlns:xsi")] #[serde(rename = "xmlns:xsi")]
pub xmlns_xsi: String, pub xmlns_xsi: String,
/// Schema location attribute for <epp> /// Schema location attribute for &lt;epp&gt;
#[serde(rename = "xsi:schemaLocation")] #[serde(rename = "xsi:schemaLocation")]
pub xsi_schema_location: String, pub xsi_schema_location: String,
/// the request or response object that is set or received in the EPP XML document /// the request or response object that is set or received in the EPP XML document
@ -123,7 +123,7 @@ pub struct Services {
} }
impl<T: ElementName> EppObject<T> { impl<T: ElementName> EppObject<T> {
/// Create the enclosing EPP XML tag <epp> for data that represents an EPP XML request or response /// Create the enclosing EPP XML tag &lt;epp&gt; for data that represents an EPP XML request or response
pub fn build(data: T) -> EppObject<T> { pub fn build(data: T) -> EppObject<T> {
EppObject { EppObject {
// xml: None, // xml: None,

View File

@ -3,12 +3,12 @@
use crate::epp::object::{StringValue, StringValueTrait}; use crate::epp::object::{StringValue, StringValueTrait};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// The <status> attribute on EPP XML for domain transactions /// The &lt;status&gt; attribute on EPP XML for domain transactions
pub type DomainStatus = ContactStatus; pub type DomainStatus = ContactStatus;
/// The <status> attribute on EPP XML for host transactions /// The &lt;status&gt; attribute on EPP XML for host transactions
pub type HostStatus = ContactStatus; pub type HostStatus = ContactStatus;
/// The <hostAddr> types domain or host transactions /// The &lt;hostAddr&gt; types domain or host transactions
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostAddr { pub struct HostAddr {
#[serde(rename = "ip")] #[serde(rename = "ip")]
@ -43,44 +43,44 @@ impl HostAddr {
} }
} }
/// The <host> type for host transactions /// The &lt;host&gt; type for host transactions
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Host { pub struct Host {
/// The <hostName> tag /// The &lt;hostName&gt; tag
pub name: StringValue, pub name: StringValue,
/// The <hostAddr> tags /// The &lt;hostAddr&gt; tags
#[serde(rename = "addr")] #[serde(rename = "addr")]
pub addresses: Option<Vec<HostAddr>>, pub addresses: Option<Vec<HostAddr>>,
} }
/// The <hostAttr> type for domain transactions /// The &lt;hostAttr&gt; type for domain transactions
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostAttr { pub struct HostAttr {
/// The <hostName> tag /// The &lt;hostName&gt; tag
#[serde(rename = "hostName")] #[serde(rename = "hostName")]
pub name: StringValue, pub name: StringValue,
/// The <hostAddr> tags /// The &lt;hostAddr&gt; tags
#[serde(rename = "hostAddr")] #[serde(rename = "hostAddr")]
pub addresses: Option<Vec<HostAddr>>, pub addresses: Option<Vec<HostAddr>>,
} }
/// The list of <hostAttr> types for domain transactions. Typically under an <ns> tag /// The list of &lt;hostAttr&gt; types for domain transactions. Typically under an &lt;ns&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostAttrList { pub struct HostAttrList {
/// The list of <hostAttr> tags /// The list of &lt;hostAttr&gt; tags
#[serde(rename = "hostAttr")] #[serde(rename = "hostAttr")]
pub hosts: Vec<HostAttr>, pub hosts: Vec<HostAttr>,
} }
/// The list of <hostObj> types for domain transactions. Typically under an <ns> tag /// The list of &lt;hostObj&gt; types for domain transactions. Typically under an &lt;ns&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostObjList { pub struct HostObjList {
/// The list of <hostObj> tags /// The list of &lt;hostObj&gt; tags
#[serde(rename = "hostObj")] #[serde(rename = "hostObj")]
pub hosts: Vec<StringValue>, pub hosts: Vec<StringValue>,
} }
/// The <contact> type on domain creation and update requests /// The &lt;contact&gt; type on domain creation and update requests
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainContact { pub struct DomainContact {
/// The contact id /// The contact id
@ -91,7 +91,7 @@ pub struct DomainContact {
pub contact_type: String, pub contact_type: String,
} }
/// The <period> type for registration, renewal or transfer on domain transactions /// The &lt;period&gt; type for registration, renewal or transfer on domain transactions
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Period { pub struct Period {
/// The interval (usually 'y' indicating years) /// The interval (usually 'y' indicating years)
@ -116,63 +116,63 @@ impl Period {
} }
} }
/// The <status> type on contact transactions /// The &lt;status&gt; type on contact transactions
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactStatus { pub struct ContactStatus {
/// The status name, represented by the 's' attr on <status> tags /// The status name, represented by the 's' attr on &lt;status&gt; tags
#[serde(rename = "s")] #[serde(rename = "s")]
pub status: String, pub status: String,
} }
/// The data for <voice> and <fax> types on domain transactions /// The data for &lt;voice&gt; and &lt;fax&gt; types on domain transactions
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Phone { pub struct Phone {
/// The inner text on the <voice> and <fax> tags /// The inner text on the &lt;voice&gt; and &lt;fax&gt; tags
#[serde(rename = "$value")] #[serde(rename = "$value")]
pub number: String, pub number: String,
/// The value of the 'x' attr on <voice> and <fax> tags /// The value of the 'x' attr on &lt;voice&gt; and &lt;fax&gt; tags
#[serde(rename = "x")] #[serde(rename = "x")]
pub extension: Option<String>, pub extension: Option<String>,
} }
/// The <addr> type on contact transactions /// The &lt;addr&gt; type on contact transactions
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Address { pub struct Address {
/// The <street> tags under <addr> /// The &lt;street&gt; tags under &lt;addr&gt;
pub street: Vec<StringValue>, pub street: Vec<StringValue>,
/// The <city> tag under <addr> /// The &lt;city&gt; tag under &lt;addr&gt;
pub city: StringValue, pub city: StringValue,
/// The <sp> tag under <addr> /// The &lt;sp&gt; tag under &lt;addr&gt;
#[serde(rename = "sp")] #[serde(rename = "sp")]
pub province: StringValue, pub province: StringValue,
/// The <pc> tag under <addr> /// The &lt;pc&gt; tag under &lt;addr&gt;
#[serde(rename = "pc")] #[serde(rename = "pc")]
pub postal_code: StringValue, pub postal_code: StringValue,
/// The <cc> tag under <addr> /// The &lt;cc&gt; tag under &lt;addr&gt;
#[serde(rename = "cc")] #[serde(rename = "cc")]
pub country_code: StringValue, pub country_code: StringValue,
} }
/// The <postalInfo> type on contact transactions /// The &lt;postalInfo&gt; type on contact transactions
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
pub struct PostalInfo { pub struct PostalInfo {
/// The 'type' attr on <postalInfo> /// The 'type' attr on &lt;postalInfo&gt;
#[serde(rename = "type")] #[serde(rename = "type")]
pub info_type: String, pub info_type: String,
/// The <name> tag under <postalInfo> /// The &lt;name&gt; tag under &lt;postalInfo&gt;
pub name: StringValue, pub name: StringValue,
/// The <org> tag under <postalInfo> /// The &lt;org&gt; tag under &lt;postalInfo&gt;
#[serde(rename = "org")] #[serde(rename = "org")]
pub organization: StringValue, pub organization: StringValue,
/// The <addr> tag under <postalInfo> /// The &lt;addr&gt; tag under &lt;postalInfo&gt;
#[serde(rename = "addr")] #[serde(rename = "addr")]
pub address: Address, pub address: Address,
} }
/// The <authInfo> tag for domain and contact transactions /// The &lt;authInfo&gt; tag for domain and contact transactions
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
pub struct AuthInfo { pub struct AuthInfo {
/// The <pw> tag under <authInfo> /// The &lt;pw&gt; tag under &lt;authInfo&gt;
#[serde(rename = "pw")] #[serde(rename = "pw")]
pub password: StringValue, pub password: StringValue,
} }

View File

@ -24,9 +24,9 @@ pub type EppLogout = EppObject<Command<Logout>>;
#[derive(Deserialize, Debug, PartialEq, ElementName)] #[derive(Deserialize, Debug, PartialEq, ElementName)]
#[element_name(name = "command")] #[element_name(name = "command")]
/// Type corresponding to the <command> tag in an EPP XML request /// Type corresponding to the &lt;command&gt; tag in an EPP XML request
pub struct Command<T: ElementName> { pub struct Command<T: ElementName> {
/// The instance that will be used to populate the <command> tag /// The instance that will be used to populate the &lt;command&gt; tag
pub command: T, pub command: T,
/// The client TRID /// The client TRID
#[serde(rename = "clTRID")] #[serde(rename = "clTRID")]
@ -67,7 +67,7 @@ impl EppHello {
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)] #[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
#[element_name(name = "login")] #[element_name(name = "login")]
/// Type corresponding to the <login> tag in an EPP XML login request /// Type corresponding to the &lt;login&gt; tag in an EPP XML login request
pub struct Login { pub struct Login {
/// The username to use for the login /// The username to use for the login
#[serde(rename(serialize = "clID", deserialize = "clID"))] #[serde(rename(serialize = "clID", deserialize = "clID"))]
@ -135,7 +135,7 @@ impl EppLogin {
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)] #[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
#[element_name(name = "logout")] #[element_name(name = "logout")]
/// Type corresponding to the <logout> tag in an EPP XML logout request /// Type corresponding to the &lt;logout&gt; tag in an EPP XML logout request
pub struct Logout; pub struct Logout;
impl EppLogout { impl EppLogout {

View File

@ -7,7 +7,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_CONTACT_XMLNS; use crate::epp::xml::EPP_CONTACT_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for contact <check> command /// Type that represents the &lt;epp&gt; request for contact &lt;check&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -39,10 +39,10 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppContactCheck = EppObject<Command<ContactCheck>>; pub type EppContactCheck = EppObject<Command<ContactCheck>>;
/// Type that represents the <check> command for contact transactions /// Type that represents the &lt;check&gt; command for contact transactions
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactList { pub struct ContactList {
/// The XML namespace for the contact <check> /// The XML namespace for the contact &lt;check&gt;
xmlns: String, xmlns: String,
/// The list of contact ids to check for availability /// The list of contact ids to check for availability
#[serde(rename = "id")] #[serde(rename = "id")]
@ -51,15 +51,15 @@ pub struct ContactList {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "check")] #[element_name(name = "check")]
/// The <command> type for contact check command /// The &lt;command&gt; type for contact check command
pub struct ContactCheck { pub struct ContactCheck {
/// The <check> tag for the contact check command /// The &lt;check&gt; tag for the contact check command
#[serde(rename = "check")] #[serde(rename = "check")]
list: ContactList, list: ContactList,
} }
impl EppContactCheck { impl EppContactCheck {
/// Creates an EppObject corresponding to the <epp> tag with data for a contact check request /// Creates an EppObject corresponding to the &lt;epp&gt; tag with data for a contact check request
pub fn new(contact_ids: Vec<&str>, client_tr_id: &str) -> EppContactCheck { pub fn new(contact_ids: Vec<&str>, client_tr_id: &str) -> EppContactCheck {
let contact_ids = contact_ids let contact_ids = contact_ids
.iter() .iter()

View File

@ -8,7 +8,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_CONTACT_XMLNS; use crate::epp::xml::EPP_CONTACT_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for contact <create> command /// Type that represents the &lt;epp&gt; request for contact &lt;create&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -55,38 +55,38 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppContactCreate = EppObject<Command<ContactCreate>>; pub type EppContactCreate = EppObject<Command<ContactCreate>>;
/// Type for elements under the contact <create> tag /// Type for elements under the contact &lt;create&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Contact { pub struct Contact {
/// XML namespace for contact commands /// XML namespace for contact commands
xmlns: String, xmlns: String,
/// Contact <id> tag /// Contact &lt;id&gt; tag
id: StringValue, id: StringValue,
/// Contact <postalInfo> tag /// Contact &lt;postalInfo&gt; tag
#[serde(rename = "postalInfo")] #[serde(rename = "postalInfo")]
postal_info: data::PostalInfo, postal_info: data::PostalInfo,
/// Contact <voice> tag /// Contact &lt;voice&gt; tag
voice: data::Phone, voice: data::Phone,
/// Contact <fax> tag, /// Contact &lt;fax&gt; tag,
fax: Option<data::Phone>, fax: Option<data::Phone>,
/// Contact <email> tag /// Contact &lt;email&gt; tag
email: StringValue, email: StringValue,
/// Contact <authInfo> tag /// Contact &lt;authInfo&gt; tag
#[serde(rename = "authInfo")] #[serde(rename = "authInfo")]
auth_info: data::AuthInfo, auth_info: data::AuthInfo,
} }
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "create")] #[element_name(name = "create")]
/// Type for EPP XML <create> command for contacts /// Type for EPP XML &lt;create&gt; command for contacts
pub struct ContactCreate { pub struct ContactCreate {
/// Data for <create> command for contact /// Data for &lt;create&gt; command for contact
#[serde(rename = "create")] #[serde(rename = "create")]
pub contact: Contact, pub contact: Contact,
} }
impl EppContactCreate { impl EppContactCreate {
/// Creates a new EppObject for contact create corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for contact create corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new( pub fn new(
id: &str, id: &str,
email: &str, email: &str,
@ -113,7 +113,7 @@ impl EppContactCreate {
}) })
} }
/// Sets the <fax> data for the request /// Sets the &lt;fax&gt; data for the request
pub fn set_fax(&mut self, fax: data::Phone) { pub fn set_fax(&mut self, fax: data::Phone) {
self.data.command.contact.fax = Some(fax); self.data.command.contact.fax = Some(fax);
} }

View File

@ -7,7 +7,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_CONTACT_XMLNS; use crate::epp::xml::EPP_CONTACT_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type for the <epp> request for contact <delete> command /// Type for the &lt;epp&gt; request for contact &lt;delete&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -39,10 +39,10 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppContactDelete = EppObject<Command<ContactDelete>>; pub type EppContactDelete = EppObject<Command<ContactDelete>>;
/// Type containing the data for the <delete> tag for contacts /// Type containing the data for the &lt;delete&gt; tag for contacts
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactDeleteData { pub struct ContactDeleteData {
/// XML namespace for the <delete> command for contacts /// XML namespace for the &lt;delete&gt; command for contacts
xmlns: String, xmlns: String,
/// The id of the contact to be deleted /// The id of the contact to be deleted
id: StringValue, id: StringValue,
@ -50,15 +50,15 @@ pub struct ContactDeleteData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "delete")] #[element_name(name = "delete")]
/// The <delete> type for the contact delete EPP command /// The &lt;delete&gt; type for the contact delete EPP command
pub struct ContactDelete { pub struct ContactDelete {
#[serde(rename = "delete")] #[serde(rename = "delete")]
/// The data for the <delete> tag for a contact delete command /// The data for the &lt;delete&gt; tag for a contact delete command
contact: ContactDeleteData, contact: ContactDeleteData,
} }
impl EppContactDelete { impl EppContactDelete {
/// Creates a new EppObject for contact delete corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for contact delete corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(id: &str, client_tr_id: &str) -> EppContactDelete { pub fn new(id: &str, client_tr_id: &str) -> EppContactDelete {
EppObject::build(Command::<ContactDelete> { EppObject::build(Command::<ContactDelete> {
command: ContactDelete { command: ContactDelete {

View File

@ -8,7 +8,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_CONTACT_XMLNS; use crate::epp::xml::EPP_CONTACT_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type for the <epp> request for contact <info> command /// Type for the &lt;epp&gt; request for contact &lt;info&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -41,29 +41,29 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppContactInfo = EppObject<Command<ContactInfo>>; pub type EppContactInfo = EppObject<Command<ContactInfo>>;
/// Type for elements under the contact <info> tag /// Type for elements under the contact &lt;info&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactInfoData { pub struct ContactInfoData {
/// XML namespace for contact commands /// XML namespace for contact commands
xmlns: String, xmlns: String,
/// The contact id for the info command /// The contact id for the info command
id: StringValue, id: StringValue,
/// The <authInfo> data /// The &lt;authInfo&gt; data
#[serde(rename = "authInfo")] #[serde(rename = "authInfo")]
auth_info: AuthInfo, auth_info: AuthInfo,
} }
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "info")] #[element_name(name = "info")]
/// Type for EPP XML <info> command for contacts /// Type for EPP XML &lt;info&gt; command for contacts
pub struct ContactInfo { pub struct ContactInfo {
/// Data for <info> command for contact /// Data for &lt;info&gt; command for contact
#[serde(rename = "info")] #[serde(rename = "info")]
info: ContactInfoData, info: ContactInfoData,
} }
impl EppContactInfo { impl EppContactInfo {
/// Creates a new EppObject for contact info corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for contact info corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(id: &str, auth_password: &str, client_tr_id: &str) -> EppContactInfo { pub fn new(id: &str, auth_password: &str, client_tr_id: &str) -> EppContactInfo {
EppObject::build(Command::<ContactInfo> { EppObject::build(Command::<ContactInfo> {
command: ContactInfo { command: ContactInfo {

View File

@ -10,7 +10,7 @@ use crate::epp::xml::EPP_CONTACT_XMLNS;
use crate::error; use crate::error;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for contact <update> command /// Type that represents the &lt;epp&gt; request for contact &lt;update&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -50,7 +50,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppContactUpdate = EppObject<Command<ContactUpdate>>; pub type EppContactUpdate = EppObject<Command<ContactUpdate>>;
/// Type for elements under the <chg> tag for contact update request /// Type for elements under the &lt;chg&gt; tag for contact update request
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactChangeInfo { pub struct ContactChangeInfo {
#[serde(rename = "postalInfo")] #[serde(rename = "postalInfo")]
@ -62,13 +62,13 @@ pub struct ContactChangeInfo {
auth_info: Option<AuthInfo>, auth_info: Option<AuthInfo>,
} }
/// Type for list of elements of the <status> tag for contact update request /// Type for list of elements of the &lt;status&gt; tag for contact update request
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct StatusList { pub struct StatusList {
status: Vec<ContactStatus>, status: Vec<ContactStatus>,
} }
/// Type for elements under the contact <update> tag /// Type for elements under the contact &lt;update&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactUpdateData { pub struct ContactUpdateData {
xmlns: String, xmlns: String,
@ -83,15 +83,15 @@ pub struct ContactUpdateData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "update")] #[element_name(name = "update")]
/// Type for EPP XML <update> command for contacts /// Type for EPP XML &lt;update&gt; command for contacts
pub struct ContactUpdate { pub struct ContactUpdate {
/// The data under the <update> tag for the contact update /// The data under the &lt;update&gt; tag for the contact update
#[serde(rename = "update")] #[serde(rename = "update")]
contact: ContactUpdateData, contact: ContactUpdateData,
} }
impl EppContactUpdate { impl EppContactUpdate {
/// Creates a new EppObject for contact update corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for contact update corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(id: &str, client_tr_id: &str) -> EppContactUpdate { pub fn new(id: &str, client_tr_id: &str) -> EppContactUpdate {
EppObject::build(Command::<ContactUpdate> { EppObject::build(Command::<ContactUpdate> {
command: ContactUpdate { command: ContactUpdate {
@ -107,7 +107,7 @@ impl EppContactUpdate {
}) })
} }
/// Sets the data for the <chg> tag for the contact update request /// Sets the data for the &lt;chg&gt; tag for the contact update request
pub fn set_info( pub fn set_info(
&mut self, &mut self,
email: &str, email: &str,
@ -124,7 +124,7 @@ impl EppContactUpdate {
}); });
} }
/// Sets the data for the <fax> tag under <chg> for the contact update request /// Sets the data for the &lt;fax&gt; tag under &lt;chg&gt; for the contact update request
pub fn set_fax(&mut self, fax: Phone) { pub fn set_fax(&mut self, fax: Phone) {
match &mut self.data.command.contact.change_info { match &mut self.data.command.contact.change_info {
Some(ref mut info) => info.fax = Some(fax), Some(ref mut info) => info.fax = Some(fax),
@ -132,17 +132,17 @@ impl EppContactUpdate {
} }
} }
/// Sets the data for the <add> tag for the contact update request /// Sets the data for the &lt;add&gt; tag for the contact update request
pub fn add(&mut self, statuses: Vec<ContactStatus>) { pub fn add(&mut self, statuses: Vec<ContactStatus>) {
self.data.command.contact.add_statuses = Some(StatusList { status: statuses }); self.data.command.contact.add_statuses = Some(StatusList { status: statuses });
} }
/// Sets the data for the <rem> tag for the contact update request /// Sets the data for the &lt;rem&gt; tag for the contact update request
pub fn remove(&mut self, statuses: Vec<ContactStatus>) { pub fn remove(&mut self, statuses: Vec<ContactStatus>) {
self.data.command.contact.remove_statuses = Some(StatusList { status: statuses }); self.data.command.contact.remove_statuses = Some(StatusList { status: statuses });
} }
/// Loads data into the <chg> tag from an existing EppContactInfoResponse object /// Loads data into the &lt;chg&gt; tag from an existing EppContactInfoResponse object
pub fn load_from_epp_contact_info( pub fn load_from_epp_contact_info(
&mut self, &mut self,
contact_info: EppContactInfoResponse, contact_info: EppContactInfoResponse,

View File

@ -7,7 +7,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_DOMAIN_XMLNS; use crate::epp::xml::EPP_DOMAIN_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for domain <check> command /// Type that represents the &lt;epp&gt; request for domain &lt;check&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -39,7 +39,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppDomainCheck = EppObject<Command<DomainCheck>>; pub type EppDomainCheck = EppObject<Command<DomainCheck>>;
/// Type for <name> elements under the domain <check> tag /// Type for &lt;name&gt; elements under the domain &lt;check&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainList { pub struct DomainList {
/// XML namespace for domain commands /// XML namespace for domain commands
@ -51,7 +51,7 @@ pub struct DomainList {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "check")] #[element_name(name = "check")]
/// Type for EPP XML <check> command for domains /// Type for EPP XML &lt;check&gt; command for domains
pub struct DomainCheck { pub struct DomainCheck {
/// The object holding the list of domains to be checked /// The object holding the list of domains to be checked
#[serde(rename = "check")] #[serde(rename = "check")]
@ -59,7 +59,7 @@ pub struct DomainCheck {
} }
impl EppDomainCheck { impl EppDomainCheck {
/// Creates a new EppObject for domain check corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain check corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(domains: Vec<&str>, client_tr_id: &str) -> EppDomainCheck { pub fn new(domains: Vec<&str>, client_tr_id: &str) -> EppDomainCheck {
let domains = domains let domains = domains
.iter() .iter()

View File

@ -10,8 +10,8 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_DOMAIN_XMLNS; use crate::epp::xml::EPP_DOMAIN_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for domain <create> command /// Type that represents the &lt;epp&gt; request for domain &lt;create&gt; command
/// with <hostObj> elements in the request for <ns> list /// with &lt;hostObj&gt; elements in the request for &lt;ns&gt; list
/// ///
/// ## Usage /// ## Usage
/// ///
@ -58,11 +58,11 @@ use serde::{Deserialize, Serialize};
/// } /// }
/// ``` /// ```
pub type EppDomainCreate = EppObject<Command<DomainCreate<HostObjList>>>; pub type EppDomainCreate = EppObject<Command<DomainCreate<HostObjList>>>;
/// Type that represents the <epp> request for domain <create> command /// Type that represents the &lt;epp&gt; request for domain &lt;create&gt; command
/// with <hostAttr> elements in the request for <ns> list /// with &lt;hostAttr&gt; elements in the request for &lt;ns&gt; list
pub type EppDomainCreateWithHostAttr = EppObject<Command<DomainCreate<HostAttrList>>>; pub type EppDomainCreateWithHostAttr = EppObject<Command<DomainCreate<HostAttrList>>>;
/// Type for elements under the domain <create> tag /// Type for elements under the domain &lt;create&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainCreateData<T> { pub struct DomainCreateData<T> {
/// XML namespace for domain commands /// XML namespace for domain commands
@ -86,7 +86,7 @@ pub struct DomainCreateData<T> {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "create")] #[element_name(name = "create")]
/// Type for EPP XML <create> command for domains /// Type for EPP XML &lt;create&gt; command for domains
pub struct DomainCreate<T> { pub struct DomainCreate<T> {
/// The data for the domain to be created with /// The data for the domain to be created with
/// T being the type of nameserver list (`HostObjList` or `HostAttrList`) /// T being the type of nameserver list (`HostObjList` or `HostAttrList`)
@ -96,8 +96,8 @@ pub struct DomainCreate<T> {
} }
impl EppDomainCreate { impl EppDomainCreate {
/// Creates a new EppObject for domain create corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain create corresponding to the &lt;epp&gt; tag in EPP XML
/// with the <ns> tag containing <hostObj> tags /// with the &lt;ns&gt; tag containing &lt;hostObj&gt; tags
pub fn new_with_ns( pub fn new_with_ns(
name: &str, name: &str,
period: u16, period: u16,
@ -128,7 +128,7 @@ impl EppDomainCreate {
}) })
} }
/// Creates a new EppObject for domain create corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain create corresponding to the &lt;epp&gt; tag in EPP XML
/// without any nameservers /// without any nameservers
pub fn new( pub fn new(
name: &str, name: &str,
@ -154,7 +154,7 @@ impl EppDomainCreate {
}) })
} }
/// Creates a new EppObject for domain create corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain create corresponding to the &lt;epp&gt; tag in EPP XML
/// without any contacts /// without any contacts
pub fn new_without_contacts( pub fn new_without_contacts(
name: &str, name: &str,
@ -178,8 +178,8 @@ impl EppDomainCreate {
}) })
} }
/// Creates a new EppObject for domain create corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain create corresponding to the &lt;epp&gt; tag in EPP XML
/// with the <ns> tag containing <hostAttr> tags /// with the &lt;ns&gt; tag containing &lt;hostAttr&gt; tags
pub fn new_with_host_attr( pub fn new_with_host_attr(
name: &str, name: &str,
period: u16, period: u16,

View File

@ -7,7 +7,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_DOMAIN_XMLNS; use crate::epp::xml::EPP_DOMAIN_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for domain <delete> command /// Type that represents the &lt;epp&gt; request for domain &lt;delete&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -36,7 +36,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppDomainDelete = EppObject<Command<DomainDelete>>; pub type EppDomainDelete = EppObject<Command<DomainDelete>>;
/// Type for <name> element under the domain <delete> tag /// Type for &lt;name&gt; element under the domain &lt;delete&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainDeleteData { pub struct DomainDeleteData {
/// XML namespace for domain commands /// XML namespace for domain commands
@ -47,15 +47,15 @@ pub struct DomainDeleteData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "delete")] #[element_name(name = "delete")]
/// Type for EPP XML <delete> command for domains /// Type for EPP XML &lt;delete&gt; command for domains
pub struct DomainDelete { pub struct DomainDelete {
/// The data under the <delete> tag for domain deletion /// The data under the &lt;delete&gt; tag for domain deletion
#[serde(rename = "delete")] #[serde(rename = "delete")]
domain: DomainDeleteData, domain: DomainDeleteData,
} }
impl EppDomainDelete { impl EppDomainDelete {
/// Creates a new EppObject for domain delete corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain delete corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(name: &str, client_tr_id: &str) -> EppDomainDelete { pub fn new(name: &str, client_tr_id: &str) -> EppDomainDelete {
EppObject::build(Command::<DomainDelete> { EppObject::build(Command::<DomainDelete> {
command: DomainDelete { command: DomainDelete {

View File

@ -7,7 +7,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_DOMAIN_XMLNS; use crate::epp::xml::EPP_DOMAIN_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for domain <info> command /// Type that represents the &lt;epp&gt; request for domain &lt;info&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -36,7 +36,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppDomainInfo = EppObject<Command<DomainInfo>>; pub type EppDomainInfo = EppObject<Command<DomainInfo>>;
/// Type for data under the <name> element tag for the domain <info> tag /// Type for data under the &lt;name&gt; element tag for the domain &lt;info&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct Domain { pub struct Domain {
/// The hosts attribute. Default value is "all" /// The hosts attribute. Default value is "all"
@ -46,7 +46,7 @@ pub struct Domain {
name: String, name: String,
} }
/// Type for <name> element under the domain <info> tag /// Type for &lt;name&gt; element under the domain &lt;info&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainInfoData { pub struct DomainInfoData {
/// XML namespace for domain commands /// XML namespace for domain commands
@ -58,15 +58,15 @@ pub struct DomainInfoData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "info")] #[element_name(name = "info")]
/// Type for EPP XML <info> command for domains /// Type for EPP XML &lt;info&gt; command for domains
pub struct DomainInfo { pub struct DomainInfo {
/// The data under the <info> tag for domain info /// The data under the &lt;info&gt; tag for domain info
#[serde(rename = "info")] #[serde(rename = "info")]
info: DomainInfoData, info: DomainInfoData,
} }
impl EppDomainInfo { impl EppDomainInfo {
/// Creates a new EppObject for domain info corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain info corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(name: &str, client_tr_id: &str) -> EppDomainInfo { pub fn new(name: &str, client_tr_id: &str) -> EppDomainInfo {
EppObject::build(Command::<DomainInfo> { EppObject::build(Command::<DomainInfo> {
command: DomainInfo { command: DomainInfo {

View File

@ -9,7 +9,7 @@ use crate::epp::xml::EPP_DOMAIN_XMLNS;
use chrono::NaiveDate; use chrono::NaiveDate;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for domain <renew> command /// Type that represents the &lt;epp&gt; request for domain &lt;renew&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -42,7 +42,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppDomainRenew = EppObject<Command<DomainRenew>>; pub type EppDomainRenew = EppObject<Command<DomainRenew>>;
/// Type for data under the domain <renew> tag /// Type for data under the domain &lt;renew&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainRenewData { pub struct DomainRenewData {
/// XML namespace for domain commands /// XML namespace for domain commands
@ -58,15 +58,15 @@ pub struct DomainRenewData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "renew")] #[element_name(name = "renew")]
/// Type for EPP XML <renew> command for domains /// Type for EPP XML &lt;renew&gt; command for domains
pub struct DomainRenew { pub struct DomainRenew {
/// The data under the <renew> tag for the domain renewal /// The data under the &lt;renew&gt; tag for the domain renewal
#[serde(rename = "renew")] #[serde(rename = "renew")]
domain: DomainRenewData, domain: DomainRenewData,
} }
impl EppDomainRenew { impl EppDomainRenew {
/// Creates a new EppObject for domain renew corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain renew corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new( pub fn new(
name: &str, name: &str,
current_expiry_date: NaiveDate, current_expiry_date: NaiveDate,

View File

@ -8,7 +8,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_DOMAIN_XMLNS; use crate::epp::xml::EPP_DOMAIN_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for transfer request for domain /// Type that represents the &lt;epp&gt; request for transfer request for domain
/// ///
/// ## Usage /// ## Usage
/// ///
@ -39,7 +39,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppDomainTransferRequest = EppObject<Command<DomainTransfer>>; pub type EppDomainTransferRequest = EppObject<Command<DomainTransfer>>;
/// Type that represents the <epp> request for transfer approval for domains /// Type that represents the &lt;epp&gt; request for transfer approval for domains
/// ///
/// ## Usage /// ## Usage
/// ///
@ -70,7 +70,7 @@ pub type EppDomainTransferRequest = EppObject<Command<DomainTransfer>>;
/// ``` /// ```
pub type EppDomainTransferApprove = EppObject<Command<DomainTransfer>>; pub type EppDomainTransferApprove = EppObject<Command<DomainTransfer>>;
/// Type that represents the <epp> request for transfer rejection for domains /// Type that represents the &lt;epp&gt; request for transfer rejection for domains
/// ///
/// ## Usage /// ## Usage
/// ///
@ -101,7 +101,7 @@ pub type EppDomainTransferApprove = EppObject<Command<DomainTransfer>>;
/// ``` /// ```
pub type EppDomainTransferReject = EppObject<Command<DomainTransfer>>; pub type EppDomainTransferReject = EppObject<Command<DomainTransfer>>;
/// Type that represents the <epp> request for transfer request cancellation for domains /// Type that represents the &lt;epp&gt; request for transfer request cancellation for domains
/// ///
/// ## Usage /// ## Usage
/// ///
@ -132,7 +132,7 @@ pub type EppDomainTransferReject = EppObject<Command<DomainTransfer>>;
/// ``` /// ```
pub type EppDomainTransferCancel = EppObject<Command<DomainTransfer>>; pub type EppDomainTransferCancel = EppObject<Command<DomainTransfer>>;
/// Type that represents the <epp> request for transfer request query for domains /// Type that represents the &lt;epp&gt; request for transfer request query for domains
/// ///
/// ## Usage /// ## Usage
/// ///
@ -163,7 +163,7 @@ pub type EppDomainTransferCancel = EppObject<Command<DomainTransfer>>;
/// ``` /// ```
pub type EppDomainTransferQuery = EppObject<Command<DomainTransfer>>; pub type EppDomainTransferQuery = EppObject<Command<DomainTransfer>>;
/// Type for elements under the domain <transfer> tag /// Type for elements under the domain &lt;transfer&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainTransferData { pub struct DomainTransferData {
/// XML namespace for domain commands /// XML namespace for domain commands
@ -181,19 +181,19 @@ pub struct DomainTransferData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "transfer")] #[element_name(name = "transfer")]
/// Type for EPP XML <transfer> command for domains /// Type for EPP XML &lt;transfer&gt; command for domains
pub struct DomainTransfer { pub struct DomainTransfer {
/// The transfer operation to perform indicated by the 'op' attr /// The transfer operation to perform indicated by the 'op' attr
/// The values are one of transfer, approve, reject, cancel, or query /// The values are one of transfer, approve, reject, cancel, or query
#[serde(rename = "op")] #[serde(rename = "op")]
operation: String, operation: String,
/// The data under the <transfer> tag in the transfer request /// The data under the &lt;transfer&gt; tag in the transfer request
#[serde(rename = "transfer")] #[serde(rename = "transfer")]
domain: DomainTransferData, domain: DomainTransferData,
} }
impl EppDomainTransferRequest { impl EppDomainTransferRequest {
/// Creates a new EppObject for domain transfer request corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain transfer request corresponding to the &lt;epp&gt; tag in EPP XML
pub fn request( pub fn request(
name: &str, name: &str,
years: u16, years: u16,
@ -221,7 +221,7 @@ impl EppDomainTransferRequest {
} }
impl EppDomainTransferApprove { impl EppDomainTransferApprove {
/// Creates a new EppObject for domain transfer approval corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain transfer approval corresponding to the &lt;epp&gt; tag in EPP XML
pub fn approve(name: &str, client_tr_id: &str) -> EppDomainTransferApprove { pub fn approve(name: &str, client_tr_id: &str) -> EppDomainTransferApprove {
EppObject::build(Command::<DomainTransfer> { EppObject::build(Command::<DomainTransfer> {
command: DomainTransfer { command: DomainTransfer {
@ -239,7 +239,7 @@ impl EppDomainTransferApprove {
} }
impl EppDomainTransferCancel { impl EppDomainTransferCancel {
/// Creates a new EppObject for domain transfer request cancellation corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain transfer request cancellation corresponding to the &lt;epp&gt; tag in EPP XML
pub fn cancel(name: &str, client_tr_id: &str) -> EppDomainTransferCancel { pub fn cancel(name: &str, client_tr_id: &str) -> EppDomainTransferCancel {
EppObject::build(Command::<DomainTransfer> { EppObject::build(Command::<DomainTransfer> {
command: DomainTransfer { command: DomainTransfer {
@ -257,7 +257,7 @@ impl EppDomainTransferCancel {
} }
impl EppDomainTransferReject { impl EppDomainTransferReject {
/// Creates a new EppObject for domain transfer rejection corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain transfer rejection corresponding to the &lt;epp&gt; tag in EPP XML
pub fn reject(name: &str, client_tr_id: &str) -> EppDomainTransferReject { pub fn reject(name: &str, client_tr_id: &str) -> EppDomainTransferReject {
EppObject::build(Command::<DomainTransfer> { EppObject::build(Command::<DomainTransfer> {
command: DomainTransfer { command: DomainTransfer {
@ -275,7 +275,7 @@ impl EppDomainTransferReject {
} }
impl EppDomainTransferQuery { impl EppDomainTransferQuery {
/// Creates a new EppObject for domain transfer request query corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain transfer request query corresponding to the &lt;epp&gt; tag in EPP XML
pub fn query(name: &str, auth_password: &str, client_tr_id: &str) -> EppDomainTransferQuery { pub fn query(name: &str, auth_password: &str, client_tr_id: &str) -> EppDomainTransferQuery {
EppObject::build(Command::<DomainTransfer> { EppObject::build(Command::<DomainTransfer> {
command: DomainTransfer { command: DomainTransfer {

View File

@ -8,8 +8,8 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_DOMAIN_XMLNS; use crate::epp::xml::EPP_DOMAIN_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for domain <update> command /// Type that represents the &lt;epp&gt; request for domain &lt;update&gt; command
/// with <hostObj> elements in the request for <ns> list /// with &lt;hostObj&gt; elements in the request for &lt;ns&gt; list
/// ///
/// ## Usage /// ## Usage
/// ///
@ -62,11 +62,11 @@ use serde::{Deserialize, Serialize};
/// } /// }
/// ``` /// ```
pub type EppDomainUpdate = EppObject<Command<DomainUpdate<HostObjList>>>; pub type EppDomainUpdate = EppObject<Command<DomainUpdate<HostObjList>>>;
/// Type that represents the <epp> request for domain <update> command /// Type that represents the &lt;epp&gt; request for domain &lt;update&gt; command
/// with <hostAttr> elements in the request for <ns> list /// with &lt;hostAttr&gt; elements in the request for &lt;ns&gt; list
pub type EppDomainUpdateWithHostAttr = EppObject<Command<DomainUpdate<HostAttrList>>>; pub type EppDomainUpdateWithHostAttr = EppObject<Command<DomainUpdate<HostAttrList>>>;
/// Type for elements under the <chg> tag for domain update /// Type for elements under the &lt;chg&gt; tag for domain update
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainChangeInfo { pub struct DomainChangeInfo {
/// The new registrant contact for the domain /// The new registrant contact for the domain
@ -76,7 +76,7 @@ pub struct DomainChangeInfo {
pub auth_info: Option<AuthInfo>, pub auth_info: Option<AuthInfo>,
} }
/// Type for elements under the <add> and <rem> tags for domain update /// Type for elements under the &lt;add&gt; and &lt;rem&gt; tags for domain update
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainAddRemove<T> { pub struct DomainAddRemove<T> {
/// The list of nameservers to add or remove /// The list of nameservers to add or remove
@ -91,7 +91,7 @@ pub struct DomainAddRemove<T> {
pub statuses: Option<Vec<DomainStatus>>, pub statuses: Option<Vec<DomainStatus>>,
} }
/// Type for elements under the <update> tag for domain update /// Type for elements under the &lt;update&gt; tag for domain update
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainUpdateData<T> { pub struct DomainUpdateData<T> {
/// XML namespace for domain commands /// XML namespace for domain commands
@ -105,22 +105,22 @@ pub struct DomainUpdateData<T> {
/// from the domain /// from the domain
#[serde(rename = "rem")] #[serde(rename = "rem")]
remove: Option<DomainAddRemove<T>>, remove: Option<DomainAddRemove<T>>,
/// The data under the <chg> tag for domain update /// The data under the &lt;chg&gt; tag for domain update
#[serde(rename = "chg")] #[serde(rename = "chg")]
change_info: Option<DomainChangeInfo>, change_info: Option<DomainChangeInfo>,
} }
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "update")] #[element_name(name = "update")]
/// Type for EPP XML <update> command for domains /// Type for EPP XML &lt;update&gt; command for domains
pub struct DomainUpdate<T> { pub struct DomainUpdate<T> {
#[serde(rename = "update")] #[serde(rename = "update")]
domain: DomainUpdateData<T>, domain: DomainUpdateData<T>,
} }
impl EppDomainUpdate { impl EppDomainUpdate {
/// Creates a new EppObject for domain update corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain update corresponding to the &lt;epp&gt; tag in EPP XML
/// with the <ns> tag containing <hostObj> tags /// with the &lt;ns&gt; tag containing &lt;hostObj&gt; tags
pub fn new(name: &str, client_tr_id: &str) -> EppDomainUpdate { pub fn new(name: &str, client_tr_id: &str) -> EppDomainUpdate {
EppObject::build(Command::<DomainUpdate<HostObjList>> { EppObject::build(Command::<DomainUpdate<HostObjList>> {
command: DomainUpdate { command: DomainUpdate {
@ -136,25 +136,25 @@ impl EppDomainUpdate {
}) })
} }
/// Sets the data for the <chg> tag /// Sets the data for the &lt;chg&gt; tag
pub fn info(&mut self, info: DomainChangeInfo) { pub fn info(&mut self, info: DomainChangeInfo) {
self.data.command.domain.change_info = Some(info); self.data.command.domain.change_info = Some(info);
} }
/// Sets the data for the <add> tag /// Sets the data for the &lt;add&gt; tag
pub fn add(&mut self, add: DomainAddRemove<HostObjList>) { pub fn add(&mut self, add: DomainAddRemove<HostObjList>) {
self.data.command.domain.add = Some(add); self.data.command.domain.add = Some(add);
} }
/// Sets the data for the <rem> tag /// Sets the data for the &lt;rem&gt; tag
pub fn remove(&mut self, remove: DomainAddRemove<HostObjList>) { pub fn remove(&mut self, remove: DomainAddRemove<HostObjList>) {
self.data.command.domain.remove = Some(remove); self.data.command.domain.remove = Some(remove);
} }
} }
impl EppDomainUpdateWithHostAttr { impl EppDomainUpdateWithHostAttr {
/// Creates a new EppObject for domain update corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for domain update corresponding to the &lt;epp&gt; tag in EPP XML
/// with the <ns> tag containing <hostAttr> tags /// with the &lt;ns&gt; tag containing &lt;hostAttr&gt; tags
pub fn new(name: &str, client_tr_id: &str) -> EppDomainUpdateWithHostAttr { pub fn new(name: &str, client_tr_id: &str) -> EppDomainUpdateWithHostAttr {
EppObject::build(Command::<DomainUpdate<HostAttrList>> { EppObject::build(Command::<DomainUpdate<HostAttrList>> {
command: DomainUpdate { command: DomainUpdate {
@ -170,17 +170,17 @@ impl EppDomainUpdateWithHostAttr {
}) })
} }
/// Sets the data for the <chg> tag /// Sets the data for the &lt;chg&gt; tag
pub fn info(&mut self, info: DomainChangeInfo) { pub fn info(&mut self, info: DomainChangeInfo) {
self.data.command.domain.change_info = Some(info); self.data.command.domain.change_info = Some(info);
} }
/// Sets the data for the <add> tag /// Sets the data for the &lt;add&gt; tag
pub fn add(&mut self, add: DomainAddRemove<HostAttrList>) { pub fn add(&mut self, add: DomainAddRemove<HostAttrList>) {
self.data.command.domain.add = Some(add); self.data.command.domain.add = Some(add);
} }
/// Sets the data for the <rem> tag /// Sets the data for the &lt;rem&gt; tag
pub fn remove(&mut self, remove: DomainAddRemove<HostAttrList>) { pub fn remove(&mut self, remove: DomainAddRemove<HostAttrList>) {
self.data.command.domain.remove = Some(remove); self.data.command.domain.remove = Some(remove);
} }

View File

@ -7,7 +7,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_HOST_XMLNS; use crate::epp::xml::EPP_HOST_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for host <check> command /// Type that represents the &lt;epp&gt; request for host &lt;check&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -39,7 +39,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppHostCheck = EppObject<Command<HostCheck>>; pub type EppHostCheck = EppObject<Command<HostCheck>>;
/// Type for data under the host <check> tag /// Type for data under the host &lt;check&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostList { pub struct HostList {
/// XML namespace for host commands /// XML namespace for host commands
@ -51,7 +51,7 @@ pub struct HostList {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "check")] #[element_name(name = "check")]
/// Type for EPP XML <check> command for hosts /// Type for EPP XML &lt;check&gt; command for hosts
pub struct HostCheck { pub struct HostCheck {
/// The instance holding the list of hosts to be checked /// The instance holding the list of hosts to be checked
#[serde(rename = "check")] #[serde(rename = "check")]
@ -59,7 +59,7 @@ pub struct HostCheck {
} }
impl EppHostCheck { impl EppHostCheck {
/// Creates a new EppObject for host check corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for host check corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(hosts: Vec<&str>, client_tr_id: &str) -> EppHostCheck { pub fn new(hosts: Vec<&str>, client_tr_id: &str) -> EppHostCheck {
let hosts = hosts let hosts = hosts
.iter() .iter()

View File

@ -8,7 +8,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_HOST_XMLNS; use crate::epp::xml::EPP_HOST_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for host <create> command /// Type that represents the &lt;epp&gt; request for host &lt;create&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -44,7 +44,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppHostCreate = EppObject<Command<HostCreate>>; pub type EppHostCreate = EppObject<Command<HostCreate>>;
/// Type for data under the host <create> tag /// Type for data under the host &lt;create&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostCreateData { pub struct HostCreateData {
/// XML namespace for host commands /// XML namespace for host commands
@ -58,7 +58,7 @@ pub struct HostCreateData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "create")] #[element_name(name = "create")]
/// Type for EPP XML <create> command for hosts /// Type for EPP XML &lt;create&gt; command for hosts
pub struct HostCreate { pub struct HostCreate {
/// The instance holding the data for the host to be created /// The instance holding the data for the host to be created
#[serde(rename = "create")] #[serde(rename = "create")]
@ -66,7 +66,7 @@ pub struct HostCreate {
} }
impl EppHostCreate { impl EppHostCreate {
/// Creates a new EppObject for host create corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for host create corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(host: &str, addresses: Vec<HostAddr>, client_tr_id: &str) -> EppHostCreate { pub fn new(host: &str, addresses: Vec<HostAddr>, client_tr_id: &str) -> EppHostCreate {
let host_create = HostCreate { let host_create = HostCreate {
host: HostCreateData { host: HostCreateData {

View File

@ -7,7 +7,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_HOST_XMLNS; use crate::epp::xml::EPP_HOST_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for host <delete> command /// Type that represents the &lt;epp&gt; request for host &lt;delete&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -36,7 +36,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppHostDelete = EppObject<Command<HostDelete>>; pub type EppHostDelete = EppObject<Command<HostDelete>>;
/// Type for data under the host <delete> tag /// Type for data under the host &lt;delete&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostDeleteData { pub struct HostDeleteData {
/// XML namespace for host commands /// XML namespace for host commands
@ -47,7 +47,7 @@ pub struct HostDeleteData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "delete")] #[element_name(name = "delete")]
/// Type for EPP XML <delete> command for hosts /// Type for EPP XML &lt;delete&gt; command for hosts
pub struct HostDelete { pub struct HostDelete {
/// The instance holding the data for the host to be deleted /// The instance holding the data for the host to be deleted
#[serde(rename = "delete")] #[serde(rename = "delete")]
@ -55,7 +55,7 @@ pub struct HostDelete {
} }
impl EppHostDelete { impl EppHostDelete {
/// Creates a new EppObject for host delete corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for host delete corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(name: &str, client_tr_id: &str) -> EppHostDelete { pub fn new(name: &str, client_tr_id: &str) -> EppHostDelete {
EppObject::build(Command::<HostDelete> { EppObject::build(Command::<HostDelete> {
command: HostDelete { command: HostDelete {

View File

@ -7,7 +7,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_HOST_XMLNS; use crate::epp::xml::EPP_HOST_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for host <info> command /// Type that represents the &lt;epp&gt; request for host &lt;info&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -36,7 +36,7 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppHostInfo = EppObject<Command<HostInfo>>; pub type EppHostInfo = EppObject<Command<HostInfo>>;
/// Type for data under the host <info> tag /// Type for data under the host &lt;info&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostInfoData { pub struct HostInfoData {
/// XML namespace for host commands /// XML namespace for host commands
@ -47,7 +47,7 @@ pub struct HostInfoData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "info")] #[element_name(name = "info")]
/// Type for EPP XML <info> command for hosts /// Type for EPP XML &lt;info&gt; command for hosts
pub struct HostInfo { pub struct HostInfo {
/// The instance holding the data for the host query /// The instance holding the data for the host query
#[serde(rename = "info")] #[serde(rename = "info")]
@ -55,7 +55,7 @@ pub struct HostInfo {
} }
impl EppHostInfo { impl EppHostInfo {
/// Creates a new EppObject for host info corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for host info corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(name: &str, client_tr_id: &str) -> EppHostInfo { pub fn new(name: &str, client_tr_id: &str) -> EppHostInfo {
EppObject::build(Command::<HostInfo> { EppObject::build(Command::<HostInfo> {
command: HostInfo { command: HostInfo {

View File

@ -8,7 +8,7 @@ use crate::epp::request::Command;
use crate::epp::xml::EPP_HOST_XMLNS; use crate::epp::xml::EPP_HOST_XMLNS;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for host <update> command /// Type that represents the &lt;epp&gt; request for host &lt;update&gt; command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -49,7 +49,7 @@ use serde::{Deserialize, Serialize};
/// host_update.add(add); /// host_update.add(add);
/// host_update.remove(remove); /// host_update.remove(remove);
/// ///
/// // Send a <chg> section as well /// // Send a &lt;chg&gt; section as well
/// host_update.info(HostChangeInfo { name: "ns2.eppdev-101.com".to_string_value() }); /// host_update.info(HostChangeInfo { name: "ns2.eppdev-101.com".to_string_value() });
/// ///
/// // send it to the registry and receive a response of type EppHostUpdateResponse /// // send it to the registry and receive a response of type EppHostUpdateResponse
@ -60,14 +60,14 @@ use serde::{Deserialize, Serialize};
/// ``` /// ```
pub type EppHostUpdate = EppObject<Command<HostUpdate>>; pub type EppHostUpdate = EppObject<Command<HostUpdate>>;
/// Type for data under the <chg> tag /// Type for data under the &lt;chg&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostChangeInfo { pub struct HostChangeInfo {
/// The new name for the host /// The new name for the host
pub name: StringValue, pub name: StringValue,
} }
/// Type for data under the <add> and <rem> tags /// Type for data under the &lt;add&gt; and &lt;rem&gt; tags
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostAddRemove { pub struct HostAddRemove {
/// The IP addresses to be added to or removed from the host /// The IP addresses to be added to or removed from the host
@ -78,7 +78,7 @@ pub struct HostAddRemove {
pub statuses: Option<Vec<HostStatus>>, pub statuses: Option<Vec<HostStatus>>,
} }
/// Type for data under the host <update> tag /// Type for data under the host &lt;update&gt; tag
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostUpdateData { pub struct HostUpdateData {
/// XML namespace for host commands /// XML namespace for host commands
@ -97,7 +97,7 @@ pub struct HostUpdateData {
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "update")] #[element_name(name = "update")]
/// Type for EPP XML <update> command for hosts /// Type for EPP XML &lt;update&gt; command for hosts
pub struct HostUpdate { pub struct HostUpdate {
/// The instance holding the data for the host to be updated /// The instance holding the data for the host to be updated
#[serde(rename = "update")] #[serde(rename = "update")]
@ -105,7 +105,7 @@ pub struct HostUpdate {
} }
impl EppHostUpdate { impl EppHostUpdate {
/// Creates a new EppObject for host update corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for host update corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(name: &str, client_tr_id: &str) -> EppHostUpdate { pub fn new(name: &str, client_tr_id: &str) -> EppHostUpdate {
EppObject::build(Command::<HostUpdate> { EppObject::build(Command::<HostUpdate> {
command: HostUpdate { command: HostUpdate {
@ -121,17 +121,17 @@ impl EppHostUpdate {
}) })
} }
/// Sets the data for the <chg> element of the host update /// Sets the data for the &lt;chg&gt; element of the host update
pub fn info(&mut self, info: HostChangeInfo) { pub fn info(&mut self, info: HostChangeInfo) {
self.data.command.host.change_info = Some(info); self.data.command.host.change_info = Some(info);
} }
/// Sets the data for the <add> element of the host update /// Sets the data for the &lt;add&gt; element of the host update
pub fn add(&mut self, add: HostAddRemove) { pub fn add(&mut self, add: HostAddRemove) {
self.data.command.host.add = Some(add); self.data.command.host.add = Some(add);
} }
/// Sets the data for the <rem> element of the host update /// Sets the data for the &lt;rem&gt; element of the host update
pub fn remove(&mut self, remove: HostAddRemove) { pub fn remove(&mut self, remove: HostAddRemove) {
self.data.command.host.remove = Some(remove); self.data.command.host.remove = Some(remove);
} }

View File

@ -6,7 +6,7 @@ use crate::epp::object::{ElementName, EppObject, StringValueTrait};
use crate::epp::request::Command; use crate::epp::request::Command;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for registry <poll op="ack"> command /// Type that represents the &lt;epp&gt; request for registry <poll op="ack"> command
/// ## Usage /// ## Usage
/// ///
/// ```ignore /// ```ignore
@ -36,7 +36,7 @@ pub type EppMessageAck = EppObject<Command<MessageAck>>;
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "poll")] #[element_name(name = "poll")]
/// Type for EPP XML <poll> command for message ack /// Type for EPP XML &lt;poll&gt; command for message ack
pub struct MessageAck { pub struct MessageAck {
/// The type of operation to perform /// The type of operation to perform
/// The value is "ack" for message acknowledgement /// The value is "ack" for message acknowledgement
@ -47,7 +47,7 @@ pub struct MessageAck {
} }
impl EppMessageAck { impl EppMessageAck {
/// Creates a new EppObject for <poll> ack corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for &lt;poll&gt; ack corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(message_id: u32, client_tr_id: &str) -> EppMessageAck { pub fn new(message_id: u32, client_tr_id: &str) -> EppMessageAck {
EppObject::build(Command::<MessageAck> { EppObject::build(Command::<MessageAck> {
command: MessageAck { command: MessageAck {

View File

@ -6,7 +6,7 @@ use crate::epp::object::{ElementName, EppObject, StringValueTrait};
use crate::epp::request::Command; use crate::epp::request::Command;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> request for registry <poll op="req"> command /// Type that represents the &lt;epp&gt; request for registry <poll op="req"> command
/// ///
/// ## Usage /// ## Usage
/// ///
@ -37,7 +37,7 @@ pub type EppMessagePoll = EppObject<Command<MessagePoll>>;
#[derive(Serialize, Deserialize, Debug, ElementName)] #[derive(Serialize, Deserialize, Debug, ElementName)]
#[element_name(name = "poll")] #[element_name(name = "poll")]
/// Type for EPP XML <poll> command for message poll /// Type for EPP XML &lt;poll&gt; command for message poll
pub struct MessagePoll { pub struct MessagePoll {
/// The type of operation to perform /// The type of operation to perform
/// The value is "req" for message polling /// The value is "req" for message polling
@ -45,7 +45,7 @@ pub struct MessagePoll {
} }
impl EppMessagePoll { impl EppMessagePoll {
/// Creates a new EppObject for <poll> req corresponding to the <epp> tag in EPP XML /// Creates a new EppObject for &lt;poll&gt; req corresponding to the &lt;epp&gt; tag in EPP XML
pub fn new(client_tr_id: &str) -> EppMessagePoll { pub fn new(client_tr_id: &str) -> EppMessagePoll {
EppObject::build(Command::<MessagePoll> { EppObject::build(Command::<MessagePoll> {
command: MessagePoll { command: MessagePoll {

View File

@ -223,7 +223,7 @@ pub struct MessageQueue {
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)] #[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
#[element_name(name = "response")] #[element_name(name = "response")]
/// Type corresponding to the <response> tag in an EPP response XML /// Type corresponding to the &lt;response&gt; tag in an EPP response XML
pub struct CommandResponse<T> { pub struct CommandResponse<T> {
/// Data under the <result> tag /// Data under the <result> tag
pub result: EppResult, pub result: EppResult,
@ -231,7 +231,7 @@ pub struct CommandResponse<T> {
#[serde(rename = "msgQ")] #[serde(rename = "msgQ")]
pub message_queue: Option<MessageQueue>, pub message_queue: Option<MessageQueue>,
#[serde(rename = "resData")] #[serde(rename = "resData")]
/// Data under the <resData> tag /// Data under the &lt;resData&gt; tag
pub res_data: Option<T>, pub res_data: Option<T>,
/// Data under the <trID> tag /// Data under the <trID> tag
#[serde(rename = "trID")] #[serde(rename = "trID")]
@ -240,8 +240,8 @@ pub struct CommandResponse<T> {
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)] #[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
#[element_name(name = "response")] #[element_name(name = "response")]
/// Type corresponding to the <response> tag in an EPP response XML /// Type corresponding to the &lt;response&gt; tag in an EPP response XML
/// without <msgQ> or <resData> sections. Generally used for error handling /// without <msgQ> or &lt;resData&gt; sections. Generally used for error handling
pub struct CommandResponseStatus { pub struct CommandResponseStatus {
/// Data under the <result> tag /// Data under the <result> tag
pub result: EppResult, pub result: EppResult,
@ -251,7 +251,7 @@ pub struct CommandResponseStatus {
} }
impl<T> CommandResponse<T> { impl<T> CommandResponse<T> {
/// Returns the data under the corresponding <resData> from the EPP XML /// Returns the data under the corresponding &lt;resData&gt; from the EPP XML
pub fn res_data(&self) -> Option<&T> { pub fn res_data(&self) -> Option<&T> {
match &self.res_data { match &self.res_data {
Some(res_data) => Some(&res_data), Some(res_data) => Some(&res_data),

View File

@ -5,31 +5,31 @@ use serde::{Deserialize, Serialize};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML contact check response /// Type that represents the &lt;epp&gt; tag for the EPP XML contact check response
pub type EppContactCheckResponse = EppObject<CommandResponse<ContactCheckResult>>; pub type EppContactCheckResponse = EppObject<CommandResponse<ContactCheckResult>>;
/// Type that represents the <id> tag for contact check response /// Type that represents the &lt;id&gt; tag for contact check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactCheck { pub struct ContactCheck {
/// The text of the <id> tag /// The text of the &lt;id&gt; tag
#[serde(rename = "$value")] #[serde(rename = "$value")]
pub id: StringValue, pub id: StringValue,
/// The avail attr on the <id> tag /// The avail attr on the &lt;id&gt; tag
#[serde(rename = "avail")] #[serde(rename = "avail")]
pub available: u16, pub available: u16,
} }
/// Type that represents the <cd> tag for contact check response /// Type that represents the &lt;cd&gt; tag for contact check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactCheckDataItem { pub struct ContactCheckDataItem {
/// Data under the <id> tag /// Data under the &lt;id&gt; tag
#[serde(rename = "id")] #[serde(rename = "id")]
pub contact: ContactCheck, pub contact: ContactCheck,
/// The reason for (un)availability /// The reason for (un)availability
pub reason: Option<StringValue>, pub reason: Option<StringValue>,
} }
/// Type that represents the <chkData> tag for contact check response /// Type that represents the &lt;chkData&gt; tag for contact check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactCheckData { pub struct ContactCheckData {
/// XML namespace for contact response data /// XML namespace for contact response data
@ -38,15 +38,15 @@ pub struct ContactCheckData {
/// XML schema location for contact response data /// XML schema location for contact response data
#[serde(rename = "xsi:schemaLocation")] #[serde(rename = "xsi:schemaLocation")]
schema_location: String, schema_location: String,
/// Data under the <cd> tag /// Data under the &lt;cd&gt; tag
#[serde(rename = "cd")] #[serde(rename = "cd")]
pub contact_list: Vec<ContactCheckDataItem>, pub contact_list: Vec<ContactCheckDataItem>,
} }
/// Type that represents the <resData> tag for contact check response /// Type that represents the &lt;resData&gt; tag for contact check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactCheckResult { pub struct ContactCheckResult {
/// Data under the <chkData> tag /// Data under the &lt;chkData&gt; tag
#[serde(rename = "chkData")] #[serde(rename = "chkData")]
pub check_data: ContactCheckData, pub check_data: ContactCheckData,
} }

View File

@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML contact create response /// Type that represents the &lt;epp&gt; tag for the EPP XML contact create response
pub type EppContactCreateResponse = EppObject<CommandResponse<ContactCreateResult>>; pub type EppContactCreateResponse = EppObject<CommandResponse<ContactCreateResult>>;
/// Type that represents the <creData> tag for contact create response /// Type that represents the &lt;creData&gt; tag for contact create response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactCreateData { pub struct ContactCreateData {
/// XML namespace for contact response data /// XML namespace for contact response data
@ -24,10 +24,10 @@ pub struct ContactCreateData {
pub created_at: StringValue, pub created_at: StringValue,
} }
/// Type that represents the <resData> tag for contact create response /// Type that represents the &lt;resData&gt; tag for contact create response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactCreateResult { pub struct ContactCreateResult {
/// Data under the <creData> tag /// Data under the &lt;creData&gt; tag
#[serde(rename = "creData")] #[serde(rename = "creData")]
pub create_data: ContactCreateData, pub create_data: ContactCreateData,
} }

View File

@ -2,5 +2,5 @@
use crate::epp::response::EppCommandResponse; use crate::epp::response::EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML contact delete response /// Type that represents the &lt;epp&gt; tag for the EPP XML contact delete response
pub type EppContactDeleteResponse = EppCommandResponse; pub type EppContactDeleteResponse = EppCommandResponse;

View File

@ -6,10 +6,10 @@ use crate::epp::object::data::{AuthInfo, ContactStatus, Phone, PostalInfo};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML contact info response /// Type that represents the &lt;epp&gt; tag for the EPP XML contact info response
pub type EppContactInfoResponse = EppObject<CommandResponse<ContactInfoResult>>; pub type EppContactInfoResponse = EppObject<CommandResponse<ContactInfoResult>>;
/// Type that represents the <infData> tag for contact check response /// Type that represents the &lt;infData&gt; tag for contact check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactInfoData { pub struct ContactInfoData {
/// XML namespace for contact response data /// XML namespace for contact response data
@ -57,10 +57,10 @@ pub struct ContactInfoData {
pub auth_info: Option<AuthInfo>, pub auth_info: Option<AuthInfo>,
} }
/// Type that represents the <resData> tag for contact info response /// Type that represents the &lt;resData&gt; tag for contact info response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct ContactInfoResult { pub struct ContactInfoResult {
/// Data under the <infData> tag /// Data under the &lt;infData&gt; tag
#[serde(rename = "infData")] #[serde(rename = "infData")]
pub info_data: ContactInfoData, pub info_data: ContactInfoData,
} }

View File

@ -2,5 +2,5 @@
use crate::epp::response::EppCommandResponse; use crate::epp::response::EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML contact update response /// Type that represents the &lt;epp&gt; tag for the EPP XML contact update response
pub type EppContactUpdateResponse = EppCommandResponse; pub type EppContactUpdateResponse = EppCommandResponse;

View File

@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain check response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain check response
pub type EppDomainCheckResponse = EppObject<CommandResponse<DomainCheckResult>>; pub type EppDomainCheckResponse = EppObject<CommandResponse<DomainCheckResult>>;
/// Type that represents the <name> tag for domain check response /// Type that represents the &lt;name&gt; tag for domain check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainCheck { pub struct DomainCheck {
/// The domain name /// The domain name
@ -19,17 +19,17 @@ pub struct DomainCheck {
pub available: u16, pub available: u16,
} }
/// Type that represents the <cd> tag for domain check response /// Type that represents the &lt;cd&gt; tag for domain check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainCheckDataItem { pub struct DomainCheckDataItem {
/// Data under the <name> tag /// Data under the &lt;name&gt; tag
#[serde(rename = "name")] #[serde(rename = "name")]
pub domain: DomainCheck, pub domain: DomainCheck,
/// The reason for (un)availability /// The reason for (un)availability
pub reason: Option<StringValue>, pub reason: Option<StringValue>,
} }
/// Type that represents the <chkData> tag for domain check response /// Type that represents the &lt;chkData&gt; tag for domain check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainCheckData { pub struct DomainCheckData {
/// XML namespace for domain response data /// XML namespace for domain response data
@ -38,15 +38,15 @@ pub struct DomainCheckData {
/// XML schema location for domain response data /// XML schema location for domain response data
#[serde(rename = "xsi:schemaLocation")] #[serde(rename = "xsi:schemaLocation")]
schema_location: String, schema_location: String,
/// Data under the <cd> tag /// Data under the &lt;cd&gt; tag
#[serde(rename = "cd")] #[serde(rename = "cd")]
pub domain_list: Vec<DomainCheckDataItem>, pub domain_list: Vec<DomainCheckDataItem>,
} }
/// Type that represents the <resData> tag for domain check response /// Type that represents the &lt;resData&gt; tag for domain check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainCheckResult { pub struct DomainCheckResult {
/// Data under the <chkData> tag /// Data under the &lt;chkData&gt; tag
#[serde(rename = "chkData")] #[serde(rename = "chkData")]
pub check_data: DomainCheckData, pub check_data: DomainCheckData,
} }

View File

@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain create response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain create response
pub type EppDomainCreateResponse = EppObject<CommandResponse<DomainCreateResult>>; pub type EppDomainCreateResponse = EppObject<CommandResponse<DomainCreateResult>>;
/// Type that represents the <chkData> tag for domain create response /// Type that represents the &lt;chkData&gt; tag for domain create response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainCreateData { pub struct DomainCreateData {
/// XML namespace for domain response data /// XML namespace for domain response data
@ -27,10 +27,10 @@ pub struct DomainCreateData {
pub expiring_at: StringValue, pub expiring_at: StringValue,
} }
/// Type that represents the <resData> tag for domain create response /// Type that represents the &lt;resData&gt; tag for domain create response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainCreateResult { pub struct DomainCreateResult {
/// Data under the <chkData> tag /// Data under the &lt;chkData&gt; tag
#[serde(rename = "creData")] #[serde(rename = "creData")]
pub create_data: DomainCreateData, pub create_data: DomainCreateData,
} }

View File

@ -2,5 +2,5 @@
use crate::epp::response::EppCommandResponse; use crate::epp::response::EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain delete response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain delete response
pub type EppDomainDeleteResponse = EppCommandResponse; pub type EppDomainDeleteResponse = EppCommandResponse;

View File

@ -6,18 +6,21 @@ use crate::epp::object::data::{AuthInfo, DomainContact, DomainStatus, HostAttr};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain info response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain info response
pub type EppDomainInfoResponse = EppObject<CommandResponse<DomainInfoResult>>; pub type EppDomainInfoResponse = EppObject<CommandResponse<DomainInfoResult>>;
/// The two types of ns lists, hostObj and hostAttr, that may be returned in the
/// domain info response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainNsList { pub struct DomainNsList {
/// List of &lt;hostObj&gt; ns elements
#[serde(rename = "hostObj")] #[serde(rename = "hostObj")]
pub host_obj: Option<Vec<StringValue>>, pub host_obj: Option<Vec<StringValue>>,
#[serde(rename = "hostAttr")] /// List of &lt;hostAttr&gt; ns elements
pub host_attr: Option<Vec<HostAttr>>, pub host_attr: Option<Vec<HostAttr>>,
} }
/// Type that represents the <infData> tag for domain info response /// Type that represents the &lt;infData&gt; tag for domain info response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainInfoData { pub struct DomainInfoData {
/// XML namespace for domain response data /// XML namespace for domain response data
@ -70,9 +73,10 @@ pub struct DomainInfoData {
pub auth_info: Option<AuthInfo>, pub auth_info: Option<AuthInfo>,
} }
/// Type that represents the <resData> tag for domain info response /// Type that represents the &lt;resData&gt; tag for domain info response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainInfoResult { pub struct DomainInfoResult {
/// Data under the &lt;resData&gt; tag
#[serde(rename = "infData")] #[serde(rename = "infData")]
pub info_data: DomainInfoData, pub info_data: DomainInfoData,
} }

View File

@ -4,10 +4,10 @@ use serde::{Deserialize, Serialize};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain renew response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain renew response
pub type EppDomainRenewResponse = EppObject<CommandResponse<DomainRenewResult>>; pub type EppDomainRenewResponse = EppObject<CommandResponse<DomainRenewResult>>;
/// Type that represents the <renData> tag for domain renew response /// Type that represents the &lt;renData&gt; tag for domain renew response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainRenewData { pub struct DomainRenewData {
/// XML namespace for domain response data /// XML namespace for domain response data
@ -23,10 +23,10 @@ pub struct DomainRenewData {
pub expiring_at: StringValue, pub expiring_at: StringValue,
} }
/// Type that represents the <resData> tag for domain renew response /// Type that represents the &lt;resData&gt; tag for domain renew response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainRenewResult { pub struct DomainRenewResult {
/// Data under the <renData> tag /// Data under the &lt;renData&gt; tag
#[serde(rename = "renData")] #[serde(rename = "renData")]
pub renew_data: DomainRenewData, pub renew_data: DomainRenewData,
} }

View File

@ -5,18 +5,18 @@ use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
use crate::epp::response::EppCommandResponse; use crate::epp::response::EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain transfer request response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain transfer request response
pub type EppDomainTransferRequestResponse = EppObject<CommandResponse<DomainTransferResult>>; pub type EppDomainTransferRequestResponse = EppObject<CommandResponse<DomainTransferResult>>;
/// Type that represents the <epp> tag for the EPP XML domain transfer approval response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain transfer approval response
pub type EppDomainTransferApproveResponse = EppCommandResponse; pub type EppDomainTransferApproveResponse = EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain transfer rejection response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain transfer rejection response
pub type EppDomainTransferRejectResponse = EppCommandResponse; pub type EppDomainTransferRejectResponse = EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain transfer cancellation response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain transfer cancellation response
pub type EppDomainTransferCancelResponse = EppCommandResponse; pub type EppDomainTransferCancelResponse = EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain transfer query response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain transfer query response
pub type EppDomainTransferQueryResponse = EppObject<CommandResponse<DomainTransferResult>>; pub type EppDomainTransferQueryResponse = EppObject<CommandResponse<DomainTransferResult>>;
/// Type that represents the <trnData> tag for domain transfer response /// Type that represents the &lt;trnData&gt; tag for domain transfer response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainTransferData { pub struct DomainTransferData {
/// XML namespace for domain response data /// XML namespace for domain response data
@ -47,10 +47,10 @@ pub struct DomainTransferData {
pub expiring_at: StringValue, pub expiring_at: StringValue,
} }
/// Type that represents the <resData> tag for domain transfer response /// Type that represents the &lt;resData&gt; tag for domain transfer response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct DomainTransferResult { pub struct DomainTransferResult {
/// Data under the <trnData> tag /// Data under the &lt;trnData&gt; tag
#[serde(rename = "trnData")] #[serde(rename = "trnData")]
pub transfer_data: DomainTransferData, pub transfer_data: DomainTransferData,
} }

View File

@ -2,5 +2,5 @@
use crate::epp::response::EppCommandResponse; use crate::epp::response::EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML domain update response /// Type that represents the &lt;epp&gt; tag for the EPP XML domain update response
pub type EppDomainUpdateResponse = EppCommandResponse; pub type EppDomainUpdateResponse = EppCommandResponse;

View File

@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML host check response /// Type that represents the &lt;epp&gt; tag for the EPP XML host check response
pub type EppHostCheckResponse = EppObject<CommandResponse<HostCheckResult>>; pub type EppHostCheckResponse = EppObject<CommandResponse<HostCheckResult>>;
/// Type that represents the <name> tag for host check response /// Type that represents the &lt;name&gt; tag for host check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostCheck { pub struct HostCheck {
/// The host name /// The host name
@ -19,17 +19,17 @@ pub struct HostCheck {
pub available: u16, pub available: u16,
} }
/// Type that represents the <cd> tag for host check response /// Type that represents the &lt;cd&gt; tag for host check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostCheckDataItem { pub struct HostCheckDataItem {
/// Data under the <name> tag /// Data under the &lt;name&gt; tag
#[serde(rename = "name")] #[serde(rename = "name")]
pub host: HostCheck, pub host: HostCheck,
/// The reason for (un)availability /// The reason for (un)availability
pub reason: Option<StringValue>, pub reason: Option<StringValue>,
} }
/// Type that represents the <chkData> tag for host check response /// Type that represents the &lt;chkData&gt; tag for host check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostCheckData { pub struct HostCheckData {
/// XML namespace for host response data /// XML namespace for host response data
@ -38,15 +38,15 @@ pub struct HostCheckData {
/// XML schema location for host response data /// XML schema location for host response data
#[serde(rename = "xsi:schemaLocation")] #[serde(rename = "xsi:schemaLocation")]
schema_location: String, schema_location: String,
/// Data under the <cd> tag /// Data under the &lt;cd&gt; tag
#[serde(rename = "cd")] #[serde(rename = "cd")]
pub host_list: Vec<HostCheckDataItem>, pub host_list: Vec<HostCheckDataItem>,
} }
/// Type that represents the <resData> tag for host check response /// Type that represents the &lt;resData&gt; tag for host check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostCheckResult { pub struct HostCheckResult {
/// Data under the <chkData> tag /// Data under the &lt;chkData&gt; tag
#[serde(rename = "chkData")] #[serde(rename = "chkData")]
pub check_data: HostCheckData, pub check_data: HostCheckData,
} }

View File

@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML host create response /// Type that represents the &lt;epp&gt; tag for the EPP XML host create response
pub type EppHostCreateResponse = EppObject<CommandResponse<HostCreateResult>>; pub type EppHostCreateResponse = EppObject<CommandResponse<HostCreateResult>>;
/// Type that represents the <creData> tag for host create response /// Type that represents the &lt;creData&gt; tag for host create response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostCreateData { pub struct HostCreateData {
/// XML namespace for host response data /// XML namespace for host response data
@ -24,10 +24,10 @@ pub struct HostCreateData {
pub created_at: StringValue, pub created_at: StringValue,
} }
/// Type that represents the <resData> tag for host check response /// Type that represents the &lt;resData&gt; tag for host check response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostCreateResult { pub struct HostCreateResult {
/// Data under the <creData> tag /// Data under the &lt;creData&gt; tag
#[serde(rename = "creData")] #[serde(rename = "creData")]
pub create_data: HostCreateData, pub create_data: HostCreateData,
} }

View File

@ -2,5 +2,5 @@
use crate::epp::response::EppCommandResponse; use crate::epp::response::EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML host delete response /// Type that represents the &lt;epp&gt; tag for the EPP XML host delete response
pub type EppHostDeleteResponse = EppCommandResponse; pub type EppHostDeleteResponse = EppCommandResponse;

View File

@ -6,10 +6,10 @@ use crate::epp::object::data::{HostAddr, HostStatus};
use crate::epp::object::{EppObject, StringValue}; use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML host info response /// Type that represents the &lt;epp&gt; tag for the EPP XML host info response
pub type EppHostInfoResponse = EppObject<CommandResponse<HostInfoResult>>; pub type EppHostInfoResponse = EppObject<CommandResponse<HostInfoResult>>;
/// Type that represents the <infData> tag for host info response /// Type that represents the &lt;infData&gt; tag for host info response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostInfoData { pub struct HostInfoData {
/// XML namespace for host response data /// XML namespace for host response data
@ -48,10 +48,10 @@ pub struct HostInfoData {
pub transferred_at: Option<StringValue>, pub transferred_at: Option<StringValue>,
} }
/// Type that represents the <resData> tag for host info response /// Type that represents the &lt;resData&gt; tag for host info response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct HostInfoResult { pub struct HostInfoResult {
/// Data under the <infData> tag /// Data under the &lt;infData&gt; tag
#[serde(rename = "infData")] #[serde(rename = "infData")]
pub info_data: HostInfoData, pub info_data: HostInfoData,
} }

View File

@ -2,5 +2,5 @@
use crate::epp::response::EppCommandResponse; use crate::epp::response::EppCommandResponse;
/// Type that represents the <epp> tag for the EPP XML host update response /// Type that represents the &lt;epp&gt; tag for the EPP XML host update response
pub type EppHostUpdateResponse = EppCommandResponse; pub type EppHostUpdateResponse = EppCommandResponse;

View File

@ -3,5 +3,5 @@
use crate::epp::object::EppObject; use crate::epp::object::EppObject;
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
/// Type that represents the <epp> tag for the EPP XML message ack response /// Type that represents the &lt;epp&gt; tag for the EPP XML message ack response
pub type EppMessageAckResponse = EppObject<CommandResponse<String>>; pub type EppMessageAckResponse = EppObject<CommandResponse<String>>;

View File

@ -4,10 +4,10 @@ use crate::epp::object::{EppObject, StringValue};
use crate::epp::response::CommandResponse; use crate::epp::response::CommandResponse;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Type that represents the <epp> tag for the EPP XML message poll response /// Type that represents the &lt;epp&gt; tag for the EPP XML message poll response
pub type EppMessagePollResponse = EppObject<CommandResponse<MessagePollResult>>; pub type EppMessagePollResponse = EppObject<CommandResponse<MessagePollResult>>;
/// Type that represents the <trnData> tag for message poll response /// Type that represents the &lt;trnData&gt; tag for message poll response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct MessageDomainTransferData { pub struct MessageDomainTransferData {
/// XML namespace for message response data /// XML namespace for message response data
@ -35,10 +35,10 @@ pub struct MessageDomainTransferData {
pub expiring_at: StringValue, pub expiring_at: StringValue,
} }
/// Type that represents the <resData> tag for message poll response /// Type that represents the &lt;resData&gt; tag for message poll response
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct MessagePollResult { pub struct MessagePollResult {
/// Data under the <trnData> tag /// Data under the &lt;trnData&gt; tag
#[serde(rename = "trnData")] #[serde(rename = "trnData")]
pub message_data: MessageDomainTransferData, pub message_data: MessageDomainTransferData,
} }

View File

@ -1,31 +1,34 @@
//! EPP Client Library for the Extensible Provisioning Protocol (EPP). //! # EPP (Extensible Provisioning Protocol) Client Library for Domain Registration and Management.
//! //!
//! ## Description //! ## Description
//! //!
//! epp-client is a client library for Internet domain registration and management for domain registrars. //! epp-client is a client library for Internet domain registration and management for domain registrars.
//! //!
//! It supports the following basic Domain, Contact and Host management calls, with plans to add more calls //! It supports the following basic Domain, Contact, Host, and Message management calls, with plans to add more calls
//! and other EPP extensions in the future, and to eventually be RFC compliant with the EPP protocol. //! and other EPP extensions in the future, and to eventually be RFC compliant with the EPP protocol.
//! //!
//! - Domain Check //! - Domain Check - [`EppDomainCheck`](epp/request/domain/check/type.EppDomainCheck.html)
//! - Domain Create //! - Domain Create - [`EppDomainCreate`](epp/request/domain/create/type.EppDomainCreate.html)
//! - Domain Info //! - Domain Info - [`EppDomainInfo`](epp/request/domain/info/type.EppDomainInfo.html)
//! - Domain Update //! - Domain Update - [`EppDomainUpdate`](epp/request/domain/update/type.EppDomainUpdate.html)
//! - Domain Delete //! - Domain Delete - [`EppDomainDelete`](epp/request/domain/delete/type.EppDomainDelete.html)
//! - Domain Renew //! - Domain Renew - [`EppDomainRenew`](epp/request/domain/renew/type.EppDomainRenew.html)
//! - Domain Transfer //! - Domain Transfer - [`EppDomainTransferRequest`](epp/request/domain/transfer/type.EppDomainTransferRequest.html)
//! //!
//! - Contact Check //! - Contact Check - [`EppContactCheck`](epp/request/contact/check/type.EppContactCheck.html)
//! - Contact Create //! - Contact Create - [`EppContactCreate`](epp/request/contact/create/type.EppContactCreate.html)
//! - Contact Info //! - Contact Info - [`EppContactInfo`](epp/request/contact/info/type.EppContactInfo.html)
//! - Contact Update //! - Contact Update - [`EppContactUpdate`](epp/request/contact/update/type.EppContactUpdate.html)
//! - Contact Delete //! - Contact Delete - [`EppContactDelete`](epp/request/contact/delete/type.EppContactDelete.html)
//! //!
//! - Host Check //! - Host Check - [`EppHostCheck`](epp/request/host/check/type.EppHostCheck.html)
//! - Host Create //! - Host Create - [`EppHostCreate`](epp/request/host/create/type.EppHostCreate.html)
//! - Host Info //! - Host Info - [`EppHostInfo`](epp/request/host/info/type.EppHostInfo.html)
//! - Host Update //! - Host Update - [`EppHostUpdate`](epp/request/host/update/type.EppHostUpdate.html)
//! - Host Delete //! - Host Delete - [`EppHostDelete`](epp/request/host/delete/type.EppHostDelete.html)
//!
//! - Message Poll - [`EppMessagePoll`](epp/request/message/poll/type.EppMessagePoll.html)
//! - Message Ack - [`EppMessageAck`](epp/request/message/ack/type.EppMessageAck.html)
//! //!
//! ## Prerequisites //! ## Prerequisites
//! //!
@ -44,7 +47,7 @@
//! # service extensions //! # service extensions
//! ext_uris = [] //! ext_uris = []
//! //!
//! [registry.hexonet.tls_files] //! [registry.verisign.tls_files]
//! # the full client certificate chain in PEM format //! # the full client certificate chain in PEM format
//! cert_chain = '/path/to/certificate/chain/pemfile' //! cert_chain = '/path/to/certificate/chain/pemfile'
//! # the RSA private key for your certificate //! # the RSA private key for your certificate
@ -72,7 +75,10 @@
//! //!
//! // Make a domain check call, which returns an object of type EppDomainCheckResponse //! // Make a domain check call, which returns an object of type EppDomainCheckResponse
//! // that contains the result of the call //! // that contains the result of the call
//! let domain_check = EppDomainCheck::new(vec!["eppdev.com", "eppdev.net"], generate_client_tr_id(&client).as_str()); //! let domain_check = EppDomainCheck::new(
//! vec!["eppdev.com", "eppdev.net"],
//! generate_client_tr_id(&client).as_str()
//! );
//! //!
//! let response = client.transact::<_, EppDomainCheckResponse>(&domain_check).await.unwrap(); //! let response = client.transact::<_, EppDomainCheckResponse>(&domain_check).await.unwrap();
//! //!