Skip to content

Add /domains/{name}/is-available/ endpoint#1291

Draft
oguzkocer wants to merge 9 commits intotrunkfrom
domains-is-available
Draft

Add /domains/{name}/is-available/ endpoint#1291
oguzkocer wants to merge 9 commits intotrunkfrom
domains-is-available

Conversation

@oguzkocer
Copy link
Copy Markdown
Contributor

Adds RestV1_3 namespace, DomainName newtype, and DomainAvailability response type covering all API fields.

@oguzkocer oguzkocer added this to the 0.2 milestone Apr 19, 2026
@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented Apr 19, 2026

XCFramework Build

This PR's XCFramework is available for testing. Add to your Package.swift:

.package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1291")

Built from 9330ada

@oguzkocer oguzkocer force-pushed the domains-is-available branch from e77dac8 to 7ef51d2 Compare April 22, 2026 04:03
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.
@oguzkocer oguzkocer force-pushed the domains-is-available branch from d8c42ec to 126999e Compare April 22, 2026 21:33
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants