Summary
Several response models that should be shared across the crate are currently duplicated across endpoint modules. The biggest example is TaskStateUpdate, which exists in multiple files with slightly different field shapes and typing. CloudTag/CloudTags are also duplicated, and task status is an enum in one place but a raw string elsewhere.
Why this matters
- increases drift risk when the API adds fields or semantics change
- makes docs and examples less consistent across handlers
- complicates Python bindings and future codegen/harmonization work
- makes it harder to reason about compatibility because similar names do not always mean the same type
Relevant code
Repeated TaskStateUpdate
src/types.rs:16
src/tasks.rs:71
src/users.rs:113
src/cloud_accounts.rs:200
src/acl.rs:367
src/fixed/subscriptions.rs:365
src/fixed/databases.rs:478
src/flexible/subscriptions.rs:801
src/flexible/databases.rs:1241
Repeated tag/link models
src/types.rs:111
src/types.rs:118
src/types.rs:146
src/types.rs:159
src/fixed/databases.rs:179
src/fixed/databases.rs:310
src/flexible/databases.rs:252
src/flexible/databases.rs:1166
Suggested direction
- choose canonical shared models in
src/types.rs
- migrate handlers to those shared types where the wire format is actually the same
- normalize task status typing so one representation is the source of truth
- use aliases or re-exports only where they preserve compatibility without reintroducing drift
Acceptance criteria
- one canonical shared representation exists for task state, tags, and links where the payload shape is the same
- task status typing is consistent across handlers, or any intentional exceptions are documented
- endpoint modules stop redefining structurally identical shared models
- tests and examples are updated to the canonical types
Summary
Several response models that should be shared across the crate are currently duplicated across endpoint modules. The biggest example is
TaskStateUpdate, which exists in multiple files with slightly different field shapes and typing.CloudTag/CloudTagsare also duplicated, and task status is an enum in one place but a raw string elsewhere.Why this matters
Relevant code
Repeated
TaskStateUpdatesrc/types.rs:16src/tasks.rs:71src/users.rs:113src/cloud_accounts.rs:200src/acl.rs:367src/fixed/subscriptions.rs:365src/fixed/databases.rs:478src/flexible/subscriptions.rs:801src/flexible/databases.rs:1241Repeated tag/link models
src/types.rs:111src/types.rs:118src/types.rs:146src/types.rs:159src/fixed/databases.rs:179src/fixed/databases.rs:310src/flexible/databases.rs:252src/flexible/databases.rs:1166Suggested direction
src/types.rsAcceptance criteria