Add /domains/{name}/is-available/ endpoint#1291
Draft
Conversation
Collaborator
XCFramework BuildThis PR's XCFramework is available for testing. Add to your .package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1291")Built from 9330ada |
e77dac8 to
7ef51d2
Compare
Adds `RestV1_3` namespace, `DomainName` newtype, and `DomainAvailability` response type covering all API fields. Includes anonymized test fixtures for 5 status categories (available, blacklisted, transferrable, tld_not_supported, hsts_required) and e2e tests.
The backend's Store_Price::amount() returns a float, not cents. Consistent with how domain suggestions already use Decimal2 for these same fields. Also normalize None assertions to use is_none().
Fields added: sale_cost, is_price_limit_exceeded, is_supported_premium_domain, other_site_domain, transferrability, maintenance_end_time, is_dot_gay_notice_required, cannot_transfer_due_to_unsupported_premium_tld, and trademark_claims_notice_info. Also updates status doc comment with comprehensive list from the backend implementation.
Add DomainAvailabilityParams with blog_id (WpComSiteId), is_cart_pre_check, and vendor — matching the backend's accepted query parameters for the v1.3 is-available endpoint.
Also add dot-gay-notice fixture from real API response with is_dot_gay_notice_required and gay_accept_requirements policy notice.
d8c42ec to
126999e
Compare
- Replace stringly-typed status field with DomainAvailabilityStatus enum covering all known backend values, with Other(String) fallback. - Remove unnecessary deserialize_json_value_as_string helper and trademark_claims_notice_info field (rare TMCH case, complex opaque structure not worth modeling). - Remove redundant #[serde(default)] on Option<T> fields.
Define CurrencyCode in wp_com module (alongside WpComSiteId) and use it for currency_code fields in PaidDomainSuggestion and DomainAvailability.
Open
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
RestV1_3namespace,DomainNamenewtype, andDomainAvailabilityresponse type covering all API fields.