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

Class ProtocolBufferModel

source code


Model class for protocol buffers.

Serializes and de-serializes the binary protocol buffer sent in the HTTP
request and response bodies.

Instance Methods [hide private]
 
__init__(self, protocol_buffer)
Constructs a ProtocolBufferModel.
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/x-protobuf'
  content_type = 'application/x-protobuf'
  alt_param = 'proto'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, protocol_buffer)
(Constructor)

source code 
Constructs a ProtocolBufferModel.

The serialzed protocol buffer returned in an HTTP response will be
de-serialized using the given protocol buffer class.

Args:
  protocol_buffer: The protocol buffer class used to de-serialize a
  response from the API.

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