(key: str)
| 60 | |
| 61 | |
| 62 | def _get_json_sync(key: str) -> Tuple[Optional[dict], Optional[str]]: |
| 63 | try: |
| 64 | resp = _get_client().get_object(Bucket=R2_BUCKET, Key=key) |
| 65 | except ClientError as e: |
| 66 | if e.response["Error"]["Code"] in ("NoSuchKey", "404"): |
| 67 | return None, None |
| 68 | raise |
| 69 | body = resp["Body"].read() |
| 70 | etag = resp.get("ETag") |
| 71 | return json.loads(body), etag |
| 72 | |
| 73 | |
| 74 | def _put_json_sync(key: str, data: dict, if_match: Optional[str], if_none_match: Optional[str]) -> str: |
nothing calls this directly
no test coverage detected