fixed comments for rustdoc
This commit is contained in:
parent
402b0da353
commit
1b4cf39c69
|
@ -1,9 +1,9 @@
|
|||
//! Macros for the EPP Client Library for the Extensible Provisioning Protocol (EPP).
|
||||
//! # Macros for the epp-client Library.
|
||||
//!
|
||||
//! ## Description
|
||||
//!
|
||||
//! 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
|
||||
//! `epp-client` is a client library for Internet domain registration and management for domain registrars.
|
||||
//! This macro crate contains a few macros to simplify serialization of generic types used in some places
|
||||
//! in the `epp-client` library
|
||||
//!
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ async fn connect(registry: &'static str) -> Result<EppClient, Box<dyn Error>> {
|
|||
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
|
||||
/// to the registry and deserialize the XML responses from the registry to local types
|
||||
pub struct EppClient {
|
||||
|
@ -133,7 +133,7 @@ impl EppClient {
|
|||
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>> {
|
||||
let hello = EppHello::new();
|
||||
let hello_xml = hello.serialize()?;
|
||||
|
@ -162,7 +162,7 @@ impl EppClient {
|
|||
}
|
||||
|
||||
/// 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>> {
|
||||
self.connection.transact(&xml).await
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ impl EppClient {
|
|||
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> {
|
||||
EppGreeting::deserialize(&self.connection.greeting)
|
||||
}
|
||||
|
|
|
@ -51,12 +51,12 @@ pub trait ElementName {
|
|||
#[derive(Deserialize, Debug, PartialEq)]
|
||||
#[serde(rename = "epp")]
|
||||
pub struct EppObject<T: ElementName> {
|
||||
/// XML namespace for the <epp> tag
|
||||
/// XML namespace for the <epp> tag
|
||||
pub xmlns: String,
|
||||
/// Schema namespace for the <epp> tag
|
||||
/// Schema namespace for the <epp> tag
|
||||
#[serde(rename = "xmlns:xsi")]
|
||||
pub xmlns_xsi: String,
|
||||
/// Schema location attribute for <epp>
|
||||
/// Schema location attribute for <epp>
|
||||
#[serde(rename = "xsi:schemaLocation")]
|
||||
pub xsi_schema_location: String,
|
||||
/// 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> {
|
||||
/// Create the enclosing EPP XML tag <epp> for data that represents an EPP XML request or response
|
||||
/// Create the enclosing EPP XML tag <epp> for data that represents an EPP XML request or response
|
||||
pub fn build(data: T) -> EppObject<T> {
|
||||
EppObject {
|
||||
// xml: None,
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
use crate::epp::object::{StringValue, StringValueTrait};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// The <status> attribute on EPP XML for domain transactions
|
||||
/// The <status> attribute on EPP XML for domain transactions
|
||||
pub type DomainStatus = ContactStatus;
|
||||
/// The <status> attribute on EPP XML for host transactions
|
||||
/// The <status> attribute on EPP XML for host transactions
|
||||
pub type HostStatus = ContactStatus;
|
||||
|
||||
/// The <hostAddr> types domain or host transactions
|
||||
/// The <hostAddr> types domain or host transactions
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostAddr {
|
||||
#[serde(rename = "ip")]
|
||||
|
@ -43,44 +43,44 @@ impl HostAddr {
|
|||
}
|
||||
}
|
||||
|
||||
/// The <host> type for host transactions
|
||||
/// The <host> type for host transactions
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct Host {
|
||||
/// The <hostName> tag
|
||||
/// The <hostName> tag
|
||||
pub name: StringValue,
|
||||
/// The <hostAddr> tags
|
||||
/// The <hostAddr> tags
|
||||
#[serde(rename = "addr")]
|
||||
pub addresses: Option<Vec<HostAddr>>,
|
||||
}
|
||||
|
||||
/// The <hostAttr> type for domain transactions
|
||||
/// The <hostAttr> type for domain transactions
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostAttr {
|
||||
/// The <hostName> tag
|
||||
/// The <hostName> tag
|
||||
#[serde(rename = "hostName")]
|
||||
pub name: StringValue,
|
||||
/// The <hostAddr> tags
|
||||
/// The <hostAddr> tags
|
||||
#[serde(rename = "hostAddr")]
|
||||
pub addresses: Option<Vec<HostAddr>>,
|
||||
}
|
||||
|
||||
/// The list of <hostAttr> types for domain transactions. Typically under an <ns> tag
|
||||
/// The list of <hostAttr> types for domain transactions. Typically under an <ns> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostAttrList {
|
||||
/// The list of <hostAttr> tags
|
||||
/// The list of <hostAttr> tags
|
||||
#[serde(rename = "hostAttr")]
|
||||
pub hosts: Vec<HostAttr>,
|
||||
}
|
||||
|
||||
/// The list of <hostObj> types for domain transactions. Typically under an <ns> tag
|
||||
/// The list of <hostObj> types for domain transactions. Typically under an <ns> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostObjList {
|
||||
/// The list of <hostObj> tags
|
||||
/// The list of <hostObj> tags
|
||||
#[serde(rename = "hostObj")]
|
||||
pub hosts: Vec<StringValue>,
|
||||
}
|
||||
|
||||
/// The <contact> type on domain creation and update requests
|
||||
/// The <contact> type on domain creation and update requests
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainContact {
|
||||
/// The contact id
|
||||
|
@ -91,7 +91,7 @@ pub struct DomainContact {
|
|||
pub contact_type: String,
|
||||
}
|
||||
|
||||
/// The <period> type for registration, renewal or transfer on domain transactions
|
||||
/// The <period> type for registration, renewal or transfer on domain transactions
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct Period {
|
||||
/// The interval (usually 'y' indicating years)
|
||||
|
@ -116,63 +116,63 @@ impl Period {
|
|||
}
|
||||
}
|
||||
|
||||
/// The <status> type on contact transactions
|
||||
/// The <status> type on contact transactions
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactStatus {
|
||||
/// The status name, represented by the 's' attr on <status> tags
|
||||
/// The status name, represented by the 's' attr on <status> tags
|
||||
#[serde(rename = "s")]
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
/// The data for <voice> and <fax> types on domain transactions
|
||||
/// The data for <voice> and <fax> types on domain transactions
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct Phone {
|
||||
/// The inner text on the <voice> and <fax> tags
|
||||
/// The inner text on the <voice> and <fax> tags
|
||||
#[serde(rename = "$value")]
|
||||
pub number: String,
|
||||
/// The value of the 'x' attr on <voice> and <fax> tags
|
||||
/// The value of the 'x' attr on <voice> and <fax> tags
|
||||
#[serde(rename = "x")]
|
||||
pub extension: Option<String>,
|
||||
}
|
||||
|
||||
/// The <addr> type on contact transactions
|
||||
/// The <addr> type on contact transactions
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct Address {
|
||||
/// The <street> tags under <addr>
|
||||
/// The <street> tags under <addr>
|
||||
pub street: Vec<StringValue>,
|
||||
/// The <city> tag under <addr>
|
||||
/// The <city> tag under <addr>
|
||||
pub city: StringValue,
|
||||
/// The <sp> tag under <addr>
|
||||
/// The <sp> tag under <addr>
|
||||
#[serde(rename = "sp")]
|
||||
pub province: StringValue,
|
||||
/// The <pc> tag under <addr>
|
||||
/// The <pc> tag under <addr>
|
||||
#[serde(rename = "pc")]
|
||||
pub postal_code: StringValue,
|
||||
/// The <cc> tag under <addr>
|
||||
/// The <cc> tag under <addr>
|
||||
#[serde(rename = "cc")]
|
||||
pub country_code: StringValue,
|
||||
}
|
||||
|
||||
/// The <postalInfo> type on contact transactions
|
||||
/// The <postalInfo> type on contact transactions
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct PostalInfo {
|
||||
/// The 'type' attr on <postalInfo>
|
||||
/// The 'type' attr on <postalInfo>
|
||||
#[serde(rename = "type")]
|
||||
pub info_type: String,
|
||||
/// The <name> tag under <postalInfo>
|
||||
/// The <name> tag under <postalInfo>
|
||||
pub name: StringValue,
|
||||
/// The <org> tag under <postalInfo>
|
||||
/// The <org> tag under <postalInfo>
|
||||
#[serde(rename = "org")]
|
||||
pub organization: StringValue,
|
||||
/// The <addr> tag under <postalInfo>
|
||||
/// The <addr> tag under <postalInfo>
|
||||
#[serde(rename = "addr")]
|
||||
pub address: Address,
|
||||
}
|
||||
|
||||
/// The <authInfo> tag for domain and contact transactions
|
||||
/// The <authInfo> tag for domain and contact transactions
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct AuthInfo {
|
||||
/// The <pw> tag under <authInfo>
|
||||
/// The <pw> tag under <authInfo>
|
||||
#[serde(rename = "pw")]
|
||||
pub password: StringValue,
|
||||
}
|
||||
|
|
|
@ -24,9 +24,9 @@ pub type EppLogout = EppObject<Command<Logout>>;
|
|||
|
||||
#[derive(Deserialize, Debug, PartialEq, ElementName)]
|
||||
#[element_name(name = "command")]
|
||||
/// Type corresponding to the <command> tag in an EPP XML request
|
||||
/// Type corresponding to the <command> tag in an EPP XML request
|
||||
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 <command> tag
|
||||
pub command: T,
|
||||
/// The client TRID
|
||||
#[serde(rename = "clTRID")]
|
||||
|
@ -67,7 +67,7 @@ impl EppHello {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
|
||||
#[element_name(name = "login")]
|
||||
/// Type corresponding to the <login> tag in an EPP XML login request
|
||||
/// Type corresponding to the <login> tag in an EPP XML login request
|
||||
pub struct Login {
|
||||
/// The username to use for the login
|
||||
#[serde(rename(serialize = "clID", deserialize = "clID"))]
|
||||
|
@ -135,7 +135,7 @@ impl EppLogin {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
|
||||
#[element_name(name = "logout")]
|
||||
/// Type corresponding to the <logout> tag in an EPP XML logout request
|
||||
/// Type corresponding to the <logout> tag in an EPP XML logout request
|
||||
pub struct Logout;
|
||||
|
||||
impl EppLogout {
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_CONTACT_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for contact <check> command
|
||||
/// Type that represents the <epp> request for contact <check> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -39,10 +39,10 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppContactCheck = EppObject<Command<ContactCheck>>;
|
||||
|
||||
/// Type that represents the <check> command for contact transactions
|
||||
/// Type that represents the <check> command for contact transactions
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactList {
|
||||
/// The XML namespace for the contact <check>
|
||||
/// The XML namespace for the contact <check>
|
||||
xmlns: String,
|
||||
/// The list of contact ids to check for availability
|
||||
#[serde(rename = "id")]
|
||||
|
@ -51,15 +51,15 @@ pub struct ContactList {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "check")]
|
||||
/// The <command> type for contact check command
|
||||
/// The <command> type for contact check command
|
||||
pub struct ContactCheck {
|
||||
/// The <check> tag for the contact check command
|
||||
/// The <check> tag for the contact check command
|
||||
#[serde(rename = "check")]
|
||||
list: ContactList,
|
||||
}
|
||||
|
||||
impl EppContactCheck {
|
||||
/// Creates an EppObject corresponding to the <epp> tag with data for a contact check request
|
||||
/// Creates an EppObject corresponding to the <epp> tag with data for a contact check request
|
||||
pub fn new(contact_ids: Vec<&str>, client_tr_id: &str) -> EppContactCheck {
|
||||
let contact_ids = contact_ids
|
||||
.iter()
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_CONTACT_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for contact <create> command
|
||||
/// Type that represents the <epp> request for contact <create> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -55,38 +55,38 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppContactCreate = EppObject<Command<ContactCreate>>;
|
||||
|
||||
/// Type for elements under the contact <create> tag
|
||||
/// Type for elements under the contact <create> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct Contact {
|
||||
/// XML namespace for contact commands
|
||||
xmlns: String,
|
||||
/// Contact <id> tag
|
||||
/// Contact <id> tag
|
||||
id: StringValue,
|
||||
/// Contact <postalInfo> tag
|
||||
/// Contact <postalInfo> tag
|
||||
#[serde(rename = "postalInfo")]
|
||||
postal_info: data::PostalInfo,
|
||||
/// Contact <voice> tag
|
||||
/// Contact <voice> tag
|
||||
voice: data::Phone,
|
||||
/// Contact <fax> tag,
|
||||
/// Contact <fax> tag,
|
||||
fax: Option<data::Phone>,
|
||||
/// Contact <email> tag
|
||||
/// Contact <email> tag
|
||||
email: StringValue,
|
||||
/// Contact <authInfo> tag
|
||||
/// Contact <authInfo> tag
|
||||
#[serde(rename = "authInfo")]
|
||||
auth_info: data::AuthInfo,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "create")]
|
||||
/// Type for EPP XML <create> command for contacts
|
||||
/// Type for EPP XML <create> command for contacts
|
||||
pub struct ContactCreate {
|
||||
/// Data for <create> command for contact
|
||||
/// Data for <create> command for contact
|
||||
#[serde(rename = "create")]
|
||||
pub contact: Contact,
|
||||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(
|
||||
id: &str,
|
||||
email: &str,
|
||||
|
@ -113,7 +113,7 @@ impl EppContactCreate {
|
|||
})
|
||||
}
|
||||
|
||||
/// Sets the <fax> data for the request
|
||||
/// Sets the <fax> data for the request
|
||||
pub fn set_fax(&mut self, fax: data::Phone) {
|
||||
self.data.command.contact.fax = Some(fax);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_CONTACT_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type for the <epp> request for contact <delete> command
|
||||
/// Type for the <epp> request for contact <delete> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -39,10 +39,10 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppContactDelete = EppObject<Command<ContactDelete>>;
|
||||
|
||||
/// Type containing the data for the <delete> tag for contacts
|
||||
/// Type containing the data for the <delete> tag for contacts
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactDeleteData {
|
||||
/// XML namespace for the <delete> command for contacts
|
||||
/// XML namespace for the <delete> command for contacts
|
||||
xmlns: String,
|
||||
/// The id of the contact to be deleted
|
||||
id: StringValue,
|
||||
|
@ -50,15 +50,15 @@ pub struct ContactDeleteData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "delete")]
|
||||
/// The <delete> type for the contact delete EPP command
|
||||
/// The <delete> type for the contact delete EPP command
|
||||
pub struct ContactDelete {
|
||||
#[serde(rename = "delete")]
|
||||
/// The data for the <delete> tag for a contact delete command
|
||||
/// The data for the <delete> tag for a contact delete command
|
||||
contact: ContactDeleteData,
|
||||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(id: &str, client_tr_id: &str) -> EppContactDelete {
|
||||
EppObject::build(Command::<ContactDelete> {
|
||||
command: ContactDelete {
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_CONTACT_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type for the <epp> request for contact <info> command
|
||||
/// Type for the <epp> request for contact <info> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -41,29 +41,29 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppContactInfo = EppObject<Command<ContactInfo>>;
|
||||
|
||||
/// Type for elements under the contact <info> tag
|
||||
/// Type for elements under the contact <info> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactInfoData {
|
||||
/// XML namespace for contact commands
|
||||
xmlns: String,
|
||||
/// The contact id for the info command
|
||||
id: StringValue,
|
||||
/// The <authInfo> data
|
||||
/// The <authInfo> data
|
||||
#[serde(rename = "authInfo")]
|
||||
auth_info: AuthInfo,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "info")]
|
||||
/// Type for EPP XML <info> command for contacts
|
||||
/// Type for EPP XML <info> command for contacts
|
||||
pub struct ContactInfo {
|
||||
/// Data for <info> command for contact
|
||||
/// Data for <info> command for contact
|
||||
#[serde(rename = "info")]
|
||||
info: ContactInfoData,
|
||||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(id: &str, auth_password: &str, client_tr_id: &str) -> EppContactInfo {
|
||||
EppObject::build(Command::<ContactInfo> {
|
||||
command: ContactInfo {
|
||||
|
|
|
@ -10,7 +10,7 @@ use crate::epp::xml::EPP_CONTACT_XMLNS;
|
|||
use crate::error;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for contact <update> command
|
||||
/// Type that represents the <epp> request for contact <update> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -50,7 +50,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppContactUpdate = EppObject<Command<ContactUpdate>>;
|
||||
|
||||
/// Type for elements under the <chg> tag for contact update request
|
||||
/// Type for elements under the <chg> tag for contact update request
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactChangeInfo {
|
||||
#[serde(rename = "postalInfo")]
|
||||
|
@ -62,13 +62,13 @@ pub struct ContactChangeInfo {
|
|||
auth_info: Option<AuthInfo>,
|
||||
}
|
||||
|
||||
/// Type for list of elements of the <status> tag for contact update request
|
||||
/// Type for list of elements of the <status> tag for contact update request
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct StatusList {
|
||||
status: Vec<ContactStatus>,
|
||||
}
|
||||
|
||||
/// Type for elements under the contact <update> tag
|
||||
/// Type for elements under the contact <update> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactUpdateData {
|
||||
xmlns: String,
|
||||
|
@ -83,15 +83,15 @@ pub struct ContactUpdateData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "update")]
|
||||
/// Type for EPP XML <update> command for contacts
|
||||
/// Type for EPP XML <update> command for contacts
|
||||
pub struct ContactUpdate {
|
||||
/// The data under the <update> tag for the contact update
|
||||
/// The data under the <update> tag for the contact update
|
||||
#[serde(rename = "update")]
|
||||
contact: ContactUpdateData,
|
||||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(id: &str, client_tr_id: &str) -> EppContactUpdate {
|
||||
EppObject::build(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 <chg> tag for the contact update request
|
||||
pub fn set_info(
|
||||
&mut self,
|
||||
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 <fax> tag under <chg> for the contact update request
|
||||
pub fn set_fax(&mut self, fax: Phone) {
|
||||
match &mut self.data.command.contact.change_info {
|
||||
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 <add> tag for the contact update request
|
||||
pub fn add(&mut self, statuses: Vec<ContactStatus>) {
|
||||
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 <rem> tag for the contact update request
|
||||
pub fn remove(&mut self, statuses: Vec<ContactStatus>) {
|
||||
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 <chg> tag from an existing EppContactInfoResponse object
|
||||
pub fn load_from_epp_contact_info(
|
||||
&mut self,
|
||||
contact_info: EppContactInfoResponse,
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_DOMAIN_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for domain <check> command
|
||||
/// Type that represents the <epp> request for domain <check> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -39,7 +39,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppDomainCheck = EppObject<Command<DomainCheck>>;
|
||||
|
||||
/// Type for <name> elements under the domain <check> tag
|
||||
/// Type for <name> elements under the domain <check> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainList {
|
||||
/// XML namespace for domain commands
|
||||
|
@ -51,7 +51,7 @@ pub struct DomainList {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "check")]
|
||||
/// Type for EPP XML <check> command for domains
|
||||
/// Type for EPP XML <check> command for domains
|
||||
pub struct DomainCheck {
|
||||
/// The object holding the list of domains to be checked
|
||||
#[serde(rename = "check")]
|
||||
|
@ -59,7 +59,7 @@ pub struct DomainCheck {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(domains: Vec<&str>, client_tr_id: &str) -> EppDomainCheck {
|
||||
let domains = domains
|
||||
.iter()
|
||||
|
|
|
@ -10,8 +10,8 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_DOMAIN_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for domain <create> command
|
||||
/// with <hostObj> elements in the request for <ns> list
|
||||
/// Type that represents the <epp> request for domain <create> command
|
||||
/// with <hostObj> elements in the request for <ns> list
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -58,11 +58,11 @@ use serde::{Deserialize, Serialize};
|
|||
/// }
|
||||
/// ```
|
||||
pub type EppDomainCreate = EppObject<Command<DomainCreate<HostObjList>>>;
|
||||
/// Type that represents the <epp> request for domain <create> command
|
||||
/// with <hostAttr> elements in the request for <ns> list
|
||||
/// Type that represents the <epp> request for domain <create> command
|
||||
/// with <hostAttr> elements in the request for <ns> list
|
||||
pub type EppDomainCreateWithHostAttr = EppObject<Command<DomainCreate<HostAttrList>>>;
|
||||
|
||||
/// Type for elements under the domain <create> tag
|
||||
/// Type for elements under the domain <create> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainCreateData<T> {
|
||||
/// XML namespace for domain commands
|
||||
|
@ -86,7 +86,7 @@ pub struct DomainCreateData<T> {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "create")]
|
||||
/// Type for EPP XML <create> command for domains
|
||||
/// Type for EPP XML <create> command for domains
|
||||
pub struct DomainCreate<T> {
|
||||
/// The data for the domain to be created with
|
||||
/// T being the type of nameserver list (`HostObjList` or `HostAttrList`)
|
||||
|
@ -96,8 +96,8 @@ pub struct DomainCreate<T> {
|
|||
}
|
||||
|
||||
impl EppDomainCreate {
|
||||
/// Creates a new EppObject for domain create corresponding to the <epp> tag in EPP XML
|
||||
/// with the <ns> tag containing <hostObj> tags
|
||||
/// Creates a new EppObject for domain create corresponding to the <epp> tag in EPP XML
|
||||
/// with the <ns> tag containing <hostObj> tags
|
||||
pub fn new_with_ns(
|
||||
name: &str,
|
||||
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 <epp> tag in EPP XML
|
||||
/// without any nameservers
|
||||
pub fn new(
|
||||
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 <epp> tag in EPP XML
|
||||
/// without any contacts
|
||||
pub fn new_without_contacts(
|
||||
name: &str,
|
||||
|
@ -178,8 +178,8 @@ impl EppDomainCreate {
|
|||
})
|
||||
}
|
||||
|
||||
/// Creates a new EppObject for domain create corresponding to the <epp> tag in EPP XML
|
||||
/// with the <ns> tag containing <hostAttr> tags
|
||||
/// Creates a new EppObject for domain create corresponding to the <epp> tag in EPP XML
|
||||
/// with the <ns> tag containing <hostAttr> tags
|
||||
pub fn new_with_host_attr(
|
||||
name: &str,
|
||||
period: u16,
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_DOMAIN_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for domain <delete> command
|
||||
/// Type that represents the <epp> request for domain <delete> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -36,7 +36,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppDomainDelete = EppObject<Command<DomainDelete>>;
|
||||
|
||||
/// Type for <name> element under the domain <delete> tag
|
||||
/// Type for <name> element under the domain <delete> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainDeleteData {
|
||||
/// XML namespace for domain commands
|
||||
|
@ -47,15 +47,15 @@ pub struct DomainDeleteData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "delete")]
|
||||
/// Type for EPP XML <delete> command for domains
|
||||
/// Type for EPP XML <delete> command for domains
|
||||
pub struct DomainDelete {
|
||||
/// The data under the <delete> tag for domain deletion
|
||||
/// The data under the <delete> tag for domain deletion
|
||||
#[serde(rename = "delete")]
|
||||
domain: DomainDeleteData,
|
||||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(name: &str, client_tr_id: &str) -> EppDomainDelete {
|
||||
EppObject::build(Command::<DomainDelete> {
|
||||
command: DomainDelete {
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_DOMAIN_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for domain <info> command
|
||||
/// Type that represents the <epp> request for domain <info> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -36,7 +36,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppDomainInfo = EppObject<Command<DomainInfo>>;
|
||||
|
||||
/// Type for data under the <name> element tag for the domain <info> tag
|
||||
/// Type for data under the <name> element tag for the domain <info> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct Domain {
|
||||
/// The hosts attribute. Default value is "all"
|
||||
|
@ -46,7 +46,7 @@ pub struct Domain {
|
|||
name: String,
|
||||
}
|
||||
|
||||
/// Type for <name> element under the domain <info> tag
|
||||
/// Type for <name> element under the domain <info> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainInfoData {
|
||||
/// XML namespace for domain commands
|
||||
|
@ -58,15 +58,15 @@ pub struct DomainInfoData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "info")]
|
||||
/// Type for EPP XML <info> command for domains
|
||||
/// Type for EPP XML <info> command for domains
|
||||
pub struct DomainInfo {
|
||||
/// The data under the <info> tag for domain info
|
||||
/// The data under the <info> tag for domain info
|
||||
#[serde(rename = "info")]
|
||||
info: DomainInfoData,
|
||||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(name: &str, client_tr_id: &str) -> EppDomainInfo {
|
||||
EppObject::build(Command::<DomainInfo> {
|
||||
command: DomainInfo {
|
||||
|
|
|
@ -9,7 +9,7 @@ use crate::epp::xml::EPP_DOMAIN_XMLNS;
|
|||
use chrono::NaiveDate;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for domain <renew> command
|
||||
/// Type that represents the <epp> request for domain <renew> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -42,7 +42,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppDomainRenew = EppObject<Command<DomainRenew>>;
|
||||
|
||||
/// Type for data under the domain <renew> tag
|
||||
/// Type for data under the domain <renew> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainRenewData {
|
||||
/// XML namespace for domain commands
|
||||
|
@ -58,15 +58,15 @@ pub struct DomainRenewData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "renew")]
|
||||
/// Type for EPP XML <renew> command for domains
|
||||
/// Type for EPP XML <renew> command for domains
|
||||
pub struct DomainRenew {
|
||||
/// The data under the <renew> tag for the domain renewal
|
||||
/// The data under the <renew> tag for the domain renewal
|
||||
#[serde(rename = "renew")]
|
||||
domain: DomainRenewData,
|
||||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(
|
||||
name: &str,
|
||||
current_expiry_date: NaiveDate,
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_DOMAIN_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for transfer request for domain
|
||||
/// Type that represents the <epp> request for transfer request for domain
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -39,7 +39,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppDomainTransferRequest = EppObject<Command<DomainTransfer>>;
|
||||
|
||||
/// Type that represents the <epp> request for transfer approval for domains
|
||||
/// Type that represents the <epp> request for transfer approval for domains
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -70,7 +70,7 @@ pub type EppDomainTransferRequest = EppObject<Command<DomainTransfer>>;
|
|||
/// ```
|
||||
pub type EppDomainTransferApprove = EppObject<Command<DomainTransfer>>;
|
||||
|
||||
/// Type that represents the <epp> request for transfer rejection for domains
|
||||
/// Type that represents the <epp> request for transfer rejection for domains
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -101,7 +101,7 @@ pub type EppDomainTransferApprove = 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 <epp> request for transfer request cancellation for domains
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -132,7 +132,7 @@ pub type EppDomainTransferReject = 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 <epp> request for transfer request query for domains
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -163,7 +163,7 @@ pub type EppDomainTransferCancel = EppObject<Command<DomainTransfer>>;
|
|||
/// ```
|
||||
pub type EppDomainTransferQuery = EppObject<Command<DomainTransfer>>;
|
||||
|
||||
/// Type for elements under the domain <transfer> tag
|
||||
/// Type for elements under the domain <transfer> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainTransferData {
|
||||
/// XML namespace for domain commands
|
||||
|
@ -181,19 +181,19 @@ pub struct DomainTransferData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "transfer")]
|
||||
/// Type for EPP XML <transfer> command for domains
|
||||
/// Type for EPP XML <transfer> command for domains
|
||||
pub struct DomainTransfer {
|
||||
/// The transfer operation to perform indicated by the 'op' attr
|
||||
/// The values are one of transfer, approve, reject, cancel, or query
|
||||
#[serde(rename = "op")]
|
||||
operation: String,
|
||||
/// The data under the <transfer> tag in the transfer request
|
||||
/// The data under the <transfer> tag in the transfer request
|
||||
#[serde(rename = "transfer")]
|
||||
domain: DomainTransferData,
|
||||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn request(
|
||||
name: &str,
|
||||
years: u16,
|
||||
|
@ -221,7 +221,7 @@ impl EppDomainTransferRequest {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn approve(name: &str, client_tr_id: &str) -> EppDomainTransferApprove {
|
||||
EppObject::build(Command::<DomainTransfer> {
|
||||
command: DomainTransfer {
|
||||
|
@ -239,7 +239,7 @@ impl EppDomainTransferApprove {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn cancel(name: &str, client_tr_id: &str) -> EppDomainTransferCancel {
|
||||
EppObject::build(Command::<DomainTransfer> {
|
||||
command: DomainTransfer {
|
||||
|
@ -257,7 +257,7 @@ impl EppDomainTransferCancel {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn reject(name: &str, client_tr_id: &str) -> EppDomainTransferReject {
|
||||
EppObject::build(Command::<DomainTransfer> {
|
||||
command: DomainTransfer {
|
||||
|
@ -275,7 +275,7 @@ impl EppDomainTransferReject {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn query(name: &str, auth_password: &str, client_tr_id: &str) -> EppDomainTransferQuery {
|
||||
EppObject::build(Command::<DomainTransfer> {
|
||||
command: DomainTransfer {
|
||||
|
|
|
@ -8,8 +8,8 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_DOMAIN_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for domain <update> command
|
||||
/// with <hostObj> elements in the request for <ns> list
|
||||
/// Type that represents the <epp> request for domain <update> command
|
||||
/// with <hostObj> elements in the request for <ns> list
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -62,11 +62,11 @@ use serde::{Deserialize, Serialize};
|
|||
/// }
|
||||
/// ```
|
||||
pub type EppDomainUpdate = EppObject<Command<DomainUpdate<HostObjList>>>;
|
||||
/// Type that represents the <epp> request for domain <update> command
|
||||
/// with <hostAttr> elements in the request for <ns> list
|
||||
/// Type that represents the <epp> request for domain <update> command
|
||||
/// with <hostAttr> elements in the request for <ns> list
|
||||
pub type EppDomainUpdateWithHostAttr = EppObject<Command<DomainUpdate<HostAttrList>>>;
|
||||
|
||||
/// Type for elements under the <chg> tag for domain update
|
||||
/// Type for elements under the <chg> tag for domain update
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainChangeInfo {
|
||||
/// The new registrant contact for the domain
|
||||
|
@ -76,7 +76,7 @@ pub struct DomainChangeInfo {
|
|||
pub auth_info: Option<AuthInfo>,
|
||||
}
|
||||
|
||||
/// Type for elements under the <add> and <rem> tags for domain update
|
||||
/// Type for elements under the <add> and <rem> tags for domain update
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainAddRemove<T> {
|
||||
/// The list of nameservers to add or remove
|
||||
|
@ -91,7 +91,7 @@ pub struct DomainAddRemove<T> {
|
|||
pub statuses: Option<Vec<DomainStatus>>,
|
||||
}
|
||||
|
||||
/// Type for elements under the <update> tag for domain update
|
||||
/// Type for elements under the <update> tag for domain update
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainUpdateData<T> {
|
||||
/// XML namespace for domain commands
|
||||
|
@ -105,22 +105,22 @@ pub struct DomainUpdateData<T> {
|
|||
/// from the domain
|
||||
#[serde(rename = "rem")]
|
||||
remove: Option<DomainAddRemove<T>>,
|
||||
/// The data under the <chg> tag for domain update
|
||||
/// The data under the <chg> tag for domain update
|
||||
#[serde(rename = "chg")]
|
||||
change_info: Option<DomainChangeInfo>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "update")]
|
||||
/// Type for EPP XML <update> command for domains
|
||||
/// Type for EPP XML <update> command for domains
|
||||
pub struct DomainUpdate<T> {
|
||||
#[serde(rename = "update")]
|
||||
domain: DomainUpdateData<T>,
|
||||
}
|
||||
|
||||
impl EppDomainUpdate {
|
||||
/// Creates a new EppObject for domain update corresponding to the <epp> tag in EPP XML
|
||||
/// with the <ns> tag containing <hostObj> tags
|
||||
/// Creates a new EppObject for domain update corresponding to the <epp> tag in EPP XML
|
||||
/// with the <ns> tag containing <hostObj> tags
|
||||
pub fn new(name: &str, client_tr_id: &str) -> EppDomainUpdate {
|
||||
EppObject::build(Command::<DomainUpdate<HostObjList>> {
|
||||
command: DomainUpdate {
|
||||
|
@ -136,25 +136,25 @@ impl EppDomainUpdate {
|
|||
})
|
||||
}
|
||||
|
||||
/// Sets the data for the <chg> tag
|
||||
/// Sets the data for the <chg> tag
|
||||
pub fn info(&mut self, info: DomainChangeInfo) {
|
||||
self.data.command.domain.change_info = Some(info);
|
||||
}
|
||||
|
||||
/// Sets the data for the <add> tag
|
||||
/// Sets the data for the <add> tag
|
||||
pub fn add(&mut self, add: DomainAddRemove<HostObjList>) {
|
||||
self.data.command.domain.add = Some(add);
|
||||
}
|
||||
|
||||
/// Sets the data for the <rem> tag
|
||||
/// Sets the data for the <rem> tag
|
||||
pub fn remove(&mut self, remove: DomainAddRemove<HostObjList>) {
|
||||
self.data.command.domain.remove = Some(remove);
|
||||
}
|
||||
}
|
||||
|
||||
impl EppDomainUpdateWithHostAttr {
|
||||
/// Creates a new EppObject for domain update corresponding to the <epp> tag in EPP XML
|
||||
/// with the <ns> tag containing <hostAttr> tags
|
||||
/// Creates a new EppObject for domain update corresponding to the <epp> tag in EPP XML
|
||||
/// with the <ns> tag containing <hostAttr> tags
|
||||
pub fn new(name: &str, client_tr_id: &str) -> EppDomainUpdateWithHostAttr {
|
||||
EppObject::build(Command::<DomainUpdate<HostAttrList>> {
|
||||
command: DomainUpdate {
|
||||
|
@ -170,17 +170,17 @@ impl EppDomainUpdateWithHostAttr {
|
|||
})
|
||||
}
|
||||
|
||||
/// Sets the data for the <chg> tag
|
||||
/// Sets the data for the <chg> tag
|
||||
pub fn info(&mut self, info: DomainChangeInfo) {
|
||||
self.data.command.domain.change_info = Some(info);
|
||||
}
|
||||
|
||||
/// Sets the data for the <add> tag
|
||||
/// Sets the data for the <add> tag
|
||||
pub fn add(&mut self, add: DomainAddRemove<HostAttrList>) {
|
||||
self.data.command.domain.add = Some(add);
|
||||
}
|
||||
|
||||
/// Sets the data for the <rem> tag
|
||||
/// Sets the data for the <rem> tag
|
||||
pub fn remove(&mut self, remove: DomainAddRemove<HostAttrList>) {
|
||||
self.data.command.domain.remove = Some(remove);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_HOST_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for host <check> command
|
||||
/// Type that represents the <epp> request for host <check> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -39,7 +39,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppHostCheck = EppObject<Command<HostCheck>>;
|
||||
|
||||
/// Type for data under the host <check> tag
|
||||
/// Type for data under the host <check> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostList {
|
||||
/// XML namespace for host commands
|
||||
|
@ -51,7 +51,7 @@ pub struct HostList {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "check")]
|
||||
/// Type for EPP XML <check> command for hosts
|
||||
/// Type for EPP XML <check> command for hosts
|
||||
pub struct HostCheck {
|
||||
/// The instance holding the list of hosts to be checked
|
||||
#[serde(rename = "check")]
|
||||
|
@ -59,7 +59,7 @@ pub struct HostCheck {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(hosts: Vec<&str>, client_tr_id: &str) -> EppHostCheck {
|
||||
let hosts = hosts
|
||||
.iter()
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_HOST_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for host <create> command
|
||||
/// Type that represents the <epp> request for host <create> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -44,7 +44,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppHostCreate = EppObject<Command<HostCreate>>;
|
||||
|
||||
/// Type for data under the host <create> tag
|
||||
/// Type for data under the host <create> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostCreateData {
|
||||
/// XML namespace for host commands
|
||||
|
@ -58,7 +58,7 @@ pub struct HostCreateData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "create")]
|
||||
/// Type for EPP XML <create> command for hosts
|
||||
/// Type for EPP XML <create> command for hosts
|
||||
pub struct HostCreate {
|
||||
/// The instance holding the data for the host to be created
|
||||
#[serde(rename = "create")]
|
||||
|
@ -66,7 +66,7 @@ pub struct HostCreate {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(host: &str, addresses: Vec<HostAddr>, client_tr_id: &str) -> EppHostCreate {
|
||||
let host_create = HostCreate {
|
||||
host: HostCreateData {
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_HOST_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for host <delete> command
|
||||
/// Type that represents the <epp> request for host <delete> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -36,7 +36,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppHostDelete = EppObject<Command<HostDelete>>;
|
||||
|
||||
/// Type for data under the host <delete> tag
|
||||
/// Type for data under the host <delete> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostDeleteData {
|
||||
/// XML namespace for host commands
|
||||
|
@ -47,7 +47,7 @@ pub struct HostDeleteData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "delete")]
|
||||
/// Type for EPP XML <delete> command for hosts
|
||||
/// Type for EPP XML <delete> command for hosts
|
||||
pub struct HostDelete {
|
||||
/// The instance holding the data for the host to be deleted
|
||||
#[serde(rename = "delete")]
|
||||
|
@ -55,7 +55,7 @@ pub struct HostDelete {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(name: &str, client_tr_id: &str) -> EppHostDelete {
|
||||
EppObject::build(Command::<HostDelete> {
|
||||
command: HostDelete {
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_HOST_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for host <info> command
|
||||
/// Type that represents the <epp> request for host <info> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -36,7 +36,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```
|
||||
pub type EppHostInfo = EppObject<Command<HostInfo>>;
|
||||
|
||||
/// Type for data under the host <info> tag
|
||||
/// Type for data under the host <info> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostInfoData {
|
||||
/// XML namespace for host commands
|
||||
|
@ -47,7 +47,7 @@ pub struct HostInfoData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "info")]
|
||||
/// Type for EPP XML <info> command for hosts
|
||||
/// Type for EPP XML <info> command for hosts
|
||||
pub struct HostInfo {
|
||||
/// The instance holding the data for the host query
|
||||
#[serde(rename = "info")]
|
||||
|
@ -55,7 +55,7 @@ pub struct HostInfo {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(name: &str, client_tr_id: &str) -> EppHostInfo {
|
||||
EppObject::build(Command::<HostInfo> {
|
||||
command: HostInfo {
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::epp::request::Command;
|
|||
use crate::epp::xml::EPP_HOST_XMLNS;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for host <update> command
|
||||
/// Type that represents the <epp> request for host <update> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -49,7 +49,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// host_update.add(add);
|
||||
/// host_update.remove(remove);
|
||||
///
|
||||
/// // Send a <chg> section as well
|
||||
/// // Send a <chg> section as well
|
||||
/// host_update.info(HostChangeInfo { name: "ns2.eppdev-101.com".to_string_value() });
|
||||
///
|
||||
/// // 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>>;
|
||||
|
||||
/// Type for data under the <chg> tag
|
||||
/// Type for data under the <chg> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostChangeInfo {
|
||||
/// The new name for the host
|
||||
pub name: StringValue,
|
||||
}
|
||||
|
||||
/// Type for data under the <add> and <rem> tags
|
||||
/// Type for data under the <add> and <rem> tags
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostAddRemove {
|
||||
/// The IP addresses to be added to or removed from the host
|
||||
|
@ -78,7 +78,7 @@ pub struct HostAddRemove {
|
|||
pub statuses: Option<Vec<HostStatus>>,
|
||||
}
|
||||
|
||||
/// Type for data under the host <update> tag
|
||||
/// Type for data under the host <update> tag
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostUpdateData {
|
||||
/// XML namespace for host commands
|
||||
|
@ -97,7 +97,7 @@ pub struct HostUpdateData {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "update")]
|
||||
/// Type for EPP XML <update> command for hosts
|
||||
/// Type for EPP XML <update> command for hosts
|
||||
pub struct HostUpdate {
|
||||
/// The instance holding the data for the host to be updated
|
||||
#[serde(rename = "update")]
|
||||
|
@ -105,7 +105,7 @@ pub struct HostUpdate {
|
|||
}
|
||||
|
||||
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 <epp> tag in EPP XML
|
||||
pub fn new(name: &str, client_tr_id: &str) -> EppHostUpdate {
|
||||
EppObject::build(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 <chg> element of the host update
|
||||
pub fn info(&mut self, info: HostChangeInfo) {
|
||||
self.data.command.host.change_info = Some(info);
|
||||
}
|
||||
|
||||
/// Sets the data for the <add> element of the host update
|
||||
/// Sets the data for the <add> element of the host update
|
||||
pub fn add(&mut self, add: HostAddRemove) {
|
||||
self.data.command.host.add = Some(add);
|
||||
}
|
||||
|
||||
/// Sets the data for the <rem> element of the host update
|
||||
/// Sets the data for the <rem> element of the host update
|
||||
pub fn remove(&mut self, remove: HostAddRemove) {
|
||||
self.data.command.host.remove = Some(remove);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::epp::object::{ElementName, EppObject, StringValueTrait};
|
|||
use crate::epp::request::Command;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for registry <poll op="ack"> command
|
||||
/// Type that represents the <epp> request for registry <poll op="ack"> command
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```ignore
|
||||
|
@ -36,7 +36,7 @@ pub type EppMessageAck = EppObject<Command<MessageAck>>;
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "poll")]
|
||||
/// Type for EPP XML <poll> command for message ack
|
||||
/// Type for EPP XML <poll> command for message ack
|
||||
pub struct MessageAck {
|
||||
/// The type of operation to perform
|
||||
/// The value is "ack" for message acknowledgement
|
||||
|
@ -47,7 +47,7 @@ pub struct MessageAck {
|
|||
}
|
||||
|
||||
impl EppMessageAck {
|
||||
/// Creates a new EppObject for <poll> ack corresponding to the <epp> tag in EPP XML
|
||||
/// Creates a new EppObject for <poll> ack corresponding to the <epp> tag in EPP XML
|
||||
pub fn new(message_id: u32, client_tr_id: &str) -> EppMessageAck {
|
||||
EppObject::build(Command::<MessageAck> {
|
||||
command: MessageAck {
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::epp::object::{ElementName, EppObject, StringValueTrait};
|
|||
use crate::epp::request::Command;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> request for registry <poll op="req"> command
|
||||
/// Type that represents the <epp> request for registry <poll op="req"> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
|
@ -37,7 +37,7 @@ pub type EppMessagePoll = EppObject<Command<MessagePoll>>;
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, ElementName)]
|
||||
#[element_name(name = "poll")]
|
||||
/// Type for EPP XML <poll> command for message poll
|
||||
/// Type for EPP XML <poll> command for message poll
|
||||
pub struct MessagePoll {
|
||||
/// The type of operation to perform
|
||||
/// The value is "req" for message polling
|
||||
|
@ -45,7 +45,7 @@ pub struct MessagePoll {
|
|||
}
|
||||
|
||||
impl EppMessagePoll {
|
||||
/// Creates a new EppObject for <poll> req corresponding to the <epp> tag in EPP XML
|
||||
/// Creates a new EppObject for <poll> req corresponding to the <epp> tag in EPP XML
|
||||
pub fn new(client_tr_id: &str) -> EppMessagePoll {
|
||||
EppObject::build(Command::<MessagePoll> {
|
||||
command: MessagePoll {
|
||||
|
|
|
@ -223,7 +223,7 @@ pub struct MessageQueue {
|
|||
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[element_name(name = "response")]
|
||||
/// Type corresponding to the <response> tag in an EPP response XML
|
||||
/// Type corresponding to the <response> tag in an EPP response XML
|
||||
pub struct CommandResponse<T> {
|
||||
/// Data under the <result> tag
|
||||
pub result: EppResult,
|
||||
|
@ -231,7 +231,7 @@ pub struct CommandResponse<T> {
|
|||
#[serde(rename = "msgQ")]
|
||||
pub message_queue: Option<MessageQueue>,
|
||||
#[serde(rename = "resData")]
|
||||
/// Data under the <resData> tag
|
||||
/// Data under the <resData> tag
|
||||
pub res_data: Option<T>,
|
||||
/// Data under the <trID> tag
|
||||
#[serde(rename = "trID")]
|
||||
|
@ -240,8 +240,8 @@ pub struct CommandResponse<T> {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
|
||||
#[element_name(name = "response")]
|
||||
/// Type corresponding to the <response> tag in an EPP response XML
|
||||
/// without <msgQ> or <resData> sections. Generally used for error handling
|
||||
/// Type corresponding to the <response> tag in an EPP response XML
|
||||
/// without <msgQ> or <resData> sections. Generally used for error handling
|
||||
pub struct CommandResponseStatus {
|
||||
/// Data under the <result> tag
|
||||
pub result: EppResult,
|
||||
|
@ -251,7 +251,7 @@ pub struct CommandResponseStatus {
|
|||
}
|
||||
|
||||
impl<T> CommandResponse<T> {
|
||||
/// Returns the data under the corresponding <resData> from the EPP XML
|
||||
/// Returns the data under the corresponding <resData> from the EPP XML
|
||||
pub fn res_data(&self) -> Option<&T> {
|
||||
match &self.res_data {
|
||||
Some(res_data) => Some(&res_data),
|
||||
|
|
|
@ -5,31 +5,31 @@ use serde::{Deserialize, Serialize};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML contact check response
|
||||
/// Type that represents the <epp> tag for the EPP XML contact check response
|
||||
pub type EppContactCheckResponse = EppObject<CommandResponse<ContactCheckResult>>;
|
||||
|
||||
/// Type that represents the <id> tag for contact check response
|
||||
/// Type that represents the <id> tag for contact check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactCheck {
|
||||
/// The text of the <id> tag
|
||||
/// The text of the <id> tag
|
||||
#[serde(rename = "$value")]
|
||||
pub id: StringValue,
|
||||
/// The avail attr on the <id> tag
|
||||
/// The avail attr on the <id> tag
|
||||
#[serde(rename = "avail")]
|
||||
pub available: u16,
|
||||
}
|
||||
|
||||
/// Type that represents the <cd> tag for contact check response
|
||||
/// Type that represents the <cd> tag for contact check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactCheckDataItem {
|
||||
/// Data under the <id> tag
|
||||
/// Data under the <id> tag
|
||||
#[serde(rename = "id")]
|
||||
pub contact: ContactCheck,
|
||||
/// The reason for (un)availability
|
||||
pub reason: Option<StringValue>,
|
||||
}
|
||||
|
||||
/// Type that represents the <chkData> tag for contact check response
|
||||
/// Type that represents the <chkData> tag for contact check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactCheckData {
|
||||
/// XML namespace for contact response data
|
||||
|
@ -38,15 +38,15 @@ pub struct ContactCheckData {
|
|||
/// XML schema location for contact response data
|
||||
#[serde(rename = "xsi:schemaLocation")]
|
||||
schema_location: String,
|
||||
/// Data under the <cd> tag
|
||||
/// Data under the <cd> tag
|
||||
#[serde(rename = "cd")]
|
||||
pub contact_list: Vec<ContactCheckDataItem>,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for contact check response
|
||||
/// Type that represents the <resData> tag for contact check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactCheckResult {
|
||||
/// Data under the <chkData> tag
|
||||
/// Data under the <chkData> tag
|
||||
#[serde(rename = "chkData")]
|
||||
pub check_data: ContactCheckData,
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML contact create response
|
||||
/// Type that represents the <epp> tag for the EPP XML contact create response
|
||||
pub type EppContactCreateResponse = EppObject<CommandResponse<ContactCreateResult>>;
|
||||
|
||||
/// Type that represents the <creData> tag for contact create response
|
||||
/// Type that represents the <creData> tag for contact create response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactCreateData {
|
||||
/// XML namespace for contact response data
|
||||
|
@ -24,10 +24,10 @@ pub struct ContactCreateData {
|
|||
pub created_at: StringValue,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for contact create response
|
||||
/// Type that represents the <resData> tag for contact create response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactCreateResult {
|
||||
/// Data under the <creData> tag
|
||||
/// Data under the <creData> tag
|
||||
#[serde(rename = "creData")]
|
||||
pub create_data: ContactCreateData,
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
use crate::epp::response::EppCommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML contact delete response
|
||||
/// Type that represents the <epp> tag for the EPP XML contact delete response
|
||||
pub type EppContactDeleteResponse = EppCommandResponse;
|
||||
|
|
|
@ -6,10 +6,10 @@ use crate::epp::object::data::{AuthInfo, ContactStatus, Phone, PostalInfo};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML contact info response
|
||||
/// Type that represents the <epp> tag for the EPP XML contact info response
|
||||
pub type EppContactInfoResponse = EppObject<CommandResponse<ContactInfoResult>>;
|
||||
|
||||
/// Type that represents the <infData> tag for contact check response
|
||||
/// Type that represents the <infData> tag for contact check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactInfoData {
|
||||
/// XML namespace for contact response data
|
||||
|
@ -57,10 +57,10 @@ pub struct ContactInfoData {
|
|||
pub auth_info: Option<AuthInfo>,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for contact info response
|
||||
/// Type that represents the <resData> tag for contact info response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ContactInfoResult {
|
||||
/// Data under the <infData> tag
|
||||
/// Data under the <infData> tag
|
||||
#[serde(rename = "infData")]
|
||||
pub info_data: ContactInfoData,
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
use crate::epp::response::EppCommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML contact update response
|
||||
/// Type that represents the <epp> tag for the EPP XML contact update response
|
||||
pub type EppContactUpdateResponse = EppCommandResponse;
|
||||
|
|
|
@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML domain check response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain check response
|
||||
pub type EppDomainCheckResponse = EppObject<CommandResponse<DomainCheckResult>>;
|
||||
|
||||
/// Type that represents the <name> tag for domain check response
|
||||
/// Type that represents the <name> tag for domain check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainCheck {
|
||||
/// The domain name
|
||||
|
@ -19,17 +19,17 @@ pub struct DomainCheck {
|
|||
pub available: u16,
|
||||
}
|
||||
|
||||
/// Type that represents the <cd> tag for domain check response
|
||||
/// Type that represents the <cd> tag for domain check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainCheckDataItem {
|
||||
/// Data under the <name> tag
|
||||
/// Data under the <name> tag
|
||||
#[serde(rename = "name")]
|
||||
pub domain: DomainCheck,
|
||||
/// The reason for (un)availability
|
||||
pub reason: Option<StringValue>,
|
||||
}
|
||||
|
||||
/// Type that represents the <chkData> tag for domain check response
|
||||
/// Type that represents the <chkData> tag for domain check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainCheckData {
|
||||
/// XML namespace for domain response data
|
||||
|
@ -38,15 +38,15 @@ pub struct DomainCheckData {
|
|||
/// XML schema location for domain response data
|
||||
#[serde(rename = "xsi:schemaLocation")]
|
||||
schema_location: String,
|
||||
/// Data under the <cd> tag
|
||||
/// Data under the <cd> tag
|
||||
#[serde(rename = "cd")]
|
||||
pub domain_list: Vec<DomainCheckDataItem>,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for domain check response
|
||||
/// Type that represents the <resData> tag for domain check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainCheckResult {
|
||||
/// Data under the <chkData> tag
|
||||
/// Data under the <chkData> tag
|
||||
#[serde(rename = "chkData")]
|
||||
pub check_data: DomainCheckData,
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML domain create response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain create response
|
||||
pub type EppDomainCreateResponse = EppObject<CommandResponse<DomainCreateResult>>;
|
||||
|
||||
/// Type that represents the <chkData> tag for domain create response
|
||||
/// Type that represents the <chkData> tag for domain create response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainCreateData {
|
||||
/// XML namespace for domain response data
|
||||
|
@ -27,10 +27,10 @@ pub struct DomainCreateData {
|
|||
pub expiring_at: StringValue,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for domain create response
|
||||
/// Type that represents the <resData> tag for domain create response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainCreateResult {
|
||||
/// Data under the <chkData> tag
|
||||
/// Data under the <chkData> tag
|
||||
#[serde(rename = "creData")]
|
||||
pub create_data: DomainCreateData,
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
use crate::epp::response::EppCommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML domain delete response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain delete response
|
||||
pub type EppDomainDeleteResponse = EppCommandResponse;
|
||||
|
|
|
@ -6,18 +6,21 @@ use crate::epp::object::data::{AuthInfo, DomainContact, DomainStatus, HostAttr};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML domain info response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain info response
|
||||
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)]
|
||||
pub struct DomainNsList {
|
||||
/// List of <hostObj> ns elements
|
||||
#[serde(rename = "hostObj")]
|
||||
pub host_obj: Option<Vec<StringValue>>,
|
||||
#[serde(rename = "hostAttr")]
|
||||
/// List of <hostAttr> ns elements
|
||||
pub host_attr: Option<Vec<HostAttr>>,
|
||||
}
|
||||
|
||||
/// Type that represents the <infData> tag for domain info response
|
||||
/// Type that represents the <infData> tag for domain info response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainInfoData {
|
||||
/// XML namespace for domain response data
|
||||
|
@ -70,9 +73,10 @@ pub struct DomainInfoData {
|
|||
pub auth_info: Option<AuthInfo>,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for domain info response
|
||||
/// Type that represents the <resData> tag for domain info response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainInfoResult {
|
||||
/// Data under the <resData> tag
|
||||
#[serde(rename = "infData")]
|
||||
pub info_data: DomainInfoData,
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@ use serde::{Deserialize, Serialize};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML domain renew response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain renew response
|
||||
pub type EppDomainRenewResponse = EppObject<CommandResponse<DomainRenewResult>>;
|
||||
|
||||
/// Type that represents the <renData> tag for domain renew response
|
||||
/// Type that represents the <renData> tag for domain renew response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainRenewData {
|
||||
/// XML namespace for domain response data
|
||||
|
@ -23,10 +23,10 @@ pub struct DomainRenewData {
|
|||
pub expiring_at: StringValue,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for domain renew response
|
||||
/// Type that represents the <resData> tag for domain renew response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainRenewResult {
|
||||
/// Data under the <renData> tag
|
||||
/// Data under the <renData> tag
|
||||
#[serde(rename = "renData")]
|
||||
pub renew_data: DomainRenewData,
|
||||
}
|
||||
|
|
|
@ -5,18 +5,18 @@ use crate::epp::object::{EppObject, StringValue};
|
|||
use crate::epp::response::CommandResponse;
|
||||
use crate::epp::response::EppCommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer request response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer request response
|
||||
pub type EppDomainTransferRequestResponse = EppObject<CommandResponse<DomainTransferResult>>;
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer approval response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer approval response
|
||||
pub type EppDomainTransferApproveResponse = EppCommandResponse;
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer rejection response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer rejection response
|
||||
pub type EppDomainTransferRejectResponse = EppCommandResponse;
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer cancellation response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer cancellation response
|
||||
pub type EppDomainTransferCancelResponse = EppCommandResponse;
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer query response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain transfer query response
|
||||
pub type EppDomainTransferQueryResponse = EppObject<CommandResponse<DomainTransferResult>>;
|
||||
|
||||
/// Type that represents the <trnData> tag for domain transfer response
|
||||
/// Type that represents the <trnData> tag for domain transfer response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainTransferData {
|
||||
/// XML namespace for domain response data
|
||||
|
@ -47,10 +47,10 @@ pub struct DomainTransferData {
|
|||
pub expiring_at: StringValue,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for domain transfer response
|
||||
/// Type that represents the <resData> tag for domain transfer response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DomainTransferResult {
|
||||
/// Data under the <trnData> tag
|
||||
/// Data under the <trnData> tag
|
||||
#[serde(rename = "trnData")]
|
||||
pub transfer_data: DomainTransferData,
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
use crate::epp::response::EppCommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML domain update response
|
||||
/// Type that represents the <epp> tag for the EPP XML domain update response
|
||||
pub type EppDomainUpdateResponse = EppCommandResponse;
|
||||
|
|
|
@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML host check response
|
||||
/// Type that represents the <epp> tag for the EPP XML host check response
|
||||
pub type EppHostCheckResponse = EppObject<CommandResponse<HostCheckResult>>;
|
||||
|
||||
/// Type that represents the <name> tag for host check response
|
||||
/// Type that represents the <name> tag for host check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostCheck {
|
||||
/// The host name
|
||||
|
@ -19,17 +19,17 @@ pub struct HostCheck {
|
|||
pub available: u16,
|
||||
}
|
||||
|
||||
/// Type that represents the <cd> tag for host check response
|
||||
/// Type that represents the <cd> tag for host check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostCheckDataItem {
|
||||
/// Data under the <name> tag
|
||||
/// Data under the <name> tag
|
||||
#[serde(rename = "name")]
|
||||
pub host: HostCheck,
|
||||
/// The reason for (un)availability
|
||||
pub reason: Option<StringValue>,
|
||||
}
|
||||
|
||||
/// Type that represents the <chkData> tag for host check response
|
||||
/// Type that represents the <chkData> tag for host check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostCheckData {
|
||||
/// XML namespace for host response data
|
||||
|
@ -38,15 +38,15 @@ pub struct HostCheckData {
|
|||
/// XML schema location for host response data
|
||||
#[serde(rename = "xsi:schemaLocation")]
|
||||
schema_location: String,
|
||||
/// Data under the <cd> tag
|
||||
/// Data under the <cd> tag
|
||||
#[serde(rename = "cd")]
|
||||
pub host_list: Vec<HostCheckDataItem>,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for host check response
|
||||
/// Type that represents the <resData> tag for host check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostCheckResult {
|
||||
/// Data under the <chkData> tag
|
||||
/// Data under the <chkData> tag
|
||||
#[serde(rename = "chkData")]
|
||||
pub check_data: HostCheckData,
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML host create response
|
||||
/// Type that represents the <epp> tag for the EPP XML host create response
|
||||
pub type EppHostCreateResponse = EppObject<CommandResponse<HostCreateResult>>;
|
||||
|
||||
/// Type that represents the <creData> tag for host create response
|
||||
/// Type that represents the <creData> tag for host create response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostCreateData {
|
||||
/// XML namespace for host response data
|
||||
|
@ -24,10 +24,10 @@ pub struct HostCreateData {
|
|||
pub created_at: StringValue,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for host check response
|
||||
/// Type that represents the <resData> tag for host check response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostCreateResult {
|
||||
/// Data under the <creData> tag
|
||||
/// Data under the <creData> tag
|
||||
#[serde(rename = "creData")]
|
||||
pub create_data: HostCreateData,
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
use crate::epp::response::EppCommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML host delete response
|
||||
/// Type that represents the <epp> tag for the EPP XML host delete response
|
||||
pub type EppHostDeleteResponse = EppCommandResponse;
|
||||
|
|
|
@ -6,10 +6,10 @@ use crate::epp::object::data::{HostAddr, HostStatus};
|
|||
use crate::epp::object::{EppObject, StringValue};
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML host info response
|
||||
/// Type that represents the <epp> tag for the EPP XML host info response
|
||||
pub type EppHostInfoResponse = EppObject<CommandResponse<HostInfoResult>>;
|
||||
|
||||
/// Type that represents the <infData> tag for host info response
|
||||
/// Type that represents the <infData> tag for host info response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostInfoData {
|
||||
/// XML namespace for host response data
|
||||
|
@ -48,10 +48,10 @@ pub struct HostInfoData {
|
|||
pub transferred_at: Option<StringValue>,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for host info response
|
||||
/// Type that represents the <resData> tag for host info response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct HostInfoResult {
|
||||
/// Data under the <infData> tag
|
||||
/// Data under the <infData> tag
|
||||
#[serde(rename = "infData")]
|
||||
pub info_data: HostInfoData,
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
use crate::epp::response::EppCommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML host update response
|
||||
/// Type that represents the <epp> tag for the EPP XML host update response
|
||||
pub type EppHostUpdateResponse = EppCommandResponse;
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
use crate::epp::object::EppObject;
|
||||
use crate::epp::response::CommandResponse;
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML message ack response
|
||||
/// Type that represents the <epp> tag for the EPP XML message ack response
|
||||
pub type EppMessageAckResponse = EppObject<CommandResponse<String>>;
|
||||
|
|
|
@ -4,10 +4,10 @@ use crate::epp::object::{EppObject, StringValue};
|
|||
use crate::epp::response::CommandResponse;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Type that represents the <epp> tag for the EPP XML message poll response
|
||||
/// Type that represents the <epp> tag for the EPP XML message poll response
|
||||
pub type EppMessagePollResponse = EppObject<CommandResponse<MessagePollResult>>;
|
||||
|
||||
/// Type that represents the <trnData> tag for message poll response
|
||||
/// Type that represents the <trnData> tag for message poll response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct MessageDomainTransferData {
|
||||
/// XML namespace for message response data
|
||||
|
@ -35,10 +35,10 @@ pub struct MessageDomainTransferData {
|
|||
pub expiring_at: StringValue,
|
||||
}
|
||||
|
||||
/// Type that represents the <resData> tag for message poll response
|
||||
/// Type that represents the <resData> tag for message poll response
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct MessagePollResult {
|
||||
/// Data under the <trnData> tag
|
||||
/// Data under the <trnData> tag
|
||||
#[serde(rename = "trnData")]
|
||||
pub message_data: MessageDomainTransferData,
|
||||
}
|
||||
|
|
|
@ -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
|
||||
//!
|
||||
//! 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.
|
||||
//!
|
||||
//! - Domain Check
|
||||
//! - Domain Create
|
||||
//! - Domain Info
|
||||
//! - Domain Update
|
||||
//! - Domain Delete
|
||||
//! - Domain Renew
|
||||
//! - Domain Transfer
|
||||
//! - Domain Check - [`EppDomainCheck`](epp/request/domain/check/type.EppDomainCheck.html)
|
||||
//! - Domain Create - [`EppDomainCreate`](epp/request/domain/create/type.EppDomainCreate.html)
|
||||
//! - Domain Info - [`EppDomainInfo`](epp/request/domain/info/type.EppDomainInfo.html)
|
||||
//! - Domain Update - [`EppDomainUpdate`](epp/request/domain/update/type.EppDomainUpdate.html)
|
||||
//! - Domain Delete - [`EppDomainDelete`](epp/request/domain/delete/type.EppDomainDelete.html)
|
||||
//! - Domain Renew - [`EppDomainRenew`](epp/request/domain/renew/type.EppDomainRenew.html)
|
||||
//! - Domain Transfer - [`EppDomainTransferRequest`](epp/request/domain/transfer/type.EppDomainTransferRequest.html)
|
||||
//!
|
||||
//! - Contact Check
|
||||
//! - Contact Create
|
||||
//! - Contact Info
|
||||
//! - Contact Update
|
||||
//! - Contact Delete
|
||||
//! - Contact Check - [`EppContactCheck`](epp/request/contact/check/type.EppContactCheck.html)
|
||||
//! - Contact Create - [`EppContactCreate`](epp/request/contact/create/type.EppContactCreate.html)
|
||||
//! - Contact Info - [`EppContactInfo`](epp/request/contact/info/type.EppContactInfo.html)
|
||||
//! - Contact Update - [`EppContactUpdate`](epp/request/contact/update/type.EppContactUpdate.html)
|
||||
//! - Contact Delete - [`EppContactDelete`](epp/request/contact/delete/type.EppContactDelete.html)
|
||||
//!
|
||||
//! - Host Check
|
||||
//! - Host Create
|
||||
//! - Host Info
|
||||
//! - Host Update
|
||||
//! - Host Delete
|
||||
//! - Host Check - [`EppHostCheck`](epp/request/host/check/type.EppHostCheck.html)
|
||||
//! - Host Create - [`EppHostCreate`](epp/request/host/create/type.EppHostCreate.html)
|
||||
//! - Host Info - [`EppHostInfo`](epp/request/host/info/type.EppHostInfo.html)
|
||||
//! - Host Update - [`EppHostUpdate`](epp/request/host/update/type.EppHostUpdate.html)
|
||||
//! - 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
|
||||
//!
|
||||
|
@ -44,7 +47,7 @@
|
|||
//! # service extensions
|
||||
//! ext_uris = []
|
||||
//!
|
||||
//! [registry.hexonet.tls_files]
|
||||
//! [registry.verisign.tls_files]
|
||||
//! # the full client certificate chain in PEM format
|
||||
//! cert_chain = '/path/to/certificate/chain/pemfile'
|
||||
//! # the RSA private key for your certificate
|
||||
|
@ -72,7 +75,10 @@
|
|||
//!
|
||||
//! // Make a domain check call, which returns an object of type EppDomainCheckResponse
|
||||
//! // 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();
|
||||
//!
|
||||
|
|
Loading…
Reference in New Issue