OpenAPI-derived models¶
Everything /api/openapi.json#/components/schemas describes, emitted as pydantic + StrEnum by the OAS codegen. v42 ships 562 classes + 260 StrEnums + 104 scalar aliases under dhis2w_client.generated.v42.oas.
Most callers reach these models indirectly — the domain shims re-export the relevant slices:
dhis2w_client.envelopes—WebMessage(asWebMessageResponsesubclass),ImportReport,ObjectReport,TypeReport,Stats,ErrorReport,ImportCount,ImportConflict(asConflict).dhis2w_client.aggregate—DataValue,DataValueSet.dhis2w_client.system—SystemInfo.dhis2w_client.maintenance—DataIntegrityCheck,DataIntegrityIssue.dhis2w_client.auth_schemes— the 5*AuthSchemeleaves (each subclassed to add thetypediscriminator).dhis2w_client.generated.v42.tracker—TrackerTrackedEntity,TrackerEnrollment,TrackerEvent,TrackerRelationship,TrackerRelationshipItem,TrackerDataValue,TrackerAttribute,TrackerNote, plusEnrollmentStatus/EventStatus.
Import directly from the OAS module when you need a shape the shims don't expose — e.g. TrackerImportReport, Grid, AppIcons, any of the 400+ admin-parameters / dimension-item / filter-wrapper schemas:
from dhis2w_client.generated.v42.oas import TrackerImportReport, Grid
report = TrackerImportReport.model_validate(raw)
grid = Grid.model_validate(analytics_response)
Regeneration (from the committed openapi.json, no network):
See Codegen for emitter specifics — every-field-optional rule, the _MAX_CLOSED_ENUM_SIZE threshold that demotes 488-member ErrorCode to a str alias, the DHIS2Warning builtin-shadow rename, the _types_namespace injection trick that resolves sibling references without cycles.
The __all__ list on dhis2w_client.generated.v42.oas holds every emitted symbol.