mirror of
https://github.com/instant-labs/instant-epp.git
synced 2025-02-16 13:52:07 +00:00
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 <check> 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.
This commit is contained in:
parent
9acd9eac29
commit
630c6b06e4
@ -54,7 +54,7 @@ pub struct DomainAvailable {
|
|||||||
pub name: StringValue<'static>,
|
pub name: StringValue<'static>,
|
||||||
/// The domain (un)availability
|
/// The domain (un)availability
|
||||||
#[serde(rename = "avail")]
|
#[serde(rename = "avail")]
|
||||||
pub available: u16,
|
pub available: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Type that represents the <cd> tag for domain check response
|
/// Type that represents the <cd> tag for domain check response
|
||||||
@ -117,12 +117,12 @@ mod tests {
|
|||||||
result.check_data.domain_list[0].domain.name,
|
result.check_data.domain_list[0].domain.name,
|
||||||
"eppdev.com".into()
|
"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!(
|
assert_eq!(
|
||||||
result.check_data.domain_list[1].domain.name,
|
result.check_data.domain_list[1].domain.name,
|
||||||
"eppdev.net".into()
|
"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.client_tr_id.unwrap(), CLTRID.into());
|
||||||
assert_eq!(object.tr_ids.server_tr_id, SVTRID.into());
|
assert_eq!(object.tr_ids.server_tr_id, SVTRID.into());
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<domain:name avail="1">eppdev.com</domain:name>
|
<domain:name avail="1">eppdev.com</domain:name>
|
||||||
</domain:cd>
|
</domain:cd>
|
||||||
<domain:cd>
|
<domain:cd>
|
||||||
<domain:name avail="0">eppdev.net</domain:name>
|
<domain:name avail="false">eppdev.net</domain:name>
|
||||||
</domain:cd>
|
</domain:cd>
|
||||||
</domain:chkData>
|
</domain:chkData>
|
||||||
</resData>
|
</resData>
|
||||||
|
Loading…
Reference in New Issue
Block a user