From 630c6b06e43bfa01afd5522b37272fc1512f5c60 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sun, 23 Jan 2022 22:33:14 +0100 Subject: [PATCH] Change DomainAvailable::available to be a bool From RFC 5731: This element MUST contain an "avail" attribute whose value indicates object availability (can it be provisioned or not) at the moment the command was completed. A value of "1" or "true" means that the object can be provisioned. A value of "0" or "false" means that the object can not be provisioned. --- src/domain/check.rs | 6 +++--- tests/resources/response/domain/check.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/domain/check.rs b/src/domain/check.rs index 1c07926..eed6ea0 100644 --- a/src/domain/check.rs +++ b/src/domain/check.rs @@ -54,7 +54,7 @@ pub struct DomainAvailable { pub name: StringValue<'static>, /// The domain (un)availability #[serde(rename = "avail")] - pub available: u16, + pub available: bool, } /// Type that represents the <cd> tag for domain check response @@ -117,12 +117,12 @@ mod tests { result.check_data.domain_list[0].domain.name, "eppdev.com".into() ); - assert_eq!(result.check_data.domain_list[0].domain.available, 1); + assert!(result.check_data.domain_list[0].domain.available); assert_eq!( result.check_data.domain_list[1].domain.name, "eppdev.net".into() ); - assert_eq!(result.check_data.domain_list[1].domain.available, 0); + assert!(!result.check_data.domain_list[1].domain.available); assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into()); assert_eq!(object.tr_ids.server_tr_id, SVTRID.into()); } diff --git a/tests/resources/response/domain/check.xml b/tests/resources/response/domain/check.xml index 3572cc3..1453b37 100644 --- a/tests/resources/response/domain/check.xml +++ b/tests/resources/response/domain/check.xml @@ -10,7 +10,7 @@ eppdev.com - eppdev.net + eppdev.net @@ -19,4 +19,4 @@ RO-6879-1627224678242975 - \ No newline at end of file +