diff --git a/epp-client/src/contact/check.rs b/epp-client/src/contact/check.rs index 26f030f..4ea81ff 100644 --- a/epp-client/src/contact/check.rs +++ b/epp-client/src/contact/check.rs @@ -3,8 +3,8 @@ use std::fmt::Debug; /// Types for EPP contact check request use epp_client_macros::*; +use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::contact::EPP_CONTACT_XMLNS; use crate::request::{EppExtension, EppRequest}; use serde::{Deserialize, Serialize}; @@ -82,7 +82,7 @@ impl ContactCheck { ContactCheck { request: ContactCheckRequest { list: ContactList { - xmlns: EPP_CONTACT_XMLNS.to_string(), + xmlns: XMLNS.to_string(), contact_ids, }, }, diff --git a/epp-client/src/contact/create.rs b/epp-client/src/contact/create.rs index b18ec07..207b331 100644 --- a/epp-client/src/contact/create.rs +++ b/epp-client/src/contact/create.rs @@ -2,8 +2,8 @@ use epp_client_macros::*; +use super::XMLNS; use crate::common::{ContactAuthInfo, ElementName, NoExtension, Phone, PostalInfo, StringValue}; -use crate::contact::EPP_CONTACT_XMLNS; use crate::request::{EppExtension, EppRequest}; use serde::{Deserialize, Serialize}; @@ -97,7 +97,7 @@ impl ContactCreate { ContactCreate { request: ContactCreateRequest { contact: Contact { - xmlns: EPP_CONTACT_XMLNS.to_string(), + xmlns: XMLNS.to_string(), id: id.into(), postal_info, voice, diff --git a/epp-client/src/contact/delete.rs b/epp-client/src/contact/delete.rs index f14349e..bccfd3f 100644 --- a/epp-client/src/contact/delete.rs +++ b/epp-client/src/contact/delete.rs @@ -2,8 +2,8 @@ use epp_client_macros::*; +use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::contact::EPP_CONTACT_XMLNS; use crate::request::{EppExtension, EppRequest}; use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; @@ -77,7 +77,7 @@ impl ContactDelete { ContactDelete { request: ContactDeleteRequest { contact: ContactDeleteRequestData { - xmlns: EPP_CONTACT_XMLNS.to_string(), + xmlns: XMLNS.to_string(), id: id.into(), }, }, diff --git a/epp-client/src/contact/info.rs b/epp-client/src/contact/info.rs index df0bf2a..0af462f 100644 --- a/epp-client/src/contact/info.rs +++ b/epp-client/src/contact/info.rs @@ -2,10 +2,10 @@ use epp_client_macros::*; +use super::XMLNS; use crate::common::{ ContactAuthInfo, ContactStatus, ElementName, NoExtension, Phone, PostalInfo, StringValue, }; -use crate::contact::EPP_CONTACT_XMLNS; use crate::request::{EppExtension, EppRequest}; use serde::{Deserialize, Serialize}; @@ -79,7 +79,7 @@ impl ContactInfo { ContactInfo { request: ContactInfoRequest { info: ContactInfoRequestData { - xmlns: EPP_CONTACT_XMLNS.to_string(), + xmlns: XMLNS.to_string(), id: id.into(), auth_info: ContactAuthInfo::new(auth_password), }, diff --git a/epp-client/src/contact/update.rs b/epp-client/src/contact/update.rs index 258604c..465112b 100644 --- a/epp-client/src/contact/update.rs +++ b/epp-client/src/contact/update.rs @@ -2,10 +2,10 @@ use epp_client_macros::*; +use super::XMLNS; use crate::common::{ ContactAuthInfo, ContactStatus, ElementName, NoExtension, Phone, PostalInfo, StringValue, }; -use crate::contact::EPP_CONTACT_XMLNS; use crate::request::{EppExtension, EppRequest}; use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; @@ -88,7 +88,7 @@ impl ContactUpdate { ContactUpdate { request: ContactUpdateRequest { contact: ContactUpdateRequestData { - xmlns: EPP_CONTACT_XMLNS.to_string(), + xmlns: XMLNS.to_string(), id: id.into(), add_statuses: None, remove_statuses: None, diff --git a/epp-client/src/domain/check.rs b/epp-client/src/domain/check.rs index c0729c6..8b48acf 100644 --- a/epp-client/src/domain/check.rs +++ b/epp-client/src/domain/check.rs @@ -2,7 +2,7 @@ use epp_client_macros::*; -use super::EPP_DOMAIN_XMLNS; +use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; use crate::request::{EppExtension, EppRequest}; use serde::{Deserialize, Serialize}; @@ -76,7 +76,7 @@ impl DomainCheck { DomainCheck { request: DomainCheckRequest { list: DomainList { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), domains: domains .into_iter() .map(|d| d.into()) diff --git a/epp-client/src/domain/create.rs b/epp-client/src/domain/create.rs index 7f4399b..4ac62cb 100644 --- a/epp-client/src/domain/create.rs +++ b/epp-client/src/domain/create.rs @@ -2,7 +2,7 @@ use epp_client_macros::*; -use super::EPP_DOMAIN_XMLNS; +use super::XMLNS; use crate::common::{ DomainAuthInfo, DomainContact, ElementName, HostList, NoExtension, Period, StringValue, }; @@ -113,7 +113,7 @@ impl DomainCreate { let registrant = registrant_id.map(|id| id.into()); let domain_create = DomainCreateRequest { domain: DomainCreateRequestData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), period: Period::new(period), ns, diff --git a/epp-client/src/domain/delete.rs b/epp-client/src/domain/delete.rs index 5451247..0d67fff 100644 --- a/epp-client/src/domain/delete.rs +++ b/epp-client/src/domain/delete.rs @@ -2,7 +2,7 @@ use epp_client_macros::*; -use super::EPP_DOMAIN_XMLNS; +use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; use crate::request::{EppExtension, EppRequest}; use crate::response::EppCommandResponse; @@ -75,7 +75,7 @@ impl DomainDelete { DomainDelete { request: DomainDeleteRequest { domain: DomainDeleteRequestData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), }, }, diff --git a/epp-client/src/domain/info.rs b/epp-client/src/domain/info.rs index 4f01bd0..c09a8ef 100644 --- a/epp-client/src/domain/info.rs +++ b/epp-client/src/domain/info.rs @@ -2,7 +2,7 @@ use epp_client_macros::*; -use super::EPP_DOMAIN_XMLNS; +use super::XMLNS; use crate::common::{ DomainAuthInfo, DomainContact, DomainStatus, ElementName, HostAttr, NoExtension, StringValue, }; @@ -76,7 +76,7 @@ impl DomainInfo { DomainInfo { request: DomainInfoRequest { info: DomainInfoRequestData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), domain: Domain { hosts: "all".to_string(), name: name.to_string(), diff --git a/epp-client/src/domain/renew.rs b/epp-client/src/domain/renew.rs index 0528b31..84e5958 100644 --- a/epp-client/src/domain/renew.rs +++ b/epp-client/src/domain/renew.rs @@ -2,7 +2,7 @@ use epp_client_macros::*; -use super::EPP_DOMAIN_XMLNS; +use super::XMLNS; use crate::common::{ElementName, NoExtension, Period, StringValue}; use crate::request::{EppExtension, EppRequest}; use chrono::NaiveDate; @@ -81,7 +81,7 @@ impl DomainRenew { DomainRenew { request: DomainRenewRequest { domain: DomainRenewRequestData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), current_expiry_date: exp_date_str, period: Period::new(years), diff --git a/epp-client/src/domain/transfer.rs b/epp-client/src/domain/transfer.rs index 12a8a00..b5d2f0a 100644 --- a/epp-client/src/domain/transfer.rs +++ b/epp-client/src/domain/transfer.rs @@ -2,7 +2,7 @@ use epp_client_macros::*; -use super::EPP_DOMAIN_XMLNS; +use super::XMLNS; use crate::common::{DomainAuthInfo, ElementName, NoExtension, Period, StringValue}; use crate::request::{EppExtension, EppRequest}; use crate::response::EppCommandResponse; @@ -138,7 +138,7 @@ impl DomainTransferRequest { request: DomainTransferReq { operation: "request".to_string(), domain: DomainTransferReqData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), period: Some(Period::new(years)), auth_info: Some(DomainAuthInfo::new(auth_password)), @@ -211,7 +211,7 @@ impl DomainTransferApprove { request: DomainTransferReq { operation: "approve".to_string(), domain: DomainTransferReqData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), period: None, auth_info: None, @@ -284,7 +284,7 @@ impl DomainTransferReject { request: DomainTransferReq { operation: "reject".to_string(), domain: DomainTransferReqData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), period: None, auth_info: None, @@ -357,7 +357,7 @@ impl DomainTransferCancel { request: DomainTransferReq { operation: "cancel".to_string(), domain: DomainTransferReqData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), period: None, auth_info: None, @@ -430,7 +430,7 @@ impl DomainTransferQuery { request: DomainTransferReq { operation: "query".to_string(), domain: DomainTransferReqData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), period: None, auth_info: Some(DomainAuthInfo::new(auth_password)), diff --git a/epp-client/src/domain/update.rs b/epp-client/src/domain/update.rs index 63a4de8..af6ea78 100644 --- a/epp-client/src/domain/update.rs +++ b/epp-client/src/domain/update.rs @@ -10,7 +10,7 @@ use crate::{ request::{EppExtension, EppRequest}, }; -use super::EPP_DOMAIN_XMLNS; +use super::XMLNS; use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; @@ -108,7 +108,7 @@ impl DomainUpdate { DomainUpdate { request: DomainUpdateRequest { domain: DomainUpdateRequestData { - xmlns: EPP_DOMAIN_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), add: None, remove: None, diff --git a/epp-client/src/host/check.rs b/epp-client/src/host/check.rs index e6bfda3..367cc49 100644 --- a/epp-client/src/host/check.rs +++ b/epp-client/src/host/check.rs @@ -4,8 +4,8 @@ use std::fmt::Debug; use epp_client_macros::*; +use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::host::EPP_HOST_XMLNS; use crate::request::{EppExtension, EppRequest}; use serde::{Deserialize, Serialize}; @@ -80,7 +80,7 @@ impl HostCheck { HostCheck { request: HostCheckRequest { list: HostList { - xmlns: EPP_HOST_XMLNS.to_string(), + xmlns: XMLNS.to_string(), hosts, }, }, diff --git a/epp-client/src/host/create.rs b/epp-client/src/host/create.rs index bbc0805..6c1a67c 100644 --- a/epp-client/src/host/create.rs +++ b/epp-client/src/host/create.rs @@ -2,8 +2,8 @@ use epp_client_macros::*; +use super::XMLNS; use crate::common::{ElementName, HostAddr, NoExtension, StringValue}; -use crate::host::EPP_HOST_XMLNS; use crate::request::{EppExtension, EppRequest}; use serde::{Deserialize, Serialize}; @@ -81,7 +81,7 @@ impl HostCreate { HostCreate { request: HostCreateRequest { host: HostCreateRequestData { - xmlns: EPP_HOST_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: host.into(), addresses: Some(addresses), }, diff --git a/epp-client/src/host/delete.rs b/epp-client/src/host/delete.rs index 5d7a88f..9da5d11 100644 --- a/epp-client/src/host/delete.rs +++ b/epp-client/src/host/delete.rs @@ -2,8 +2,8 @@ use epp_client_macros::*; +use super::XMLNS; use crate::common::{ElementName, NoExtension, StringValue}; -use crate::host::EPP_HOST_XMLNS; use crate::request::{EppExtension, EppRequest}; use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; @@ -75,7 +75,7 @@ impl HostDelete { HostDelete { request: HostDeleteRequest { host: HostDeleteRequestData { - xmlns: EPP_HOST_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), }, }, diff --git a/epp-client/src/host/info.rs b/epp-client/src/host/info.rs index 3f6759c..020aa29 100644 --- a/epp-client/src/host/info.rs +++ b/epp-client/src/host/info.rs @@ -2,8 +2,8 @@ use epp_client_macros::*; +use super::XMLNS; use crate::common::{ElementName, HostAddr, HostStatus, NoExtension, StringValue}; -use crate::host::EPP_HOST_XMLNS; use crate::request::{EppExtension, EppRequest}; use serde::{Deserialize, Serialize}; @@ -74,7 +74,7 @@ impl HostInfo { HostInfo { request: HostInfoRequest { info: HostInfoRequestData { - xmlns: EPP_HOST_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), }, }, diff --git a/epp-client/src/host/update.rs b/epp-client/src/host/update.rs index c689fb6..360742d 100644 --- a/epp-client/src/host/update.rs +++ b/epp-client/src/host/update.rs @@ -2,8 +2,8 @@ use epp_client_macros::*; +use super::XMLNS; use crate::common::{ElementName, HostAddr, HostStatus, NoExtension, StringValue}; -use crate::host::EPP_HOST_XMLNS; use crate::request::{EppExtension, EppRequest}; use crate::response::EppCommandResponse; use serde::{Deserialize, Serialize}; @@ -97,7 +97,7 @@ impl HostUpdate { HostUpdate { request: HostUpdateRequest { host: HostUpdateRequestData { - xmlns: EPP_HOST_XMLNS.to_string(), + xmlns: XMLNS.to_string(), name: name.into(), add: None, remove: None, diff --git a/epp-client/src/lib.rs b/epp-client/src/lib.rs index 11c9704..7bc3c89 100644 --- a/epp-client/src/lib.rs +++ b/epp-client/src/lib.rs @@ -119,7 +119,7 @@ pub mod contact { pub mod info; pub mod update; - pub const EPP_CONTACT_XMLNS: &str = "urn:ietf:params:xml:ns:contact-1.0"; + pub const XMLNS: &str = "urn:ietf:params:xml:ns:contact-1.0"; } pub mod domain { @@ -132,7 +132,7 @@ pub mod domain { pub mod transfer; pub mod update; - pub const EPP_DOMAIN_XMLNS: &str = "urn:ietf:params:xml:ns:domain-1.0"; + pub const XMLNS: &str = "urn:ietf:params:xml:ns:domain-1.0"; } pub mod host { @@ -142,7 +142,7 @@ pub mod host { pub mod info; pub mod update; - pub const EPP_HOST_XMLNS: &str = "urn:ietf:params:xml:ns:host-1.0"; + pub const XMLNS: &str = "urn:ietf:params:xml:ns:host-1.0"; } pub mod message { diff --git a/epp-client/src/login.rs b/epp-client/src/login.rs index 3984759..23e5cb5 100644 --- a/epp-client/src/login.rs +++ b/epp-client/src/login.rs @@ -5,9 +5,7 @@ use serde::{Deserialize, Serialize}; use crate::{ common::{ElementName, NoExtension, Options, ServiceExtension, Services, StringValue}, - contact::EPP_CONTACT_XMLNS, - domain::EPP_DOMAIN_XMLNS, - host::EPP_HOST_XMLNS, + contact, domain, host, request::{EppExtension, EppRequest, EPP_LANG, EPP_VERSION}, response::EppCommandResponse, }; @@ -47,9 +45,9 @@ impl Login { }, services: Services { obj_uris: vec![ - EPP_HOST_XMLNS.into(), - EPP_CONTACT_XMLNS.into(), - EPP_DOMAIN_XMLNS.into(), + host::XMLNS.into(), + contact::XMLNS.into(), + domain::XMLNS.into(), ], svc_ext: Some(ServiceExtension { ext_uris }), },