Package googleapiclient :: Module model :: Class JsonModel
[hide private]
[frames] | no frames]

Class JsonModel

source code


Model class for JSON.

Serializes and de-serializes between JSON and the Python
object representation of HTTP request and response bodies.

Instance Methods [hide private]
 
__init__(self, data_wrapper=False)
Construct a JsonModel.
source code
 
serialize(self, body_value)
Perform the actual Python object serialization.
source code
 
deserialize(self, content)
Perform the actual deserialization from response string to Python object.
source code
 
no_content_response(self) source code

Inherited from BaseModel: request, response

Inherited from BaseModel (private): _build_query, _log_request, _log_response

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  accept = 'application/json'
  content_type = 'application/json'
  alt_param = 'json'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data_wrapper=False)
(Constructor)

source code 
Construct a JsonModel.

Args:
  data_wrapper: boolean, wrap requests and responses in a data wrapper

Overrides: object.__init__

serialize(self, body_value)

source code 
Perform the actual Python object serialization.

Args:
  body_value: object, the request body as a Python object.

Returns:
  string, the body in serialized form.

Overrides: BaseModel.serialize
(inherited documentation)

deserialize(self, content)

source code 
Perform the actual deserialization from response string to Python
object.

Args:
  content: string, the body of the HTTP response

Returns:
  The body de-serialized as a Python object.

Overrides: BaseModel.deserialize
(inherited documentation)

no_content_response(self)

source code 
Decorators:
  • @property
Overrides: no_content_response