Update Login::new to take ownership of Option ext_uris

This commit is contained in:
Nicholas Rempel 2021-12-03 10:07:36 -08:00 committed by masalachai
parent 0b42579484
commit cf446f58c7
27 changed files with 32 additions and 34 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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![

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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");

View File

@ -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 =

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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);