Skip to content

feat(rest): generated fabric address-management resources (client.fabric.*) — phase 1#70

Draft
mjerris wants to merge 1 commit into
mainfrom
feat/fabric-addresses
Draft

feat(rest): generated fabric address-management resources (client.fabric.*) — phase 1#70
mjerris wants to merge 1 commit into
mainfrom
feat/fabric-addresses

Conversation

@mjerris

@mjerris mjerris commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Phase 1 (python-first): generated fabric address-management resources

Generated resources + client wiring + tests for the three fabric address-management resources. Depends on the coordinated porting-sdk PR signalwire/porting-sdk#115 (the reshaped spec + SPEC_NAMES + regenerated oracle) — the mock only serves /api/fabric/{sip,phone_number,alias}_addresses once that lands.

All generated files were produced by porting-sdk's generate_python_rest_types.pyNOT hand-written (they carry AUTO-GENERATED ... DO NOT EDIT).

What landed

Three full-CRUD resources fold into the existing client.fabric container (the spec declares x-sdk-namespace.attr: fabric), siblings of the read-only client.fabric.addresses:

accessor route verbs
client.fabric.sip_addresses /api/fabric/sip_addresses list/get/create/update(PATCH)/delete
client.fabric.phone_number_addresses /api/fabric/phone_number_addresses list/get/create/update(PATCH)/delete
client.fabric.alias_addresses /api/fabric/alias_addresses list/get/create/update(PATCH)/delete
  • fabric_addresses_resources_generated.pySipAddresses / PhoneNumberAddresses / AliasAddresses typed CRUD subclasses (closed-typed create/update + extras door).
  • fabric_addresses_types_generated.py — 47 TypedDicts (bodies, lists, 422 shapes, shared status-code schemas).
  • _client_tree_generated.py — the three accessors wired under FabricNamespace.
  • tests/unit/rest/fabric_generated_test.py — the generator's wire-test suite, now covering the three new resources (CRUD success + a 500 error path each).

Hand-written tests (over the shared mock, no requests mock.patch)

  • tests/unit/rest/test_fabric_addresses_mock.py21 tests: every CRUD op asserts (method, path, matched_route) on the wire, plus a structured 401 Unauthorized and 404 Not Found error path per resource (surfacing as SignalWireRestError with the right status_code).

Verification

  • client.fabric.{sip_addresses,phone_number_addresses,alias_addresses} resolve to the 3 new resource classes; client.fabric.addresses (read-only) unchanged. No new top-level accessor.
  • 21 hand-written + 30 generated wire tests for the new resources: green against the shared mock (run with MOCK_SIGNALWIRE_PORT pointed at a mock built from porting-sdk#115).
  • audit_no_cheat_tests.py on tests/unit/rest: clean.
  • Generated files are ruff-format-clean and pass GEN-FRESH --check (exit 0).

Deferred

The 9-port fan-out is DEFERRED to a later owner-gated phase. Cross-port will be red-until-implemented by design.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NqhUoqrbptHNS3cypq9s6t

…ic.*)

Phase 1 (python-first) of the fabric address-management REST rollout. All
generated files were produced by porting-sdk's generate_python_rest_types.py
against the reshaped rest-apis/fabric-addresses/openapi.yaml — NOT hand-written
(they carry the AUTO-GENERATED ... DO NOT EDIT header).

Three full-CRUD resources fold into the existing client.fabric container (the
spec declares x-sdk-namespace.attr: fabric), siblings of the read-only
client.fabric.addresses:
  client.fabric.sip_addresses           -> /api/fabric/sip_addresses
  client.fabric.phone_number_addresses  -> /api/fabric/phone_number_addresses
  client.fabric.alias_addresses         -> /api/fabric/alias_addresses
Each has list/get/delete (from CrudResource) + closed-typed create/update
(PATCH), bound to the spec's typed request/response schemas.

Generated:
- fabric_addresses_resources_generated.py — SipAddresses / PhoneNumberAddresses /
  AliasAddresses typed CRUD subclasses.
- fabric_addresses_types_generated.py — 47 TypedDicts (bodies, lists, 422s,
  shared status-code schemas).
- _client_tree_generated.py — the three new accessors wired under FabricNamespace.
- tests/unit/rest/fabric_generated_test.py — the generator's wire-test suite,
  now covering the three new resources (CRUD success + a 500 error path each).

Hand-written (over the shared mock, no requests mock.patch):
- tests/unit/rest/test_fabric_addresses_mock.py — 21 tests: every CRUD op asserts
  (method, path, matched_route) on the wire, plus a structured 401 Unauthorized
  and 404 Not Found error path per resource.

Requires the coordinated porting-sdk feat/fabric-addresses PR (the spec +
SPEC_NAMES + regenerated oracle). The 9-port fan-out is DEFERRED to a later
owner-gated phase (cross-port red-until-implemented by design).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NqhUoqrbptHNS3cypq9s6t
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

Successfully merging this pull request may close these issues.

1 participant