Update Login::new to take ownership of Option ext_uris
This commit is contained in:
parent
0b42579484
commit
cf446f58c7
|
@ -80,7 +80,7 @@ async fn main() {
|
|||
Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
};
|
||||
|
||||
let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
let login = Login::<NoExtension>::new("username", "password", None);
|
||||
client.transact(login, "transaction-id").await.unwrap();
|
||||
|
||||
// Create an DomainCheck instance
|
||||
|
|
|
@ -80,7 +80,7 @@ async fn main() {
|
|||
Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
};
|
||||
|
||||
let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
let login = Login::<NoExtension>::new("username", "password", None);
|
||||
client.transact(login, "transaction-id").await.unwrap();
|
||||
|
||||
// Create an DomainCheck instance
|
||||
|
|
|
@ -57,7 +57,7 @@ impl<E: EppExtension> EppRequest<E> for ContactCheck<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an ContactCheck instance
|
||||
|
|
|
@ -57,7 +57,7 @@ impl<E: EppExtension> EppRequest<E> for ContactCreate<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create the address, postal_info, voice instances
|
||||
|
|
|
@ -57,7 +57,7 @@ impl<E: EppExtension> EppRequest<E> for ContactDelete<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an ContactDelete instance
|
||||
|
|
|
@ -58,7 +58,7 @@ impl<E: EppExtension> EppRequest<E> for ContactInfo<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an ContactInfo instance
|
||||
|
|
|
@ -60,7 +60,7 @@ impl<E: EppExtension> EppRequest<E> for ContactUpdate<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an ContactUpdate instance
|
||||
|
|
|
@ -56,7 +56,7 @@ impl<E: EppExtension> EppRequest<E> for DomainCheck<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainCheck instance
|
||||
|
|
|
@ -63,7 +63,7 @@ impl<E: EppExtension> EppRequest<E> for DomainCreate<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// let contacts = vec![
|
||||
|
|
|
@ -57,7 +57,7 @@ impl<E: EppExtension> EppRequest<E> for DomainDelete<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainDelete instance
|
||||
|
|
|
@ -58,7 +58,7 @@ impl<E: EppExtension> EppRequest<E> for DomainInfo<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainInfo instance
|
||||
|
|
|
@ -59,7 +59,7 @@ impl<E: EppExtension> EppRequest<E> for DomainRenew<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// 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
|
||||
|
|
|
@ -117,7 +117,7 @@ impl<E: EppExtension> EppRequest<E> for DomainTransferQuery<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainTransferRequest instance
|
||||
|
@ -192,7 +192,7 @@ impl<E: EppExtension> DomainTransferRequest<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// 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
|
||||
|
@ -273,7 +273,7 @@ impl<E: EppExtension> DomainTransferApprove<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainTransferReject instance
|
||||
|
@ -348,7 +348,7 @@ impl<E: EppExtension> DomainTransferReject<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainTransferCancel instance
|
||||
|
@ -423,7 +423,7 @@ impl<E: EppExtension> DomainTransferCancel<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainTransferQuery instance
|
||||
|
|
|
@ -66,7 +66,7 @@ impl<E: EppExtension> EppRequest<E> for DomainUpdate<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an DomainUpdate instance
|
||||
|
|
|
@ -45,7 +45,7 @@ pub const XMLNS: &str = "http://www.verisign-grs.com/epp/namestoreExt-1.1";
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// let namestore_ext = NameStore::new("com");
|
||||
|
|
|
@ -47,7 +47,7 @@ use super::EPP_DOMAIN_RGP_EXT_XMLNS;
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// let pre_data =
|
||||
|
|
|
@ -45,7 +45,7 @@ use super::EPP_DOMAIN_RGP_EXT_XMLNS;
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an RgpRestoreRequest instance
|
||||
|
|
|
@ -58,7 +58,7 @@ impl<E: EppExtension> EppRequest<E> for HostCheck<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an HostCheck instance
|
||||
|
|
|
@ -57,7 +57,7 @@ impl<E: EppExtension> EppRequest<E> for HostCreate<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// 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
|
||||
|
|
|
@ -57,7 +57,7 @@ impl<E: EppExtension> EppRequest<E> for HostDelete<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an HostDelete instance
|
||||
|
|
|
@ -56,7 +56,7 @@ impl<E: EppExtension> EppRequest<E> for HostInfo<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an HostInfo instance
|
||||
|
|
|
@ -58,7 +58,7 @@ impl<E: EppExtension> EppRequest<E> for HostUpdate<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an HostUpdate instance
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
//! Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
//! };
|
||||
//!
|
||||
//! let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
//! let login = Login::<NoExtension>::new("username", "password", None);
|
||||
//! client.transact(login, "transaction-id").await.unwrap();
|
||||
//!
|
||||
//! // Make a domain check call, which returns an object of type EppDomainCheckResponse
|
||||
|
|
|
@ -29,11 +29,9 @@ impl<E: EppExtension> Login<E> {
|
|||
pub fn new(
|
||||
username: &str,
|
||||
password: &str,
|
||||
ext_uris: &Option<Vec<String>>,
|
||||
ext_uris: Option<Vec<String>>,
|
||||
) -> Login<NoExtension> {
|
||||
let ext_uris = ext_uris
|
||||
.as_ref()
|
||||
.map(|uris| uris.iter().map(|u| u.as_str().into()).collect());
|
||||
let ext_uris = ext_uris.map(|uris| uris.iter().map(|u| u.as_str().into()).collect());
|
||||
|
||||
Login {
|
||||
request: LoginRequest {
|
||||
|
|
|
@ -54,7 +54,7 @@ impl<E: EppExtension> EppRequest<E> for MessageAck<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an MessageAck instance
|
||||
|
|
|
@ -55,7 +55,7 @@ impl<E: EppExtension> EppRequest<E> for MessagePoll<E> {
|
|||
/// Err(e) => panic!("Failed to create EppClient: {}", e)
|
||||
/// };
|
||||
///
|
||||
/// let login = Login::<NoExtension>::new("username", "password", &None);
|
||||
/// let login = Login::<NoExtension>::new("username", "password", None);
|
||||
/// client.transact(login, "transaction-id").await.unwrap();
|
||||
///
|
||||
/// // Create an MessagePoll instance
|
||||
|
|
|
@ -64,7 +64,7 @@ mod request {
|
|||
]);
|
||||
|
||||
let xml = get_xml("request/login.xml").unwrap();
|
||||
let object = Login::<NoExtension>::new("username", "password", &ext_uris);
|
||||
let object = Login::<NoExtension>::new("username", "password", ext_uris);
|
||||
let serialized = object.serialize_request(CLTRID).unwrap();
|
||||
|
||||
assert_eq!(xml, serialized);
|
||||
|
|
Loading…
Reference in New Issue