Remove overly duplicative doctests
This commit is contained in:
parent
50c21a7037
commit
38d4391e43
|
@ -23,57 +23,6 @@ impl<E: EppExtension> Transaction<E> for ContactCheck<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for contact <check> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::contact::check::ContactCheck;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an ContactCheck instance
|
||||
/// let contact_check = ContactCheck::<NoExtension>::new(
|
||||
/// &["epp-client-c1", "epp-client-c2"]
|
||||
/// );
|
||||
///
|
||||
/// // send it to the registry and receive a response of type ContactCheckResponse
|
||||
///
|
||||
/// let response = client.transact(contact_check, "transaction-id").await.unwrap();
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> ContactCheck<E> {
|
||||
pub fn new(contact_ids: &[&str]) -> ContactCheck<NoExtension> {
|
||||
let contact_ids = contact_ids
|
||||
|
|
|
@ -22,72 +22,6 @@ impl<E: EppExtension> Transaction<E> for ContactCreate<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for contact <create> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::{Address, Phone, PostalInfo};
|
||||
/// use epp_client::contact::create::ContactCreate;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create the address, postal_info, voice instances
|
||||
/// let street = vec!["58", "Orchid Road"];
|
||||
/// let address = Address::new(&street, "New York", "New York", "392374", "US".parse().unwrap());
|
||||
/// let postal_info = PostalInfo::new("int", "John Doe", "Acme Widgets", address);
|
||||
/// let mut voice = Phone::new("+1.47237942");
|
||||
/// voice.set_extension("123");
|
||||
/// let mut fax = Phone::new("+1.86698799");
|
||||
/// fax.set_extension("677");
|
||||
///
|
||||
/// // Create an ContactCreate instance
|
||||
/// let mut contact_create = ContactCreate::<NoExtension>::new(
|
||||
/// "eppdev-contact-100",
|
||||
/// "contact@eppdev.net",
|
||||
/// postal_info,
|
||||
/// voice,
|
||||
/// "epP4uthd#v"
|
||||
/// );
|
||||
/// contact_create.set_fax(fax);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type ContactCreateResponse
|
||||
/// let response = client.transact(contact_create, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> ContactCreate<E> {
|
||||
pub fn new(
|
||||
id: &str,
|
||||
|
|
|
@ -23,57 +23,6 @@ impl<E: EppExtension> Transaction<E> for ContactDelete<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type for the <epp> request for contact <delete> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::contact::delete::ContactDelete;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an ContactDelete instance
|
||||
/// let contact_delete = ContactDelete::<NoExtension>::new(
|
||||
/// "eppdev-contact-100"
|
||||
/// );
|
||||
///
|
||||
/// // send it to the registry and receive a response of type ContactDeleteResponse
|
||||
/// let response = client.transact(contact_delete, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> ContactDelete<E> {
|
||||
pub fn new(id: &str) -> ContactDelete<NoExtension> {
|
||||
ContactDelete {
|
||||
|
|
|
@ -24,58 +24,6 @@ impl<E: EppExtension> Transaction<E> for ContactInfo<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type for the <epp> request for contact <info> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::contact::info::ContactInfo;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an ContactInfo instance
|
||||
/// let contact_info = ContactInfo::<NoExtension>::new(
|
||||
/// "eppdev-contact-100",
|
||||
/// "epP4uthd#v"
|
||||
/// );
|
||||
///
|
||||
/// // send it to the registry and receive a response of type ContactInfoResponse
|
||||
/// let response = client.transact(contact_info, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> ContactInfo<E> {
|
||||
pub fn new(id: &str, auth_password: &str) -> ContactInfo<NoExtension> {
|
||||
ContactInfo {
|
||||
|
|
|
@ -25,66 +25,6 @@ impl<E: EppExtension> Transaction<E> for ContactUpdate<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for contact <update> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::contact::update::ContactUpdate;
|
||||
/// use epp_client::common::ContactStatus;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an ContactUpdate instance
|
||||
/// let mut contact_update = ContactUpdate::<NoExtension>::new(
|
||||
/// "eppdev-contact-100"
|
||||
/// );
|
||||
///
|
||||
/// let add_statuses = vec![
|
||||
/// ContactStatus {
|
||||
/// status: "clientTransferProhibited".to_string()
|
||||
/// }
|
||||
/// ];
|
||||
///
|
||||
/// contact_update.add(add_statuses);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type ContactUpdateResponse
|
||||
/// let response = client.transact(contact_update, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> ContactUpdate<E> {
|
||||
pub fn new(id: &str) -> ContactUpdate<NoExtension> {
|
||||
ContactUpdate {
|
||||
|
|
|
@ -22,57 +22,6 @@ impl<E: EppExtension> Transaction<E> for DomainCheck<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for domain <check> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::check::DomainCheck;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainCheck instance
|
||||
/// let domain_check = DomainCheck::<NoExtension>::new(
|
||||
/// vec!["eppdev-100.com", "eppdev-100.net"],
|
||||
/// );
|
||||
///
|
||||
/// // send it to the registry and receive a response of type EppDomainCheckResponse
|
||||
/// let response = client.transact(domain_check, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> DomainCheck<E> {
|
||||
pub fn new(domains: Vec<&str>) -> DomainCheck<NoExtension> {
|
||||
DomainCheck {
|
||||
|
|
|
@ -24,85 +24,6 @@ impl<E: EppExtension> Transaction<E> for DomainCreate<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for domain <create> command
|
||||
/// with <hostObj> elements in the request for <ns> list
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::DomainContact;
|
||||
/// use epp_client::domain::create::DomainCreate;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
/// use epp_client::common::HostAttrList;
|
||||
/// use epp_client::common::HostList;
|
||||
/// use epp_client::common::HostObjList;
|
||||
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// let contacts = vec![
|
||||
/// DomainContact {
|
||||
/// contact_type: "admin".to_string(),
|
||||
/// id: "eppdev-contact-3".to_string(),
|
||||
/// },
|
||||
/// DomainContact {
|
||||
/// contact_type: "tech".to_string(),
|
||||
/// id: "eppdev-contact-3".to_string(),
|
||||
/// },
|
||||
/// DomainContact {
|
||||
/// contact_type: "billing".to_string(),
|
||||
/// id: "eppdev-contact-3".to_string(),
|
||||
/// },
|
||||
/// ];
|
||||
|
||||
/// let ns = Some(HostList::HostObjList(HostObjList {
|
||||
/// hosts: vec!["ns1.test.com".into(), "ns2.test.com".into()],
|
||||
/// }));
|
||||
|
||||
/// let domain_create = DomainCreate::<NoExtension>::new(
|
||||
/// "eppdev-1.com",
|
||||
/// 1,
|
||||
/// ns,
|
||||
/// Some("eppdev-contact-3"),
|
||||
/// "epP4uthd#v",
|
||||
/// Some(contacts),
|
||||
/// );
|
||||
///
|
||||
/// // send it to the registry and receive a response of type EppDomainCreateResponse
|
||||
/// let response = client.transact(domain_create, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> DomainCreate<E> {
|
||||
pub fn new(
|
||||
name: &str,
|
||||
|
|
|
@ -23,55 +23,6 @@ impl<E: EppExtension> Transaction<E> for DomainDelete<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for domain <delete> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::delete::DomainDelete;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainDelete instance
|
||||
/// let mut domain_delete = DomainDelete::<NoExtension>::new("eppdev-100.com");
|
||||
///
|
||||
/// // send it to the registry and receive a response of type DomainDeleteResponse
|
||||
/// let response = client.transact(domain_delete, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> DomainDelete<E> {
|
||||
pub fn new(name: &str) -> DomainDelete<NoExtension> {
|
||||
DomainDelete {
|
||||
|
|
|
@ -24,55 +24,6 @@ impl<E: EppExtension> Transaction<E> for DomainInfo<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for domain <info> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::info::DomainInfo;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainInfo instance
|
||||
/// let domain_info = DomainInfo::<NoExtension>::new("eppdev-100.com", None);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type DomainInfoResponse
|
||||
/// let response = client.transact(domain_info, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> DomainInfo<E> {
|
||||
pub fn new(name: &str, auth_password: Option<&str>) -> DomainInfo<NoExtension> {
|
||||
DomainInfo {
|
||||
|
|
|
@ -23,60 +23,6 @@ impl<E: EppExtension> Transaction<E> for DomainRenew<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for domain <renew> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use chrono::NaiveDate;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::renew::DomainRenew;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create a date object to set the current expiry date
|
||||
/// let exp_date = NaiveDate::from_ymd(2022, 7, 27);
|
||||
///
|
||||
/// // Create an DomainRenew instance
|
||||
/// let domain_renew = DomainRenew::<NoExtension>::new("eppdev-100.com", exp_date, 1);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type DomainRenewResponse
|
||||
/// let response = client.transact(domain_renew, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> DomainRenew<E> {
|
||||
pub fn new(name: &str, current_expiry_date: NaiveDate, years: u16) -> DomainRenew<NoExtension> {
|
||||
let exp_date_str = current_expiry_date.format("%Y-%m-%d").to_string().into();
|
||||
|
|
|
@ -161,63 +161,6 @@ impl<E: EppExtension> DomainTransferRequest<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for transfer approval for domains
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::transfer::DomainTransferApprove;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// // Create an DomainTransferApprove instance
|
||||
/// let domain_transfer_approve = DomainTransferApprove::<NoExtension>::new(
|
||||
/// "eppdev-100.net"
|
||||
/// );
|
||||
///
|
||||
/// // send it to the registry and receive a response of type DomainTransferApproveResponse
|
||||
/// let response = client.transact(domain_transfer_approve, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> DomainTransferApprove<E> {
|
||||
pub fn new(name: &str) -> DomainTransferApprove<NoExtension> {
|
||||
DomainTransferApprove {
|
||||
|
|
|
@ -30,81 +30,6 @@ impl<E: EppExtension> Transaction<E> for DomainUpdate<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for domain <update> command
|
||||
/// with <hostObj> elements in the request for <ns> list
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::{DomainStatus, DomainContact};
|
||||
/// use epp_client::domain::update::{DomainUpdate, DomainAddRemove};
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainUpdate instance
|
||||
/// let mut domain_update = DomainUpdate::<NoExtension>::new("eppdev-100.com");
|
||||
///
|
||||
/// let add = DomainAddRemove {
|
||||
/// ns: None,
|
||||
/// contacts: None,
|
||||
/// statuses: Some(vec![
|
||||
/// DomainStatus {
|
||||
/// status: "clientUpdateProhibited".to_string()
|
||||
/// }
|
||||
/// ])
|
||||
/// };
|
||||
///
|
||||
/// let remove = DomainAddRemove {
|
||||
/// ns: None,
|
||||
/// contacts: Some(vec![
|
||||
/// DomainContact {
|
||||
/// contact_type: "billing".to_string(),
|
||||
/// id: "eppdev-contact-2".to_string()
|
||||
/// }
|
||||
/// ]),
|
||||
/// statuses: None,
|
||||
/// };
|
||||
///
|
||||
/// domain_update.add(add);
|
||||
/// domain_update.remove(remove);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type EppDomainUpdateResponse
|
||||
/// let response = client.transact(domain_update, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> DomainUpdate<E> {
|
||||
pub fn new(name: &str) -> DomainUpdate<NoExtension> {
|
||||
DomainUpdate {
|
||||
|
|
|
@ -53,63 +53,6 @@ impl fmt::Display for GMonthDay {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the domain rgp restore report extension
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::{DomainStatus, DomainContact};
|
||||
/// use epp_client::domain::update::DomainUpdate;
|
||||
/// use epp_client::extensions::consolidate;
|
||||
/// use epp_client::extensions::consolidate::GMonthDay;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
/// use chrono::{DateTime, NaiveDate};
|
||||
/// use std::str::FromStr;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// let exp = GMonthDay::new(5, 31, None).unwrap();
|
||||
/// let consolidate_ext = consolidate::Update::new(exp);
|
||||
///
|
||||
/// // Create an DomainUpdate instance
|
||||
/// let mut domain_update = DomainUpdate::<consolidate::Update>::new("eppdev-100.com").with_extension(consolidate_ext);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type EppDomainUpdateResponse
|
||||
/// let response = client.transact(domain_update, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl Update {
|
||||
/// Create a new RGP restore report request
|
||||
pub fn new(expiration: GMonthDay) -> Self {
|
||||
|
|
|
@ -6,60 +6,6 @@ use crate::{common::StringValue, request::EppExtension};
|
|||
|
||||
pub const XMLNS: &str = "http://www.verisign-grs.com/epp/namestoreExt-1.1";
|
||||
|
||||
/// Type that represents the <epp> request for domain <check> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::check::DomainCheck;
|
||||
/// use epp_client::extensions::namestore::NameStore;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// let namestore_ext = NameStore::new("com");
|
||||
///
|
||||
/// // Create an DomainCheck instance
|
||||
/// let domain_check = DomainCheck::<NameStore>::new(
|
||||
/// vec!["eppdev-100.com", "eppdev-200.com"],
|
||||
/// ).with_extension(namestore_ext);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type EppDomainCheckResponse
|
||||
/// let response = client.transact(domain_check, "test-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl NameStore {
|
||||
/// Create a new RGP restore report request
|
||||
pub fn new(subproduct: &str) -> NameStore {
|
||||
|
|
|
@ -9,82 +9,6 @@ use serde::{Deserialize, Serialize};
|
|||
|
||||
use super::{Update, XMLNS};
|
||||
|
||||
/// Type that represents the domain rgp restore report extension
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::{DomainStatus, DomainContact};
|
||||
/// use epp_client::extensions::rgp::{Update, report::RgpRestoreReport};
|
||||
/// use epp_client::domain::update::DomainUpdate;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
/// use chrono::{DateTime, NaiveDate};
|
||||
/// use std::str::FromStr;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// let pre_data =
|
||||
/// "Pre-delete registration data goes here. Both XML and free text are allowed.";
|
||||
/// let post_data =
|
||||
/// "Post-restore registration data goes here. Both XML and free text are allowed.";
|
||||
/// let deleted_at = DateTime::from_str("2021-07-10T22:00:00.0Z").unwrap();
|
||||
/// let restored_at = DateTime::from_str("2021-07-20T22:00:00.0Z").unwrap();
|
||||
/// let restore_reason = "Registrant error.";
|
||||
/// let statements = vec![
|
||||
/// "This registrar has not restored the Registered Name in order to assume the rights to use or sell the Registered Name for itself or for any third party.",
|
||||
/// "The information in this report is true to best of this registrar's knowledge, and this registrar acknowledges that intentionally supplying false information in this report shall constitute an incurable material breach of the Registry-Registrar Agreement.",
|
||||
/// ];
|
||||
/// let other = "Supporting information goes here.";
|
||||
///
|
||||
/// let domain_restore_report = Update { data: RgpRestoreReport::new(
|
||||
/// pre_data,
|
||||
/// post_data,
|
||||
/// deleted_at,
|
||||
/// restored_at,
|
||||
/// restore_reason,
|
||||
/// &statements,
|
||||
/// other
|
||||
/// ) };
|
||||
///
|
||||
/// // Create an DomainUpdate instance
|
||||
/// let mut domain_update = DomainUpdate::<Update<RgpRestoreReport>>::new("eppdev-100.com").with_extension(domain_restore_report);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type EppDomainUpdateResponse
|
||||
/// let response = client.transact(domain_update, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl RgpRestoreReport {
|
||||
/// Create a new RGP restore report request
|
||||
pub fn new(
|
||||
|
|
|
@ -10,60 +10,6 @@ use serde::{Deserialize, Serialize};
|
|||
|
||||
use super::{Update, XMLNS};
|
||||
|
||||
/// Type that represents the <epp> request for a domain rgp restore request command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::extensions::rgp::{Update, request::RgpRestoreRequest};
|
||||
/// use epp_client::domain::update::DomainUpdate;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
/// use epp_client::common::NoExtension;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an RgpRestoreRequest instance
|
||||
/// let domain_restore_req = Update { data: RgpRestoreRequest::default() };
|
||||
///
|
||||
/// // Create an DomainUpdate instance
|
||||
/// let mut domain_update = DomainUpdate::<Update<RgpRestoreRequest>>::new("eppdev-100.com").with_extension(domain_restore_req);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type EppDomainUpdateResponse
|
||||
/// let response = client.transact(domain_update, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
impl EppExtension for Update<RgpRestoreRequest> {
|
||||
type Response = Update<RgpRequestResponse>;
|
||||
}
|
||||
|
|
|
@ -24,57 +24,6 @@ impl<E: EppExtension> Transaction<E> for HostCheck<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for host <check> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::host::check::HostCheck;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an HostCheck instance
|
||||
/// let host_check = HostCheck::<NoExtension>::new(
|
||||
/// &["ns1.eppdev-101.com", "ns2.eppdev-101.com"]
|
||||
/// );
|
||||
///
|
||||
/// // send it to the registry and receive a response of type HostCheckResponse
|
||||
/// let response = client.transact(host_check, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> HostCheck<E> {
|
||||
pub fn new(hosts: &[&str]) -> HostCheck<NoExtension> {
|
||||
let hosts = hosts.iter().map(|&d| d.into()).collect();
|
||||
|
|
|
@ -22,62 +22,6 @@ impl<E: EppExtension> Transaction<E> for HostCreate<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for host <create> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::HostAddr;
|
||||
/// use epp_client::host::create::HostCreate;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create a vector of IP addresses to assign to the host
|
||||
/// let addresses = vec![
|
||||
/// HostAddr::new("v4", "29.245.122.14"),
|
||||
/// HostAddr::new("v6", "2404:6800:4001:801::200e"),
|
||||
/// ];
|
||||
///
|
||||
/// // Create an HostCreate instance
|
||||
/// let host_create = HostCreate::<NoExtension>::new("ns1.eppdev-101.com", addresses);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type HostCreateResponse
|
||||
/// let response = client.transact(host_create, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> HostCreate<E> {
|
||||
pub fn new(host: &str, addresses: Vec<HostAddr>) -> HostCreate<NoExtension> {
|
||||
HostCreate {
|
||||
|
|
|
@ -23,55 +23,6 @@ impl<E: EppExtension> Transaction<E> for HostDelete<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for host <delete> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::host::delete::HostDelete;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an HostDelete instance
|
||||
/// let host_delete = HostDelete::<NoExtension>::new("ns2.eppdev-101.com");
|
||||
///
|
||||
/// // send it to the registry and receive a response of type HostDeleteResponse
|
||||
/// let response = client.transact(host_delete, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> HostDelete<E> {
|
||||
pub fn new(name: &str) -> HostDelete<NoExtension> {
|
||||
HostDelete {
|
||||
|
|
|
@ -22,55 +22,6 @@ impl<E: EppExtension> Transaction<E> for HostInfo<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for host <info> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::host::info::HostInfo;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an HostInfo instance
|
||||
/// let host_info = HostInfo::<NoExtension>::new("ns2.eppdev-101.com");
|
||||
///
|
||||
/// // send it to the registry and receive a response of type HostInfoResponse
|
||||
/// let response = client.transact(host_info, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> HostInfo<E> {
|
||||
pub fn new(name: &str) -> HostInfo<NoExtension> {
|
||||
HostInfo {
|
||||
|
|
|
@ -23,77 +23,6 @@ impl<E: EppExtension> Transaction<E> for HostUpdate<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for host <update> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::{HostAddr, HostStatus};
|
||||
/// use epp_client::host::update::{HostUpdate, HostAddRemove, HostChangeInfo};
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an HostUpdate instance
|
||||
/// let mut host_update = HostUpdate::<NoExtension>::new("ns1.eppdev-101.com");
|
||||
///
|
||||
/// /// Prepare the add and remove sections for the update
|
||||
/// let add = HostAddRemove {
|
||||
/// addresses: Some(vec![
|
||||
/// HostAddr::new("v4", "177.34.126.17")
|
||||
/// ]),
|
||||
/// statuses: None
|
||||
/// };
|
||||
///
|
||||
/// let remove = HostAddRemove {
|
||||
/// addresses: Some(vec![
|
||||
/// HostAddr::new("v6", "2404:6800:4001:801::200e")
|
||||
/// ]),
|
||||
/// statuses: None,
|
||||
/// };
|
||||
///
|
||||
/// host_update.add(add);
|
||||
/// host_update.remove(remove);
|
||||
///
|
||||
/// // Send a <chg> section as well
|
||||
/// host_update.info(HostChangeInfo { name: "ns2.eppdev-101.com".into() });
|
||||
///
|
||||
/// // send it to the registry and receive a response of type HostUpdateResponse
|
||||
/// let response = client.transact(host_update, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> HostUpdate<E> {
|
||||
pub fn new(name: &str) -> HostUpdate<NoExtension> {
|
||||
HostUpdate {
|
||||
|
|
|
@ -21,54 +21,6 @@ impl<E: EppExtension> Transaction<E> for MessageAck<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for registry <poll op="ack"> command
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::message::ack::MessageAck;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an MessageAck instance
|
||||
/// let message_ack = MessageAck::<NoExtension>::new(12345);
|
||||
///
|
||||
/// // send it to the registry and receive a response of type MessageAckResponse
|
||||
/// let response = client.transact(message_ack, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> MessageAck<E> {
|
||||
pub fn new(message_id: u32) -> MessageAck<NoExtension> {
|
||||
MessageAck {
|
||||
|
|
|
@ -21,55 +21,6 @@ impl<E: EppExtension> Transaction<E> for MessagePoll<E> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Type that represents the <epp> request for registry <poll op="req"> command
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::message::poll::MessagePoll;
|
||||
/// use epp_client::common::NoExtension;
|
||||
/// use epp_client::login::Login;
|
||||
/// use epp_client::logout::Logout;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// tls_files: None,
|
||||
/// },
|
||||
/// );
|
||||
/// let config = EppClientConfig { registry };
|
||||
///
|
||||
/// // Create an instance of EppClient, passing the config and the registry you want to connect to
|
||||
/// let mut client = match EppClient::new(&config, "registry_name").await {
|
||||
/// Ok(client) => client,
|
||||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an MessagePoll instance
|
||||
/// let message_poll = MessagePoll::<NoExtension>::new();
|
||||
///
|
||||
/// // send it to the registry and receive a response of type MessagePollResponse
|
||||
/// let response = client.transact(message_poll, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// println!("{:?}", response);
|
||||
///
|
||||
/// let logout = Logout::<NoExtension>::new();
|
||||
/// client.transact(logout, "transaction-id").await.unwrap();
|
||||
/// }
|
||||
/// ```
|
||||
impl<E: EppExtension> MessagePoll<E> {
|
||||
pub fn new() -> MessagePoll<NoExtension> {
|
||||
MessagePoll {
|
||||
|
|
Loading…
Reference in New Issue