blob: e55af8cd9797db8d8e37e10bc70f75d231ce38a6 [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
11><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/jcgregorio/projects/apiary/apiclient/oauth.py">/usr/local/google/home/jcgregorio/projects/apiary/apiclient/oauth.py</a></font></td></tr></table>
12 <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>
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="urllib.html">urllib</a><br>
27</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
28<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
29<tr bgcolor="#ee77aa">
30<td colspan=3 valign=bottom>&nbsp;<br>
31<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
32
33<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
34<td width="100%"><dl>
35<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
36</font></dt><dd>
37<dl>
38<dt><font face="helvetica, arial"><a href="apiclient.oauth.html#Credentials">Credentials</a>
39</font></dt><dd>
40<dl>
41<dt><font face="helvetica, arial"><a href="apiclient.oauth.html#OAuthCredentials">OAuthCredentials</a>
42</font></dt></dl>
43</dd>
44<dt><font face="helvetica, arial"><a href="apiclient.oauth.html#FlowThreeLegged">FlowThreeLegged</a>
45</font></dt></dl>
46</dd>
47<dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>)
48</font></dt><dd>
49<dl>
50<dt><font face="helvetica, arial"><a href="apiclient.oauth.html#Error">Error</a>
51</font></dt><dd>
52<dl>
53<dt><font face="helvetica, arial"><a href="apiclient.oauth.html#MissingParameter">MissingParameter</a>
54</font></dt><dt><font face="helvetica, arial"><a href="apiclient.oauth.html#RequestError">RequestError</a>
55</font></dt></dl>
56</dd>
57</dl>
58</dd>
59</dl>
60 <p>
61<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
62<tr bgcolor="#ffc8d8">
63<td colspan=3 valign=bottom>&nbsp;<br>
64<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>
65
66<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
67<td colspan=2><tt>Base&nbsp;class&nbsp;for&nbsp;all&nbsp;<a href="#Credentials">Credentials</a>&nbsp;objects.<br>
68&nbsp;<br>
69Subclasses&nbsp;must&nbsp;define&nbsp;an&nbsp;<a href="#Credentials-authorize">authorize</a>()&nbsp;method<br>
70that&nbsp;applies&nbsp;the&nbsp;credentials&nbsp;to&nbsp;an&nbsp;HTTP&nbsp;transport.<br>&nbsp;</tt></td></tr>
71<tr><td>&nbsp;</td>
72<td width="100%">Methods defined here:<br>
73<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>
74authorizes&nbsp;it&nbsp;for&nbsp;the&nbsp;set&nbsp;of&nbsp;credentials,&nbsp;usually&nbsp;by<br>
75replacing&nbsp;http.request()&nbsp;with&nbsp;a&nbsp;method&nbsp;that&nbsp;adds&nbsp;in<br>
76the&nbsp;appropriate&nbsp;headers&nbsp;and&nbsp;then&nbsp;delegates&nbsp;to&nbsp;the&nbsp;original<br>
77Http.request()&nbsp;method.</tt></dd></dl>
78
79<hr>
80Data descriptors defined here:<br>
81<dl><dt><strong>__dict__</strong></dt>
82<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
83</dl>
84<dl><dt><strong>__weakref__</strong></dt>
85<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
86</dl>
87</td></tr></table> <p>
88<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
89<tr bgcolor="#ffc8d8">
90<td colspan=3 valign=bottom>&nbsp;<br>
91<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>
92
93<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
94<td colspan=2><tt>Base&nbsp;error&nbsp;for&nbsp;this&nbsp;module.<br>&nbsp;</tt></td></tr>
95<tr><td>&nbsp;</td>
96<td width="100%"><dl><dt>Method resolution order:</dt>
97<dd><a href="apiclient.oauth.html#Error">Error</a></dd>
98<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
99<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
100<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
101</dl>
102<hr>
103Data descriptors defined here:<br>
104<dl><dt><strong>__weakref__</strong></dt>
105<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
106</dl>
107<hr>
108Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
109<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>
110
111<hr>
112Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
113<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>
114
115<hr>
116Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
117<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>
118
119<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>
120
121<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>
122
123<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>
124&nbsp;<br>
125Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
126
127<dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
128
129<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>
130
131<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>
132
133<dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
134
135<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>
136
137<dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
138
139<hr>
140Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
141<dl><dt><strong>__dict__</strong></dt>
142</dl>
143<dl><dt><strong>args</strong></dt>
144</dl>
145<dl><dt><strong>message</strong></dt>
146</dl>
147</td></tr></table> <p>
148<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
149<tr bgcolor="#ffc8d8">
150<td colspan=3 valign=bottom>&nbsp;<br>
151<font color="#000000" face="helvetica, arial"><a name="FlowThreeLegged">class <strong>FlowThreeLegged</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
152
153<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
154<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>
155<tr><td>&nbsp;</td>
156<td width="100%">Methods defined here:<br>
157<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>
158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;OAuth&nbsp;endpoints.<br>
159consumer_key&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;OAuth&nbsp;consumer&nbsp;key<br>
160consumer_secret&nbsp;-&nbsp;OAuth&nbsp;consumer&nbsp;secret<br>
161user_agent&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;The&nbsp;HTTP&nbsp;User-Agent&nbsp;that&nbsp;identifies&nbsp;the&nbsp;application.<br>
162**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>
163&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>
164
165<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>
166&nbsp;<br>
167oauth_callback&nbsp;-&nbsp;Either&nbsp;the&nbsp;string&nbsp;'oob'&nbsp;for&nbsp;a&nbsp;non-web-based&nbsp;application,<br>
168&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>
169&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server.<br>
170&nbsp;<br>
171If&nbsp;oauth_callback&nbsp;is&nbsp;'oob'&nbsp;then&nbsp;pass&nbsp;in&nbsp;the<br>
172generated&nbsp;verification&nbsp;code&nbsp;to&nbsp;step2_exchange,<br>
173otherwise&nbsp;pass&nbsp;in&nbsp;the&nbsp;query&nbsp;parameters&nbsp;received<br>
174at&nbsp;the&nbsp;callback&nbsp;uri&nbsp;to&nbsp;step2_exchange.</tt></dd></dl>
175
176<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>
177for&nbsp;<a href="#OAuthCredentials">OAuthCredentials</a>.<br>
178&nbsp;<br>
179verifier&nbsp;-&nbsp;either&nbsp;the&nbsp;verifier&nbsp;token,&nbsp;or&nbsp;a&nbsp;dictionary<br>
180&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;the&nbsp;query&nbsp;parameters&nbsp;to&nbsp;the&nbsp;callback,&nbsp;which&nbsp;contains<br>
181&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;oauth_verifier.</tt></dd></dl>
182
183<hr>
184Data descriptors defined here:<br>
185<dl><dt><strong>__dict__</strong></dt>
186<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
187</dl>
188<dl><dt><strong>__weakref__</strong></dt>
189<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
190</dl>
191</td></tr></table> <p>
192<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
193<tr bgcolor="#ffc8d8">
194<td colspan=3 valign=bottom>&nbsp;<br>
195<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>
196
197<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
198<td width="100%"><dl><dt>Method resolution order:</dt>
199<dd><a href="apiclient.oauth.html#MissingParameter">MissingParameter</a></dd>
200<dd><a href="apiclient.oauth.html#Error">Error</a></dd>
201<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
202<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
203<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
204</dl>
205<hr>
206Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br>
207<dl><dt><strong>__weakref__</strong></dt>
208<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
209</dl>
210<hr>
211Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
212<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>
213
214<hr>
215Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
216<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>
217
218<hr>
219Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
220<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>
221
222<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>
223
224<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>
225
226<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>
227&nbsp;<br>
228Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
229
230<dl><dt><a name="MissingParameter-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
231
232<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>
233
234<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>
235
236<dl><dt><a name="MissingParameter-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
237
238<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>
239
240<dl><dt><a name="MissingParameter-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
241
242<hr>
243Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
244<dl><dt><strong>__dict__</strong></dt>
245</dl>
246<dl><dt><strong>args</strong></dt>
247</dl>
248<dl><dt><strong>message</strong></dt>
249</dl>
250</td></tr></table> <p>
251<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
252<tr bgcolor="#ffc8d8">
253<td colspan=3 valign=bottom>&nbsp;<br>
254<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>
255
256<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
257<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>
258<tr><td>&nbsp;</td>
259<td width="100%"><dl><dt>Method resolution order:</dt>
260<dd><a href="apiclient.oauth.html#OAuthCredentials">OAuthCredentials</a></dd>
261<dd><a href="apiclient.oauth.html#Credentials">Credentials</a></dd>
262<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
263</dl>
264<hr>
265Methods defined here:<br>
266<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>
267token&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;An&nbsp;instance&nbsp;of&nbsp;oauth.Token&nbsp;constructed&nbsp;with<br>
268&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;access&nbsp;token&nbsp;and&nbsp;secret.<br>
269user_agent&nbsp;-&nbsp;The&nbsp;HTTP&nbsp;User-Agent&nbsp;to&nbsp;provide&nbsp;for&nbsp;this&nbsp;application.</tt></dd></dl>
270
271<dl><dt><a name="OAuthCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Args:<br>
272&nbsp;&nbsp;&nbsp;http&nbsp;-&nbsp;An&nbsp;instance&nbsp;of&nbsp;httplib2.Http<br>
273&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;something&nbsp;that&nbsp;acts&nbsp;like&nbsp;it.<br>
274&nbsp;<br>
275Returns:<br>
276&nbsp;&nbsp;&nbsp;A&nbsp;modified&nbsp;instance&nbsp;of&nbsp;http&nbsp;that&nbsp;was&nbsp;passed&nbsp;in.<br>
277&nbsp;<br>
278Example:<br>
279&nbsp;<br>
280&nbsp;&nbsp;h&nbsp;=&nbsp;httplib2.Http()<br>
281&nbsp;&nbsp;h&nbsp;=&nbsp;credentials.<a href="#OAuthCredentials-authorize">authorize</a>(h)<br>
282&nbsp;<br>
283You&nbsp;can't&nbsp;create&nbsp;a&nbsp;new&nbsp;OAuth<br>
284subclass&nbsp;of&nbsp;httplib2.Authenication&nbsp;because<br>
285it&nbsp;never&nbsp;gets&nbsp;passed&nbsp;the&nbsp;absolute&nbsp;URI,&nbsp;which&nbsp;is<br>
286needed&nbsp;for&nbsp;signing.&nbsp;So&nbsp;instead&nbsp;we&nbsp;have&nbsp;to&nbsp;overload<br>
287'request'&nbsp;with&nbsp;a&nbsp;closure&nbsp;that&nbsp;adds&nbsp;in&nbsp;the<br>
288Authorization&nbsp;header&nbsp;and&nbsp;then&nbsp;calls&nbsp;the&nbsp;original&nbsp;version<br>
289of&nbsp;'request()'.</tt></dd></dl>
290
291<hr>
292Data descriptors inherited from <a href="apiclient.oauth.html#Credentials">Credentials</a>:<br>
293<dl><dt><strong>__dict__</strong></dt>
294<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
295</dl>
296<dl><dt><strong>__weakref__</strong></dt>
297<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
298</dl>
299</td></tr></table> <p>
300<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
301<tr bgcolor="#ffc8d8">
302<td colspan=3 valign=bottom>&nbsp;<br>
303<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>
304
305<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
306<td colspan=2><tt><a href="#Error">Error</a>&nbsp;occurred&nbsp;during&nbsp;request.<br>&nbsp;</tt></td></tr>
307<tr><td>&nbsp;</td>
308<td width="100%"><dl><dt>Method resolution order:</dt>
309<dd><a href="apiclient.oauth.html#RequestError">RequestError</a></dd>
310<dd><a href="apiclient.oauth.html#Error">Error</a></dd>
311<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
312<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
313<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
314</dl>
315<hr>
316Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br>
317<dl><dt><strong>__weakref__</strong></dt>
318<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
319</dl>
320<hr>
321Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
322<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>
323
324<hr>
325Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
326<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>
327
328<hr>
329Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
330<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>
331
332<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>
333
334<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>
335
336<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>
337&nbsp;<br>
338Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
339
340<dl><dt><a name="RequestError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
341
342<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>
343
344<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>
345
346<dl><dt><a name="RequestError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
347
348<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>
349
350<dl><dt><a name="RequestError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
351
352<hr>
353Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
354<dl><dt><strong>__dict__</strong></dt>
355</dl>
356<dl><dt><strong>args</strong></dt>
357</dl>
358<dl><dt><strong>message</strong></dt>
359</dl>
360</td></tr></table></td></tr></table><p>
361<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
362<tr bgcolor="#55aa55">
363<td colspan=3 valign=bottom>&nbsp;<br>
364<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
365
366<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
367<td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p>
368<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
369<tr bgcolor="#7799ee">
370<td colspan=3 valign=bottom>&nbsp;<br>
371<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
372
373<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
374<td width="100%">jcgregorio@google.com&nbsp;(Joe&nbsp;Gregorio)</td></tr></table>
375</body></html>