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 | 6121dd9 | 2012-04-13 07:50:04 -0400 | [diff] [blame^] | 11 | ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/apiclient/apiclient/oauth.py">/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> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 26 | </td><td width="25%" valign=top><a href="json.html">json</a><br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 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> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 37 | <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) |
| 38 | </font></dt><dd> |
| 39 | <dl> |
| 40 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#Error">Error</a> |
| 41 | </font></dt><dd> |
| 42 | <dl> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 43 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#CredentialsInvalidError">CredentialsInvalidError</a> |
| 44 | </font></dt><dt><font face="helvetica, arial"><a href="apiclient.oauth.html#MissingParameter">MissingParameter</a> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 45 | </font></dt><dt><font face="helvetica, arial"><a href="apiclient.oauth.html#RequestError">RequestError</a> |
| 46 | </font></dt></dl> |
| 47 | </dd> |
| 48 | </dl> |
| 49 | </dd> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 50 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>(<a href="__builtin__.html#object">__builtin__.object</a>) |
| 51 | </font></dt><dd> |
| 52 | <dl> |
| 53 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#OAuthCredentials">OAuthCredentials</a> |
| 54 | </font></dt><dt><font face="helvetica, arial"><a href="apiclient.oauth.html#TwoLeggedOAuthCredentials">TwoLeggedOAuthCredentials</a> |
| 55 | </font></dt></dl> |
| 56 | </dd> |
| 57 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Flow">oauth2client.client.Flow</a>(<a href="__builtin__.html#object">__builtin__.object</a>) |
| 58 | </font></dt><dd> |
| 59 | <dl> |
| 60 | <dt><font face="helvetica, arial"><a href="apiclient.oauth.html#FlowThreeLegged">FlowThreeLegged</a> |
| 61 | </font></dt></dl> |
| 62 | </dd> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 63 | </dl> |
| 64 | <p> |
| 65 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 66 | <tr bgcolor="#ffc8d8"> |
| 67 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 68 | <font color="#000000" face="helvetica, arial"><a name="CredentialsInvalidError">class <strong>CredentialsInvalidError</strong></a>(<a href="apiclient.oauth.html#Error">Error</a>)</font></td></tr> |
| 69 | |
| 70 | <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> |
| 71 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 72 | <dd><a href="apiclient.oauth.html#CredentialsInvalidError">CredentialsInvalidError</a></dd> |
| 73 | <dd><a href="apiclient.oauth.html#Error">Error</a></dd> |
| 74 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 75 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 76 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 77 | </dl> |
| 78 | <hr> |
| 79 | Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br> |
| 80 | <dl><dt><strong>__weakref__</strong></dt> |
| 81 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 82 | </dl> |
| 83 | <hr> |
| 84 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 85 | <dl><dt><a name="CredentialsInvalidError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 86 | |
| 87 | <hr> |
| 88 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 89 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#CredentialsInvalidError-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 90 | |
| 91 | <hr> |
| 92 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 93 | <dl><dt><a name="CredentialsInvalidError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 94 | |
| 95 | <dl><dt><a name="CredentialsInvalidError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 96 | |
| 97 | <dl><dt><a name="CredentialsInvalidError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 98 | |
| 99 | <dl><dt><a name="CredentialsInvalidError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 100 | <br> |
| 101 | Use of negative indices is not supported.</tt></dd></dl> |
| 102 | |
| 103 | <dl><dt><a name="CredentialsInvalidError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 104 | |
| 105 | <dl><dt><a name="CredentialsInvalidError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 106 | |
| 107 | <dl><dt><a name="CredentialsInvalidError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 108 | |
| 109 | <dl><dt><a name="CredentialsInvalidError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 110 | |
| 111 | <dl><dt><a name="CredentialsInvalidError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 112 | |
| 113 | <dl><dt><a name="CredentialsInvalidError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 114 | |
| 115 | <hr> |
| 116 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 117 | <dl><dt><strong>__dict__</strong></dt> |
| 118 | </dl> |
| 119 | <dl><dt><strong>args</strong></dt> |
| 120 | </dl> |
| 121 | <dl><dt><strong>message</strong></dt> |
| 122 | </dl> |
| 123 | </td></tr></table> <p> |
| 124 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 125 | <tr bgcolor="#ffc8d8"> |
| 126 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 127 | <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> |
| 128 | |
| 129 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 130 | <td colspan=2><tt>Base error for this module.<br> </tt></td></tr> |
| 131 | <tr><td> </td> |
| 132 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 133 | <dd><a href="apiclient.oauth.html#Error">Error</a></dd> |
| 134 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 135 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 136 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 137 | </dl> |
| 138 | <hr> |
| 139 | Data descriptors defined here:<br> |
| 140 | <dl><dt><strong>__weakref__</strong></dt> |
| 141 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 142 | </dl> |
| 143 | <hr> |
| 144 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 145 | <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> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 146 | |
| 147 | <hr> |
| 148 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 149 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#Error-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 150 | |
| 151 | <hr> |
| 152 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 153 | <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> |
| 154 | |
| 155 | <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> |
| 156 | |
| 157 | <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> |
| 158 | |
| 159 | <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> |
| 160 | <br> |
| 161 | Use of negative indices is not supported.</tt></dd></dl> |
| 162 | |
| 163 | <dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 164 | |
| 165 | <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> |
| 166 | |
| 167 | <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> |
| 168 | |
| 169 | <dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 170 | |
| 171 | <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> |
| 172 | |
| 173 | <dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 174 | |
| 175 | <hr> |
| 176 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 177 | <dl><dt><strong>__dict__</strong></dt> |
| 178 | </dl> |
| 179 | <dl><dt><strong>args</strong></dt> |
| 180 | </dl> |
| 181 | <dl><dt><strong>message</strong></dt> |
| 182 | </dl> |
| 183 | </td></tr></table> <p> |
| 184 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 185 | <tr bgcolor="#ffc8d8"> |
| 186 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 187 | <font color="#000000" face="helvetica, arial"><a name="FlowThreeLegged">class <strong>FlowThreeLegged</strong></a>(<a href="oauth2client.client.html#Flow">oauth2client.client.Flow</a>)</font></td></tr> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 188 | |
| 189 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 190 | <td colspan=2><tt>Does the Three Legged Dance for OAuth 1.0a.<br> </tt></td></tr> |
| 191 | <tr><td> </td> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 192 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 193 | <dd><a href="apiclient.oauth.html#FlowThreeLegged">FlowThreeLegged</a></dd> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 194 | <dd><a href="oauth2client.client.html#Flow">oauth2client.client.Flow</a></dd> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 195 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 196 | </dl> |
| 197 | <hr> |
| 198 | Methods defined here:<br> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 199 | <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> |
| 200 | the OAuth endpoints.<br> |
| 201 | consumer_key - OAuth consumer key<br> |
| 202 | consumer_secret - OAuth consumer secret<br> |
| 203 | user_agent - The HTTP User-Agent that identifies the application.<br> |
| 204 | **kwargs - The keyword arguments are all optional and required<br> |
| 205 | parameters for the OAuth calls.</tt></dd></dl> |
| 206 | |
| 207 | <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> |
| 208 | <br> |
| 209 | oauth_callback - Either the string 'oob' for a non-web-based application,<br> |
| 210 | or a URI that handles the callback from the authorization<br> |
| 211 | server.<br> |
| 212 | <br> |
| 213 | If oauth_callback is 'oob' then pass in the<br> |
| 214 | generated verification code to step2_exchange,<br> |
| 215 | otherwise pass in the query parameters received<br> |
| 216 | at the callback uri to step2_exchange.</tt></dd></dl> |
| 217 | |
| 218 | <dl><dt><a name="FlowThreeLegged-step2_exchange"><strong>step2_exchange</strong></a>(self, verifier)</dt><dd><tt>Exhanges an authorized request token<br> |
| 219 | for <a href="#OAuthCredentials">OAuthCredentials</a>.<br> |
| 220 | <br> |
Joe Gregorio | 4258d6b | 2011-03-18 10:20:16 -0400 | [diff] [blame] | 221 | Args:<br> |
| 222 | verifier: string, dict - either the verifier token, or a dictionary<br> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 223 | of the query parameters to the callback, which contains<br> |
Joe Gregorio | 4258d6b | 2011-03-18 10:20:16 -0400 | [diff] [blame] | 224 | the oauth_verifier.<br> |
| 225 | Returns:<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 226 | The <a href="oauth2client.client.html#Credentials">Credentials</a> object.</tt></dd></dl> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 227 | |
| 228 | <hr> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 229 | Data descriptors inherited from <a href="oauth2client.client.html#Flow">oauth2client.client.Flow</a>:<br> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 230 | <dl><dt><strong>__dict__</strong></dt> |
| 231 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 232 | </dl> |
| 233 | <dl><dt><strong>__weakref__</strong></dt> |
| 234 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 235 | </dl> |
| 236 | </td></tr></table> <p> |
| 237 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 238 | <tr bgcolor="#ffc8d8"> |
| 239 | <td colspan=3 valign=bottom> <br> |
| 240 | <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> |
| 241 | |
| 242 | <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> |
| 243 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 244 | <dd><a href="apiclient.oauth.html#MissingParameter">MissingParameter</a></dd> |
| 245 | <dd><a href="apiclient.oauth.html#Error">Error</a></dd> |
| 246 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 247 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 248 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 249 | </dl> |
| 250 | <hr> |
| 251 | Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br> |
| 252 | <dl><dt><strong>__weakref__</strong></dt> |
| 253 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 254 | </dl> |
| 255 | <hr> |
| 256 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 257 | <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> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 258 | |
| 259 | <hr> |
| 260 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 261 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#MissingParameter-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 262 | |
| 263 | <hr> |
| 264 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 265 | <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> |
| 266 | |
| 267 | <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> |
| 268 | |
| 269 | <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> |
| 270 | |
| 271 | <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> |
| 272 | <br> |
| 273 | Use of negative indices is not supported.</tt></dd></dl> |
| 274 | |
| 275 | <dl><dt><a name="MissingParameter-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 276 | |
| 277 | <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> |
| 278 | |
| 279 | <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> |
| 280 | |
| 281 | <dl><dt><a name="MissingParameter-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 282 | |
| 283 | <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> |
| 284 | |
| 285 | <dl><dt><a name="MissingParameter-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 286 | |
| 287 | <hr> |
| 288 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 289 | <dl><dt><strong>__dict__</strong></dt> |
| 290 | </dl> |
| 291 | <dl><dt><strong>args</strong></dt> |
| 292 | </dl> |
| 293 | <dl><dt><strong>message</strong></dt> |
| 294 | </dl> |
| 295 | </td></tr></table> <p> |
| 296 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 297 | <tr bgcolor="#ffc8d8"> |
| 298 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 299 | <font color="#000000" face="helvetica, arial"><a name="OAuthCredentials">class <strong>OAuthCredentials</strong></a>(<a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>)</font></td></tr> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 300 | |
| 301 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 302 | <td colspan=2><tt><a href="oauth2client.client.html#Credentials">Credentials</a> object for OAuth 1.0a<br> </tt></td></tr> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 303 | <tr><td> </td> |
| 304 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 305 | <dd><a href="apiclient.oauth.html#OAuthCredentials">OAuthCredentials</a></dd> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 306 | <dd><a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a></dd> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 307 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 308 | </dl> |
| 309 | <hr> |
| 310 | Methods defined here:<br> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 311 | <dl><dt><a name="OAuthCredentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl> |
| 312 | |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 313 | <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> |
| 314 | token - An instance of oauth.Token constructed with<br> |
| 315 | the access token and secret.<br> |
| 316 | user_agent - The HTTP User-Agent to provide for this application.</tt></dd></dl> |
| 317 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 318 | <dl><dt><a name="OAuthCredentials-__setstate__"><strong>__setstate__</strong></a>(self, state)</dt><dd><tt>Reconstitute the state of the object from being pickled.</tt></dd></dl> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 319 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 320 | <dl><dt><a name="OAuthCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these <a href="oauth2client.client.html#Credentials">Credentials</a><br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 321 | <br> |
| 322 | Args:<br> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 323 | http - An instance of httplib2.Http<br> |
| 324 | or something that acts like it.<br> |
| 325 | <br> |
| 326 | Returns:<br> |
| 327 | A modified instance of http that was passed in.<br> |
| 328 | <br> |
| 329 | Example:<br> |
| 330 | <br> |
| 331 | h = httplib2.Http()<br> |
| 332 | h = credentials.<a href="#OAuthCredentials-authorize">authorize</a>(h)<br> |
| 333 | <br> |
| 334 | You can't create a new OAuth<br> |
| 335 | subclass of httplib2.Authenication because<br> |
| 336 | it never gets passed the absolute URI, which is<br> |
| 337 | needed for signing. So instead we have to overload<br> |
| 338 | 'request' with a closure that adds in the<br> |
| 339 | Authorization header and then calls the original version<br> |
| 340 | of 'request()'.</tt></dd></dl> |
| 341 | |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 342 | <dl><dt><a name="OAuthCredentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the storage for the credential.<br> |
| 343 | <br> |
| 344 | Args:<br> |
| 345 | store: callable, a callable that when passed a Credential<br> |
| 346 | will store the credential back to where it came from.<br> |
| 347 | This is needed to store the latest access_token if it<br> |
| 348 | has been revoked.</tt></dd></dl> |
| 349 | |
| 350 | <hr> |
| 351 | Data descriptors defined here:<br> |
| 352 | <dl><dt><strong>invalid</strong></dt> |
| 353 | <dd><tt>True if the credentials are invalid, such as being revoked.</tt></dd> |
| 354 | </dl> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 355 | <hr> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 356 | Methods inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br> |
| 357 | <dl><dt><a name="OAuthCredentials-apply"><strong>apply</strong></a>(self, headers)</dt><dd><tt>Add the authorization to the headers.<br> |
| 358 | <br> |
| 359 | Args:<br> |
| 360 | headers: dict, the headers to add the Authorization header to.</tt></dd></dl> |
| 361 | |
| 362 | <dl><dt><a name="OAuthCredentials-refresh"><strong>refresh</strong></a>(self, http)</dt><dd><tt>Forces a refresh of the access_token.<br> |
| 363 | <br> |
| 364 | Args:<br> |
| 365 | http: httplib2.Http, an http object to be used to make the refresh<br> |
| 366 | request.</tt></dd></dl> |
| 367 | |
| 368 | <dl><dt><a name="OAuthCredentials-to_json"><strong>to_json</strong></a>(self)</dt><dd><tt>Creating a JSON representation of an instance of <a href="oauth2client.client.html#Credentials">Credentials</a>.<br> |
| 369 | <br> |
| 370 | Returns:<br> |
| 371 | string, a JSON representation of this instance, suitable to pass to<br> |
Joe Gregorio | 6121dd9 | 2012-04-13 07:50:04 -0400 | [diff] [blame^] | 372 | <a href="#OAuthCredentials-from_json">from_json</a>().</tt></dd></dl> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 373 | |
| 374 | <hr> |
| 375 | Class methods inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br> |
Joe Gregorio | 6121dd9 | 2012-04-13 07:50:04 -0400 | [diff] [blame^] | 376 | <dl><dt><a name="OAuthCredentials-from_json"><strong>from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Instantiate a <a href="oauth2client.client.html#Credentials">Credentials</a> object from a JSON description of it. The JSON<br> |
| 377 | should have been produced by calling .<a href="#OAuthCredentials-to_json">to_json</a>() on the object.<br> |
| 378 | <br> |
| 379 | Args:<br> |
| 380 | data: dict, A deserialized JSON object.<br> |
| 381 | <br> |
| 382 | Returns:<br> |
| 383 | An instance of a <a href="oauth2client.client.html#Credentials">Credentials</a> subclass.</tt></dd></dl> |
| 384 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 385 | <dl><dt><a name="OAuthCredentials-new_from_json"><strong>new_from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Utility class method to instantiate a <a href="oauth2client.client.html#Credentials">Credentials</a> subclass from a JSON<br> |
| 386 | representation produced by <a href="#OAuthCredentials-to_json">to_json</a>().<br> |
| 387 | <br> |
| 388 | Args:<br> |
| 389 | s: string, JSON from <a href="#OAuthCredentials-to_json">to_json</a>().<br> |
| 390 | <br> |
| 391 | Returns:<br> |
| 392 | An instance of the subclass of <a href="oauth2client.client.html#Credentials">Credentials</a> that was serialized with<br> |
| 393 | <a href="#OAuthCredentials-to_json">to_json</a>().</tt></dd></dl> |
| 394 | |
| 395 | <hr> |
| 396 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 397 | <dl><dt><strong>__dict__</strong></dt> |
| 398 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 399 | </dl> |
| 400 | <dl><dt><strong>__weakref__</strong></dt> |
| 401 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 402 | </dl> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 403 | <hr> |
| 404 | Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br> |
| 405 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 406 | |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 407 | </td></tr></table> <p> |
| 408 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 409 | <tr bgcolor="#ffc8d8"> |
| 410 | <td colspan=3 valign=bottom> <br> |
| 411 | <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> |
| 412 | |
| 413 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 414 | <td colspan=2><tt><a href="#Error">Error</a> occurred during request.<br> </tt></td></tr> |
| 415 | <tr><td> </td> |
| 416 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 417 | <dd><a href="apiclient.oauth.html#RequestError">RequestError</a></dd> |
| 418 | <dd><a href="apiclient.oauth.html#Error">Error</a></dd> |
| 419 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 420 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 421 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 422 | </dl> |
| 423 | <hr> |
| 424 | Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br> |
| 425 | <dl><dt><strong>__weakref__</strong></dt> |
| 426 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 427 | </dl> |
| 428 | <hr> |
| 429 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 430 | <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> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 431 | |
| 432 | <hr> |
| 433 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 434 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#RequestError-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl> |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 435 | |
| 436 | <hr> |
| 437 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 438 | <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> |
| 439 | |
| 440 | <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> |
| 441 | |
| 442 | <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> |
| 443 | |
| 444 | <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> |
| 445 | <br> |
| 446 | Use of negative indices is not supported.</tt></dd></dl> |
| 447 | |
| 448 | <dl><dt><a name="RequestError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 449 | |
| 450 | <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> |
| 451 | |
| 452 | <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> |
| 453 | |
| 454 | <dl><dt><a name="RequestError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 455 | |
| 456 | <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> |
| 457 | |
| 458 | <dl><dt><a name="RequestError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 459 | |
| 460 | <hr> |
| 461 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 462 | <dl><dt><strong>__dict__</strong></dt> |
| 463 | </dl> |
| 464 | <dl><dt><strong>args</strong></dt> |
| 465 | </dl> |
| 466 | <dl><dt><strong>message</strong></dt> |
| 467 | </dl> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 468 | </td></tr></table> <p> |
| 469 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 470 | <tr bgcolor="#ffc8d8"> |
| 471 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 472 | <font color="#000000" face="helvetica, arial"><a name="TwoLeggedOAuthCredentials">class <strong>TwoLeggedOAuthCredentials</strong></a>(<a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>)</font></td></tr> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 473 | |
| 474 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 475 | <td colspan=2><tt>Two Legged <a href="oauth2client.client.html#Credentials">Credentials</a> object for OAuth 1.0a.<br> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 476 | <br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 477 | The Two Legged object is created directly, not from a flow. Once you<br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 478 | authorize and httplib2.Http instance you can change the requestor and that<br> |
| 479 | change will propogate to the authorized httplib2.Http instance. For example:<br> |
| 480 | <br> |
| 481 | http = httplib2.Http()<br> |
| 482 | http = credentials.<a href="#TwoLeggedOAuthCredentials-authorize">authorize</a>(http)<br> |
| 483 | <br> |
| 484 | credentials.requestor = 'foo@example.info'<br> |
| 485 | http.request(...)<br> |
| 486 | credentials.requestor = 'bar@example.info'<br> |
| 487 | http.request(...)<br> </tt></td></tr> |
| 488 | <tr><td> </td> |
| 489 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 490 | <dd><a href="apiclient.oauth.html#TwoLeggedOAuthCredentials">TwoLeggedOAuthCredentials</a></dd> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 491 | <dd><a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a></dd> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 492 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 493 | </dl> |
| 494 | <hr> |
| 495 | Methods defined here:<br> |
| 496 | <dl><dt><a name="TwoLeggedOAuthCredentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl> |
| 497 | |
| 498 | <dl><dt><a name="TwoLeggedOAuthCredentials-__init__"><strong>__init__</strong></a>(self, consumer_key, consumer_secret, user_agent)</dt><dd><tt>Args:<br> |
| 499 | consumer_key: string, An OAuth 1.0 consumer key<br> |
| 500 | consumer_secret: string, An OAuth 1.0 consumer secret<br> |
| 501 | user_agent: string, The HTTP User-Agent to provide for this application.</tt></dd></dl> |
| 502 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 503 | <dl><dt><a name="TwoLeggedOAuthCredentials-__setstate__"><strong>__setstate__</strong></a>(self, state)</dt><dd><tt>Reconstitute the state of the object from being pickled.</tt></dd></dl> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 504 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 505 | <dl><dt><a name="TwoLeggedOAuthCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these <a href="oauth2client.client.html#Credentials">Credentials</a><br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 506 | <br> |
| 507 | Args:<br> |
| 508 | http - An instance of httplib2.Http<br> |
| 509 | or something that acts like it.<br> |
| 510 | <br> |
| 511 | Returns:<br> |
| 512 | A modified instance of http that was passed in.<br> |
| 513 | <br> |
| 514 | Example:<br> |
| 515 | <br> |
| 516 | h = httplib2.Http()<br> |
| 517 | h = credentials.<a href="#TwoLeggedOAuthCredentials-authorize">authorize</a>(h)<br> |
| 518 | <br> |
| 519 | You can't create a new OAuth<br> |
| 520 | subclass of httplib2.Authenication because<br> |
| 521 | it never gets passed the absolute URI, which is<br> |
| 522 | needed for signing. So instead we have to overload<br> |
| 523 | 'request' with a closure that adds in the<br> |
| 524 | Authorization header and then calls the original version<br> |
| 525 | of 'request()'.</tt></dd></dl> |
| 526 | |
| 527 | <dl><dt><a name="TwoLeggedOAuthCredentials-getrequestor"><strong>getrequestor</strong></a>(self)</dt></dl> |
| 528 | |
| 529 | <dl><dt><a name="TwoLeggedOAuthCredentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the storage for the credential.<br> |
| 530 | <br> |
| 531 | Args:<br> |
| 532 | store: callable, a callable that when passed a Credential<br> |
| 533 | will store the credential back to where it came from.<br> |
| 534 | This is needed to store the latest access_token if it<br> |
| 535 | has been revoked.</tt></dd></dl> |
| 536 | |
| 537 | <dl><dt><a name="TwoLeggedOAuthCredentials-setrequestor"><strong>setrequestor</strong></a>(self, email)</dt></dl> |
| 538 | |
| 539 | <hr> |
| 540 | Data descriptors defined here:<br> |
| 541 | <dl><dt><strong>invalid</strong></dt> |
| 542 | <dd><tt>True if the credentials are invalid, such as being revoked.<br> |
| 543 | <br> |
| 544 | Always returns False for Two Legged Credentials.</tt></dd> |
| 545 | </dl> |
| 546 | <dl><dt><strong>requestor</strong></dt> |
| 547 | <dd><tt>The email address of the user to act on behalf of</tt></dd> |
| 548 | </dl> |
| 549 | <hr> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 550 | Methods inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br> |
| 551 | <dl><dt><a name="TwoLeggedOAuthCredentials-apply"><strong>apply</strong></a>(self, headers)</dt><dd><tt>Add the authorization to the headers.<br> |
| 552 | <br> |
| 553 | Args:<br> |
| 554 | headers: dict, the headers to add the Authorization header to.</tt></dd></dl> |
| 555 | |
| 556 | <dl><dt><a name="TwoLeggedOAuthCredentials-refresh"><strong>refresh</strong></a>(self, http)</dt><dd><tt>Forces a refresh of the access_token.<br> |
| 557 | <br> |
| 558 | Args:<br> |
| 559 | http: httplib2.Http, an http object to be used to make the refresh<br> |
| 560 | request.</tt></dd></dl> |
| 561 | |
| 562 | <dl><dt><a name="TwoLeggedOAuthCredentials-to_json"><strong>to_json</strong></a>(self)</dt><dd><tt>Creating a JSON representation of an instance of <a href="oauth2client.client.html#Credentials">Credentials</a>.<br> |
| 563 | <br> |
| 564 | Returns:<br> |
| 565 | string, a JSON representation of this instance, suitable to pass to<br> |
Joe Gregorio | 6121dd9 | 2012-04-13 07:50:04 -0400 | [diff] [blame^] | 566 | <a href="#TwoLeggedOAuthCredentials-from_json">from_json</a>().</tt></dd></dl> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 567 | |
| 568 | <hr> |
| 569 | Class methods inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br> |
Joe Gregorio | 6121dd9 | 2012-04-13 07:50:04 -0400 | [diff] [blame^] | 570 | <dl><dt><a name="TwoLeggedOAuthCredentials-from_json"><strong>from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Instantiate a <a href="oauth2client.client.html#Credentials">Credentials</a> object from a JSON description of it. The JSON<br> |
| 571 | should have been produced by calling .<a href="#TwoLeggedOAuthCredentials-to_json">to_json</a>() on the object.<br> |
| 572 | <br> |
| 573 | Args:<br> |
| 574 | data: dict, A deserialized JSON object.<br> |
| 575 | <br> |
| 576 | Returns:<br> |
| 577 | An instance of a <a href="oauth2client.client.html#Credentials">Credentials</a> subclass.</tt></dd></dl> |
| 578 | |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 579 | <dl><dt><a name="TwoLeggedOAuthCredentials-new_from_json"><strong>new_from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Utility class method to instantiate a <a href="oauth2client.client.html#Credentials">Credentials</a> subclass from a JSON<br> |
| 580 | representation produced by <a href="#TwoLeggedOAuthCredentials-to_json">to_json</a>().<br> |
| 581 | <br> |
| 582 | Args:<br> |
| 583 | s: string, JSON from <a href="#TwoLeggedOAuthCredentials-to_json">to_json</a>().<br> |
| 584 | <br> |
| 585 | Returns:<br> |
| 586 | An instance of the subclass of <a href="oauth2client.client.html#Credentials">Credentials</a> that was serialized with<br> |
| 587 | <a href="#TwoLeggedOAuthCredentials-to_json">to_json</a>().</tt></dd></dl> |
| 588 | |
| 589 | <hr> |
| 590 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 591 | <dl><dt><strong>__dict__</strong></dt> |
| 592 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 593 | </dl> |
| 594 | <dl><dt><strong>__weakref__</strong></dt> |
| 595 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 596 | </dl> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 597 | <hr> |
| 598 | Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br> |
| 599 | <dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl> |
| 600 | |
Joe Gregorio | 30dfdc3 | 2010-12-09 16:34:22 -0500 | [diff] [blame] | 601 | </td></tr></table></td></tr></table><p> |
| 602 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 603 | <tr bgcolor="#55aa55"> |
| 604 | <td colspan=3 valign=bottom> <br> |
| 605 | <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
| 606 | |
| 607 | <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
| 608 | <td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p> |
| 609 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 610 | <tr bgcolor="#7799ee"> |
| 611 | <td colspan=3 valign=bottom> <br> |
| 612 | <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> |
| 613 | |
| 614 | <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> |
| 615 | <td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table> |
| 616 | </body></html> |