class documentation
class Resource(object):
Constructor: Resource(http, baseUrl, model, requestBuilder, ...)
A class for interacting with a resource.
| Method | __enter__ |
Undocumented |
| Method | __exit__ |
Undocumented |
| Method | __getstate__ |
Trim the state down to something that can be pickled. |
| Method | __init__ |
Build a Resource from the API description. |
| Method | __setstate__ |
Reconstitute the state of the object from being pickled. |
| Method | close |
Close httplib2 connections. |
| Method | _add |
Undocumented |
| Method | _add |
Undocumented |
| Method | _add |
Undocumented |
| Method | _set |
Sets an instance attribute and tracks it in a list of dynamic attributes. |
| Method | _set |
Undocumented |
| Method | _validate |
Validates client's and credentials' universe domains are consistent. |
| Instance Variable | _base |
Undocumented |
| Instance Variable | _credentials |
Undocumented |
| Instance Variable | _developer |
Undocumented |
| Instance Variable | _dynamic |
Undocumented |
| Instance Variable | _http |
Undocumented |
| Instance Variable | _model |
Undocumented |
| Instance Variable | _request |
Undocumented |
| Instance Variable | _resource |
Undocumented |
| Instance Variable | _root |
Undocumented |
| Instance Variable | _schema |
Undocumented |
| Instance Variable | _universe |
Undocumented |
Trim the state down to something that can be pickled.
Uses the fact that the instance variable _dynamic_attrs holds attrs that will be wiped and restored on pickle serialization.
def __init__(self, http, baseUrl, model, requestBuilder, developerKey, resourceDesc, rootDesc, schema, universe_domain=universe.DEFAULT_UNIVERSE if HAS_UNIVERSE else ''):
¶
Build a Resource from the API description.
| Parameters | |
| http | httplib2.Http, Object to make http requests with. |
| base | string, base URL for the API. All requests are relative to this URI. |
| model | googleapiclient.Model, converts to and from the wire format. |
| request | class or callable that instantiates an googleapiclient.HttpRequest object. |
| developer | string, key obtained from https://code.google.com/apis/console |
| resource | object, section of deserialized discovery document that describes a resource. Note that the top level discovery document is considered a resource. |
| root | object, the entire deserialized discovery document. |
| schema | object, mapping of schema names to schema descriptions. |
| universe | string, the universe for the API. The default universe |
| is "googleapis | |
Reconstitute the state of the object from being pickled.
Uses the fact that the instance variable _dynamic_attrs holds attrs that will be wiped and restored on pickle serialization.
Sets an instance attribute and tracks it in a list of dynamic attributes.
| Parameters | |
| attr | string; The name of the attribute to be set |
| value | The value being set on the object and tracked in the dynamic cache. |