Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContactStatus can be an enum #32

Open
nrempel opened this issue Dec 1, 2021 · 4 comments
Open

ContactStatus can be an enum #32

nrempel opened this issue Dec 1, 2021 · 4 comments

Comments

@nrempel
Copy link
Collaborator

nrempel commented Dec 1, 2021

Possible values:

clientDeleteProhibited, clientHold, clientRenewProhibited, clientTransferProhibited, clientUpdateProhibited, inactive, ok, pendingCreate, pendingDelete, pendingRenew, pendingTransfer, pendingUpdate, serverDeleteProhibited, serverHold, serverRenewProhibited, serverTransferProhibited, serverUpdateProhibited

https://datatracker.ietf.org/doc/html/rfc5731#section-2.3

This might be more ergonomic for developers, what do you think?

@masalachai
Copy link
Owner

Yes, this is a good idea, along with having similar enums for things like 2-letter country codes (there has to be a crate that already provides this?).

@djc
Copy link
Collaborator

djc commented Dec 2, 2021

That definitely exists, https://crates.io/crates/celes looks like a decent option.

@djc
Copy link
Collaborator

djc commented Dec 2, 2021

I tried and I couldn't get the serde impls to line up correctly. I think we'd need tafia/quick-xml#304 to be able to do this without adding a lot of custom (de)serialization code.

@masalachai
Copy link
Owner

masalachai commented Dec 2, 2021

Hi @djc,

I tried with a Serialize and Deserialize impl for an enum with the expected statuses in #37 , and updated the contact_update() and contact_info() tests for it. Let us know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants