module documentation
Model objects for requests and responses.
Each API may support one or more serializations, such as JSON, Atom, etc. The model classes are responsible for converting between the wire format and the Python object representation.
| Class | |
Base model class. |
| Class | |
Model class for JSON. |
| Class | |
Model class for requests that return Media. |
| Class | |
Model base class. |
| Class | |
Model class for protocol buffers. |
| Class | |
Model class for requests that don't return JSON. |
| Function | makepatch |
Create a patch object. |
| Constant | LOGGER |
Undocumented |
| Variable | __author__ |
Undocumented |
| Variable | dump |
Undocumented |
| Function | _abstract |
Undocumented |
| Constant | _PY |
Undocumented |
Create a patch object.
Some methods support PATCH, an efficient way to send updates to a resource. This method allows the easy construction of patch bodies by looking at the differences between a resource before and after it was modified.
- Example usage:
item = service.activities().get(postid=postid, userid=userid).execute() original = copy.deepcopy(item) item['object']['content'] = 'This is updated.' service.activities.patch(postid=postid, userid=userid,
body=makepatch(original, item)).execute()
| Parameters | |
| original | object, the original deserialized resource |
| modified | object, the modified deserialized resource |
| Returns | |
| An object that contains only the changes from original to modified, in a form suitable to pass to a PATCH method. | |