Commit 2ebfefc
Add core result types for fluent API pattern (Phase 1.1)
Introduces foundational types that enable the `.with_detail_response()` fluent API pattern:
- RequestMetadata: HTTP request/response metadata for diagnostics (client_request_id, correlation_id, service_request_id, http_status_code, timing_ms)
- DataverseResponse[T]: Generic response object with result and telemetry dict
- FluentResult[T]: Wrapper enabling fluent pattern - acts like result by default, returns DataverseResponse via .with_detail_response()
FluentResult implements magic methods (__iter__, __getitem__, __len__, __eq__, __bool__, __contains__, __hash__) for transparent backward compatibility.
Existing OperationResult, CreateResult, UpdateResult, DeleteResult, GetResult, PagedResult types remain unchanged for backward compatibility.
Includes comprehensive unit tests (44 tests) covering:
- RequestMetadata dataclass behavior
- DataverseResponse structure
- FluentResult wrapper with all magic methods
- Legacy type backward compatibility
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 09ff1fe commit 2ebfefc
3 files changed
Lines changed: 951 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments