graflo.data_source.api_response¶
API response envelope parsing and optional first-response auto-detection.
ResolvedApiResponse
¶
Bases: ApiResponseStructure
Response paths resolved after optional auto-detection on the first body.
Source code in graflo/data_source/api_response.py
detect_carry_params(body)
¶
Infer session-token carry map from known response field names.
Returns a query-param-name -> response-path map. Looks at top-level object
keys first, then at 0.<key> when the body is a non-empty list of
objects (e.g. BMC Discovery kind envelopes). Does not treat singular
result_id as a carry token.
Source code in graflo/data_source/api_response.py
detect_response_shape(body)
¶
Infer unset response path keys from a top-level response envelope.
Source code in graflo/data_source/api_response.py
extract_records(body, resolved)
¶
Extract record dicts from a parsed JSON body.
Source code in graflo/data_source/api_response.py
get_at_path(obj, path)
¶
Resolve a dot-separated path against a JSON-like object.
Source code in graflo/data_source/api_response.py
get_batch_metadata(body, resolved)
¶
Read batch-level metadata from the response envelope.
Source code in graflo/data_source/api_response.py
has_more_pages(body, resolved, items, *, strategy)
¶
Return whether another HTTP page should be fetched.
Source code in graflo/data_source/api_response.py
next_cursor_value(body, resolved)
¶
Read the next cursor token from the response when configured.
Source code in graflo/data_source/api_response.py
next_offset_value(body, resolved)
¶
Read the next offset from the response when configured.
Source code in graflo/data_source/api_response.py
update_carried_params(body, carry_params, carried)
¶
Refresh carried query params from the latest response body.