MCPcopy Create free account
hub / github.com/Roy3838/Observer / put_json

Function put_json

api/r2_store.py:129–141  ·  view source on GitHub ↗

Write a JSON object. Pass if_match= for an optimistic-concurrency write, or if_none_match="*" to fail if the key already exists. Raises PreconditionFailed when the condition is not met.

(
    key: str,
    data: dict,
    if_match: Optional[str] = None,
    if_none_match: Optional[str] = None,
)

Source from the content-addressed store, hash-verified

127
128
129async def put_json(
130 key: str,
131 data: dict,
132 if_match: Optional[str] = None,
133 if_none_match: Optional[str] = None,
134) -> str:
135 """
136 Write a JSON object. Pass if_match=<etag> for an optimistic-concurrency
137 write, or if_none_match="*" to fail if the key already exists.
138
139 Raises PreconditionFailed when the condition is not met.
140 """
141 return await asyncio.to_thread(_put_json_sync, key, data, if_match, if_none_match)
142
143
144async def put_bytes(

Callers 1

update_jsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected