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.BaseModel</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 BaseModel 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.BaseModel-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 BaseModel</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel">source code</a></span></p> 60<center> 61<center> <map id="uml_class_diagram_for_googleap_38" name="uml_class_diagram_for_googleap_38"> 62<area shape="rect" id="node1_8" href="googleapiclient.model.BaseModel-class.html#accept" title="googleapiclient.model.BaseModel.accept" alt="" coords="17,93,396,113"/> 63<area shape="rect" id="node1_9" href="googleapiclient.model.BaseModel-class.html#content_type" title="googleapiclient.model.BaseModel.content_type" alt="" coords="17,113,396,133"/> 64<area shape="rect" id="node1_10" href="googleapiclient.model.BaseModel-class.html#no_content_response" title="googleapiclient.model.BaseModel.no_content_response" alt="" coords="17,133,396,153"/> 65<area shape="rect" id="node1_11" href="googleapiclient.model.BaseModel-class.html#alt_param" title="googleapiclient.model.BaseModel.alt_param" alt="" coords="17,153,396,173"/> 66<area shape="rect" id="node1_12" href="googleapiclient.model.BaseModel-class.html#request" title="Updates outgoing requests with a serialized body." alt="" coords="17,175,396,195"/> 67<area shape="rect" id="node1_13" href="googleapiclient.model.BaseModel-class.html#response" title="Convert the response wire format into a Python object." alt="" coords="17,195,396,215"/> 68<area shape="rect" id="node1_14" href="googleapiclient.model.BaseModel-class.html#serialize" title="Perform the actual Python object serialization." alt="" coords="17,215,396,235"/> 69<area shape="rect" id="node1_15" href="googleapiclient.model.BaseModel-class.html#deserialize" title="Perform the actual deserialization from response string to Python object." alt="" coords="17,235,396,255"/> 70<area shape="rect" id="node1" href="googleapiclient.model.BaseModel-class.html" title="Base model class." alt="" coords="5,68,408,261"/> 71<area shape="rect" id="node2" href="googleapiclient.model.Model-class.html" title="Model base class." alt="" coords="175,5,235,49"/> 72</map> 73 <img src="uml_class_diagram_for_googleap_38.gif" alt='' usemap="#uml_class_diagram_for_googleap_38" ismap="ismap" class="graph-without-title" /> 74</center> 75</center> 76<hr /> 77<pre class="literalblock"> 78Base model class. 79 80Subclasses should provide implementations for the "serialize" and 81"deserialize" methods, as well as values for the following class attributes. 82 83Attributes: 84 accept: The value to use for the HTTP Accept header. 85 content_type: The value to use for the HTTP Content-type header. 86 no_content_response: The value to return when deserializing a 204 "No 87 Content" response. 88 alt_param: The value to supply as the "alt" query parameter for requests. 89 90</pre> 91 92<!-- ==================== INSTANCE METHODS ==================== --> 93<a name="section-InstanceMethods"></a> 94<table class="summary" border="1" cellpadding="3" 95 cellspacing="0" width="100%" bgcolor="white"> 96<tr bgcolor="#70b0f0" class="table-header"> 97 <td colspan="2" class="table-header"> 98 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 99 <tr valign="top"> 100 <td align="left"><span class="table-header">Instance Methods</span></td> 101 <td align="right" valign="top" 102 ><span class="options">[<a href="#section-InstanceMethods" 103 class="privatelink" onclick="toggle_private();" 104 >hide private</a>]</span></td> 105 </tr> 106 </table> 107 </td> 108</tr> 109<tr class="private"> 110 <td width="15%" align="right" valign="top" class="summary"> 111 <span class="summary-type"> </span> 112 </td><td class="summary"> 113 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 114 <tr> 115 <td><span class="summary-sig"><a name="_log_request"></a><span class="summary-sig-name">_log_request</span>(<span class="summary-sig-arg">self</span>, 116 <span class="summary-sig-arg">headers</span>, 117 <span class="summary-sig-arg">path_params</span>, 118 <span class="summary-sig-arg">query</span>, 119 <span class="summary-sig-arg">body</span>)</span><br /> 120 Logs debugging information about the request if requested.</td> 121 <td align="right" valign="top"> 122 <span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel._log_request">source code</a></span> 123 124 </td> 125 </tr> 126 </table> 127 128 </td> 129 </tr> 130<tr> 131 <td width="15%" align="right" valign="top" class="summary"> 132 <span class="summary-type"> </span> 133 </td><td class="summary"> 134 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 135 <tr> 136 <td><span class="summary-sig"><a href="googleapiclient.model.BaseModel-class.html#request" class="summary-sig-name">request</a>(<span class="summary-sig-arg">self</span>, 137 <span class="summary-sig-arg">headers</span>, 138 <span class="summary-sig-arg">path_params</span>, 139 <span class="summary-sig-arg">query_params</span>, 140 <span class="summary-sig-arg">body_value</span>)</span><br /> 141 Updates outgoing requests with a serialized body.</td> 142 <td align="right" valign="top"> 143 <span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel.request">source code</a></span> 144 145 </td> 146 </tr> 147 </table> 148 149 </td> 150 </tr> 151<tr class="private"> 152 <td width="15%" align="right" valign="top" class="summary"> 153 <span class="summary-type"> </span> 154 </td><td class="summary"> 155 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 156 <tr> 157 <td><span class="summary-sig"><a href="googleapiclient.model.BaseModel-class.html#_build_query" class="summary-sig-name" onclick="show_private();">_build_query</a>(<span class="summary-sig-arg">self</span>, 158 <span class="summary-sig-arg">params</span>)</span><br /> 159 Builds a query string.</td> 160 <td align="right" valign="top"> 161 <span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel._build_query">source code</a></span> 162 163 </td> 164 </tr> 165 </table> 166 167 </td> 168 </tr> 169<tr class="private"> 170 <td width="15%" align="right" valign="top" class="summary"> 171 <span class="summary-type"> </span> 172 </td><td class="summary"> 173 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 174 <tr> 175 <td><span class="summary-sig"><a name="_log_response"></a><span class="summary-sig-name">_log_response</span>(<span class="summary-sig-arg">self</span>, 176 <span class="summary-sig-arg">resp</span>, 177 <span class="summary-sig-arg">content</span>)</span><br /> 178 Logs debugging information about the response if requested.</td> 179 <td align="right" valign="top"> 180 <span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel._log_response">source code</a></span> 181 182 </td> 183 </tr> 184 </table> 185 186 </td> 187 </tr> 188<tr> 189 <td width="15%" align="right" valign="top" class="summary"> 190 <span class="summary-type"> </span> 191 </td><td class="summary"> 192 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 193 <tr> 194 <td><span class="summary-sig"><a href="googleapiclient.model.BaseModel-class.html#response" class="summary-sig-name">response</a>(<span class="summary-sig-arg">self</span>, 195 <span class="summary-sig-arg">resp</span>, 196 <span class="summary-sig-arg">content</span>)</span><br /> 197 Convert the response wire format into a Python object.</td> 198 <td align="right" valign="top"> 199 <span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel.response">source code</a></span> 200 201 </td> 202 </tr> 203 </table> 204 205 </td> 206 </tr> 207<tr> 208 <td width="15%" align="right" valign="top" class="summary"> 209 <span class="summary-type"> </span> 210 </td><td class="summary"> 211 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 212 <tr> 213 <td><span class="summary-sig"><a href="googleapiclient.model.BaseModel-class.html#serialize" class="summary-sig-name">serialize</a>(<span class="summary-sig-arg">self</span>, 214 <span class="summary-sig-arg">body_value</span>)</span><br /> 215 Perform the actual Python object serialization.</td> 216 <td align="right" valign="top"> 217 <span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel.serialize">source code</a></span> 218 219 </td> 220 </tr> 221 </table> 222 223 </td> 224 </tr> 225<tr> 226 <td width="15%" align="right" valign="top" class="summary"> 227 <span class="summary-type"> </span> 228 </td><td class="summary"> 229 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 230 <tr> 231 <td><span class="summary-sig"><a href="googleapiclient.model.BaseModel-class.html#deserialize" class="summary-sig-name">deserialize</a>(<span class="summary-sig-arg">self</span>, 232 <span class="summary-sig-arg">content</span>)</span><br /> 233 Perform the actual deserialization from response string to Python 234object.</td> 235 <td align="right" valign="top"> 236 <span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel.deserialize">source code</a></span> 237 238 </td> 239 </tr> 240 </table> 241 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>__delattr__</code>, 248 <code>__format__</code>, 249 <code>__getattribute__</code>, 250 <code>__hash__</code>, 251 <code>__init__</code>, 252 <code>__new__</code>, 253 <code>__reduce__</code>, 254 <code>__reduce_ex__</code>, 255 <code>__repr__</code>, 256 <code>__setattr__</code>, 257 <code>__sizeof__</code>, 258 <code>__str__</code>, 259 <code>__subclasshook__</code> 260 </p> 261 </td> 262 </tr> 263</table> 264<!-- ==================== CLASS VARIABLES ==================== --> 265<a name="section-ClassVariables"></a> 266<table class="summary" border="1" cellpadding="3" 267 cellspacing="0" width="100%" bgcolor="white"> 268<tr bgcolor="#70b0f0" class="table-header"> 269 <td colspan="2" class="table-header"> 270 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 271 <tr valign="top"> 272 <td align="left"><span class="table-header">Class Variables</span></td> 273 <td align="right" valign="top" 274 ><span class="options">[<a href="#section-ClassVariables" 275 class="privatelink" onclick="toggle_private();" 276 >hide private</a>]</span></td> 277 </tr> 278 </table> 279 </td> 280</tr> 281<tr> 282 <td width="15%" align="right" valign="top" class="summary"> 283 <span class="summary-type"> </span> 284 </td><td class="summary"> 285 <a name="accept"></a><span class="summary-name">accept</span> = <code title="None">None</code> 286 </td> 287 </tr> 288<tr> 289 <td width="15%" align="right" valign="top" class="summary"> 290 <span class="summary-type"> </span> 291 </td><td class="summary"> 292 <a name="content_type"></a><span class="summary-name">content_type</span> = <code title="None">None</code> 293 </td> 294 </tr> 295<tr> 296 <td width="15%" align="right" valign="top" class="summary"> 297 <span class="summary-type"> </span> 298 </td><td class="summary"> 299 <a name="no_content_response"></a><span class="summary-name">no_content_response</span> = <code title="None">None</code> 300 </td> 301 </tr> 302<tr> 303 <td width="15%" align="right" valign="top" class="summary"> 304 <span class="summary-type"> </span> 305 </td><td class="summary"> 306 <a name="alt_param"></a><span class="summary-name">alt_param</span> = <code title="None">None</code> 307 </td> 308 </tr> 309</table> 310<!-- ==================== PROPERTIES ==================== --> 311<a name="section-Properties"></a> 312<table class="summary" border="1" cellpadding="3" 313 cellspacing="0" width="100%" bgcolor="white"> 314<tr bgcolor="#70b0f0" class="table-header"> 315 <td colspan="2" class="table-header"> 316 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 317 <tr valign="top"> 318 <td align="left"><span class="table-header">Properties</span></td> 319 <td align="right" valign="top" 320 ><span class="options">[<a href="#section-Properties" 321 class="privatelink" onclick="toggle_private();" 322 >hide private</a>]</span></td> 323 </tr> 324 </table> 325 </td> 326</tr> 327 <tr> 328 <td colspan="2" class="summary"> 329 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 330 <code>__class__</code> 331 </p> 332 </td> 333 </tr> 334</table> 335<!-- ==================== METHOD DETAILS ==================== --> 336<a name="section-MethodDetails"></a> 337<table class="details" border="1" cellpadding="3" 338 cellspacing="0" width="100%" bgcolor="white"> 339<tr bgcolor="#70b0f0" class="table-header"> 340 <td colspan="2" class="table-header"> 341 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 342 <tr valign="top"> 343 <td align="left"><span class="table-header">Method Details</span></td> 344 <td align="right" valign="top" 345 ><span class="options">[<a href="#section-MethodDetails" 346 class="privatelink" onclick="toggle_private();" 347 >hide private</a>]</span></td> 348 </tr> 349 </table> 350 </td> 351</tr> 352</table> 353<a name="request"></a> 354<div> 355<table class="details" border="1" cellpadding="3" 356 cellspacing="0" width="100%" bgcolor="white"> 357<tr><td> 358 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 359 <tr valign="top"><td> 360 <h3 class="epydoc"><span class="sig"><span class="sig-name">request</span>(<span class="sig-arg">self</span>, 361 <span class="sig-arg">headers</span>, 362 <span class="sig-arg">path_params</span>, 363 <span class="sig-arg">query_params</span>, 364 <span class="sig-arg">body_value</span>)</span> 365 </h3> 366 </td><td align="right" valign="top" 367 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel.request">source code</a></span> 368 </td> 369 </tr></table> 370 371 <pre class="literalblock"> 372Updates outgoing requests with a serialized body. 373 374Args: 375 headers: dict, request headers 376 path_params: dict, parameters that appear in the request path 377 query_params: dict, parameters that appear in the query 378 body_value: object, the request body as a Python object, which must be 379 serializable by json. 380Returns: 381 A tuple of (headers, path_params, query, body) 382 383 headers: dict, request headers 384 path_params: dict, parameters that appear in the request path 385 query: string, query part of the request URI 386 body: string, the body serialized as JSON 387 388</pre> 389 <dl class="fields"> 390 <dt>Overrides: 391 <a href="googleapiclient.model.Model-class.html#request">Model.request</a> 392 </dt> 393 </dl> 394</td></tr></table> 395</div> 396<a name="_build_query"></a> 397<div class="private"> 398<table class="details" border="1" cellpadding="3" 399 cellspacing="0" width="100%" bgcolor="white"> 400<tr><td> 401 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 402 <tr valign="top"><td> 403 <h3 class="epydoc"><span class="sig"><span class="sig-name">_build_query</span>(<span class="sig-arg">self</span>, 404 <span class="sig-arg">params</span>)</span> 405 </h3> 406 </td><td align="right" valign="top" 407 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel._build_query">source code</a></span> 408 </td> 409 </tr></table> 410 411 <pre class="literalblock"> 412Builds a query string. 413 414Args: 415 params: dict, the query parameters 416 417Returns: 418 The query parameters properly encoded into an HTTP URI query string. 419 420</pre> 421 <dl class="fields"> 422 </dl> 423</td></tr></table> 424</div> 425<a name="response"></a> 426<div> 427<table class="details" border="1" cellpadding="3" 428 cellspacing="0" width="100%" bgcolor="white"> 429<tr><td> 430 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 431 <tr valign="top"><td> 432 <h3 class="epydoc"><span class="sig"><span class="sig-name">response</span>(<span class="sig-arg">self</span>, 433 <span class="sig-arg">resp</span>, 434 <span class="sig-arg">content</span>)</span> 435 </h3> 436 </td><td align="right" valign="top" 437 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel.response">source code</a></span> 438 </td> 439 </tr></table> 440 441 <pre class="literalblock"> 442Convert the response wire format into a Python object. 443 444Args: 445 resp: httplib2.Response, the HTTP response headers and status 446 content: string, the body of the HTTP response 447 448Returns: 449 The body de-serialized as a Python object. 450 451Raises: 452 googleapiclient.errors.HttpError if a non 2xx response is received. 453 454</pre> 455 <dl class="fields"> 456 <dt>Overrides: 457 <a href="googleapiclient.model.Model-class.html#response">Model.response</a> 458 </dt> 459 </dl> 460</td></tr></table> 461</div> 462<a name="serialize"></a> 463<div> 464<table class="details" border="1" cellpadding="3" 465 cellspacing="0" width="100%" bgcolor="white"> 466<tr><td> 467 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 468 <tr valign="top"><td> 469 <h3 class="epydoc"><span class="sig"><span class="sig-name">serialize</span>(<span class="sig-arg">self</span>, 470 <span class="sig-arg">body_value</span>)</span> 471 </h3> 472 </td><td align="right" valign="top" 473 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel.serialize">source code</a></span> 474 </td> 475 </tr></table> 476 477 <pre class="literalblock"> 478Perform the actual Python object serialization. 479 480Args: 481 body_value: object, the request body as a Python object. 482 483Returns: 484 string, the body in serialized form. 485 486</pre> 487 <dl class="fields"> 488 </dl> 489</td></tr></table> 490</div> 491<a name="deserialize"></a> 492<div> 493<table class="details" border="1" cellpadding="3" 494 cellspacing="0" width="100%" bgcolor="white"> 495<tr><td> 496 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 497 <tr valign="top"><td> 498 <h3 class="epydoc"><span class="sig"><span class="sig-name">deserialize</span>(<span class="sig-arg">self</span>, 499 <span class="sig-arg">content</span>)</span> 500 </h3> 501 </td><td align="right" valign="top" 502 ><span class="codelink"><a href="googleapiclient.model-pysrc.html#BaseModel.deserialize">source code</a></span> 503 </td> 504 </tr></table> 505 506 <pre class="literalblock"> 507Perform the actual deserialization from response string to Python 508object. 509 510Args: 511 content: string, the body of the HTTP response 512 513Returns: 514 The body de-serialized as a Python object. 515 516</pre> 517 <dl class="fields"> 518 </dl> 519</td></tr></table> 520</div> 521<br /> 522<!-- ==================== NAVIGATION BAR ==================== --> 523<table class="navbar" border="0" width="100%" cellpadding="0" 524 bgcolor="#a0c0ff" cellspacing="0"> 525 <tr valign="middle"> 526 <!-- Home link --> 527 <th> <a 528 href="googleapiclient-module.html">Home</a> </th> 529 530 <!-- Tree link --> 531 <th> <a 532 href="module-tree.html">Trees</a> </th> 533 534 <!-- Index link --> 535 <th> <a 536 href="identifier-index.html">Indices</a> </th> 537 538 <!-- Help link --> 539 <th> <a 540 href="help.html">Help</a> </th> 541 542 <th class="navbar" width="100%"></th> 543 </tr> 544</table> 545<table border="0" cellpadding="0" cellspacing="0" width="100%%"> 546 <tr> 547 <td align="left" class="footer"> 548 Generated by Epydoc 3.0.1 on Fri Jun 14 15:57:28 2019 549 </td> 550 <td align="right" class="footer"> 551 <a target="mainFrame" href="http://epydoc.sourceforge.net" 552 >http://epydoc.sourceforge.net</a> 553 </td> 554 </tr> 555</table> 556 557<script type="text/javascript"> 558 <!-- 559 // Private objects are initially displayed (because if 560 // javascript is turned off then we want them to be 561 // visible); but by default, we want to hide them. So hide 562 // them unless we have a cookie that says to show them. 563 checkCookie(); 564 // --> 565</script> 566</body> 567</html> 568