Expose delete endpoint for organization_domains - DAAP-1753#462
Expose delete endpoint for organization_domains - DAAP-1753#462
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR adds a new delete_organization_domain method to the WorkOS Python SDK's Organizations module. The implementation follows the established CRUD patterns in the codebase by adding the method to the protocol interface and implementing it in both sync and async Organization classes.
The change exposes an HTTP DELETE endpoint for organization domains at the path organization_domains/{id}. The method takes an organization_domain_id parameter and returns None, consistent with other delete operations in the SDK like delete_organization. Both synchronous and asynchronous implementations are provided, maintaining the dual-interface pattern used throughout the WorkOS Python SDK.
The implementation integrates seamlessly with the existing codebase architecture - it uses the same _http_client.request() pattern with REQUEST_METHOD_DELETE constant, follows the same URL construction approach as other domain-related methods, and maintains the same docstring format and parameter validation patterns established in the Organizations module.
Comprehensive test coverage has been added that validates the HTTP request construction, URL endpoint correctness, method type (DELETE), and expected return value (None). The test follows the same mocking and assertion patterns used by other delete operation tests in the test suite.
Confidence score: 5/5
- This PR is very safe to merge with minimal risk of production issues
- The implementation follows established patterns exactly, has comprehensive test coverage, and addresses a straightforward CRUD operation gap
- No files require additional attention - the code is clean and follows existing conventions
2 files reviewed, no comments
Description
Exposes an SDK method to delete an organization domain
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.
Docs PR:
https://github.com/workos/workos/pull/42288