| 353 | return self._request(*args, **kwargs) |
| 354 | |
| 355 | def _get_body(self, response): |
| 356 | if response.status_code != 200: |
| 357 | raise googlemaps.exceptions.HTTPError(response.status_code) |
| 358 | |
| 359 | body = response.json() |
| 360 | |
| 361 | api_status = body["status"] |
| 362 | if api_status == "OK" or api_status == "ZERO_RESULTS": |
| 363 | return body |
| 364 | |
| 365 | if api_status == "OVER_QUERY_LIMIT": |
| 366 | raise googlemaps.exceptions._OverQueryLimit( |
| 367 | api_status, body.get("error_message")) |
| 368 | |
| 369 | raise googlemaps.exceptions.ApiError(api_status, |
| 370 | body.get("error_message")) |
| 371 | |
| 372 | def _generate_auth_url(self, path, params, accepts_clientid): |
| 373 | """Returns the path and query string portion of the request URL, first |