diff --git a/epp-client/src/contact/check.rs b/epp-client/src/contact/check.rs index 7747bde..bc1a93a 100644 --- a/epp-client/src/contact/check.rs +++ b/epp-client/src/contact/check.rs @@ -23,57 +23,6 @@ impl Transaction for ContactCheck { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an ContactCheck instance -/// let contact_check = ContactCheck::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl ContactCheck { pub fn new(contact_ids: &[&str]) -> ContactCheck { let contact_ids = contact_ids diff --git a/epp-client/src/contact/create.rs b/epp-client/src/contact/create.rs index 96e7340..238167d 100644 --- a/epp-client/src/contact/create.rs +++ b/epp-client/src/contact/create.rs @@ -22,72 +22,6 @@ impl Transaction for ContactCreate { } } -/// 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 = 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::::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::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl ContactCreate { pub fn new( id: &str, diff --git a/epp-client/src/contact/delete.rs b/epp-client/src/contact/delete.rs index fd93e29..06d2a33 100644 --- a/epp-client/src/contact/delete.rs +++ b/epp-client/src/contact/delete.rs @@ -23,57 +23,6 @@ impl Transaction for ContactDelete { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an ContactDelete instance -/// let contact_delete = ContactDelete::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl ContactDelete { pub fn new(id: &str) -> ContactDelete { ContactDelete { diff --git a/epp-client/src/contact/info.rs b/epp-client/src/contact/info.rs index d846163..97d7a40 100644 --- a/epp-client/src/contact/info.rs +++ b/epp-client/src/contact/info.rs @@ -24,58 +24,6 @@ impl Transaction for ContactInfo { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an ContactInfo instance -/// let contact_info = ContactInfo::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl ContactInfo { pub fn new(id: &str, auth_password: &str) -> ContactInfo { ContactInfo { diff --git a/epp-client/src/contact/update.rs b/epp-client/src/contact/update.rs index 15d1341..d7fc9ae 100644 --- a/epp-client/src/contact/update.rs +++ b/epp-client/src/contact/update.rs @@ -25,66 +25,6 @@ impl Transaction for ContactUpdate { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an ContactUpdate instance -/// let mut contact_update = ContactUpdate::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl ContactUpdate { pub fn new(id: &str) -> ContactUpdate { ContactUpdate { diff --git a/epp-client/src/domain/check.rs b/epp-client/src/domain/check.rs index 6fbada2..62d9654 100644 --- a/epp-client/src/domain/check.rs +++ b/epp-client/src/domain/check.rs @@ -22,57 +22,6 @@ impl Transaction for DomainCheck { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an DomainCheck instance -/// let domain_check = DomainCheck::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl DomainCheck { pub fn new(domains: Vec<&str>) -> DomainCheck { DomainCheck { diff --git a/epp-client/src/domain/create.rs b/epp-client/src/domain/create.rs index f2a2c90..035d632 100644 --- a/epp-client/src/domain/create.rs +++ b/epp-client/src/domain/create.rs @@ -24,85 +24,6 @@ impl Transaction for DomainCreate { } } -/// 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 = 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::::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::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl DomainCreate { pub fn new( name: &str, diff --git a/epp-client/src/domain/delete.rs b/epp-client/src/domain/delete.rs index d2d03c1..d37db41 100644 --- a/epp-client/src/domain/delete.rs +++ b/epp-client/src/domain/delete.rs @@ -23,55 +23,6 @@ impl Transaction for DomainDelete { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an DomainDelete instance -/// let mut domain_delete = DomainDelete::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl DomainDelete { pub fn new(name: &str) -> DomainDelete { DomainDelete { diff --git a/epp-client/src/domain/info.rs b/epp-client/src/domain/info.rs index 7136672..c6b2456 100644 --- a/epp-client/src/domain/info.rs +++ b/epp-client/src/domain/info.rs @@ -24,55 +24,6 @@ impl Transaction for DomainInfo { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an DomainInfo instance -/// let domain_info = DomainInfo::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl DomainInfo { pub fn new(name: &str, auth_password: Option<&str>) -> DomainInfo { DomainInfo { diff --git a/epp-client/src/domain/renew.rs b/epp-client/src/domain/renew.rs index 02aaa26..a46a57e 100644 --- a/epp-client/src/domain/renew.rs +++ b/epp-client/src/domain/renew.rs @@ -23,60 +23,6 @@ impl Transaction for DomainRenew { } } -/// 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 = 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::::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::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl DomainRenew { pub fn new(name: &str, current_expiry_date: NaiveDate, years: u16) -> DomainRenew { let exp_date_str = current_expiry_date.format("%Y-%m-%d").to_string().into(); diff --git a/epp-client/src/domain/transfer.rs b/epp-client/src/domain/transfer.rs index faf6f97..b816513 100644 --- a/epp-client/src/domain/transfer.rs +++ b/epp-client/src/domain/transfer.rs @@ -161,63 +161,6 @@ impl DomainTransferRequest { } } -/// 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 = 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::::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::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl DomainTransferApprove { pub fn new(name: &str) -> DomainTransferApprove { DomainTransferApprove { diff --git a/epp-client/src/domain/update.rs b/epp-client/src/domain/update.rs index 8271c04..d5e91cb 100644 --- a/epp-client/src/domain/update.rs +++ b/epp-client/src/domain/update.rs @@ -30,81 +30,6 @@ impl Transaction for DomainUpdate { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an DomainUpdate instance -/// let mut domain_update = DomainUpdate::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl DomainUpdate { pub fn new(name: &str) -> DomainUpdate { DomainUpdate { diff --git a/epp-client/src/extensions/consolidate.rs b/epp-client/src/extensions/consolidate.rs index 2b82f13..4ef63e5 100644 --- a/epp-client/src/extensions/consolidate.rs +++ b/epp-client/src/extensions/consolidate.rs @@ -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 = 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::::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::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl Update { /// Create a new RGP restore report request pub fn new(expiration: GMonthDay) -> Self { diff --git a/epp-client/src/extensions/namestore.rs b/epp-client/src/extensions/namestore.rs index 2e1c9a8..cf0f139 100644 --- a/epp-client/src/extensions/namestore.rs +++ b/epp-client/src/extensions/namestore.rs @@ -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 = 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::::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::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl NameStore { /// Create a new RGP restore report request pub fn new(subproduct: &str) -> NameStore { diff --git a/epp-client/src/extensions/rgp/report.rs b/epp-client/src/extensions/rgp/report.rs index e64e4a4..0b5c79e 100644 --- a/epp-client/src/extensions/rgp/report.rs +++ b/epp-client/src/extensions/rgp/report.rs @@ -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 = 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::::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::>::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl RgpRestoreReport { /// Create a new RGP restore report request pub fn new( diff --git a/epp-client/src/extensions/rgp/request.rs b/epp-client/src/extensions/rgp/request.rs index f6fe54d..6ef1d4b 100644 --- a/epp-client/src/extensions/rgp/request.rs +++ b/epp-client/src/extensions/rgp/request.rs @@ -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 = 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::::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::>::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` - impl EppExtension for Update { type Response = Update; } diff --git a/epp-client/src/host/check.rs b/epp-client/src/host/check.rs index d9bfc0f..34ce0f7 100644 --- a/epp-client/src/host/check.rs +++ b/epp-client/src/host/check.rs @@ -24,57 +24,6 @@ impl Transaction for HostCheck { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an HostCheck instance -/// let host_check = HostCheck::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl HostCheck { pub fn new(hosts: &[&str]) -> HostCheck { let hosts = hosts.iter().map(|&d| d.into()).collect(); diff --git a/epp-client/src/host/create.rs b/epp-client/src/host/create.rs index 85fde99..dcbf525 100644 --- a/epp-client/src/host/create.rs +++ b/epp-client/src/host/create.rs @@ -22,62 +22,6 @@ impl Transaction for HostCreate { } } -/// 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 = 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::::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::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl HostCreate { pub fn new(host: &str, addresses: Vec) -> HostCreate { HostCreate { diff --git a/epp-client/src/host/delete.rs b/epp-client/src/host/delete.rs index 63f8490..618bd8b 100644 --- a/epp-client/src/host/delete.rs +++ b/epp-client/src/host/delete.rs @@ -23,55 +23,6 @@ impl Transaction for HostDelete { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an HostDelete instance -/// let host_delete = HostDelete::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl HostDelete { pub fn new(name: &str) -> HostDelete { HostDelete { diff --git a/epp-client/src/host/info.rs b/epp-client/src/host/info.rs index 5c21b2b..4831fd9 100644 --- a/epp-client/src/host/info.rs +++ b/epp-client/src/host/info.rs @@ -22,55 +22,6 @@ impl Transaction for HostInfo { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an HostInfo instance -/// let host_info = HostInfo::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl HostInfo { pub fn new(name: &str) -> HostInfo { HostInfo { diff --git a/epp-client/src/host/update.rs b/epp-client/src/host/update.rs index 09ba555..0cc3bd0 100644 --- a/epp-client/src/host/update.rs +++ b/epp-client/src/host/update.rs @@ -23,77 +23,6 @@ impl Transaction for HostUpdate { } } -/// 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an HostUpdate instance -/// let mut host_update = HostUpdate::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl HostUpdate { pub fn new(name: &str) -> HostUpdate { HostUpdate { diff --git a/epp-client/src/message/ack.rs b/epp-client/src/message/ack.rs index ba4ed0e..c4cb084 100644 --- a/epp-client/src/message/ack.rs +++ b/epp-client/src/message/ack.rs @@ -21,54 +21,6 @@ impl Transaction for MessageAck { } } -/// Type that represents the <epp> request for registry 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an MessageAck instance -/// let message_ack = MessageAck::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl MessageAck { pub fn new(message_id: u32) -> MessageAck { MessageAck { diff --git a/epp-client/src/message/poll.rs b/epp-client/src/message/poll.rs index 7f98613..a307d78 100644 --- a/epp-client/src/message/poll.rs +++ b/epp-client/src/message/poll.rs @@ -21,55 +21,6 @@ impl Transaction for MessagePoll { } } -/// Type that represents the <epp> request for registry 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 = 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::::new("username", "password", None); -/// client.transact(login, "transaction-id").await.unwrap(); -/// -/// // Create an MessagePoll instance -/// let message_poll = MessagePoll::::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::::new(); -/// client.transact(logout, "transaction-id").await.unwrap(); -/// } -/// ``` impl MessagePoll { pub fn new() -> MessagePoll { MessagePoll {