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.JsonModel</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 JsonModel 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.JsonModel-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 JsonModel</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.model-pysrc.html#JsonModel">source code</a></span></p> 60<center> 61 62</center> 63<hr /> 64<pre class="literalblock"> 65Model class for JSON. 66 67Serializes and de-serializes between JSON and the Python 68object representation of HTTP request 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.JsonModel-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, 96 <span class="summary-sig-arg">data_wrapper</span>=<span class="summary-sig-default">False</span>)</span><br /> 97 Construct a JsonModel.</td> 98 <td align="right" valign="top"> 99 <span class="codelink"><a href="googleapiclient.model-pysrc.html#JsonModel.__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.JsonModel-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#JsonModel.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.JsonModel-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#JsonModel.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.JsonModel-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#JsonModel.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/json'">'application/json'</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/json'">'application/json'</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="'json'">'json'</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">data_wrapper</span>=<span class="sig-default">False</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#JsonModel.__init__">source code</a></span> 283 </td> 284 </tr></table> 285 286 <pre class="literalblock"> 287Construct a JsonModel. 288 289Args: 290 data_wrapper: boolean, wrap requests and responses in a data wrapper 291 292</pre> 293 <dl class="fields"> 294 <dt>Overrides: 295 object.__init__ 296 </dt> 297 </dl> 298</td></tr></table> 299</div> 300<a name="serialize"></a> 301<div> 302<table class="details" border="1" cellpadding="3" 303 cellspacing="0" width="100%" bgcolor="white"> 304<tr><td> 305 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 306 <tr valign="top"><td> 307 <h3 class="epydoc"><span class="sig"><span class="sig-name">serialize</span>(<span class="sig-arg">self</span>, 308 <span class="sig-arg">body_value</span>)</span> 309 </h3> 310 </td><td align="right" valign="top" 311 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#JsonModel.serialize">source code</a></span> 312 </td> 313 </tr></table> 314 315 <pre class="literalblock"> 316Perform the actual Python object serialization. 317 318Args: 319 body_value: object, the request body as a Python object. 320 321Returns: 322 string, the body in serialized form. 323 324</pre> 325 <dl class="fields"> 326 <dt>Overrides: 327 <a href="googleapiclient.model.BaseModel-class.html#serialize">BaseModel.serialize</a> 328 <dd><em class="note">(inherited documentation)</em></dd> 329 </dt> 330 </dl> 331</td></tr></table> 332</div> 333<a name="deserialize"></a> 334<div> 335<table class="details" border="1" cellpadding="3" 336 cellspacing="0" width="100%" bgcolor="white"> 337<tr><td> 338 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 339 <tr valign="top"><td> 340 <h3 class="epydoc"><span class="sig"><span class="sig-name">deserialize</span>(<span class="sig-arg">self</span>, 341 <span class="sig-arg">content</span>)</span> 342 </h3> 343 </td><td align="right" valign="top" 344 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#JsonModel.deserialize">source code</a></span> 345 </td> 346 </tr></table> 347 348 <pre class="literalblock"> 349Perform the actual deserialization from response string to Python 350object. 351 352Args: 353 content: string, the body of the HTTP response 354 355Returns: 356 The body de-serialized as a Python object. 357 358</pre> 359 <dl class="fields"> 360 <dt>Overrides: 361 <a href="googleapiclient.model.BaseModel-class.html#deserialize">BaseModel.deserialize</a> 362 <dd><em class="note">(inherited documentation)</em></dd> 363 </dt> 364 </dl> 365</td></tr></table> 366</div> 367<a name="no_content_response"></a> 368<div> 369<table class="details" border="1" cellpadding="3" 370 cellspacing="0" width="100%" bgcolor="white"> 371<tr><td> 372 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 373 <tr valign="top"><td> 374 <h3 class="epydoc"><span class="sig"><span class="sig-name">no_content_response</span>(<span class="sig-arg">self</span>)</span> 375 </h3> 376 </td><td align="right" valign="top" 377 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#JsonModel.no_content_response">source code</a></span> 378 </td> 379 </tr></table> 380 381 382 <dl class="fields"> 383 <dt>Decorators:</dt> 384 <dd><ul class="nomargin-top"> 385 <li><code>@property</code></li> 386 </ul></dd> 387 <dt>Overrides: 388 <a href="googleapiclient.model.BaseModel-class.html#no_content_response">no_content_response</a> 389 </dt> 390 </dl> 391</td></tr></table> 392</div> 393<br /> 394<!-- ==================== NAVIGATION BAR ==================== --> 395<table class="navbar" border="0" width="100%" cellpadding="0" 396 bgcolor="#a0c0ff" cellspacing="0"> 397 <tr valign="middle"> 398 <!-- Home link --> 399 <th> <a 400 href="googleapiclient-module.html">Home</a> </th> 401 402 <!-- Tree link --> 403 <th> <a 404 href="module-tree.html">Trees</a> </th> 405 406 <!-- Index link --> 407 <th> <a 408 href="identifier-index.html">Indices</a> </th> 409 410 <!-- Help link --> 411 <th> <a 412 href="help.html">Help</a> </th> 413 414 <th class="navbar" width="100%"></th> 415 </tr> 416</table> 417<table border="0" cellpadding="0" cellspacing="0" width="100%%"> 418 <tr> 419 <td align="left" class="footer"> 420 Generated by Epydoc 3.0.1 on Mon Jun 5 13:38:40 2017 421 </td> 422 <td align="right" class="footer"> 423 <a target="mainFrame" href="http://epydoc.sourceforge.net" 424 >http://epydoc.sourceforge.net</a> 425 </td> 426 </tr> 427</table> 428 429<script type="text/javascript"> 430 <!-- 431 // Private objects are initially displayed (because if 432 // javascript is turned off then we want them to be 433 // visible); but by default, we want to hide them. So hide 434 // them unless we have a cookie that says to show them. 435 checkCookie(); 436 // --> 437</script> 438</body> 439</html> 440