Skip to contents

This is a package-internal function for code-deduplication within various manual-layer functions.

Usage

.get_raw_response_body_or_stop(resultObject)

Arguments

resultObject

Should be a return value from an API function which uses .wrap_as_api_response internally. These are functions which are manually edited after OpenAPI autogen.

Value

The argument, as long as it's of type raw. Else, stops. The caller can then decode the raw body.

Details

For the API-level functions which use .wrap_as_api_response, manual-layer functions will receive either (a) the raw HTTP body, if the status_code was 2xx, or (b) an ApiResponse object. Using this function, callsites can get the HTTP body (if available), else an informative stop().