class documentation

class Model(object):

Known subclasses: googleapiclient.model.BaseModel

View In Hierarchy

Model base class.

All Model classes should implement this interface. The Model serializes and de-serializes between a wire format such as JSON and a Python object representation.

Method request Updates outgoing requests with a serialized body.
Method response Convert the response wire format into a Python object.
def request(self, headers, path_params, query_params, body_value):

Updates outgoing requests with a serialized body.

Parameters
headersdict, request headers
path_paramsdict, parameters that appear in the request path
query_paramsdict, parameters that appear in the query
body_valueobject, the request body as a Python object, which must be serializable.
Returns
A tuple of (headers, path_params, query, body)headers: dict, request headers path_params: dict, parameters that appear in the request path query: string, query part of the request URI body: string, the body serialized in the desired wire format.
def response(self, resp, content):

Convert the response wire format into a Python object.

Parameters
resphttplib2.Response, the HTTP response headers and status
contentstring, the body of the HTTP response
Returns
The body de-serialized as a Python object.
Raises
googleapiclient.errors.HttpError if a non 2xx response is received.