Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: module apiclient.oauth</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| 7 | <tr bgcolor="#7799ee"> |
| 8 | <td valign=bottom> <br> |
| 9 | <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.oauth</strong></big></big></font></td |
| 10 | ><td align=right valign=bottom |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 11 | ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/jcgregorio/projects/apiclient/apiclient/oauth.py">/usr/local/google/home/jcgregorio/projects/apiclient/apiclient/oauth.py</a></font></td></tr></table> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 12 | <p><tt>Utilities for OAuth.<br> |
| 13 | <br> |
| 14 | Utilities for making it easier to work with OAuth.</tt></p> |
| 15 | <p> |
| 16 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 17 | <tr bgcolor="#aa55cc"> |
| 18 | <td colspan=3 valign=bottom> <br> |
| 19 | <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
| 20 | |
| 21 | <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| 22 | <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="copy.html">copy</a><br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 23 | <a href="httplib2.html">httplib2</a><br> |
| 24 | </td><td width="25%" valign=top><a href="logging.html">logging</a><br> |
| 25 | <a href="oauth2.html">oauth2</a><br> |
| 26 | </td><td width="25%" valign=top><a href="simplejson.html">simplejson</a><br> |
| 27 | <a href="urllib.html">urllib</a><br> |
| 28 | </td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 29 | </td></tr></table></td></tr></table><p> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 30 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 31 | <tr bgcolor="#ee77aa"> |
| 32 | <td colspan=3 valign=bottom> <br> |
| 33 | <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| 34 | |
| 35 | <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| 36 | <td width="100%"><dl> |
| 37 | <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> |
| 38 | </font></dt><dd> |
| 39 | <dl> |
| 40 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#Credentials">Credentials</a> |
| 41 | </font></dt><dd> |
| 42 | <dl> |
| 43 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#OAuthCredentials">OAuthCredentials</a> |
| 44 | </font></dt></dl> |
| 45 | </dd> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 46 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#Flow">Flow</a> |
| 47 | </font></dt><dd> |
| 48 | <dl> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 49 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#FlowThreeLegged">FlowThreeLegged</a> |
| 50 | </font></dt></dl> |
| 51 | </dd> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 52 | </dl> |
| 53 | </dd> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 54 | <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) |
| 55 | </font></dt><dd> |
| 56 | <dl> |
| 57 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#Error">Error</a> |
| 58 | </font></dt><dd> |
| 59 | <dl> |
| 60 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#MissingParameter">MissingParameter</a> |
| 61 | </font></dt><dt><font face="helvetica, arial"><a href="apiclient.oauth.html#RequestError">RequestError</a> |
| 62 | </font></dt></dl> |
| 63 | </dd> |
| 64 | </dl> |
| 65 | </dd> |
| 66 | </dl> |
| 67 | <p> |
| 68 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 69 | <tr bgcolor="#ffc8d8"> |
| 70 | <td colspan=3 valign=bottom> <br> |
| 71 | <font color="#000000" face="helvetica, arial"><a name="Credentials">class <strong>Credentials</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 72 | |
| 73 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 74 | <td colspan=2><tt>Base class for all <a href="#Credentials">Credentials</a> objects.<br> |
| 75 | <br> |
| 76 | Subclasses must define an <a href="#Credentials-authorize">authorize</a>() method<br> |
| 77 | that applies the credentials to an HTTP transport.<br> </tt></td></tr> |
| 78 | <tr><td> </td> |
| 79 | <td width="100%">Methods defined here:<br> |
| 80 | <dl><dt><a name="Credentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Take an httplib2.Http instance (or equivalent) and<br> |
| 81 | authorizes it for the set of credentials, usually by<br> |
| 82 | replacing http.request() with a method that adds in<br> |
| 83 | the appropriate headers and then delegates to the original<br> |
| 84 | Http.request() method.</tt></dd></dl> |
| 85 | |
| 86 | <hr> |
| 87 | Data descriptors defined here:<br> |
| 88 | <dl><dt><strong>__dict__</strong></dt> |
| 89 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 90 | </dl> |
| 91 | <dl><dt><strong>__weakref__</strong></dt> |
| 92 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 93 | </dl> |
| 94 | </td></tr></table> <p> |
| 95 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 96 | <tr bgcolor="#ffc8d8"> |
| 97 | <td colspan=3 valign=bottom> <br> |
| 98 | <font color="#000000" face="helvetica, arial"><a name="Error">class <strong>Error</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr> |
| 99 | |
| 100 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 101 | <td colspan=2><tt>Base error for this module.<br> </tt></td></tr> |
| 102 | <tr><td> </td> |
| 103 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 104 | <dd><a href="apiclient.oauth.html#Error">Error</a></dd> |
| 105 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 106 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 107 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 108 | </dl> |
| 109 | <hr> |
| 110 | Data descriptors defined here:<br> |
| 111 | <dl><dt><strong>__weakref__</strong></dt> |
| 112 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 113 | </dl> |
| 114 | <hr> |
| 115 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 116 | <dl><dt><a name="Error-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
| 117 | |
| 118 | <hr> |
| 119 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 120 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#Error-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 121 | |
| 122 | <hr> |
| 123 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 124 | <dl><dt><a name="Error-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 125 | |
| 126 | <dl><dt><a name="Error-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 127 | |
| 128 | <dl><dt><a name="Error-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 129 | |
| 130 | <dl><dt><a name="Error-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 131 | <br> |
| 132 | Use of negative indices is not supported.</tt></dd></dl> |
| 133 | |
| 134 | <dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 135 | |
| 136 | <dl><dt><a name="Error-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 137 | |
| 138 | <dl><dt><a name="Error-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 139 | |
| 140 | <dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 141 | |
| 142 | <dl><dt><a name="Error-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 143 | |
| 144 | <dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 145 | |
| 146 | <hr> |
| 147 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 148 | <dl><dt><strong>__dict__</strong></dt> |
| 149 | </dl> |
| 150 | <dl><dt><strong>args</strong></dt> |
| 151 | </dl> |
| 152 | <dl><dt><strong>message</strong></dt> |
| 153 | </dl> |
| 154 | </td></tr></table> <p> |
| 155 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 156 | <tr bgcolor="#ffc8d8"> |
| 157 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 158 | <font color="#000000" face="helvetica, arial"><a name="Flow">class <strong>Flow</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 159 | |
| 160 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 161 | <td colspan=2><tt>Base class for all <a href="#Flow">Flow</a> objects.<br> </tt></td></tr> |
| 162 | <tr><td> </td> |
| 163 | <td width="100%">Data descriptors defined here:<br> |
| 164 | <dl><dt><strong>__dict__</strong></dt> |
| 165 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 166 | </dl> |
| 167 | <dl><dt><strong>__weakref__</strong></dt> |
| 168 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 169 | </dl> |
| 170 | </td></tr></table> <p> |
| 171 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 172 | <tr bgcolor="#ffc8d8"> |
| 173 | <td colspan=3 valign=bottom> <br> |
| 174 | <font color="#000000" face="helvetica, arial"><a name="FlowThreeLegged">class <strong>FlowThreeLegged</strong></a>(<a href="apiclient.oauth.html#Flow">Flow</a>)</font></td></tr> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 175 | |
| 176 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 177 | <td colspan=2><tt>Does the Three Legged Dance for OAuth 1.0a.<br> </tt></td></tr> |
| 178 | <tr><td> </td> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 179 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 180 | <dd><a href="apiclient.oauth.html#FlowThreeLegged">FlowThreeLegged</a></dd> |
| 181 | <dd><a href="apiclient.oauth.html#Flow">Flow</a></dd> |
| 182 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 183 | </dl> |
| 184 | <hr> |
| 185 | Methods defined here:<br> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 186 | <dl><dt><a name="FlowThreeLegged-__init__"><strong>__init__</strong></a>(self, discovery, consumer_key, consumer_secret, user_agent, **kwargs)</dt><dd><tt>discovery - Section of the API discovery document that describes<br> |
| 187 | the OAuth endpoints.<br> |
| 188 | consumer_key - OAuth consumer key<br> |
| 189 | consumer_secret - OAuth consumer secret<br> |
| 190 | user_agent - The HTTP User-Agent that identifies the application.<br> |
| 191 | **kwargs - The keyword arguments are all optional and required<br> |
| 192 | parameters for the OAuth calls.</tt></dd></dl> |
| 193 | |
| 194 | <dl><dt><a name="FlowThreeLegged-step1_get_authorize_url"><strong>step1_get_authorize_url</strong></a>(self, oauth_callback<font color="#909090">='oob'</font>)</dt><dd><tt>Returns a URI to redirect to the provider.<br> |
| 195 | <br> |
| 196 | oauth_callback - Either the string 'oob' for a non-web-based application,<br> |
| 197 | or a URI that handles the callback from the authorization<br> |
| 198 | server.<br> |
| 199 | <br> |
| 200 | If oauth_callback is 'oob' then pass in the<br> |
| 201 | generated verification code to step2_exchange,<br> |
| 202 | otherwise pass in the query parameters received<br> |
| 203 | at the callback uri to step2_exchange.</tt></dd></dl> |
| 204 | |
| 205 | <dl><dt><a name="FlowThreeLegged-step2_exchange"><strong>step2_exchange</strong></a>(self, verifier)</dt><dd><tt>Exhanges an authorized request token<br> |
| 206 | for <a href="#OAuthCredentials">OAuthCredentials</a>.<br> |
| 207 | <br> |
| 208 | verifier - either the verifier token, or a dictionary<br> |
| 209 | of the query parameters to the callback, which contains<br> |
| 210 | the oauth_verifier.</tt></dd></dl> |
| 211 | |
| 212 | <hr> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 213 | Data descriptors inherited from <a href="apiclient.oauth.html#Flow">Flow</a>:<br> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 214 | <dl><dt><strong>__dict__</strong></dt> |
| 215 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 216 | </dl> |
| 217 | <dl><dt><strong>__weakref__</strong></dt> |
| 218 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 219 | </dl> |
| 220 | </td></tr></table> <p> |
| 221 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 222 | <tr bgcolor="#ffc8d8"> |
| 223 | <td colspan=3 valign=bottom> <br> |
| 224 | <font color="#000000" face="helvetica, arial"><a name="MissingParameter">class <strong>MissingParameter</strong></a>(<a href="apiclient.oauth.html#Error">Error</a>)</font></td></tr> |
| 225 | |
| 226 | <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> |
| 227 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 228 | <dd><a href="apiclient.oauth.html#MissingParameter">MissingParameter</a></dd> |
| 229 | <dd><a href="apiclient.oauth.html#Error">Error</a></dd> |
| 230 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 231 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 232 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 233 | </dl> |
| 234 | <hr> |
| 235 | Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br> |
| 236 | <dl><dt><strong>__weakref__</strong></dt> |
| 237 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 238 | </dl> |
| 239 | <hr> |
| 240 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 241 | <dl><dt><a name="MissingParameter-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
| 242 | |
| 243 | <hr> |
| 244 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 245 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#MissingParameter-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 246 | |
| 247 | <hr> |
| 248 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 249 | <dl><dt><a name="MissingParameter-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 250 | |
| 251 | <dl><dt><a name="MissingParameter-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 252 | |
| 253 | <dl><dt><a name="MissingParameter-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 254 | |
| 255 | <dl><dt><a name="MissingParameter-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 256 | <br> |
| 257 | Use of negative indices is not supported.</tt></dd></dl> |
| 258 | |
| 259 | <dl><dt><a name="MissingParameter-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 260 | |
| 261 | <dl><dt><a name="MissingParameter-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 262 | |
| 263 | <dl><dt><a name="MissingParameter-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 264 | |
| 265 | <dl><dt><a name="MissingParameter-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 266 | |
| 267 | <dl><dt><a name="MissingParameter-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 268 | |
| 269 | <dl><dt><a name="MissingParameter-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 270 | |
| 271 | <hr> |
| 272 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 273 | <dl><dt><strong>__dict__</strong></dt> |
| 274 | </dl> |
| 275 | <dl><dt><strong>args</strong></dt> |
| 276 | </dl> |
| 277 | <dl><dt><strong>message</strong></dt> |
| 278 | </dl> |
| 279 | </td></tr></table> <p> |
| 280 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 281 | <tr bgcolor="#ffc8d8"> |
| 282 | <td colspan=3 valign=bottom> <br> |
| 283 | <font color="#000000" face="helvetica, arial"><a name="OAuthCredentials">class <strong>OAuthCredentials</strong></a>(<a href="apiclient.oauth.html#Credentials">Credentials</a>)</font></td></tr> |
| 284 | |
| 285 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 286 | <td colspan=2><tt><a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> for OAuth 1.0a<br> </tt></td></tr> |
| 287 | <tr><td> </td> |
| 288 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 289 | <dd><a href="apiclient.oauth.html#OAuthCredentials">OAuthCredentials</a></dd> |
| 290 | <dd><a href="apiclient.oauth.html#Credentials">Credentials</a></dd> |
| 291 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 292 | </dl> |
| 293 | <hr> |
| 294 | Methods defined here:<br> |
| 295 | <dl><dt><a name="OAuthCredentials-__init__"><strong>__init__</strong></a>(self, consumer, token, user_agent)</dt><dd><tt>consumer - An instance of oauth.Consumer.<br> |
| 296 | token - An instance of oauth.Token constructed with<br> |
| 297 | the access token and secret.<br> |
| 298 | user_agent - The HTTP User-Agent to provide for this application.</tt></dd></dl> |
| 299 | |
| 300 | <dl><dt><a name="OAuthCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Args:<br> |
| 301 | http - An instance of httplib2.Http<br> |
| 302 | or something that acts like it.<br> |
| 303 | <br> |
| 304 | Returns:<br> |
| 305 | A modified instance of http that was passed in.<br> |
| 306 | <br> |
| 307 | Example:<br> |
| 308 | <br> |
| 309 | h = httplib2.Http()<br> |
| 310 | h = credentials.<a href="#OAuthCredentials-authorize">authorize</a>(h)<br> |
| 311 | <br> |
| 312 | You can't create a new OAuth<br> |
| 313 | subclass of httplib2.Authenication because<br> |
| 314 | it never gets passed the absolute URI, which is<br> |
| 315 | needed for signing. So instead we have to overload<br> |
| 316 | 'request' with a closure that adds in the<br> |
| 317 | Authorization header and then calls the original version<br> |
| 318 | of 'request()'.</tt></dd></dl> |
| 319 | |
| 320 | <hr> |
| 321 | Data descriptors inherited from <a href="apiclient.oauth.html#Credentials">Credentials</a>:<br> |
| 322 | <dl><dt><strong>__dict__</strong></dt> |
| 323 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 324 | </dl> |
| 325 | <dl><dt><strong>__weakref__</strong></dt> |
| 326 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 327 | </dl> |
| 328 | </td></tr></table> <p> |
| 329 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 330 | <tr bgcolor="#ffc8d8"> |
| 331 | <td colspan=3 valign=bottom> <br> |
| 332 | <font color="#000000" face="helvetica, arial"><a name="RequestError">class <strong>RequestError</strong></a>(<a href="apiclient.oauth.html#Error">Error</a>)</font></td></tr> |
| 333 | |
| 334 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 335 | <td colspan=2><tt><a href="#Error">Error</a> occurred during request.<br> </tt></td></tr> |
| 336 | <tr><td> </td> |
| 337 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 338 | <dd><a href="apiclient.oauth.html#RequestError">RequestError</a></dd> |
| 339 | <dd><a href="apiclient.oauth.html#Error">Error</a></dd> |
| 340 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 341 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 342 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 343 | </dl> |
| 344 | <hr> |
| 345 | Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br> |
| 346 | <dl><dt><strong>__weakref__</strong></dt> |
| 347 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 348 | </dl> |
| 349 | <hr> |
| 350 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 351 | <dl><dt><a name="RequestError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
| 352 | |
| 353 | <hr> |
| 354 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 355 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#RequestError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 356 | |
| 357 | <hr> |
| 358 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 359 | <dl><dt><a name="RequestError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 360 | |
| 361 | <dl><dt><a name="RequestError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 362 | |
| 363 | <dl><dt><a name="RequestError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 364 | |
| 365 | <dl><dt><a name="RequestError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 366 | <br> |
| 367 | Use of negative indices is not supported.</tt></dd></dl> |
| 368 | |
| 369 | <dl><dt><a name="RequestError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 370 | |
| 371 | <dl><dt><a name="RequestError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 372 | |
| 373 | <dl><dt><a name="RequestError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 374 | |
| 375 | <dl><dt><a name="RequestError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 376 | |
| 377 | <dl><dt><a name="RequestError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 378 | |
| 379 | <dl><dt><a name="RequestError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 380 | |
| 381 | <hr> |
| 382 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 383 | <dl><dt><strong>__dict__</strong></dt> |
| 384 | </dl> |
| 385 | <dl><dt><strong>args</strong></dt> |
| 386 | </dl> |
| 387 | <dl><dt><strong>message</strong></dt> |
| 388 | </dl> |
| 389 | </td></tr></table></td></tr></table><p> |
| 390 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 391 | <tr bgcolor="#55aa55"> |
| 392 | <td colspan=3 valign=bottom> <br> |
| 393 | <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
| 394 | |
| 395 | <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
| 396 | <td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p> |
| 397 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 398 | <tr bgcolor="#7799ee"> |
| 399 | <td colspan=3 valign=bottom> <br> |
| 400 | <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> |
| 401 | |
| 402 | <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> |
| 403 | <td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table> |
| 404 | </body></html> |