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