1<?xml version="1.0" encoding="ascii"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 3 "DTD/xhtml1-transitional.dtd"> 4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 5<head> 6 <title>googleapiclient.model.ProtocolBufferModel</title> 7 <link rel="stylesheet" href="epydoc.css" type="text/css" /> 8 <script type="text/javascript" src="epydoc.js"></script> 9</head> 10 11<body bgcolor="white" text="black" link="blue" vlink="#204080" 12 alink="#204080"> 13<!-- ==================== NAVIGATION BAR ==================== --> 14<table class="navbar" border="0" width="100%" cellpadding="0" 15 bgcolor="#a0c0ff" cellspacing="0"> 16 <tr valign="middle"> 17 <!-- Home link --> 18 <th> <a 19 href="googleapiclient-module.html">Home</a> </th> 20 21 <!-- Tree link --> 22 <th> <a 23 href="module-tree.html">Trees</a> </th> 24 25 <!-- Index link --> 26 <th> <a 27 href="identifier-index.html">Indices</a> </th> 28 29 <!-- Help link --> 30 <th> <a 31 href="help.html">Help</a> </th> 32 33 <th class="navbar" width="100%"></th> 34 </tr> 35</table> 36<table width="100%" cellpadding="0" cellspacing="0"> 37 <tr valign="top"> 38 <td width="100%"> 39 <span class="breadcrumbs"> 40 <a href="googleapiclient-module.html">Package googleapiclient</a> :: 41 <a href="googleapiclient.model-module.html">Module model</a> :: 42 Class ProtocolBufferModel 43 </span> 44 </td> 45 <td> 46 <table cellpadding="0" cellspacing="0"> 47 <!-- hide/show private --> 48 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" 49 onclick="toggle_private();">hide private</a>]</span></td></tr> 50 <tr><td align="right"><span class="options" 51 >[<a href="frames.html" target="_top">frames</a 52 >] | <a href="googleapiclient.model.ProtocolBufferModel-class.html" 53 target="_top">no frames</a>]</span></td></tr> 54 </table> 55 </td> 56 </tr> 57</table> 58<!-- ==================== CLASS DESCRIPTION ==================== --> 59<h1 class="epydoc">Class ProtocolBufferModel</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.model-pysrc.html#ProtocolBufferModel">source code</a></span></p> 60<center> 61 62</center> 63<hr /> 64<pre class="literalblock"> 65Model class for protocol buffers. 66 67Serializes and de-serializes the binary protocol buffer sent in the HTTP 68request and response bodies. 69 70</pre> 71 72<!-- ==================== INSTANCE METHODS ==================== --> 73<a name="section-InstanceMethods"></a> 74<table class="summary" border="1" cellpadding="3" 75 cellspacing="0" width="100%" bgcolor="white"> 76<tr bgcolor="#70b0f0" class="table-header"> 77 <td colspan="2" class="table-header"> 78 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 79 <tr valign="top"> 80 <td align="left"><span class="table-header">Instance Methods</span></td> 81 <td align="right" valign="top" 82 ><span class="options">[<a href="#section-InstanceMethods" 83 class="privatelink" onclick="toggle_private();" 84 >hide private</a>]</span></td> 85 </tr> 86 </table> 87 </td> 88</tr> 89<tr> 90 <td width="15%" align="right" valign="top" class="summary"> 91 <span class="summary-type"> </span> 92 </td><td class="summary"> 93 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 94 <tr> 95 <td><span class="summary-sig"><a href="googleapiclient.model.ProtocolBufferModel-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, 96 <span class="summary-sig-arg">protocol_buffer</span>)</span><br /> 97 Constructs a ProtocolBufferModel.</td> 98 <td align="right" valign="top"> 99 <span class="codelink"><a href="googleapiclient.model-pysrc.html#ProtocolBufferModel.__init__">source code</a></span> 100 101 </td> 102 </tr> 103 </table> 104 105 </td> 106 </tr> 107<tr> 108 <td width="15%" align="right" valign="top" class="summary"> 109 <span class="summary-type"> </span> 110 </td><td class="summary"> 111 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 112 <tr> 113 <td><span class="summary-sig"><a href="googleapiclient.model.ProtocolBufferModel-class.html#serialize" class="summary-sig-name">serialize</a>(<span class="summary-sig-arg">self</span>, 114 <span class="summary-sig-arg">body_value</span>)</span><br /> 115 Perform the actual Python object serialization.</td> 116 <td align="right" valign="top"> 117 <span class="codelink"><a href="googleapiclient.model-pysrc.html#ProtocolBufferModel.serialize">source code</a></span> 118 119 </td> 120 </tr> 121 </table> 122 123 </td> 124 </tr> 125<tr> 126 <td width="15%" align="right" valign="top" class="summary"> 127 <span class="summary-type"> </span> 128 </td><td class="summary"> 129 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 130 <tr> 131 <td><span class="summary-sig"><a href="googleapiclient.model.ProtocolBufferModel-class.html#deserialize" class="summary-sig-name">deserialize</a>(<span class="summary-sig-arg">self</span>, 132 <span class="summary-sig-arg">content</span>)</span><br /> 133 Perform the actual deserialization from response string to Python 134object.</td> 135 <td align="right" valign="top"> 136 <span class="codelink"><a href="googleapiclient.model-pysrc.html#ProtocolBufferModel.deserialize">source code</a></span> 137 138 </td> 139 </tr> 140 </table> 141 142 </td> 143 </tr> 144<tr> 145 <td width="15%" align="right" valign="top" class="summary"> 146 <span class="summary-type"> </span> 147 </td><td class="summary"> 148 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 149 <tr> 150 <td><span class="summary-sig"><a href="googleapiclient.model.ProtocolBufferModel-class.html#no_content_response" class="summary-sig-name">no_content_response</a>(<span class="summary-sig-arg">self</span>)</span></td> 151 <td align="right" valign="top"> 152 <span class="codelink"><a href="googleapiclient.model-pysrc.html#ProtocolBufferModel.no_content_response">source code</a></span> 153 154 </td> 155 </tr> 156 </table> 157 158 </td> 159 </tr> 160 <tr> 161 <td colspan="2" class="summary"> 162 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="googleapiclient.model.BaseModel-class.html">BaseModel</a></code></b>: 163 <code><a href="googleapiclient.model.BaseModel-class.html#request">request</a></code>, 164 <code><a href="googleapiclient.model.BaseModel-class.html#response">response</a></code> 165 </p> 166 <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="googleapiclient.model.BaseModel-class.html">BaseModel</a></code></b> (private): 167 <code><a href="googleapiclient.model.BaseModel-class.html#_build_query" onclick="show_private();">_build_query</a></code>, 168 <code><a href="googleapiclient.model.BaseModel-class.html#_log_request" onclick="show_private();">_log_request</a></code>, 169 <code><a href="googleapiclient.model.BaseModel-class.html#_log_response" onclick="show_private();">_log_response</a></code> 170 </p></div> 171 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 172 <code>__delattr__</code>, 173 <code>__format__</code>, 174 <code>__getattribute__</code>, 175 <code>__hash__</code>, 176 <code>__new__</code>, 177 <code>__reduce__</code>, 178 <code>__reduce_ex__</code>, 179 <code>__repr__</code>, 180 <code>__setattr__</code>, 181 <code>__sizeof__</code>, 182 <code>__str__</code>, 183 <code>__subclasshook__</code> 184 </p> 185 </td> 186 </tr> 187</table> 188<!-- ==================== CLASS VARIABLES ==================== --> 189<a name="section-ClassVariables"></a> 190<table class="summary" border="1" cellpadding="3" 191 cellspacing="0" width="100%" bgcolor="white"> 192<tr bgcolor="#70b0f0" class="table-header"> 193 <td colspan="2" class="table-header"> 194 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 195 <tr valign="top"> 196 <td align="left"><span class="table-header">Class Variables</span></td> 197 <td align="right" valign="top" 198 ><span class="options">[<a href="#section-ClassVariables" 199 class="privatelink" onclick="toggle_private();" 200 >hide private</a>]</span></td> 201 </tr> 202 </table> 203 </td> 204</tr> 205<tr> 206 <td width="15%" align="right" valign="top" class="summary"> 207 <span class="summary-type"> </span> 208 </td><td class="summary"> 209 <a name="accept"></a><span class="summary-name">accept</span> = <code title="'application/x-protobuf'">'application/x-protobuf'</code> 210 </td> 211 </tr> 212<tr> 213 <td width="15%" align="right" valign="top" class="summary"> 214 <span class="summary-type"> </span> 215 </td><td class="summary"> 216 <a name="content_type"></a><span class="summary-name">content_type</span> = <code title="'application/x-protobuf'">'application/x-protobuf'</code> 217 </td> 218 </tr> 219<tr> 220 <td width="15%" align="right" valign="top" class="summary"> 221 <span class="summary-type"> </span> 222 </td><td class="summary"> 223 <a name="alt_param"></a><span class="summary-name">alt_param</span> = <code title="'proto'">'proto'</code> 224 </td> 225 </tr> 226</table> 227<!-- ==================== PROPERTIES ==================== --> 228<a name="section-Properties"></a> 229<table class="summary" border="1" cellpadding="3" 230 cellspacing="0" width="100%" bgcolor="white"> 231<tr bgcolor="#70b0f0" class="table-header"> 232 <td colspan="2" class="table-header"> 233 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 234 <tr valign="top"> 235 <td align="left"><span class="table-header">Properties</span></td> 236 <td align="right" valign="top" 237 ><span class="options">[<a href="#section-Properties" 238 class="privatelink" onclick="toggle_private();" 239 >hide private</a>]</span></td> 240 </tr> 241 </table> 242 </td> 243</tr> 244 <tr> 245 <td colspan="2" class="summary"> 246 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 247 <code>__class__</code> 248 </p> 249 </td> 250 </tr> 251</table> 252<!-- ==================== METHOD DETAILS ==================== --> 253<a name="section-MethodDetails"></a> 254<table class="details" border="1" cellpadding="3" 255 cellspacing="0" width="100%" bgcolor="white"> 256<tr bgcolor="#70b0f0" class="table-header"> 257 <td colspan="2" class="table-header"> 258 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 259 <tr valign="top"> 260 <td align="left"><span class="table-header">Method Details</span></td> 261 <td align="right" valign="top" 262 ><span class="options">[<a href="#section-MethodDetails" 263 class="privatelink" onclick="toggle_private();" 264 >hide private</a>]</span></td> 265 </tr> 266 </table> 267 </td> 268</tr> 269</table> 270<a name="__init__"></a> 271<div> 272<table class="details" border="1" cellpadding="3" 273 cellspacing="0" width="100%" bgcolor="white"> 274<tr><td> 275 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 276 <tr valign="top"><td> 277 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, 278 <span class="sig-arg">protocol_buffer</span>)</span> 279 <br /><em class="fname">(Constructor)</em> 280 </h3> 281 </td><td align="right" valign="top" 282 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#ProtocolBufferModel.__init__">source code</a></span> 283 </td> 284 </tr></table> 285 286 <pre class="literalblock"> 287Constructs a ProtocolBufferModel. 288 289The serialzed protocol buffer returned in an HTTP response will be 290de-serialized using the given protocol buffer class. 291 292Args: 293 protocol_buffer: The protocol buffer class used to de-serialize a 294 response from the API. 295 296</pre> 297 <dl class="fields"> 298 <dt>Overrides: 299 object.__init__ 300 </dt> 301 </dl> 302</td></tr></table> 303</div> 304<a name="serialize"></a> 305<div> 306<table class="details" border="1" cellpadding="3" 307 cellspacing="0" width="100%" bgcolor="white"> 308<tr><td> 309 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 310 <tr valign="top"><td> 311 <h3 class="epydoc"><span class="sig"><span class="sig-name">serialize</span>(<span class="sig-arg">self</span>, 312 <span class="sig-arg">body_value</span>)</span> 313 </h3> 314 </td><td align="right" valign="top" 315 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#ProtocolBufferModel.serialize">source code</a></span> 316 </td> 317 </tr></table> 318 319 <pre class="literalblock"> 320Perform the actual Python object serialization. 321 322Args: 323 body_value: object, the request body as a Python object. 324 325Returns: 326 string, the body in serialized form. 327 328</pre> 329 <dl class="fields"> 330 <dt>Overrides: 331 <a href="googleapiclient.model.BaseModel-class.html#serialize">BaseModel.serialize</a> 332 <dd><em class="note">(inherited documentation)</em></dd> 333 </dt> 334 </dl> 335</td></tr></table> 336</div> 337<a name="deserialize"></a> 338<div> 339<table class="details" border="1" cellpadding="3" 340 cellspacing="0" width="100%" bgcolor="white"> 341<tr><td> 342 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 343 <tr valign="top"><td> 344 <h3 class="epydoc"><span class="sig"><span class="sig-name">deserialize</span>(<span class="sig-arg">self</span>, 345 <span class="sig-arg">content</span>)</span> 346 </h3> 347 </td><td align="right" valign="top" 348 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#ProtocolBufferModel.deserialize">source code</a></span> 349 </td> 350 </tr></table> 351 352 <pre class="literalblock"> 353Perform the actual deserialization from response string to Python 354object. 355 356Args: 357 content: string, the body of the HTTP response 358 359Returns: 360 The body de-serialized as a Python object. 361 362</pre> 363 <dl class="fields"> 364 <dt>Overrides: 365 <a href="googleapiclient.model.BaseModel-class.html#deserialize">BaseModel.deserialize</a> 366 <dd><em class="note">(inherited documentation)</em></dd> 367 </dt> 368 </dl> 369</td></tr></table> 370</div> 371<a name="no_content_response"></a> 372<div> 373<table class="details" border="1" cellpadding="3" 374 cellspacing="0" width="100%" bgcolor="white"> 375<tr><td> 376 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 377 <tr valign="top"><td> 378 <h3 class="epydoc"><span class="sig"><span class="sig-name">no_content_response</span>(<span class="sig-arg">self</span>)</span> 379 </h3> 380 </td><td align="right" valign="top" 381 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#ProtocolBufferModel.no_content_response">source code</a></span> 382 </td> 383 </tr></table> 384 385 386 <dl class="fields"> 387 <dt>Decorators:</dt> 388 <dd><ul class="nomargin-top"> 389 <li><code>@property</code></li> 390 </ul></dd> 391 <dt>Overrides: 392 <a href="googleapiclient.model.BaseModel-class.html#no_content_response">no_content_response</a> 393 </dt> 394 </dl> 395</td></tr></table> 396</div> 397<br /> 398<!-- ==================== NAVIGATION BAR ==================== --> 399<table class="navbar" border="0" width="100%" cellpadding="0" 400 bgcolor="#a0c0ff" cellspacing="0"> 401 <tr valign="middle"> 402 <!-- Home link --> 403 <th> <a 404 href="googleapiclient-module.html">Home</a> </th> 405 406 <!-- Tree link --> 407 <th> <a 408 href="module-tree.html">Trees</a> </th> 409 410 <!-- Index link --> 411 <th> <a 412 href="identifier-index.html">Indices</a> </th> 413 414 <!-- Help link --> 415 <th> <a 416 href="help.html">Help</a> </th> 417 418 <th class="navbar" width="100%"></th> 419 </tr> 420</table> 421<table border="0" cellpadding="0" cellspacing="0" width="100%%"> 422 <tr> 423 <td align="left" class="footer"> 424 Generated by Epydoc 3.0.1 on Mon Jun 5 13:38:40 2017 425 </td> 426 <td align="right" class="footer"> 427 <a target="mainFrame" href="http://epydoc.sourceforge.net" 428 >http://epydoc.sourceforge.net</a> 429 </td> 430 </tr> 431</table> 432 433<script type="text/javascript"> 434 <!-- 435 // Private objects are initially displayed (because if 436 // javascript is turned off then we want them to be 437 // visible); but by default, we want to hide them. So hide 438 // them unless we have a cookie that says to show them. 439 checkCookie(); 440 // --> 441</script> 442</body> 443</html> 444