Remove overly duplicative doctests

This commit is contained in:
Dirkjan Ochtman 2021-12-07 09:27:13 +01:00 committed by masalachai
parent 50c21a7037
commit 38d4391e43
23 changed files with 0 additions and 1308 deletions

View File

@ -23,57 +23,6 @@ impl<E: EppExtension> Transaction<E> for ContactCheck<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for contact &lt;check&gt; 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> { impl<E: EppExtension> ContactCheck<E> {
pub fn new(contact_ids: &[&str]) -> ContactCheck<NoExtension> { pub fn new(contact_ids: &[&str]) -> ContactCheck<NoExtension> {
let contact_ids = contact_ids let contact_ids = contact_ids

View File

@ -22,72 +22,6 @@ impl<E: EppExtension> Transaction<E> for ContactCreate<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for contact &lt;create&gt; 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> { impl<E: EppExtension> ContactCreate<E> {
pub fn new( pub fn new(
id: &str, id: &str,

View File

@ -23,57 +23,6 @@ impl<E: EppExtension> Transaction<E> for ContactDelete<E> {
} }
} }
/// Type for the &lt;epp&gt; request for contact &lt;delete&gt; 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> { impl<E: EppExtension> ContactDelete<E> {
pub fn new(id: &str) -> ContactDelete<NoExtension> { pub fn new(id: &str) -> ContactDelete<NoExtension> {
ContactDelete { ContactDelete {

View File

@ -24,58 +24,6 @@ impl<E: EppExtension> Transaction<E> for ContactInfo<E> {
} }
} }
/// Type for the &lt;epp&gt; request for contact &lt;info&gt; 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> { impl<E: EppExtension> ContactInfo<E> {
pub fn new(id: &str, auth_password: &str) -> ContactInfo<NoExtension> { pub fn new(id: &str, auth_password: &str) -> ContactInfo<NoExtension> {
ContactInfo { ContactInfo {

View File

@ -25,66 +25,6 @@ impl<E: EppExtension> Transaction<E> for ContactUpdate<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for contact &lt;update&gt; 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> { impl<E: EppExtension> ContactUpdate<E> {
pub fn new(id: &str) -> ContactUpdate<NoExtension> { pub fn new(id: &str) -> ContactUpdate<NoExtension> {
ContactUpdate { ContactUpdate {

View File

@ -22,57 +22,6 @@ impl<E: EppExtension> Transaction<E> for DomainCheck<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for domain &lt;check&gt; 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> { impl<E: EppExtension> DomainCheck<E> {
pub fn new(domains: Vec<&str>) -> DomainCheck<NoExtension> { pub fn new(domains: Vec<&str>) -> DomainCheck<NoExtension> {
DomainCheck { DomainCheck {

View File

@ -24,85 +24,6 @@ impl<E: EppExtension> Transaction<E> for DomainCreate<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for domain &lt;create&gt; command
/// with &lt;hostObj&gt; elements in the request for &lt;ns&gt; 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> { impl<E: EppExtension> DomainCreate<E> {
pub fn new( pub fn new(
name: &str, name: &str,

View File

@ -23,55 +23,6 @@ impl<E: EppExtension> Transaction<E> for DomainDelete<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for domain &lt;delete&gt; 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> { impl<E: EppExtension> DomainDelete<E> {
pub fn new(name: &str) -> DomainDelete<NoExtension> { pub fn new(name: &str) -> DomainDelete<NoExtension> {
DomainDelete { DomainDelete {

View File

@ -24,55 +24,6 @@ impl<E: EppExtension> Transaction<E> for DomainInfo<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for domain &lt;info&gt; 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> { impl<E: EppExtension> DomainInfo<E> {
pub fn new(name: &str, auth_password: Option<&str>) -> DomainInfo<NoExtension> { pub fn new(name: &str, auth_password: Option<&str>) -> DomainInfo<NoExtension> {
DomainInfo { DomainInfo {

View File

@ -23,60 +23,6 @@ impl<E: EppExtension> Transaction<E> for DomainRenew<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for domain &lt;renew&gt; 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> { impl<E: EppExtension> DomainRenew<E> {
pub fn new(name: &str, current_expiry_date: NaiveDate, years: u16) -> DomainRenew<NoExtension> { 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(); let exp_date_str = current_expiry_date.format("%Y-%m-%d").to_string().into();

View File

@ -161,63 +161,6 @@ impl<E: EppExtension> DomainTransferRequest<E> {
} }
} }
/// Type that represents the &lt;epp&gt; 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> { impl<E: EppExtension> DomainTransferApprove<E> {
pub fn new(name: &str) -> DomainTransferApprove<NoExtension> { pub fn new(name: &str) -> DomainTransferApprove<NoExtension> {
DomainTransferApprove { DomainTransferApprove {

View File

@ -30,81 +30,6 @@ impl<E: EppExtension> Transaction<E> for DomainUpdate<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for domain &lt;update&gt; command
/// with &lt;hostObj&gt; elements in the request for &lt;ns&gt; 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> { impl<E: EppExtension> DomainUpdate<E> {
pub fn new(name: &str) -> DomainUpdate<NoExtension> { pub fn new(name: &str) -> DomainUpdate<NoExtension> {
DomainUpdate { DomainUpdate {

View File

@ -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 { impl Update {
/// Create a new RGP restore report request /// Create a new RGP restore report request
pub fn new(expiration: GMonthDay) -> Self { pub fn new(expiration: GMonthDay) -> Self {

View File

@ -6,60 +6,6 @@ use crate::{common::StringValue, request::EppExtension};
pub const XMLNS: &str = "http://www.verisign-grs.com/epp/namestoreExt-1.1"; pub const XMLNS: &str = "http://www.verisign-grs.com/epp/namestoreExt-1.1";
/// Type that represents the &lt;epp&gt; request for domain &lt;check&gt; 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 { impl NameStore {
/// Create a new RGP restore report request /// Create a new RGP restore report request
pub fn new(subproduct: &str) -> NameStore { pub fn new(subproduct: &str) -> NameStore {

View File

@ -9,82 +9,6 @@ use serde::{Deserialize, Serialize};
use super::{Update, XMLNS}; 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 { impl RgpRestoreReport {
/// Create a new RGP restore report request /// Create a new RGP restore report request
pub fn new( pub fn new(

View File

@ -10,60 +10,6 @@ use serde::{Deserialize, Serialize};
use super::{Update, XMLNS}; use super::{Update, XMLNS};
/// Type that represents the &lt;epp&gt; 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> { impl EppExtension for Update<RgpRestoreRequest> {
type Response = Update<RgpRequestResponse>; type Response = Update<RgpRequestResponse>;
} }

View File

@ -24,57 +24,6 @@ impl<E: EppExtension> Transaction<E> for HostCheck<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for host &lt;check&gt; 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> { impl<E: EppExtension> HostCheck<E> {
pub fn new(hosts: &[&str]) -> HostCheck<NoExtension> { pub fn new(hosts: &[&str]) -> HostCheck<NoExtension> {
let hosts = hosts.iter().map(|&d| d.into()).collect(); let hosts = hosts.iter().map(|&d| d.into()).collect();

View File

@ -22,62 +22,6 @@ impl<E: EppExtension> Transaction<E> for HostCreate<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for host &lt;create&gt; 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> { impl<E: EppExtension> HostCreate<E> {
pub fn new(host: &str, addresses: Vec<HostAddr>) -> HostCreate<NoExtension> { pub fn new(host: &str, addresses: Vec<HostAddr>) -> HostCreate<NoExtension> {
HostCreate { HostCreate {

View File

@ -23,55 +23,6 @@ impl<E: EppExtension> Transaction<E> for HostDelete<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for host &lt;delete&gt; 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> { impl<E: EppExtension> HostDelete<E> {
pub fn new(name: &str) -> HostDelete<NoExtension> { pub fn new(name: &str) -> HostDelete<NoExtension> {
HostDelete { HostDelete {

View File

@ -22,55 +22,6 @@ impl<E: EppExtension> Transaction<E> for HostInfo<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for host &lt;info&gt; 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> { impl<E: EppExtension> HostInfo<E> {
pub fn new(name: &str) -> HostInfo<NoExtension> { pub fn new(name: &str) -> HostInfo<NoExtension> {
HostInfo { HostInfo {

View File

@ -23,77 +23,6 @@ impl<E: EppExtension> Transaction<E> for HostUpdate<E> {
} }
} }
/// Type that represents the &lt;epp&gt; request for host &lt;update&gt; 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 &lt;chg&gt; 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> { impl<E: EppExtension> HostUpdate<E> {
pub fn new(name: &str) -> HostUpdate<NoExtension> { pub fn new(name: &str) -> HostUpdate<NoExtension> {
HostUpdate { HostUpdate {

View File

@ -21,54 +21,6 @@ impl<E: EppExtension> Transaction<E> for MessageAck<E> {
} }
} }
/// Type that represents the &lt;epp&gt; 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> { impl<E: EppExtension> MessageAck<E> {
pub fn new(message_id: u32) -> MessageAck<NoExtension> { pub fn new(message_id: u32) -> MessageAck<NoExtension> {
MessageAck { MessageAck {

View File

@ -21,55 +21,6 @@ impl<E: EppExtension> Transaction<E> for MessagePoll<E> {
} }
} }
/// Type that represents the &lt;epp&gt; 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> { impl<E: EppExtension> MessagePoll<E> {
pub fn new() -> MessagePoll<NoExtension> { pub fn new() -> MessagePoll<NoExtension> {
MessagePoll { MessagePoll {