docs(profiles): match the job create response in openapi
The 202 body documented usage_units and a results array. The API returns
entity_count_reserved, event_id and, for sample jobs, entity_ids; results
only appears on GET /v2/profiles/jobs/{id}/. The SDK types already use
entityCountReserved and entityIds, so the spec was the one out of step.
The docs sample example indexes entity_ids with .get(), matching the
notebook and the TS example's ?? [].
This commit is contained in:
+10
-6
@@ -8450,8 +8450,13 @@
|
||||
"entity_type": {
|
||||
"type": "string"
|
||||
},
|
||||
"usage_units": {
|
||||
"type": "integer"
|
||||
"entity_count_reserved": {
|
||||
"type": "integer",
|
||||
"description": "Entities reserved against usage for this job."
|
||||
},
|
||||
"event_id": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"replayed": {
|
||||
"type": "boolean",
|
||||
@@ -8461,13 +8466,12 @@
|
||||
"type": "integer",
|
||||
"description": "`sample` only."
|
||||
},
|
||||
"results": {
|
||||
"entity_ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
"type": "string"
|
||||
},
|
||||
"description": "`sample` only."
|
||||
"description": "`sample` only: the entity ids picked. Read each with `GET /v2/entities/user/{entity_id}/profile/`."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ while True:
|
||||
print(status["status"], status["succeeded"], "of", status["total"])
|
||||
|
||||
# The create response lists the sampled entities; read each one's saved profile.
|
||||
for entity_id in job["entity_ids"]:
|
||||
for entity_id in job.get("entity_ids", []):
|
||||
print(client.get_profile(entity_id))
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user