Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 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>apiclient.discovery</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 | |
| 18 | <!-- Tree link --> |
| 19 | <th> <a |
| 20 | href="module-tree.html">Trees</a> </th> |
| 21 | |
| 22 | <!-- Index link --> |
| 23 | <th> <a |
| 24 | href="identifier-index.html">Indices</a> </th> |
| 25 | |
| 26 | <!-- Help link --> |
| 27 | <th> <a |
| 28 | href="help.html">Help</a> </th> |
| 29 | |
| 30 | <th class="navbar" width="100%"></th> |
| 31 | </tr> |
| 32 | </table> |
| 33 | <table width="100%" cellpadding="0" cellspacing="0"> |
| 34 | <tr valign="top"> |
| 35 | <td width="100%"> |
| 36 | <span class="breadcrumbs"> |
| 37 | <a href="apiclient-module.html">Package apiclient</a> :: |
| 38 | Module discovery |
| 39 | </span> |
| 40 | </td> |
| 41 | <td> |
| 42 | <table cellpadding="0" cellspacing="0"> |
| 43 | <!-- hide/show private --> |
| 44 | <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" |
| 45 | onclick="toggle_private();">hide private</a>]</span></td></tr> |
| 46 | <tr><td align="right"><span class="options" |
| 47 | >[<a href="frames.html" target="_top">frames</a |
| 48 | >] | <a href="apiclient.discovery-module.html" |
| 49 | target="_top">no frames</a>]</span></td></tr> |
| 50 | </table> |
| 51 | </td> |
| 52 | </tr> |
| 53 | </table> |
| 54 | <!-- ==================== MODULE DESCRIPTION ==================== --> |
| 55 | <h1 class="epydoc">Module discovery</h1><p class="nomargin-top"><span class="codelink"><a href="apiclient.discovery-pysrc.html">source code</a></span></p> |
| 56 | <pre class="literalblock"> |
| 57 | Client for discovery based APIs |
| 58 | |
| 59 | A client library for Google's discovery based APIs. |
| 60 | |
| 61 | </pre> |
| 62 | |
| 63 | <hr /> |
| 64 | <div class="fields"> <p><strong>Author:</strong> |
| 65 | jcgregorio@google.com (Joe Gregorio) |
| 66 | </p> |
| 67 | </div><!-- ==================== FUNCTIONS ==================== --> |
| 68 | <a name="section-Functions"></a> |
| 69 | <table class="summary" border="1" cellpadding="3" |
| 70 | cellspacing="0" width="100%" bgcolor="white"> |
| 71 | <tr bgcolor="#70b0f0" class="table-header"> |
| 72 | <td colspan="2" class="table-header"> |
| 73 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 74 | <tr valign="top"> |
| 75 | <td align="left"><span class="table-header">Functions</span></td> |
| 76 | <td align="right" valign="top" |
| 77 | ><span class="options">[<a href="#section-Functions" |
| 78 | class="privatelink" onclick="toggle_private();" |
| 79 | >hide private</a>]</span></td> |
| 80 | </tr> |
| 81 | </table> |
| 82 | </td> |
| 83 | </tr> |
| 84 | <tr class="private"> |
| 85 | <td width="15%" align="right" valign="top" class="summary"> |
| 86 | <span class="summary-type"> </span> |
| 87 | </td><td class="summary"> |
| 88 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 89 | <tr> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 90 | <td><span class="summary-sig"><a href="apiclient.discovery-module.html#fix_method_name" class="summary-sig-name" onclick="show_private();">fix_method_name</a>(<span class="summary-sig-arg">name</span>)</span><br /> |
| 91 | Fix method names to avoid reserved word conflicts.</td> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 92 | <td align="right" valign="top"> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 93 | <span class="codelink"><a href="apiclient.discovery-pysrc.html#fix_method_name">source code</a></span> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 94 | |
| 95 | </td> |
| 96 | </tr> |
| 97 | </table> |
| 98 | |
| 99 | </td> |
| 100 | </tr> |
| 101 | <tr class="private"> |
| 102 | <td width="15%" align="right" valign="top" class="summary"> |
| 103 | <span class="summary-type"> </span> |
| 104 | </td><td class="summary"> |
| 105 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 106 | <tr> |
| 107 | <td><span class="summary-sig"><a href="apiclient.discovery-module.html#_add_query_parameter" class="summary-sig-name" onclick="show_private();">_add_query_parameter</a>(<span class="summary-sig-arg">url</span>, |
| 108 | <span class="summary-sig-arg">name</span>, |
| 109 | <span class="summary-sig-arg">value</span>)</span><br /> |
| 110 | Adds a query parameter to a url.</td> |
| 111 | <td align="right" valign="top"> |
| 112 | <span class="codelink"><a href="apiclient.discovery-pysrc.html#_add_query_parameter">source code</a></span> |
| 113 | |
| 114 | </td> |
| 115 | </tr> |
| 116 | </table> |
| 117 | |
| 118 | </td> |
| 119 | </tr> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 120 | <tr> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 121 | <td width="15%" align="right" valign="top" class="summary"> |
| 122 | <span class="summary-type"> </span> |
| 123 | </td><td class="summary"> |
| 124 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 125 | <tr> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 126 | <td><span class="summary-sig"><a href="apiclient.discovery-module.html#key2param" class="summary-sig-name">key2param</a>(<span class="summary-sig-arg">key</span>)</span><br /> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 127 | Converts key names into parameter names.</td> |
| 128 | <td align="right" valign="top"> |
| 129 | <span class="codelink"><a href="apiclient.discovery-pysrc.html#key2param">source code</a></span> |
| 130 | |
| 131 | </td> |
| 132 | </tr> |
| 133 | </table> |
| 134 | |
| 135 | </td> |
| 136 | </tr> |
| 137 | <tr> |
| 138 | <td width="15%" align="right" valign="top" class="summary"> |
| 139 | <span class="summary-type"> </span> |
| 140 | </td><td class="summary"> |
| 141 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 142 | <tr> |
Joe Gregorio | 1b425aa | 2012-08-24 12:04:34 -0400 | [diff] [blame^] | 143 | <td><span class="summary-sig"><a href="apiclient.discovery-module.html#build" class="summary-sig-name">build</a>(<span class="summary-sig-arg">*args</span>, |
| 144 | <span class="summary-sig-arg">**kwargs</span>)</span><br /> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 145 | Construct a Resource for interacting with an API.</td> |
| 146 | <td align="right" valign="top"> |
Joe Gregorio | 1b425aa | 2012-08-24 12:04:34 -0400 | [diff] [blame^] | 147 | <span class="codelink"><a href="oauth2client.util-pysrc.html">source code</a></span> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 148 | |
| 149 | </td> |
| 150 | </tr> |
| 151 | </table> |
| 152 | |
| 153 | </td> |
| 154 | </tr> |
| 155 | <tr class="private"> |
| 156 | <td width="15%" align="right" valign="top" class="summary"> |
| 157 | <span class="summary-type"> </span> |
| 158 | </td><td class="summary"> |
| 159 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 160 | <tr> |
| 161 | <td><span class="summary-sig"><a href="apiclient.discovery-module.html#_cast" class="summary-sig-name" onclick="show_private();">_cast</a>(<span class="summary-sig-arg">value</span>, |
| 162 | <span class="summary-sig-arg">schema_type</span>)</span><br /> |
| 163 | Convert value to a string based on JSON Schema type.</td> |
| 164 | <td align="right" valign="top"> |
| 165 | <span class="codelink"><a href="apiclient.discovery-pysrc.html#_cast">source code</a></span> |
| 166 | |
| 167 | </td> |
| 168 | </tr> |
| 169 | </table> |
| 170 | |
| 171 | </td> |
| 172 | </tr> |
| 173 | <tr class="private"> |
| 174 | <td width="15%" align="right" valign="top" class="summary"> |
| 175 | <span class="summary-type"> </span> |
| 176 | </td><td class="summary"> |
| 177 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 178 | <tr> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 179 | <td><span class="summary-sig"><a href="apiclient.discovery-module.html#_media_size_to_long" class="summary-sig-name" onclick="show_private();">_media_size_to_long</a>(<span class="summary-sig-arg">maxSize</span>)</span><br /> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 180 | Convert a string media size, such as 10GB or 3TB into an integer.</td> |
| 181 | <td align="right" valign="top"> |
| 182 | <span class="codelink"><a href="apiclient.discovery-pysrc.html#_media_size_to_long">source code</a></span> |
| 183 | |
| 184 | </td> |
| 185 | </tr> |
| 186 | </table> |
| 187 | |
| 188 | </td> |
| 189 | </tr> |
| 190 | <tr class="private"> |
| 191 | <td width="15%" align="right" valign="top" class="summary"> |
| 192 | <span class="summary-type"> </span> |
| 193 | </td><td class="summary"> |
| 194 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 195 | <tr> |
Joe Gregorio | ebd0b84 | 2012-06-15 14:14:17 -0400 | [diff] [blame] | 196 | <td><span class="summary-sig"><a href="apiclient.discovery-module.html#_createResource" class="summary-sig-name" onclick="show_private();">_createResource</a>(<span class="summary-sig-arg">http</span>, |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 197 | <span class="summary-sig-arg">baseUrl</span>, |
| 198 | <span class="summary-sig-arg">model</span>, |
| 199 | <span class="summary-sig-arg">requestBuilder</span>, |
| 200 | <span class="summary-sig-arg">developerKey</span>, |
| 201 | <span class="summary-sig-arg">resourceDesc</span>, |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 202 | <span class="summary-sig-arg">rootDesc</span>, |
| 203 | <span class="summary-sig-arg">schema</span>)</span><br /> |
| 204 | Build a Resource from the API description.</td> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 205 | <td align="right" valign="top"> |
Joe Gregorio | ebd0b84 | 2012-06-15 14:14:17 -0400 | [diff] [blame] | 206 | <span class="codelink"><a href="apiclient.discovery-pysrc.html#_createResource">source code</a></span> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 207 | |
| 208 | </td> |
| 209 | </tr> |
| 210 | </table> |
| 211 | |
| 212 | </td> |
| 213 | </tr> |
| 214 | </table> |
| 215 | <!-- ==================== VARIABLES ==================== --> |
| 216 | <a name="section-Variables"></a> |
| 217 | <table class="summary" border="1" cellpadding="3" |
| 218 | cellspacing="0" width="100%" bgcolor="white"> |
| 219 | <tr bgcolor="#70b0f0" class="table-header"> |
| 220 | <td colspan="2" class="table-header"> |
| 221 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 222 | <tr valign="top"> |
| 223 | <td align="left"><span class="table-header">Variables</span></td> |
| 224 | <td align="right" valign="top" |
| 225 | ><span class="options">[<a href="#section-Variables" |
| 226 | class="privatelink" onclick="toggle_private();" |
| 227 | >hide private</a>]</span></td> |
| 228 | </tr> |
| 229 | </table> |
| 230 | </td> |
| 231 | </tr> |
| 232 | <tr class="private"> |
| 233 | <td width="15%" align="right" valign="top" class="summary"> |
| 234 | <span class="summary-type"> </span> |
| 235 | </td><td class="summary"> |
| 236 | <a name="logger"></a><span class="summary-name">logger</span> = <code title="logging.getLogger(__name__)">logging.getLogger(__name__)</code> |
| 237 | </td> |
| 238 | </tr> |
| 239 | <tr class="private"> |
| 240 | <td width="15%" align="right" valign="top" class="summary"> |
| 241 | <span class="summary-type"> </span> |
| 242 | </td><td class="summary"> |
| 243 | <a name="URITEMPLATE"></a><span class="summary-name">URITEMPLATE</span> = <code title="re.compile(r'\{[^\}]*\}')">re.compile(r'\{<code class="re-group">[^</code>\}<code class="re-group">]</code><code class="re-op">*</code>\}')</code> |
| 244 | </td> |
| 245 | </tr> |
| 246 | <tr class="private"> |
| 247 | <td width="15%" align="right" valign="top" class="summary"> |
| 248 | <span class="summary-type"> </span> |
| 249 | </td><td class="summary"> |
| 250 | <a name="VARNAME"></a><span class="summary-name">VARNAME</span> = <code title="re.compile(r'[a-zA-Z0-9_-]+')">re.compile(r'<code class="re-group">[</code>a<code class="re-op">-</code>zA<code class="re-op">-</code>Z0<code class="re-op">-</code>9_-<code class="re-group">]</code><code class="re-op">+</code>')</code> |
| 251 | </td> |
| 252 | </tr> |
| 253 | <tr class="private"> |
| 254 | <td width="15%" align="right" valign="top" class="summary"> |
| 255 | <span class="summary-type"> </span> |
| 256 | </td><td class="summary"> |
| 257 | <a href="apiclient.discovery-module.html#DISCOVERY_URI" class="summary-name" onclick="show_private();">DISCOVERY_URI</a> = <code title="'https://www.googleapis.com/discovery/v1/apis/{api}/{apiVersion}/rest'"><code class="variable-quote">'</code><code class="variable-string">https://www.googleapis.com/discovery/v1/apis/</code><code class="variable-ellipsis">...</code></code> |
| 258 | </td> |
| 259 | </tr> |
| 260 | <tr class="private"> |
| 261 | <td width="15%" align="right" valign="top" class="summary"> |
| 262 | <span class="summary-type"> </span> |
| 263 | </td><td class="summary"> |
| 264 | <a name="DEFAULT_METHOD_DOC"></a><span class="summary-name">DEFAULT_METHOD_DOC</span> = <code title="'A description of how to use this function'"><code class="variable-quote">'</code><code class="variable-string">A description of how to use this function</code><code class="variable-quote">'</code></code> |
| 265 | </td> |
| 266 | </tr> |
| 267 | <tr class="private"> |
| 268 | <td width="15%" align="right" valign="top" class="summary"> |
| 269 | <span class="summary-type"> </span> |
| 270 | </td><td class="summary"> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 271 | <a name="STACK_QUERY_PARAMETERS"></a><span class="summary-name">STACK_QUERY_PARAMETERS</span> = <code title="['trace', 'pp', 'userip', 'strict']"><code class="variable-group">[</code><code class="variable-quote">'</code><code class="variable-string">trace</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">pp</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">userip</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">strict</code><code class="variable-quote">'</code><code class="variable-group">]</code></code> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 272 | </td> |
| 273 | </tr> |
| 274 | <tr class="private"> |
| 275 | <td width="15%" align="right" valign="top" class="summary"> |
| 276 | <span class="summary-type"> </span> |
| 277 | </td><td class="summary"> |
| 278 | <a href="apiclient.discovery-module.html#RESERVED_WORDS" class="summary-name" onclick="show_private();">RESERVED_WORDS</a> = <code title="['and', |
| 279 | 'assert', |
| 280 | 'break', |
| 281 | 'class', |
| 282 | 'continue', |
| 283 | 'def', |
| 284 | 'del', |
| 285 | 'elif', |
| 286 | ..."><code class="variable-group">[</code><code class="variable-quote">'</code><code class="variable-string">and</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">assert</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">break</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">class</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">continue</code><code class="variable-ellipsis">...</code></code> |
| 287 | </td> |
| 288 | </tr> |
| 289 | <tr class="private"> |
| 290 | <td width="15%" align="right" valign="top" class="summary"> |
| 291 | <span class="summary-type"> </span> |
| 292 | </td><td class="summary"> |
| 293 | <a href="apiclient.discovery-module.html#MULTIPLIERS" class="summary-name" onclick="show_private();">MULTIPLIERS</a> = <code title="{'GB': 1073741824, 'KB': 1024, 'MB': 1048576, 'TB': 1099511627776}"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">GB</code><code class="variable-quote">'</code><code class="variable-op">: </code>1073741824<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">KB</code><code class="variable-quote">'</code><code class="variable-op">: </code>1024<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">MB</code><code class="variable-quote">'</code><code class="variable-op">: </code>1048576<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">T</code><code class="variable-ellipsis">...</code></code> |
| 294 | </td> |
| 295 | </tr> |
| 296 | <tr class="private"> |
| 297 | <td width="15%" align="right" valign="top" class="summary"> |
| 298 | <span class="summary-type"> </span> |
| 299 | </td><td class="summary"> |
| 300 | <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'apiclient'"><code class="variable-quote">'</code><code class="variable-string">apiclient</code><code class="variable-quote">'</code></code> |
| 301 | </td> |
| 302 | </tr> |
| 303 | </table> |
| 304 | <!-- ==================== FUNCTION DETAILS ==================== --> |
| 305 | <a name="section-FunctionDetails"></a> |
| 306 | <table class="details" border="1" cellpadding="3" |
| 307 | cellspacing="0" width="100%" bgcolor="white"> |
| 308 | <tr bgcolor="#70b0f0" class="table-header"> |
| 309 | <td colspan="2" class="table-header"> |
| 310 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 311 | <tr valign="top"> |
| 312 | <td align="left"><span class="table-header">Function Details</span></td> |
| 313 | <td align="right" valign="top" |
| 314 | ><span class="options">[<a href="#section-FunctionDetails" |
| 315 | class="privatelink" onclick="toggle_private();" |
| 316 | >hide private</a>]</span></td> |
| 317 | </tr> |
| 318 | </table> |
| 319 | </td> |
| 320 | </tr> |
| 321 | </table> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 322 | <a name="fix_method_name"></a> |
| 323 | <div class="private"> |
| 324 | <table class="details" border="1" cellpadding="3" |
| 325 | cellspacing="0" width="100%" bgcolor="white"> |
| 326 | <tr><td> |
| 327 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 328 | <tr valign="top"><td> |
| 329 | <h3 class="epydoc"><span class="sig"><span class="sig-name">fix_method_name</span>(<span class="sig-arg">name</span>)</span> |
| 330 | </h3> |
| 331 | </td><td align="right" valign="top" |
| 332 | ><span class="codelink"><a href="apiclient.discovery-pysrc.html#fix_method_name">source code</a></span> |
| 333 | </td> |
| 334 | </tr></table> |
| 335 | |
| 336 | <pre class="literalblock"> |
| 337 | Fix method names to avoid reserved word conflicts. |
| 338 | |
| 339 | Args: |
| 340 | name: string, method name. |
| 341 | |
| 342 | Returns: |
| 343 | The name with a '_' prefixed if the name is a reserved word. |
| 344 | |
| 345 | </pre> |
| 346 | <dl class="fields"> |
| 347 | </dl> |
| 348 | </td></tr></table> |
| 349 | </div> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 350 | <a name="_add_query_parameter"></a> |
| 351 | <div class="private"> |
| 352 | <table class="details" border="1" cellpadding="3" |
| 353 | cellspacing="0" width="100%" bgcolor="white"> |
| 354 | <tr><td> |
| 355 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 356 | <tr valign="top"><td> |
| 357 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_add_query_parameter</span>(<span class="sig-arg">url</span>, |
| 358 | <span class="sig-arg">name</span>, |
| 359 | <span class="sig-arg">value</span>)</span> |
| 360 | </h3> |
| 361 | </td><td align="right" valign="top" |
| 362 | ><span class="codelink"><a href="apiclient.discovery-pysrc.html#_add_query_parameter">source code</a></span> |
| 363 | </td> |
| 364 | </tr></table> |
| 365 | |
| 366 | <pre class="literalblock"> |
| 367 | Adds a query parameter to a url. |
| 368 | |
| 369 | Replaces the current value if it already exists in the URL. |
| 370 | |
| 371 | Args: |
| 372 | url: string, url to add the query parameter to. |
| 373 | name: string, query parameter name. |
| 374 | value: string, query parameter value. |
| 375 | |
| 376 | Returns: |
| 377 | Updated query parameter. Does not update the url if value is None. |
| 378 | |
| 379 | </pre> |
| 380 | <dl class="fields"> |
| 381 | </dl> |
| 382 | </td></tr></table> |
| 383 | </div> |
| 384 | <a name="key2param"></a> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 385 | <div> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 386 | <table class="details" border="1" cellpadding="3" |
| 387 | cellspacing="0" width="100%" bgcolor="white"> |
| 388 | <tr><td> |
| 389 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 390 | <tr valign="top"><td> |
| 391 | <h3 class="epydoc"><span class="sig"><span class="sig-name">key2param</span>(<span class="sig-arg">key</span>)</span> |
| 392 | </h3> |
| 393 | </td><td align="right" valign="top" |
| 394 | ><span class="codelink"><a href="apiclient.discovery-pysrc.html#key2param">source code</a></span> |
| 395 | </td> |
| 396 | </tr></table> |
| 397 | |
| 398 | <pre class="literalblock"> |
| 399 | Converts key names into parameter names. |
| 400 | |
| 401 | For example, converting "max-results" -> "max_results" |
| 402 | |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 403 | Args: |
| 404 | key: string, the method key name. |
| 405 | |
| 406 | Returns: |
| 407 | A safe method name based on the key name. |
| 408 | |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 409 | </pre> |
| 410 | <dl class="fields"> |
| 411 | </dl> |
| 412 | </td></tr></table> |
| 413 | </div> |
| 414 | <a name="build"></a> |
| 415 | <div> |
| 416 | <table class="details" border="1" cellpadding="3" |
| 417 | cellspacing="0" width="100%" bgcolor="white"> |
| 418 | <tr><td> |
| 419 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 420 | <tr valign="top"><td> |
Joe Gregorio | 1b425aa | 2012-08-24 12:04:34 -0400 | [diff] [blame^] | 421 | <h3 class="epydoc"><span class="sig"><span class="sig-name">build</span>(<span class="sig-arg">*args</span>, |
| 422 | <span class="sig-arg">**kwargs</span>)</span> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 423 | </h3> |
| 424 | </td><td align="right" valign="top" |
Joe Gregorio | 1b425aa | 2012-08-24 12:04:34 -0400 | [diff] [blame^] | 425 | ><span class="codelink"><a href="oauth2client.util-pysrc.html">source code</a></span> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 426 | </td> |
| 427 | </tr></table> |
| 428 | |
| 429 | <pre class="literalblock"> |
| 430 | Construct a Resource for interacting with an API. |
| 431 | |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 432 | Construct a Resource object for interacting with an API. The serviceName and |
| 433 | version are the names from the Discovery service. |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 434 | |
| 435 | Args: |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 436 | serviceName: string, name of the service. |
| 437 | version: string, the version of the service. |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 438 | http: httplib2.Http, An instance of httplib2.Http or something that acts |
| 439 | like it that HTTP requests will be made through. |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 440 | discoveryServiceUrl: string, a URI Template that points to the location of |
| 441 | the discovery service. It should have two parameters {api} and |
| 442 | {apiVersion} that when filled in produce an absolute URI to the discovery |
| 443 | document for that service. |
| 444 | developerKey: string, key obtained from |
| 445 | https://code.google.com/apis/console. |
| 446 | model: apiclient.Model, converts to and from the wire format. |
| 447 | requestBuilder: apiclient.http.HttpRequest, encapsulator for an HTTP |
| 448 | request. |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 449 | |
| 450 | Returns: |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 451 | A Resource object with methods for interacting with the service. |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 452 | |
| 453 | </pre> |
| 454 | <dl class="fields"> |
Joe Gregorio | 1b425aa | 2012-08-24 12:04:34 -0400 | [diff] [blame^] | 455 | <dt>Decorators:</dt> |
| 456 | <dd><ul class="nomargin-top"> |
| 457 | <li><code>@util.positional(2)</code></li> |
| 458 | </ul></dd> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 459 | </dl> |
| 460 | </td></tr></table> |
| 461 | </div> |
| 462 | <a name="_cast"></a> |
| 463 | <div class="private"> |
| 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">_cast</span>(<span class="sig-arg">value</span>, |
| 470 | <span class="sig-arg">schema_type</span>)</span> |
| 471 | </h3> |
| 472 | </td><td align="right" valign="top" |
| 473 | ><span class="codelink"><a href="apiclient.discovery-pysrc.html#_cast">source code</a></span> |
| 474 | </td> |
| 475 | </tr></table> |
| 476 | |
| 477 | <pre class="literalblock"> |
| 478 | Convert value to a string based on JSON Schema type. |
| 479 | |
| 480 | See http://tools.ietf.org/html/draft-zyp-json-schema-03 for more details on |
| 481 | JSON Schema. |
| 482 | |
| 483 | Args: |
| 484 | value: any, the value to convert |
| 485 | schema_type: string, the type that value should be interpreted as |
| 486 | |
| 487 | Returns: |
| 488 | A string representation of 'value' based on the schema_type. |
| 489 | |
| 490 | </pre> |
| 491 | <dl class="fields"> |
| 492 | </dl> |
| 493 | </td></tr></table> |
| 494 | </div> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 495 | <a name="_media_size_to_long"></a> |
| 496 | <div class="private"> |
| 497 | <table class="details" border="1" cellpadding="3" |
| 498 | cellspacing="0" width="100%" bgcolor="white"> |
| 499 | <tr><td> |
| 500 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 501 | <tr valign="top"><td> |
| 502 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_media_size_to_long</span>(<span class="sig-arg">maxSize</span>)</span> |
| 503 | </h3> |
| 504 | </td><td align="right" valign="top" |
| 505 | ><span class="codelink"><a href="apiclient.discovery-pysrc.html#_media_size_to_long">source code</a></span> |
| 506 | </td> |
| 507 | </tr></table> |
| 508 | |
| 509 | <pre class="literalblock"> |
| 510 | Convert a string media size, such as 10GB or 3TB into an integer. |
| 511 | |
| 512 | Args: |
| 513 | maxSize: string, size as a string, such as 2MB or 7GB. |
| 514 | |
| 515 | Returns: |
| 516 | The size as an integer value. |
| 517 | |
| 518 | </pre> |
| 519 | <dl class="fields"> |
| 520 | </dl> |
| 521 | </td></tr></table> |
| 522 | </div> |
Joe Gregorio | ebd0b84 | 2012-06-15 14:14:17 -0400 | [diff] [blame] | 523 | <a name="_createResource"></a> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 524 | <div class="private"> |
| 525 | <table class="details" border="1" cellpadding="3" |
| 526 | cellspacing="0" width="100%" bgcolor="white"> |
| 527 | <tr><td> |
| 528 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 529 | <tr valign="top"><td> |
Joe Gregorio | ebd0b84 | 2012-06-15 14:14:17 -0400 | [diff] [blame] | 530 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_createResource</span>(<span class="sig-arg">http</span>, |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 531 | <span class="sig-arg">baseUrl</span>, |
| 532 | <span class="sig-arg">model</span>, |
| 533 | <span class="sig-arg">requestBuilder</span>, |
| 534 | <span class="sig-arg">developerKey</span>, |
| 535 | <span class="sig-arg">resourceDesc</span>, |
| 536 | <span class="sig-arg">rootDesc</span>, |
| 537 | <span class="sig-arg">schema</span>)</span> |
| 538 | </h3> |
| 539 | </td><td align="right" valign="top" |
Joe Gregorio | ebd0b84 | 2012-06-15 14:14:17 -0400 | [diff] [blame] | 540 | ><span class="codelink"><a href="apiclient.discovery-pysrc.html#_createResource">source code</a></span> |
Joe Gregorio | 6621203 | 2012-06-14 09:10:14 -0400 | [diff] [blame] | 541 | </td> |
| 542 | </tr></table> |
| 543 | |
| 544 | <pre class="literalblock"> |
| 545 | Build a Resource from the API description. |
| 546 | |
| 547 | Args: |
| 548 | http: httplib2.Http, Object to make http requests with. |
| 549 | baseUrl: string, base URL for the API. All requests are relative to this |
| 550 | URI. |
| 551 | model: apiclient.Model, converts to and from the wire format. |
| 552 | requestBuilder: class or callable that instantiates an |
| 553 | apiclient.HttpRequest object. |
| 554 | developerKey: string, key obtained from |
| 555 | https://code.google.com/apis/console |
| 556 | resourceDesc: object, section of deserialized discovery document that |
| 557 | describes a resource. Note that the top level discovery document |
| 558 | is considered a resource. |
| 559 | rootDesc: object, the entire deserialized discovery document. |
| 560 | schema: object, mapping of schema names to schema descriptions. |
| 561 | |
| 562 | Returns: |
| 563 | An instance of Resource with all the methods attached for interacting with |
| 564 | that resource. |
| 565 | |
| 566 | </pre> |
| 567 | <dl class="fields"> |
| 568 | </dl> |
| 569 | </td></tr></table> |
| 570 | </div> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 571 | <br /> |
| 572 | <!-- ==================== VARIABLES DETAILS ==================== --> |
| 573 | <a name="section-VariablesDetails"></a> |
| 574 | <table class="details" border="1" cellpadding="3" |
| 575 | cellspacing="0" width="100%" bgcolor="white"> |
| 576 | <tr bgcolor="#70b0f0" class="table-header"> |
| 577 | <td colspan="2" class="table-header"> |
| 578 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 579 | <tr valign="top"> |
| 580 | <td align="left"><span class="table-header">Variables Details</span></td> |
| 581 | <td align="right" valign="top" |
| 582 | ><span class="options">[<a href="#section-VariablesDetails" |
| 583 | class="privatelink" onclick="toggle_private();" |
| 584 | >hide private</a>]</span></td> |
| 585 | </tr> |
| 586 | </table> |
| 587 | </td> |
| 588 | </tr> |
| 589 | </table> |
| 590 | <a name="DISCOVERY_URI"></a> |
| 591 | <div class="private"> |
| 592 | <table class="details" border="1" cellpadding="3" |
| 593 | cellspacing="0" width="100%" bgcolor="white"> |
| 594 | <tr><td> |
| 595 | <h3 class="epydoc">DISCOVERY_URI</h3> |
| 596 | |
| 597 | <dl class="fields"> |
| 598 | </dl> |
| 599 | <dl class="fields"> |
| 600 | <dt>Value:</dt> |
| 601 | <dd><table><tr><td><pre class="variable"> |
| 602 | <code class="variable-quote">'</code><code class="variable-string">https://www.googleapis.com/discovery/v1/apis/{api}/{apiVersion}/rest</code><code class="variable-quote">'</code> |
| 603 | </pre></td></tr></table> |
| 604 | </dd> |
| 605 | </dl> |
| 606 | </td></tr></table> |
| 607 | </div> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 608 | <a name="RESERVED_WORDS"></a> |
| 609 | <div class="private"> |
| 610 | <table class="details" border="1" cellpadding="3" |
| 611 | cellspacing="0" width="100%" bgcolor="white"> |
| 612 | <tr><td> |
| 613 | <h3 class="epydoc">RESERVED_WORDS</h3> |
| 614 | |
| 615 | <dl class="fields"> |
| 616 | </dl> |
| 617 | <dl class="fields"> |
| 618 | <dt>Value:</dt> |
| 619 | <dd><table><tr><td><pre class="variable"> |
| 620 | <code class="variable-group">[</code><code class="variable-quote">'</code><code class="variable-string">and</code><code class="variable-quote">'</code><code class="variable-op">,</code> |
| 621 | <code class="variable-quote">'</code><code class="variable-string">assert</code><code class="variable-quote">'</code><code class="variable-op">,</code> |
| 622 | <code class="variable-quote">'</code><code class="variable-string">break</code><code class="variable-quote">'</code><code class="variable-op">,</code> |
| 623 | <code class="variable-quote">'</code><code class="variable-string">class</code><code class="variable-quote">'</code><code class="variable-op">,</code> |
| 624 | <code class="variable-quote">'</code><code class="variable-string">continue</code><code class="variable-quote">'</code><code class="variable-op">,</code> |
| 625 | <code class="variable-quote">'</code><code class="variable-string">def</code><code class="variable-quote">'</code><code class="variable-op">,</code> |
| 626 | <code class="variable-quote">'</code><code class="variable-string">del</code><code class="variable-quote">'</code><code class="variable-op">,</code> |
| 627 | <code class="variable-quote">'</code><code class="variable-string">elif</code><code class="variable-quote">'</code><code class="variable-op">,</code> |
| 628 | <code class="variable-ellipsis">...</code> |
| 629 | </pre></td></tr></table> |
| 630 | </dd> |
| 631 | </dl> |
| 632 | </td></tr></table> |
| 633 | </div> |
| 634 | <a name="MULTIPLIERS"></a> |
| 635 | <div class="private"> |
| 636 | <table class="details" border="1" cellpadding="3" |
| 637 | cellspacing="0" width="100%" bgcolor="white"> |
| 638 | <tr><td> |
| 639 | <h3 class="epydoc">MULTIPLIERS</h3> |
| 640 | |
| 641 | <dl class="fields"> |
| 642 | </dl> |
| 643 | <dl class="fields"> |
| 644 | <dt>Value:</dt> |
| 645 | <dd><table><tr><td><pre class="variable"> |
| 646 | <code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">GB</code><code class="variable-quote">'</code><code class="variable-op">: </code>1073741824<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">KB</code><code class="variable-quote">'</code><code class="variable-op">: </code>1024<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">MB</code><code class="variable-quote">'</code><code class="variable-op">: </code>1048576<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">TB</code><code class="variable-quote">'</code><code class="variable-op">: </code>1099511627776<code class="variable-group">}</code> |
| 647 | </pre></td></tr></table> |
| 648 | </dd> |
| 649 | </dl> |
| 650 | </td></tr></table> |
| 651 | </div> |
| 652 | <br /> |
| 653 | <!-- ==================== NAVIGATION BAR ==================== --> |
| 654 | <table class="navbar" border="0" width="100%" cellpadding="0" |
| 655 | bgcolor="#a0c0ff" cellspacing="0"> |
| 656 | <tr valign="middle"> |
| 657 | |
| 658 | <!-- Tree link --> |
| 659 | <th> <a |
| 660 | href="module-tree.html">Trees</a> </th> |
| 661 | |
| 662 | <!-- Index link --> |
| 663 | <th> <a |
| 664 | href="identifier-index.html">Indices</a> </th> |
| 665 | |
| 666 | <!-- Help link --> |
| 667 | <th> <a |
| 668 | href="help.html">Help</a> </th> |
| 669 | |
| 670 | <th class="navbar" width="100%"></th> |
| 671 | </tr> |
| 672 | </table> |
| 673 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
| 674 | <tr> |
| 675 | <td align="left" class="footer"> |
Joe Gregorio | 1b425aa | 2012-08-24 12:04:34 -0400 | [diff] [blame^] | 676 | Generated by Epydoc 3.0.1 on Fri Aug 24 11:02:00 2012 |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 677 | </td> |
| 678 | <td align="right" class="footer"> |
| 679 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
| 680 | >http://epydoc.sourceforge.net</a> |
| 681 | </td> |
| 682 | </tr> |
| 683 | </table> |
| 684 | |
| 685 | <script type="text/javascript"> |
| 686 | <!-- |
| 687 | // Private objects are initially displayed (because if |
| 688 | // javascript is turned off then we want them to be |
| 689 | // visible); but by default, we want to hide them. So hide |
| 690 | // them unless we have a cookie that says to show them. |
| 691 | checkCookie(); |
| 692 | // --> |
| 693 | </script> |
| 694 | </body> |
| 695 | </html> |