|
8 | 8 | <td valign=bottom> <br> |
9 | 9 | <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.discovery</strong></big></big></font></td |
10 | 10 | ><td align=right valign=bottom |
11 | | -><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/apiclient-release/apiclient/discovery.py">/home/jcgregorio/projects/apiclient-release/apiclient/discovery.py</a></font></td></tr></table> |
| 11 | +><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/clean/apiclient/discovery.py">/home/jcgregorio/projects/clean/apiclient/discovery.py</a></font></td></tr></table> |
12 | 12 | <p><tt>Client for discovery based APIs<br> |
13 | 13 | <br> |
14 | 14 | A client library for Google's discovery based APIs.</tt></p> |
|
40 | 40 | <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> |
41 | 41 | <td width="100%"><dl><dt><a name="-build"><strong>build</strong></a>(serviceName, version, http<font color="#909090">=None</font>, discoveryServiceUrl<font color="#909090">='https://www.googleapis.com/discovery/v1/apis/{api}/{apiVersion}/rest'</font>, developerKey<font color="#909090">=None</font>, model<font color="#909090">=None</font>, requestBuilder<font color="#909090">=<class 'apiclient.http.HttpRequest'></font>)</dt><dd><tt>Construct a Resource for interacting with an API.<br> |
42 | 42 | <br> |
43 | | -Construct a Resource object for interacting with<br> |
44 | | -an API. The serviceName and version are the<br> |
45 | | -names from the Discovery service.<br> |
| 43 | +Construct a Resource object for interacting with an API. The serviceName and<br> |
| 44 | +version are the names from the Discovery service.<br> |
46 | 45 | <br> |
47 | 46 | Args:<br> |
48 | | - serviceName: string, name of the service<br> |
49 | | - version: string, the version of the service<br> |
| 47 | + serviceName: string, name of the service.<br> |
| 48 | + version: string, the version of the service.<br> |
50 | 49 | http: httplib2.Http, An instance of httplib2.Http or something that acts<br> |
51 | 50 | like it that HTTP requests will be made through.<br> |
52 | | - discoveryServiceUrl: string, a URI Template that points to<br> |
53 | | - the location of the discovery service. It should have two<br> |
54 | | - parameters {api} and {apiVersion} that when filled in<br> |
55 | | - produce an absolute URI to the discovery document for<br> |
56 | | - that service.<br> |
57 | | - developerKey: string, key obtained<br> |
58 | | - from https://code.google.com/apis/console<br> |
59 | | - model: apiclient.Model, converts to and from the wire format<br> |
60 | | - requestBuilder: apiclient.http.HttpRequest, encapsulator for<br> |
61 | | - an HTTP request<br> |
| 51 | + discoveryServiceUrl: string, a URI Template that points to the location of<br> |
| 52 | + the discovery service. It should have two parameters {api} and<br> |
| 53 | + {apiVersion} that when filled in produce an absolute URI to the discovery<br> |
| 54 | + document for that service.<br> |
| 55 | + developerKey: string, key obtained from<br> |
| 56 | + https://code.google.com/apis/console.<br> |
| 57 | + model: apiclient.Model, converts to and from the wire format.<br> |
| 58 | + requestBuilder: apiclient.http.HttpRequest, encapsulator for an HTTP<br> |
| 59 | + request.<br> |
62 | 60 | <br> |
63 | 61 | Returns:<br> |
64 | | - A Resource object with methods for interacting with<br> |
65 | | - the service.</tt></dd></dl> |
66 | | - <dl><dt><a name="-build_from_document"><strong>build_from_document</strong></a>(service, base, future<font color="#909090">=None</font>, http<font color="#909090">=None</font>, developerKey<font color="#909090">=None</font>, model<font color="#909090">=None</font>, requestBuilder<font color="#909090">=<class 'apiclient.http.HttpRequest'></font>)</dt><dd><tt>Create a Resource for interacting with an API.<br> |
| 62 | + A Resource object with methods for interacting with the service.</tt></dd></dl> |
| 63 | + <dl><dt><a name="-key2param"><strong>key2param</strong></a>(key)</dt><dd><tt>Converts key names into parameter names.<br> |
67 | 64 | <br> |
68 | | -Same as `<a href="#-build">build</a>()`, but constructs the Resource object<br> |
69 | | -from a discovery document that is it given, as opposed to<br> |
70 | | -retrieving one over HTTP.<br> |
| 65 | +For example, converting "max-results" -> "max_results"<br> |
71 | 66 | <br> |
72 | 67 | Args:<br> |
73 | | - service: string, discovery document<br> |
74 | | - base: string, base URI for all HTTP requests, usually the discovery URI<br> |
75 | | - future: string, discovery document with future capabilities<br> |
76 | | - auth_discovery: dict, information about the authentication the API supports<br> |
77 | | - http: httplib2.Http, An instance of httplib2.Http or something that acts<br> |
78 | | - like it that HTTP requests will be made through.<br> |
79 | | - developerKey: string, Key for controlling API usage, generated<br> |
80 | | - from the API Console.<br> |
81 | | - model: Model class instance that serializes and<br> |
82 | | - de-serializes requests and responses.<br> |
83 | | - requestBuilder: Takes an http request and packages it up to be executed.<br> |
| 68 | + key: string, the method key name.<br> |
84 | 69 | <br> |
85 | 70 | Returns:<br> |
86 | | - A Resource object with methods for interacting with<br> |
87 | | - the service.</tt></dd></dl> |
| 71 | + A safe method name based on the key name.</tt></dd></dl> |
88 | 72 | </td></tr></table><p> |
89 | 73 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
90 | 74 | <tr bgcolor="#55aa55"> |
91 | 75 | <td colspan=3 valign=bottom> <br> |
92 | 76 | <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
93 | 77 |
|
94 | 78 | <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
95 | | -<td width="100%"><strong>__all__</strong> = ['build', 'build_from_document']<br> |
| 79 | +<td width="100%"><strong>__all__</strong> = ['build', 'build_from_documentfix_method_name', 'key2param']<br> |
96 | 80 | <strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p> |
97 | 81 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
98 | 82 | <tr bgcolor="#7799ee"> |
|
0 commit comments