cadrumo.adapters.outbound.google.api module¶
Shared Google API request execution with typed-error translation.
Both adapters.outbound.google.calc_sheets_apply and
adapters.outbound.google.calc_sheets_pull issue
google-api-python-client requests. This module provides the single
execute_request() boundary they route
through so transport failures, HTTP failures, and quota responses become the typed
OutboundStorageError hierarchy
instead of endpoint-specific HttpError strings.
- execute_request(request, *, action)[source]¶
Execute a google-api-python-client request, translating failures.
Runs
request.execute(num_retries=3)and returns the decoded JSON payload unchanged. HTTP 401/403 responses becomeOutboundStoragePermissionError, HTTP 404 responses becomeOutboundStorageNotFoundError, HTTP 429 responses and recognised Google quota markers becomeOutboundStorageQuotaError, and every other transport or unmapped HTTP failure becomesOutboundStorageNetworkError. A typedOutboundStorageErrorraised by a nested call is re-raised unchanged so ownership and validation refusals are never re-wrapped as network errors.- Parameters:
- Return type:
TypeVar(ResponseBodyT)- Returns:
The deserialised API response payload.
- Raises:
OutboundStorageError – Re-raised unchanged when a nested call already raised a typed outbound-storage error.
OutboundStoragePermissionError – On HTTP 401 or 403 responses that are not quota refusals.
OutboundStorageQuotaError – On HTTP 429 responses or HTTP 403 responses carrying a recognised Google quota marker.
OutboundStorageNotFoundError – On HTTP 404 responses.
OutboundStorageNetworkError – On any other transport or unmapped HTTP failure.