Skip to content

Establish API model modules and extract shared and smaller domains #377

Description

@sdairs

Parent: #317

Stack position: 3 of 7. Establishes the model facade used by the remaining model moves.

Goal

Introduce the incremental models.rs facade and extract the shared and smaller model domains without changing the public Rust or wire API.

Scope

  • Keep models.rs as the facade, with private child modules and explicit pub use re-exports.
  • Keep the discriminated_union! macro in a location usable by child modules.
  • Extract genuinely shared leaves such as ApiResponse, assigned-role types, IP access-list types, resource tags, and License.
  • Extract organizations, members, invitations, RBAC, BYOC, quotas, organization private endpoints, API keys, activity, SCIM, and UDF models into domain files.
  • Move each enum with its Display/VALUES implementation and each union/default implementation with the model that owns it.

Acceptance

  • Existing clickhouse_cloud_api::Type and clickhouse_cloud_api::models::Type paths continue to compile.
  • Child modules remain private so no new public module paths are introduced.
  • Analyzer model counts and drift findings remain unchanged.
  • SCIM stays strict and outside the response tree.
  • Default and deprecated-fields feature builds compile.
  • Focused tests, clippy, rustfmt, and cargo check --workspace --all-features pass.

Out of scope

  • Service, backup, Postgres, ClickPipes, and ClickStack models.
  • Any model, enum, Serde, or wire-contract change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrustPull requests that update rust code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions